From psc.dav at gmail.com Sat Sep 2 16:45:47 2017 From: psc.dav at gmail.com (David Pascucci) Date: Sat, 2 Sep 2017 16:45:47 +0200 Subject: [FieldTrip] Fwd: single trials eLoreta In-Reply-To: References: Message-ID: Dear fieldtrip experts, I am posting again my questions, hoping that someone has experience with a similar pipeline and can give some feedback. I am trying to use the eLoreta method to get single-trial estimates of source activity from specific ROIs, in the following way: % eLORETA cfg = []; cfg.method = 'eloreta'; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.eloreta.keepfilter = 'yes'; cfg.eloreta.normalize = 'yes'; cfg.eloreta.lambda = 0.05; *(1) cfg.eloreta.projectnoise = 'yes'; eLO_source = ft_sourceanalysis(cfg,data); % in the above line, "data" is the results of ft_timelockanalysis % with cfg.covariance = 'yes'; *(2) % then I put the source positions from the MNI template I % used for the sourcemodel (see: % http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject- % specific_grids_that_are_equivalent_across_subjects_in_normalized_space eLO_source.pos = template_grid.pos; iPOS = eLO_source.pos; iPOS(eLO_source.inside==0,:) = NaN; % only points inside gray matter % Then I select ROIs (here only one for simplicity) to extract single-trial source activity: [v,I] = min(pdist2(iPOS, ROIs_mni , 'euclidean')); % And I multiply the spatial filter for the EEG data in each trial W = eLO_source.avg.filter{I}; % filter at my ROI of interest for tr = 1:size(data.trial,1) % loop over trials trials{tr} = W * squeeze(data.trial(tr,:,:)); *(3) end Is this approach correct? My main questions are: *(1) Is there a way to select the best lambda parameter (e.g., selecting the one that best approximates the activity at the EEG channels level)? *(2) I am confused about the role of the covariance, since it doesn't seem to be used when source activity is estimated using the set of spatial filters at the single trial *(3) Is the "trials{tr} = W * squeeze(data.trial(tr,:,:)); " approach correct to get time-series of source activity in a ROI? Looking forward for your feedback. Best, David -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From juliacoopiza at gmail.com Sun Sep 3 17:14:06 2017 From: juliacoopiza at gmail.com (Julia Coopi) Date: Sun, 3 Sep 2017 09:14:06 -0600 Subject: [FieldTrip] Using PPC method In-Reply-To: References: Message-ID: Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz wrote: > Dear Tianyang, > > maybe it's a good idea to download the accompanying sample data from the > tutorial and look if you can recreate the shown data structure. Then look > closer into the values of the respective fields. That should give you a > better grasp on what is required there. > > I have not fully looked into the code but my feeling is that > spikeTrials.timestamp is not of any further use and is just carried from > the data structure before (which was not cut into trials and where the raw > timestamps were useful). The timing of spikes relative to the trial zero > point is fully described in the fields ".time", ".trial" and ".trialtime". > Best, > Andreas > > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of 马天阳 [tianyangma2013 at gmail.com] > *Sent:* Monday, August 28, 2017 5:31 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Using PPC method > > Dear Andreas, > > I still don't quite understand the tutorial. > > spikeTrials = > label: {'sig002a_wf' 'sig003a_wf'} > timestamp: {[1x83601 int32 ] [1x61513 int32 ]} > waveform: {[1x32x83601 double ] [1x32x61513 double ]} > unit: {[1x83601 double ] [1x61513 double ]} > hdr: [1x1 struct ] > dimord: '{chan}_lead_time_spike' > cfg: [1x1 struct ] > time: {[1x83601 double ] [1x61513 double ]} > trial: {[1x83601 double ] [1x61513 double ]} > trialtime: [600x2 double ] > > Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? > > I feel I am quite lost. > > Best, > > Tianyang > > > _______________________________________________ > 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.lehongre-ihu at icm-institute.org Mon Sep 4 11:26:52 2017 From: k.lehongre-ihu at icm-institute.org (Katia Lehongre) Date: Mon, 4 Sep 2017 11:26:52 +0200 Subject: [FieldTrip] Workshop on intracranial recordings in human, October 3-4, Paris Message-ID: <6eba6c50-169d-a0f0-ab1e-73d808e81d24@icm-institute.org> Dear all, The first*WIRED*(*W*orkshop on *I*ntracranial *R*ecordings in humans : *E*pilepsy, *D*BS), will be held in Paris, France, at the Brain and Spine Institute (ICM) on October 3 and 4. Registration is opened and*free*. Conferences, technical discussions, poster session (prize worth 800€ to be awarded), commercial solutions, wine and cheese…  All information and registration to this event on our website: http://wired-icm.org _Note that_ only *a few spots are left* for poster presentation and that we have reach *70% of full capacity* including people from 10 Parisian institutes, 6 major French cities and 9 countries. We hope to see you there! The organizers _Organization_ : Katia Lehongre, Adrien Schramm – _Scientific Committee_: Vincent Navarro, Katia Lehongre, Brian Lau, Nathalie George, Michel Le Van Quyen, Marie Laure Welter, Lionel Naccache *_Program_* *Tuesday October 3^rd * *AM* *Research Lecture Session* ** 9:00 *   – /Welcome breakfast/* 9:30*    –   Event Introduction* 
/V. Navarro,  K. Lehongre/ 9:45*     –   Keynote : Epileptic ictal wavefront* */C. Schevon/ */ (Columbia, USA)/ 10:45 *– /Break/* 11:00*   –   DBS: Title to be determined* /J. Bastin (Grenoble, France)/ 11:45*   –   DBS: **Title to be determined* 12:30*    – /Lunch & Poster session/* *PM* *Methodological aspects* ** 14:00 *   –   Equipment : Focus on new electrodes* 
 /L. Valton/ / (Toulouse, France)/ 15:00*    –   Analysis : Spike sorting techniques* 
 /F. Mormann/ / (Bonn, Germany)/ 16:00 *– /Coffe Break/* 16:30*   –   Imaging: Electrode localization* */S. Fernandez/ */ (Paris, France/) 18:00*   –   Wine and Cheese session* ** *Wednesday October 4^th * *AM* *Research Lecture Session* 8:45 *   – /Breakfast/* 9:00*    –   Keynote : Title to be determined* */P. Brown/ */ (Oxford, UK)/ 10:00*   –   Memory encoding* */N. Axmacher/ */ (Bochum, Germany)/ 10:45 *–   Visual processing* /L. Reddy / /(Toulouse, France/) 11:30*   – /Coffee Break/* 11:45*   –   Focus: Imaging and electrophysiology* /C. Ciumas-Gaumond (Lyon, France)/ 12:45*    –  Conclusion & poster award* *PM – Off event* *Réunion du groupe Français Microelectrode* * * *Note that *The *Blackrock Microsystems’ Clinical Electrophysiology Workshop* will occur on Monday 2nd. All info and registration on this satellite event click here . ** -- Katia Lehongre Ingénieure de recherche IHU-A-ICM PF STIM CENIR, bureau -1.041 ICM, UPMC/Inserm U1127/CNRS UMR7225 Institut du Cerveau et de la Moelle épinière Hôpital Pitié-Salpêtrière 47 Boulevard de l'Hôpital CS 21414 75646 PARIS CEDEX 13 tel: 01 57 27 47 14 -------------- next part -------------- An HTML attachment was scrubbed... URL: From linzhangysu at outlook.com Mon Sep 4 13:09:45 2017 From: linzhangysu at outlook.com (linzhangysu at outlook.com) Date: Mon, 4 Sep 2017 11:09:45 +0000 Subject: [FieldTrip] WPLI Message-ID: [cid:image002.png at 01D325AA.E537BE20] I want to calculate the WPLI of 64 channels for one subject. But I met some questions. Firstly, I didn’t understand the meaning of repetitions (just as the maker of the figure ). The dimension of repetitions was 1 in my MATLAB code , which resulted in the WPLI result are NaN vectors. How can I solve the problem about ‘repetitions’? I am looking forward to your reply very urgently, Thank you ! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: 41C8A441EE344C5FB6F9EBCBE63CA91A.png URL: From michelic72 at gmail.com Mon Sep 4 13:19:27 2017 From: michelic72 at gmail.com (Cristiano Micheli) Date: Mon, 4 Sep 2017 13:19:27 +0200 Subject: [FieldTrip] WPLI In-Reply-To: References: Message-ID: Dear Linzhangysu the wPLI metric requires you to have your experimental design matrix organized in 'repetitions' or 'trials'. This is typically the case (but not only) of an evoked related design, where the repetitions dimension is used to calculate your 'average' wPLI across trials, and this is what the FT code is doing for you in the *ft_connectivity_wpli* function. In summary, with this formula you will not be able to apply wPLI to a single trial (e.g. like in resting state). If your experiment allows organizing the experimental data into 'trials' (with the operation of epoching) then you can solve your problem, otherwise you will have to use other metrics of phase coupling. IHTH Cris Micheli On Mon, Sep 4, 2017 at 1:09 PM, linzhangysu at outlook.com < linzhangysu at outlook.com> wrote: > > > [image: cid:image002.png at 01D325AA.E537BE20] > > > > I want to calculate the WPLI of 64 channels for one subject. But I met > some questions. > > Firstly, I didn’t understand the meaning of repetitions (just as the > maker of the figure ). The dimension of repetitions was 1 in my MATLAB code > , which resulted in the WPLI result are NaN vectors. How can I solve the > problem about ‘repetitions’? > > I am looking forward to your reply very urgently, Thank you ! > > > > _______________________________________________ > 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: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: not available URL: From awutz at mit.edu Mon Sep 4 14:24:47 2017 From: awutz at mit.edu (Andreas Wutz) Date: Mon, 4 Sep 2017 12:24:47 +0000 Subject: [FieldTrip] Using PPC method In-Reply-To: References: , Message-ID: Dear Julia, I did not see your error message. Maybe, your lfp data structure is still in a continuous recording format without a trial definition? ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Sunday, September 03, 2017 11:14 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz > wrote: Dear Tianyang, maybe it's a good idea to download the accompanying sample data from the tutorial and look if you can recreate the shown data structure. Then look closer into the values of the respective fields. That should give you a better grasp on what is required there. I have not fully looked into the code but my feeling is that spikeTrials.timestamp is not of any further use and is just carried from the data structure before (which was not cut into trials and where the raw timestamps were useful). The timing of spikes relative to the trial zero point is fully described in the fields ".time", ".trial" and ".trialtime". Best, Andreas From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of 马天阳 [tianyangma2013 at gmail.com] Sent: Monday, August 28, 2017 5:31 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, I still don't quite understand the tutorial. spikeTrials = label: {'sig002a_wf' 'sig003a_wf'} timestamp: {[1x83601 int32] [1x61513 int32]} waveform: {[1x32x83601 double] [1x32x61513 double]} unit: {[1x83601 double] [1x61513 double]} hdr: [1x1 struct] dimord: '{chan}_lead_time_spike' cfg: [1x1 struct] time: {[1x83601 double] [1x61513 double]} trial: {[1x83601 double] [1x61513 double]} trialtime: [600x2 double] Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? I feel I am quite lost. Best, Tianyang _______________________________________________ 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 christine.blume at sbg.ac.at Mon Sep 4 14:28:47 2017 From: christine.blume at sbg.ac.at (Blume Christine) Date: Mon, 4 Sep 2017 12:28:47 +0000 Subject: [FieldTrip] Effect size measure for cluster-based permutation tests In-Reply-To: References: Message-ID: Hi Alik, Thanks a lot for your suggestion, which I hoped would prompt more answers. Does anyone have suggestions on how exactly to implement the calculation of an effect size measure? Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Alik Widge Gesendet: Mittwoch, 23. August 2017 16:42 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Effect size measure for cluster-based permutation tests My naive answer, which perhaps will provoke Eric to provide a better one: you have the actual cluster statistic and its permutation distribution under the null hypothesis. It seems as though that distribution could be assumed Gaussian and something like Cohen's d calculated. On Aug 23, 2017 9:35 AM, "Blume Christine" > wrote: Dear all, I came across a question posted by someone about a year ago, which concerned effect size measures for cluster-based permutation tests. Unfortunately, the question does not seem to have been answered… Q: I am using cluster-based permutation tests (depsamplesT, on time-frequency data) and am wondering how to best calculate an effect size from that. Best, Christine _______________________________________________ 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 xiew1202 at gmail.com Mon Sep 4 14:44:26 2017 From: xiew1202 at gmail.com (Xie Wanze) Date: Mon, 04 Sep 2017 12:44:26 +0000 Subject: [FieldTrip] WPLI In-Reply-To: References: Message-ID: Dear Linzhang, As Cris mentioned, you cannot calculate the WPLi value with one trial. The WPLI toolbox calculates the CSD and PSD for each single trial, and then get the "correlation" of the phase information across trials. This apparently could not be done with one trial. If you have continuous data you may try to segment it into epochs. Wanze Cristiano Micheli 于2017年9月4日 周一上午7:35写道: > Dear Linzhangysu > > the wPLI metric requires you to have your experimental design matrix > organized in 'repetitions' or 'trials'. > This is typically the case (but not only) of an evoked related design, > where the repetitions dimension is used to calculate your 'average' wPLI > across trials, and this is what the FT code is doing for you in the > *ft_connectivity_wpli* function. > In summary, with this formula you will not be able to apply wPLI to a > single trial (e.g. like in resting state). If your experiment allows > organizing the experimental data into 'trials' (with the operation of > epoching) then you can solve your problem, otherwise you will have to use > other metrics of phase coupling. > > IHTH > Cris Micheli > > > > On Mon, Sep 4, 2017 at 1:09 PM, linzhangysu at outlook.com < > linzhangysu at outlook.com> wrote: > >> >> >> [image: cid:image002.png at 01D325AA.E537BE20] >> >> >> >> I want to calculate the WPLI of 64 channels for one subject. But I met >> some questions. >> >> Firstly, I didn’t understand the meaning of repetitions (just as the >> maker of the figure ). The dimension of repetitions was 1 in my MATLAB code >> , which resulted in the WPLI result are NaN vectors. How can I solve the >> problem about ‘repetitions’? >> >> I am looking forward to your reply very urgently, Thank you ! >> >> >> >> _______________________________________________ >> 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: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: not available URL: From e.maris at donders.ru.nl Tue Sep 5 14:12:52 2017 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Tue, 5 Sep 2017 12:12:52 +0000 Subject: [FieldTrip] Effect size measure for cluster-based permutation tests In-Reply-To: References: Message-ID: <59403DFC-9FBC-4585-928E-84787AE7E99F@donders.ru.nl> Dear discussion list readers & contributors (especially Christine Blume), There have been many questions (not only on the FT discussion list) about the calculation of effect size measures in the context of cluster-based permutation tests. I will continue my reply under the quotes below. From: Blume Christine > Subject: Re: [FieldTrip] Effect size measure for cluster-based permutation tests Date: 4 September 2017 at 14:28:47 GMT+2 To: FieldTrip discussion list > Reply-To: FieldTrip discussion list > Hi Alik, Thanks a lot for your suggestion, which I hoped would prompt more answers. Does anyone have suggestions on how exactly to implement the calculation of an effect size measure? Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Alik Widge Gesendet: Mittwoch, 23. August 2017 16:42 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Effect size measure for cluster-based permutation tests My naive answer, which perhaps will provoke Eric to provide a better one: you have the actual cluster statistic and its permutation distribution under the null hypothesis. It seems as though that distribution could be assumed Gaussian and something like Cohen's d calculated. On Aug 23, 2017 9:35 AM, "Blume Christine" > wrote: Dear all, I came across a question posted by someone about a year ago, which concerned effect size measures for cluster-based permutation tests. Unfortunately, the question does not seem to have been answered… Q: I am using cluster-based permutation tests (depsamplesT, on time-frequency data) and am wondering how to best calculate an effect size from that. Best, Christine Giving a useful answer to this question requires that one knows for what this effect size measure will be used. Typically, a standardised effect size measure is required to perform a power calculation. A power calculation is possible for a number of parametric statistical tests such as the T- and the F-test. As input for this power calculation, Cohen’s d is required. A sensible value for Cohen’s d can sometimes be found in published studies (preferably with large sample sizes). Cohen’s d can easily be obtained from the outcome of a cluster-based permutation test: 1. Calculate the non-standardised effect sizes by averaging the (sensor, frequency, time)-specific effects within the cluster of interest. Typically, the (sensor, frequency, time)-specific effects are raw differences between the subject averages for the experimental conditions that are being compared. 2. Calculate the standard deviation over the subjects of these non-standardised effect sizes. 3. Calculate Cohen’s d by dividing the grand average of the non-standardised effect sizes by the standard deviation obtained in 2. Unfortunately, Cohen’s d calculated in this way, will be biased, and therefore cannot be used for a power calculation. This type of bias is sometimes denoted as “double dipping”. In general, it is extremely challenging to perform a power calculations for statistical analyses that involve high-dimensional data. This does not only hold for electrophysiological, but also for fMRI data. To get idea about the difficulties that one encounters, have a look at this paper from the fMRI community: http://www.biorxiv.org/content/early/2016/04/20/049429. For the analysis of high-dimensional electrophysiological data, quite some statistical work still has to be done. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From bioeng.yoosofzadeh at gmail.com Wed Sep 6 04:22:10 2017 From: bioeng.yoosofzadeh at gmail.com (Vahab Yousofzadeh) Date: Tue, 5 Sep 2017 22:22:10 -0400 Subject: [FieldTrip] Effect size measure for cluster-based Message-ID: Hi Christine, Based on my understanding from the following link the effect size (that correspond to the significant clusters) can not be derived from p (or t)-values by ft_sourcestatistics: http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test Cheers, Vahab From christine.blume at sbg.ac.at Wed Sep 6 09:10:25 2017 From: christine.blume at sbg.ac.at (Blume Christine) Date: Wed, 6 Sep 2017 07:10:25 +0000 Subject: [FieldTrip] Effect size measure for cluster-based In-Reply-To: References: Message-ID: Dear all, Thank you so much for all the suggestions and hints. I will look into them! Best, Christine ________________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Vahab Yousofzadeh [bioeng.yoosofzadeh at gmail.com] Gesendet: Mittwoch, 06. September 2017 04:22 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Effect size measure for cluster-based Hi Christine, Based on my understanding from the following link the effect size (that correspond to the significant clusters) can not be derived from p (or t)-values by ft_sourcestatistics: http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test Cheers, Vahab _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From preted at mcmaster.ca Wed Sep 6 16:48:26 2017 From: preted at mcmaster.ca (David) Date: Wed, 6 Sep 2017 10:48:26 -0400 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I’ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I’m running into is stated below as well as my code and I’ve attached an image of what the data looks like. I’ve tried following the tutorials and searching through the mailing list and can’t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: “Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);” Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot (16).png Type: image/png Size: 161547 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Sep 6 17:18:53 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 6 Sep 2017 15:18:53 +0000 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> References: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570@donders.ru.nl> Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I’ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I’m running into is stated below as well as my code and I’ve attached an image of what the data looks like. I’ve tried following the tutorials and searching through the mailing list and can’t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: “Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);” Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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 tokimoto at mejiro.ac.jp Wed Sep 6 17:57:17 2017 From: tokimoto at mejiro.ac.jp (=?utf-8?B?5pmC5pys55yf5ZC+?=) Date: Thu, 7 Sep 2017 00:57:17 +0900 Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: From smoratti at psi.ucm.es Wed Sep 6 18:25:54 2017 From: smoratti at psi.ucm.es (STEPHAN MORATTI) Date: Wed, 6 Sep 2017 18:25:54 +0200 Subject: [FieldTrip] Learning agreementbuybr 8 In-Reply-To: References: Message-ID: C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" escribió: Buenos días Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ¿Serías tan amable de enviármelo firmado? Gracias y perdón por las molestias, Sara -------------- next part -------------- An HTML attachment was scrubbed... URL: From preted at mcmaster.ca Wed Sep 6 18:43:41 2017 From: preted at mcmaster.ca (David) Date: Wed, 6 Sep 2017 12:43:41 -0400 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: References: Message-ID: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> Hi Jan-Mathijs, I’ve double checked and the label is written as ‘CZ’. So, it seems to be more than a typo, unfortunately. David From: fieldtrip-request at science.ru.nl Sent: September 6, 2017 12:26 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 82, Issue 8 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: Reshape Error Using ft_freqstatistics (Schoffelen, J.M. (Jan Mathijs)) 2. Cluster-based permutation tests for 3 conditions (????) 3. Re: Learning agreementbuybr 8 (STEPHAN MORATTI) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Sep 2017 15:18:53 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570 at donders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I?ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I?m running into is stated below as well as my code and I?ve attached an image of what the data looks like. I?ve tried following the tutorials and searching through the mailing list and can?t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: ?Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);? Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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: 2 Date: Thu, 7 Sep 2017 00:57:17 +0900 From: ???? To: FieldTrip discussion list Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: Content-Type: text/plain; charset="us-ascii" Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: ------------------------------ Message: 3 Date: Wed, 6 Sep 2017 18:25:54 +0200 From: STEPHAN MORATTI To: SARA RODRIGUEZ FREGENAL , FieldTrip discussion list Subject: Re: [FieldTrip] Learning agreementbuybr 8 Message-ID: Content-Type: text/plain; charset="utf-8" C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" escribi?: Buenos d?as Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ?Ser?as tan amable de envi?rmelo firmado? Gracias y perd?n por las molestias, Sara -------------- 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 82, Issue 8 **************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 7 07:19:09 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 7 Sep 2017 05:19:09 +0000 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> References: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> Message-ID: <5038FBE1-5E7B-4F6B-B152-4A500879F002@donders.ru.nl> In that case I recommend that you try and interpret the error message in a bit more detail. From the information you provide nobody can tell what’s going on, apart from the fact that it is a low-level matlab error. I suggest to use the matlab debugger to investigate the size of ‘meanreshapeddat', and the value of ‘nchan’ ‘nfreq’ ‘nrepl’ ‘ntime’ in this specific case. And also think about your specification of cfg.latency. Note that you only include positive latencies to be tested, but you ask for actvsblT as a test statistic, which name suggests to use a baseline (i.e. require latencies of < 0 in the data). JM On 6 Sep 2017, at 18:43, David > wrote: Hi Jan-Mathijs, I’ve double checked and the label is written as ‘CZ’. So, it seems to be more than a typo, unfortunately. David From: fieldtrip-request at science.ru.nl Sent: September 6, 2017 12:26 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 82, Issue 8 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: Reshape Error Using ft_freqstatistics (Schoffelen, J.M. (Jan Mathijs)) 2. Cluster-based permutation tests for 3 conditions (????) 3. Re: Learning agreementbuybr 8 (STEPHAN MORATTI) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Sep 2017 15:18:53 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570 at donders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I?ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I?m running into is stated below as well as my code and I?ve attached an image of what the data looks like. I?ve tried following the tutorials and searching through the mailing list and can?t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: ?Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);? Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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: 2 Date: Thu, 7 Sep 2017 00:57:17 +0900 From: ???? > To: FieldTrip discussion list > Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: > Content-Type: text/plain; charset="us-ascii" Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: ------------------------------ Message: 3 Date: Wed, 6 Sep 2017 18:25:54 +0200 From: STEPHAN MORATTI > To: SARA RODRIGUEZ FREGENAL >, FieldTrip discussion list > Subject: Re: [FieldTrip] Learning agreementbuybr 8 Message-ID: > Content-Type: text/plain; charset="utf-8" C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" > escribi?: Buenos d?as Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ?Ser?as tan amable de envi?rmelo firmado? Gracias y perd?n por las molestias, Sara -------------- 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 82, Issue 8 **************************************** _______________________________________________ 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 nugenta at mail.nih.gov Thu Sep 7 03:02:10 2017 From: nugenta at mail.nih.gov (Nugent, Allison C. (NIH/NIMH) [E]) Date: Thu, 7 Sep 2017 01:02:10 +0000 Subject: [FieldTrip] 2nd MEG North America Meeting - Abstract Submission Reminder Message-ID: This is a reminder that we are currently accepting abstracts for the 2nd MEG-North America meeting, to be held in Bethesda, Maryland November 8th and 9th. Committee meetings will be held on November 8th, with the scientific session on November 9th. There will be a poster session and oral sessions on November 9th. We are attempting to secure funding to present several speaker honoraria for excellent abstracts submitted by early career investigators and trainees. If you would like to be considered for this, please indicate your preference, along with your position, on your abstract submission. Abstracts may be submitted any time up until Wednesday, September 13th at 11:59pm, directly to NIHMEGworkshop at gmail.com (note the deadline has been extended). Please visit our website at https://megworkshop.nih.gov/MEGWorkshop/ - We have added additional information regarding the program! Or register at: https://www.eventbrite.com/e/meg-north-america-2017-tickets-36315511673 We hope to see you there! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alice.bollini at yahoo.com Thu Sep 7 10:18:22 2017 From: alice.bollini at yahoo.com (Alice B) Date: Thu, 7 Sep 2017 08:18:22 +0000 (UTC) Subject: [FieldTrip] Source reconstruction issues References: <283732377.7662318.1504772302305.ref@mail.yahoo.com> Message-ID: <283732377.7662318.1504772302305@mail.yahoo.com> Hello everyone, I would like to use fieldtrip for extracting source activity from specific ROIs (using the eLoreta approach). Here is my script, there are few things I am not sure in the pipeline (marked with numbers on the right) % eLORETA cfg = []; cfg.method                          = 'eloreta';cfg.grid                                  = leadfield;cfg.headmodel                       = headmodel;cfg.eloreta.keepfilter              = 'yes';cfg.eloreta.normalize               = 'yes';cfg.eloreta.lambda                  = 0.05;                                      *(1)cfg.eloreta.projectnoise            = 'yes';eLO_source                          = ft_sourceanalysis(cfg,data); % in the above line, "data" is the results of ft_timelockanalysis% with cfg.covariance = 'yes';                                                  *(2) % then I put the source positions from the MNI template% used for the sourcemodel (http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space)eLO_source.pos                      = template_grid.pos;iPOS                                        = eLO_source.pos;iPOS(eLO_source.inside==0,:)        = NaN; % only points inside gray matter % Then I select ROIs (here only one for simplicity) to extract single-trial source activity:[v,I]       = min(pdist2(iPOS, ROIs_mni , 'euclidean')); % And I multiply the spatial filter for the EEG data in each trialW            = eLO_source.avg.filter{I}; % filter at my ROI of interestfor tr = 1:size(data.trial,1)       % loop over trials         trials{tr} = W * squeeze(data.trial(tr,:,:));                            *(3)end Is this approach correct?My main questions are: *(1) Is there a way to select the best lambda parameter (e.g., selecting the one that best approximates the activity at the EEG channels level)? *(2) I am confused about the role of the covariance, since it doesn't seem to be used when source activity is estimated using the set of spatial filters at the single trial *(3) Is the "trials{tr} = W * squeeze(data.trial(tr,:,:)); " approach correct to get time-series of source activity in a ROI? Best,Alice -------------- next part -------------- An HTML attachment was scrubbed... URL: From da401 at kent.ac.uk Thu Sep 7 13:53:20 2017 From: da401 at kent.ac.uk (D.Abdallah) Date: Thu, 7 Sep 2017 11:53:20 +0000 Subject: [FieldTrip] Question about MVPA topographic map Message-ID: <1504785200819.38370@kent.ac.uk> Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref = 'yes'; cfg.channel = {'Cz', 'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; cfg.refchannel = 'Cz'; cfg.demean = 'yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype = '?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref = 'no'; FaceTrials.keeptrials = 'yes'; % classifiers operate on individual trials FaceTrials.channel = {'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; % occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref = 'no'; VaseTrials.keeptrials = 'yes'; % classifiers operate on individual trials VaseTrials.channel = {'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; % occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout = 'biosemi64.lay'; cfg.method = 'crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy' 'binomial' 'contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter = 'mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments = ''; cfg.colorbar = 'yes'; cfg.interplimits= 'electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Subject 8 Topographical map.fig Type: application/octet-stream Size: 450612 bytes Desc: Subject 8 Topographical map.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imagesc Subject 8.fig Type: application/octet-stream Size: 40249 bytes Desc: Imagesc Subject 8.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tutorial topographic map.png Type: image/png Size: 10419 bytes Desc: tutorial topographic map.png URL: From Patrick.Rollo at uth.tmc.edu Fri Sep 8 20:38:22 2017 From: Patrick.Rollo at uth.tmc.edu (Rollo, Patrick) Date: Fri, 8 Sep 2017 18:38:22 +0000 Subject: [FieldTrip] Job Posting on FieldTrip message board Message-ID: <6484964699b24059ba1dd00807892d06@uth.tmc.edu> FieldTrip Moderators, I have a job posting that I would like to make on this message board, our lab, Tandon Lab, has posted in the past. The advert is attached here. Please let me know if you have any questions, Thank you, Patrick Rollo Research Assistant Department of Neurosurgery UTHealth McGovern Medical School at Houston 6431 Fannin St MSB G.550G Houston TX 77030 phone: 713-500-5475 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Postdocs_U01_updated 5:17.pdf Type: application/pdf Size: 236167 bytes Desc: Postdocs_U01_updated 5:17.pdf URL: From lxykh0700073 at outlook.com Sun Sep 10 03:53:24 2017 From: lxykh0700073 at outlook.com (Xinyi Li) Date: Sun, 10 Sep 2017 01:53:24 +0000 Subject: [FieldTrip] mixed design permutation tests on time-frequency data? Message-ID: Hi all, I'm wondering how to do a mixed design permutation test on time-frequency data, specifically, how to specify the design matrix. I followed the instructions in this post https://mailman.science.ru.nl/pipermail/fieldtrip/2008-March/001500.html for design matrix, but got an error 'the design matrix variables should be constant within a block'. Any suggestions? Thanks! Xinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Miguel.Granjaespiritosanto at nottingham.ac.uk Mon Sep 11 11:19:13 2017 From: Miguel.Granjaespiritosanto at nottingham.ac.uk (Miguel Granja Espirito Santo) Date: Mon, 11 Sep 2017 09:19:13 +0000 Subject: [FieldTrip] Any update on the group-level source MNE stats? Message-ID: Hi fieldtripers, I was wondering if there is any update on doing group level stats after conducting an MNE source analysis. I found several threads on the mailings list which I have successfully replicated, but I was wondering if there is any official FT approved way. At the end of the MNE page it says that this is under development, so is anyone privy to what the status of documentation is? Just asking because of supervisor enquiry for publication of our results. Best, Miguel PhD Student School of Psychology University of Nottingham 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 Manuel.Bange at unimedizin-mainz.de Mon Sep 11 14:32:57 2017 From: Manuel.Bange at unimedizin-mainz.de (Bange, Manuel) Date: Mon, 11 Sep 2017 12:32:57 +0000 Subject: [FieldTrip] Time normalisation for trials of different lenghts Message-ID: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> Dear fieldtrip community, My name is Manuel Bange and I am working in the Movement Disorder and Neurostimulation Lab in Mainz, Germany. Currently I am working on a project where we recorded EEG and EMG data combined with simultaneously recorded ground reaction forces during walking on a treadmill. I intend to use complete gait cycles as trials in order to, for example, calculate the inter-trial coherence. The issue I now face is that every cycle lasts a different amount of time. In a first step I have separated the continuous data into trials that correspond to whole gait cycles. One cycle starts with the onset of the right foot and ends one sample before the following onset of the same foot. This results in a number of trials (around 18 per subject) of different lengths. Following this, I performed a time-frequency analysis for each individual trial by 1. selecting a specific trial cfg.trials = 2; % select a a trial, here trial 2 trial2 = ft_selectdata(cfg, data) 2. performing time-frequency analysis cfg = []; cfg.output = 'pow'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [1:1:40]; cfg.t_ftimwin = ones(length(cfg.foi),1).*1; cfg.toi = trial2.time{1,1}(1,125):0.01:trial2.time{1,1}(1,end-125-1); cfg.keeptrials = 'yes' data_tfa1 = ft_freqanalysis(cfg, trial2); resulting in data_tfa1 = struct with fields: label: {257×1 cell} dimord: 'rpt_chan_freq_time' freq: [1×40 double] time: [1×172 double] % differs for each trial powspctrm: [1×257×40×172 double] cumtapcnt: [1×40 double] cfg: [1×1 struct] Now my question is: Is there a way to normalise this data over the time-axis, so that all trials have the same length? This is important to calculate an average time-frequency representation, or in another step, to calculate the inter-trial coherence. I have thought of normalising the time axis and interpolating the corresponding power-values. Thanks and best regards, Manuel Bange M.Sc. Sports Science Johannes-Gutenberg-University Hospital Movement Disorders and Neurostimulation Department of Neurology Langenbeckstr. 1 55131 Mainz, Germany www.unimedizin-mainz.de Email: manuel.bange at unimedizin-mainz.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From juliacoopiza at gmail.com Mon Sep 11 15:24:35 2017 From: juliacoopiza at gmail.com (Julia Coopi) Date: Mon, 11 Sep 2017 07:24:35 -0600 Subject: [FieldTrip] Using PPC method In-Reply-To: References: Message-ID: Dear Andreas, Finally, I managed to get PPC result from fliedtrip, now I have a problem: I am using mtmfft as method I wnat to have fine frequency resolution atleast I wan to have a point for each 1 hz. I have used cfg.foi =2:1:80; But it did't work, my output has a frequncy vector like this:[ 5 10 15 20 ... 80]; do you have any suggestion for better frequency resolution. If any body has a suggestion, that woulb be great to share it. Thanks, Julia On Mon, Sep 4, 2017 at 6:24 AM, Andreas Wutz wrote: > Dear Julia, > > I did not see your error message. Maybe, your lfp data structure is still > in a continuous recording format without a trial definition? > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Julia Coopi [juliacoopiza at gmail.com] > *Sent:* Sunday, September 03, 2017 11:14 AM > > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Using PPC method > > Dear Andreas, > > Thanks for your response, I am going through your suggestion. did you have > any problem regarding the appending spikes and lfp. I got this error: > > Error using ft_appendspike (line 112) > could not find the trial information in the continuous data > > thanks. > Julia > > On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz wrote: > >> Dear Tianyang, >> >> maybe it's a good idea to download the accompanying sample data from the >> tutorial and look if you can recreate the shown data structure. Then look >> closer into the values of the respective fields. That should give you a >> better grasp on what is required there. >> >> I have not fully looked into the code but my feeling is that >> spikeTrials.timestamp is not of any further use and is just carried from >> the data structure before (which was not cut into trials and where the raw >> timestamps were useful). The timing of spikes relative to the trial zero >> point is fully described in the fields ".time", ".trial" and ".trialtime". >> Best, >> Andreas >> >> >> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] >> on behalf of 马天阳 [tianyangma2013 at gmail.com] >> *Sent:* Monday, August 28, 2017 5:31 PM >> *To:* FieldTrip discussion list >> *Subject:* Re: [FieldTrip] Using PPC method >> >> Dear Andreas, >> >> I still don't quite understand the tutorial. >> >> spikeTrials = >> label: {'sig002a_wf' 'sig003a_wf'} >> timestamp: {[1x83601 int32 ] [1x61513 int32 ]} >> waveform: {[1x32x83601 double ] [1x32x61513 double ]} >> unit: {[1x83601 double ] [1x61513 double ]} >> hdr: [1x1 struct ] >> dimord: '{chan}_lead_time_spike' >> cfg: [1x1 struct ] >> time: {[1x83601 double ] [1x61513 double ]} >> trial: {[1x83601 double ] [1x61513 double ]} >> trialtime: [600x2 double ] >> >> Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? >> >> I feel I am quite lost. >> >> Best, >> >> Tianyang >> >> >> _______________________________________________ >> 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 awutz at mit.edu Mon Sep 11 15:57:02 2017 From: awutz at mit.edu (Andreas Wutz) Date: Mon, 11 Sep 2017 13:57:02 +0000 Subject: [FieldTrip] Using PPC method In-Reply-To: References: , Message-ID: Dear Julia, your frequency resolution depends on the time window you give to the FFT (cfg.timwin). Increasing that window will increase your freq resolution. ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Monday, September 11, 2017 9:24 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Finally, I managed to get PPC result from fliedtrip, now I have a problem: I am using mtmfft as method I wnat to have fine frequency resolution atleast I wan to have a point for each 1 hz. I have used cfg.foi =2:1:80; But it did't work, my output has a frequncy vector like this:[ 5 10 15 20 ... 80]; do you have any suggestion for better frequency resolution. If any body has a suggestion, that woulb be great to share it. Thanks, Julia On Mon, Sep 4, 2017 at 6:24 AM, Andreas Wutz > wrote: Dear Julia, I did not see your error message. Maybe, your lfp data structure is still in a continuous recording format without a trial definition? ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Sunday, September 03, 2017 11:14 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz > wrote: Dear Tianyang, maybe it's a good idea to download the accompanying sample data from the tutorial and look if you can recreate the shown data structure. Then look closer into the values of the respective fields. That should give you a better grasp on what is required there. I have not fully looked into the code but my feeling is that spikeTrials.timestamp is not of any further use and is just carried from the data structure before (which was not cut into trials and where the raw timestamps were useful). The timing of spikes relative to the trial zero point is fully described in the fields ".time", ".trial" and ".trialtime". Best, Andreas From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of 马天阳 [tianyangma2013 at gmail.com] Sent: Monday, August 28, 2017 5:31 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, I still don't quite understand the tutorial. spikeTrials = label: {'sig002a_wf' 'sig003a_wf'} timestamp: {[1x83601 int32] [1x61513 int32]} waveform: {[1x32x83601 double] [1x32x61513 double]} unit: {[1x83601 double] [1x61513 double]} hdr: [1x1 struct] dimord: '{chan}_lead_time_spike' cfg: [1x1 struct] time: {[1x83601 double] [1x61513 double]} trial: {[1x83601 double] [1x61513 double]} trialtime: [600x2 double] Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? I feel I am quite lost. Best, Tianyang _______________________________________________ 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 nasseroleslami at gmail.com Mon Sep 11 19:09:52 2017 From: nasseroleslami at gmail.com (Bahman Nasseroleslami) Date: Mon, 11 Sep 2017 18:09:52 +0100 Subject: [FieldTrip] Research Assistant in Position Neural Engineering Position - Trinity College Dublin, the University of Dublin, Dublin, Ireland Message-ID: Dear all, There is a research assistant position available in Academic Unit of Neurology, Trinity College Dublin, the University of Dublin, Dublin, Ireland. --------------------------------------- Job ID : 032518 Post Title: Research Assistant in Neural Engineering Post Status: 12 month contract, full-time Research Group / Department / School Academic Unit of Neurology, School of Medicine, Trinity College Dublin, the University of Dublin Location: Trinity Biomedical Sciences Institute, Trinity College Dublin, the University of Dublin, College Green, Dublin D02 R590, Ireland Reports to: Professor Orla Hardiman/Dr Bahman Nasseroleslami Salary: Research Assistant Level based on Irish Universities Association (IUA) Guideline, Point 1: €21,459 per annum (or above commensurate with experience). Closing Date: 5pm on Wednesday 27th September 2017 Please note that Garda vetting will be sought in respect of individuals who come under consideration for a post. Post Summary Applications are invited for a motivated and self-driven individual for the position of research assistant with the Irish ALS Research Group, hosted in the Trinity Biomedical Sciences Institute (TBSI)'s Academic Unit of Neurology. The ideal candidate will have an undergraduate or master's degree in engineering, bioengineering, mathematics, computational biology, or a cognate area. Familiarity with and/or the ability to quickly acquire skills in electrophysiological recordings and analysis (e.g. EEG/EMG), would be highly desirable as would a knowledge of computer programming (MATLAB). --------------------------------------- The detailed job description file (PDF) and the application instructions can be found online at http://jobs.tcd.ie. It would be really appreciated if you could share this with those that may be interested. Sincerely Bahman –––––––––––– Bahman Nasseroleslami Senior Research Fellow, IRC Postdoctoral Fellow Academic Unit of Neurology, School of Medicine Trinity College Dublin, the University of Dublin Dublin 2, Ireland. Room 5.43, Trinity Biomedical Sciences Institute 152-160 Pearse Street, Dublin D02 R590, Ireland. nasserob at tcd.ie, nasseroleslami at gmail.com www.tcd.ie Trinity College Dublin, the University of Dublin is ranked 1st in Ireland and in the top 100 world universities by the QS World University Rankings. –––––––––––– -------------- next part -------------- An HTML attachment was scrubbed... URL: From michak at is.umk.pl Mon Sep 11 23:16:54 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Mon, 11 Sep 2017 23:16:54 +0200 Subject: [FieldTrip] MRI low contrast Message-ID: Dear Fieldtrippers, How to correct low contrast in MR image when using ft_mri_read and ft_sourceplot to read and display MR image? (see attachment mri00_lowctrst.png) For comparison, same .nii opened with mricron software ( http://people.cas.sc.edu/rorden/mricron/install.html) displays with proper contrast (see attachment mri00_hictrst.png) Code: ss = 'sub1'; f = ['../data/ind/', ss, '/mri/mri00.nii']; mri00 = ft_read_mri(f) ft_sourceplot([],mri00) Thank you in advance ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mri00_hictrst.png Type: image/png Size: 460834 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mri00_lowctrst.png Type: image/png Size: 88547 bytes Desc: not available URL: From a.stolk8 at gmail.com Mon Sep 11 23:48:47 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 11 Sep 2017 14:48:47 -0700 Subject: [FieldTrip] MRI low contrast In-Reply-To: References: Message-ID: Hi Michal, There's a (undocumented) keyboard shortcut, shift+equal sign (numpad +) to adjust the contrast scaling (use numpad - for the opposite direction). Perhaps ft_sourceplot should additionally require the same cfg.lim option that for instance ft_determine_coordsys uses. Will propose in a PR. Best, Arjen On Mon, Sep 11, 2017 at 2:16 PM, Michał Komorowski wrote: > Dear Fieldtrippers, > > How to correct low contrast in MR image when using ft_mri_read and > ft_sourceplot to read and display MR image? (see attachment > mri00_lowctrst.png) > > For comparison, same .nii opened with mricron software ( > http://people.cas.sc.edu/rorden/mricron/install.html) displays with > proper contrast (see attachment mri00_hictrst.png) > > Code: > > ss = 'sub1'; > f = ['../data/ind/', ss, '/mri/mri00.nii']; > mri00 = ft_read_mri(f) > ft_sourceplot([],mri00) > > > Thank you in advance ! > > Michał Komorowski, MSc > Nicolaus Copernicus University in Toruń > Faculty of Physics, Astronomy and Informatics > Department of Informatics > > _______________________________________________ > 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 anne.urai at gmail.com Tue Sep 12 09:01:03 2017 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 12 Sep 2017 09:01:03 +0200 Subject: [FieldTrip] BIDS data format survey Message-ID: Dear FieldTrippers, Recently, a number of people have been working on developing a common data standard for MEG called BIDS (Brain Imaging Data Structure). They are now requesting community feedback, so please have a look at the brief survey here and help them out: https://t.co/BjAFmR7yhN *Magnetoencephalography (MEG) studies produce enormous amounts of data that need to be stored, organized and analyzed. However, naming conventions and metadata are often incomplete or inexistent, which is an impediment to the transfer of scientific data and knowledge, the reproducibility of research results, and the curation of large data repositories with entries from heterogenous origins. * *Building on recent efforts from the MRI community, MEG-BIDS is a proposition to standardize the arrangement of data structures in MEG. Please refer to the MEG-BIDS manuscript and to the MEG-BIDS detailed specifications for all details concerning the proposed structure:- MEG-BIDS Manuscript: http://www.biorxiv.org/content/early/2017/08/08/172684 * *- MEG-BIDS Specifications: http://www.biorxiv.org/content/biorxiv/suppl/2017/08/08/172684.DC1/172684-1.pdf * *We wish to survey the MEG community on its present needs with respect to data management, and design the MEG-BIDS standard to best respond to these presently unmet needs.* *Your participation is truly appreciated.* ... — Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie Universitätsklinikum Hamburg-Eppendorf | Martinistrasse 52, 20246 | Hamburg, Germany www.anneurai.net / @AnneEUrai -------------- next part -------------- An HTML attachment was scrubbed... URL: From michak at is.umk.pl Tue Sep 12 09:56:58 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Tue, 12 Sep 2017 09:56:58 +0200 Subject: [FieldTrip] MRI low contrast In-Reply-To: References: Message-ID: Yaay ! + and - works ! :D For determining coordsys one should type: % clim adjusts contrast (default [0 1], the lower the brighter) [dataout] = ft_determine_coordsys(mri00, 'clim', [0 0.25]) Thank you very much ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics 2017-09-11 23:48 GMT+02:00 Arjen Stolk : > Hi Michal, > > There's a (undocumented) keyboard shortcut, shift+equal sign (numpad +) to > adjust the contrast scaling (use numpad - for the opposite direction). > > Perhaps ft_sourceplot should additionally require the same cfg.lim option > that for instance ft_determine_coordsys uses. Will propose in a PR. > > Best, > Arjen > > > > > On Mon, Sep 11, 2017 at 2:16 PM, Michał Komorowski > wrote: > >> Dear Fieldtrippers, >> >> How to correct low contrast in MR image when using ft_mri_read and >> ft_sourceplot to read and display MR image? (see attachment >> mri00_lowctrst.png) >> >> For comparison, same .nii opened with mricron software ( >> http://people.cas.sc.edu/rorden/mricron/install.html) displays with >> proper contrast (see attachment mri00_hictrst.png) >> >> Code: >> >> ss = 'sub1'; >> f = ['../data/ind/', ss, '/mri/mri00.nii']; >> mri00 = ft_read_mri(f) >> ft_sourceplot([],mri00) >> >> >> Thank you in advance ! >> >> Michał Komorowski, MSc >> Nicolaus Copernicus University in Toruń >> Faculty of Physics, Astronomy and Informatics >> Department of Informatics >> >> _______________________________________________ >> 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 behinger at uos.de Tue Sep 12 20:14:22 2017 From: behinger at uos.de (Benedikt Ehinger) Date: Tue, 12 Sep 2017 20:14:22 +0200 Subject: [FieldTrip] Time normalisation for trials of different lenghts In-Reply-To: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> References: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> Message-ID: <1311033b-5017-443e-9cd9-0f4e4486f112@uos.de> Dear Manuel, first off, I do not know if or how you can do this in fieldtrip. But in eeglab you can do something they call "timewarping". One calculates a time-frequency (TF) decomposition for each trial and then warps/interpolates the TF so that some given events align. This is very similar (identical?) to what you describe and you might find more information either in the papers or the eeglab implementation. The method has been described in Gwin 2010 [1] and we also used it in on of our own studies [2]. Whether you can do the same also for phase (=> coherence) I don't know. I hope that helps in your analysis. Best, Benedikt [1] https://www.ncbi.nlm.nih.gov/pubmed/20410364 [2] https://www.ncbi.nlm.nih.gov/pubmed/24616681 Am 11.09.2017 um 14:32 schrieb Bange, Manuel: > Dear fieldtrip community, > >   > > My name is Manuel Bange and I am working in the Movement Disorder and > Neurostimulation Lab in Mainz, Germany. Currently I am working on a > project where we recorded EEG and EMG data combined with simultaneously > recorded ground reaction forces during walking on a treadmill. I intend > to use complete gait cycles as trials in order to, for example, > calculate the inter-trial coherence. The issue I now face is that every > cycle lasts a different amount of time. > > In a first step I have separated the continuous data into trials that > correspond to whole gait cycles. One cycle starts with the onset of the > right foot and ends one sample before the following onset of the same > foot. This results in a number of trials (around 18 per subject) of > different lengths. > > Following this, I performed a time-frequency analysis for each > individual trial by > >   > > 1.       selecting a specific trial > > /cfg.trials      = 2; >                                                               % select a > a trial, here trial 2/ > > /trial2 = ft_selectdata(cfg, data)/ > > / / > > 2.       performing time-frequency analysis > > /cfg          = [];/ > > /cfg.output   = 'pow';/ > > /cfg.method   = 'mtmconvol';/ > > /cfg.taper    = 'hanning';/ > > /cfg.foi      = [1:1:40];/ > > /cfg.t_ftimwin    = ones(length(cfg.foi),1).*1;/ > > /cfg.toi          = > trial2.time{1,1}(1,125):0.01:trial2.time{1,1}(1,end-125-1);            / > > /cfg.keeptrials = 'yes'/ > > /data_tfa1     = ft_freqanalysis(cfg, trial2);/ > > /resulting in/ > > /  data_tfa1 = / > > /  struct with fields:/ > > /label: {257×1 cell}/ > > /dimord: 'rpt_chan_freq_time'/ > > /freq: [1×40 double]/ > > /time: [1×172 > double]                                                                    > % differs for each trial/ > > /powspctrm: [1×257×40×172 double]/ > > /cumtapcnt: [1×40 double]/ > > /cfg: [1×1 struct]/ > >   > > Now my question is: > > Is there a way to normalise this data over the time-axis, so that all > trials have the same length? This is important to calculate an average > time-frequency representation, or in another step, to calculate the > inter-trial coherence. I have thought of normalising the time axis and > interpolating the corresponding power-values. > >   > > Thanks and best regards, > >   > > Manuel Bange > > M.Sc. Sports Science > >   > >   > > Johannes-Gutenberg-University Hospital > > Movement Disorders and Neurostimulation > > Department of Neurology > > Langenbeckstr. 1 > > 55131 Mainz, Germany > > www.unimedizin-mainz.de > >   > > Email: manuel.bange at unimedizin-mainz.de > >   > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From psc.dav at gmail.com Tue Sep 12 20:47:15 2017 From: psc.dav at gmail.com (David Pascucci) Date: Tue, 12 Sep 2017 20:47:15 +0200 Subject: [FieldTrip] inverse imaging Message-ID: Dear fieldtrip experts, I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Sep 13 12:22:01 2017 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 13 Sep 2017 12:22:01 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Hi David, do you want to obtain single-trial activity in source space? In that case, have you looked at the „virtual sensors“-tutorial? http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors In the tutorial, LCMV is used for the source analysis, but it should also work with sloreta, as the output-structure of the source-analysis is identical. I’m not sure about MNE though. Good luck, Julian > Am 12.09.2017 um 20:47 schrieb David Pascucci : > > Dear fieldtrip experts, > > I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… > > > > Thanks in advance > > _______________________________________________ > 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 psc.dav at gmail.com Wed Sep 13 13:22:46 2017 From: psc.dav at gmail.com (David Pascucci) Date: Wed, 13 Sep 2017 13:22:46 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Thaks Julian, that is the approach I was using, with eLoreta. I am not sure about two steps,though. One is the estimate and use of the signal covariance to input for single-trial activity in source space. The other is the choice of the optimal lambda. If you have some advice, that wold be very helpful. Thanks, David 2017-09-13 12:22 GMT+02:00 Julian Keil : > Hi David, > > do you want to obtain single-trial activity in source space? In that case, > have you looked at the „virtual sensors“-tutorial? http://www. > fieldtriptoolbox.org/tutorial/shared/virtual_sensors > In the tutorial, LCMV is used for the source analysis, but it should also > work with sloreta, as the output-structure of the source-analysis is > identical. I’m not sure about MNE though. > > Good luck, > > Julian > > > Am 12.09.2017 um 20:47 schrieb David Pascucci : > > Dear fieldtrip experts, > > I was wondering if anyone has experience with extracting single trials > estimates of source activity (using MNE or Loreta-based approaches) from > regions of interest, and what would be the best procedure… > > > Thanks in advance > _______________________________________________ > 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 > -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Sep 13 13:41:22 2017 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 13 Sep 2017 13:41:22 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Hi David, regarding the lambda, I think there are different ideas floating around the fieldtrip discussion-list. I suggest searching for the term „lambda“ to get a rough idea. Personally, for our EEG-data I usually use 10%. What is your question exactly regarding the covariance as input? Cheers, Julian > Am 13.09.2017 um 13:22 schrieb David Pascucci : > > Thaks Julian, > that is the approach I was using, with eLoreta. > I am not sure about two steps,though. > One is the estimate and use of the signal covariance to input for single-trial activity in source space. > The other is the choice of the optimal lambda. > > If you have some advice, that wold be very helpful. > > Thanks, > David > > 2017-09-13 12:22 GMT+02:00 Julian Keil >: > Hi David, > > do you want to obtain single-trial activity in source space? In that case, have you looked at the „virtual sensors“-tutorial? http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors > In the tutorial, LCMV is used for the source analysis, but it should also work with sloreta, as the output-structure of the source-analysis is identical. I’m not sure about MNE though. > > Good luck, > > Julian > > >> Am 12.09.2017 um 20:47 schrieb David Pascucci >: >> >> Dear fieldtrip experts, >> >> I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… >> >> >> >> Thanks in advance >> >> _______________________________________________ >> 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 > > > > -- > --------------------- > David Pascucci > > Postdoctoral Fellow > University of Fribourg > Department of Psychology > Rue de Faucigny 2 > 1700 Fribourg > Switzerland > _______________________________________________ > 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 evelyn.muschter at unitn.it Wed Sep 13 13:50:06 2017 From: evelyn.muschter at unitn.it (Evelyn Muschter) Date: Wed, 13 Sep 2017 13:50:06 +0200 Subject: [FieldTrip] Any update on the group-level source MNE stats?/ Vol 82, Issue 13 In-Reply-To: References: Message-ID: <88486D75-ED4E-40E0-8EE1-95A1A21E60CB@unitn.it> Hi Miguel and all, I have been wondering this myself! I have also followed various tutorial snippets here, but I am stuck with how to properly do group level stats. Any suggestions and input would be greatly appreciated! Best, Evelyn > On Sep 11, 2017, at 12:00 PM, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > 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. Any update on the group-level source MNE stats? > (Miguel Granja Espirito Santo) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 11 Sep 2017 09:19:13 +0000 > From: Miguel Granja Espirito Santo > > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Any update on the group-level source MNE stats? > Message-ID: > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi fieldtripers, > > > I was wondering if there is any update on doing group level stats after conducting an MNE source analysis. I found several threads on the mailings list which I have successfully replicated, but I was wondering if there is any official FT approved way. > > > At the end of the MNE page it says that this is under development, so is anyone privy to what the status of documentation is? > > Just asking because of supervisor enquiry for publication of our results. > > > Best, > > Miguel > PhD Student > School of Psychology > University of Nottingham > > > > > > 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: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 82, Issue 13 > ***************************************** From psc.dav at gmail.com Wed Sep 13 15:33:57 2017 From: psc.dav at gmail.com (David Pascucci) Date: Wed, 13 Sep 2017 15:33:57 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Thanks again Julian, About the covariance, I am not sure about its usage in the reconstruction of single-trials activity. According to the example, this is done by multiplying the spatial filters with the EEG data. Whereas the covariance (Cf) is used to compute the avg.pow and ori in ft_eloreta (line 160-168) % get the power dip.pow = zeros(size(dip.pos,1),1); dip.ori = cell(size(dip.pos,1),1); for i=1:size(dip.pos,1) csd = dip.filter{i}**Cf**dip.filter{i}'; [u,s,vv] = svd(real(csd)); dip.pow(i) = s(1); dip.ori{i} = u(:,1); end It does not seem to be considered when creating and storing spatial filters (later used for single-trials reconstruction) (line 152-158, ft_eloreta) % use existing filters, or compute them if ~isfield(dip, 'filter') filt = mkfilt_eloreta_v2(leadfield, lambda); for i=1:size(dip.pos,1) dip.filter{i,1} = squeeze(filt(:,i,:))'; end end My question is, am I getting this wrong? and if not, should I ignore the covariance estimation in the case of single-trials reconstructed via filters*data? Cheers, David 2017-09-13 13:41 GMT+02:00 Julian Keil : > Hi David, > > regarding the lambda, I think there are different ideas floating around > the fieldtrip discussion-list. I suggest searching for the term „lambda“ to > get a rough idea. Personally, for our EEG-data I usually use 10%. > > What is your question exactly regarding the covariance as input? > > Cheers, > > Julian > > Am 13.09.2017 um 13:22 schrieb David Pascucci : > > Thaks Julian, > that is the approach I was using, with eLoreta. > I am not sure about two steps,though. > One is the estimate and use of the signal covariance to input for single-trial > activity in source space. > The other is the choice of the optimal lambda. > > If you have some advice, that wold be very helpful. > > Thanks, > David > > 2017-09-13 12:22 GMT+02:00 Julian Keil : > >> Hi David, >> >> do you want to obtain single-trial activity in source space? In that >> case, have you looked at the „virtual sensors“-tutorial? http://www. >> fieldtriptoolbox.org/tutorial/shared/virtual_sensors >> In the tutorial, LCMV is used for the source analysis, but it should also >> work with sloreta, as the output-structure of the source-analysis is >> identical. I’m not sure about MNE though. >> >> Good luck, >> >> Julian >> >> >> Am 12.09.2017 um 20:47 schrieb David Pascucci : >> >> Dear fieldtrip experts, >> >> I was wondering if anyone has experience with extracting single trials >> estimates of source activity (using MNE or Loreta-based approaches) from >> regions of interest, and what would be the best procedure… >> >> >> Thanks in advance >> _______________________________________________ >> 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 >> > > > > -- > --------------------- > David Pascucci > > Postdoctoral Fellow > University of Fribourg > Department of Psychology > Rue de Faucigny 2 > 1700 Fribourg > Switzerland > _______________________________________________ > 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 > -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From Adeen.Flinker at nyumc.org Wed Sep 13 20:23:40 2017 From: Adeen.Flinker at nyumc.org (Flinker, Adeen) Date: Wed, 13 Sep 2017 18:23:40 +0000 Subject: [FieldTrip] ECoG postdoc position Message-ID: <99026305-0472-4915-871A-C55374055912@nyumc.org> NYU School of Medicine is looking for candidates for two post-doctoral positions in Human Electrocortigoraphy (ECoG) research. Both positions will be under the supervision of Dr. Adeen Flinker, investigating speech processing and cortical network dynamics. The research will be conducted at NYU Comprehensive Epilepsy Center working with a population of surgical patients undergoing treatment for refractory epilepsy. Research paradigms will be conducted in close collaboration with the clinical neurology team. The candidate will conduct neurophysiological research in patients implanted with intracranial electrodes (surface, depth, laminar, Utah arrays) and in intraoperative patients undergoing acute recording, stimulation or cooling. The ideal applicant must have a Ph.D. in Neuroscience, Psychology, Biomedical Engineering or a related field. Proficiency in oral and written English is mandatory. A solid background in programming, statistics and scientific writing is required. The candidate is expected to be autonomous and to have a track-record of peer-reviewed publication. Previous experience with human electrophysiology or machine learning will be an asset. One postdoctoral position is funded by a MURI grant investigating event segmentation and episodic memory. The candidate will have an opportunity to work closely with collaborators in Princeton (Dr. Hasson, Dr. Norman), Harvard (Dr. Gershman), UC Davis (Dr. Ranganath) and Washington University (Dr. Zacks). Interested individuals should send an email to adeen.flinker at nyumc.org, including a cover letter describing research experience and qualifications, academic CV, and contact information of referees. Adeen Flinker, PhD Assistant Professor Department of Neurology NYU School of Medicine 145 East 32nd Street New York, NY 10016 646-754-2228 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1377 bytes Desc: not available URL: -------------- next part -------------- ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From C.Mazzetti at donders.ru.nl Thu Sep 14 13:28:45 2017 From: C.Mazzetti at donders.ru.nl (Mazzetti, C. (Cecilia)) Date: Thu, 14 Sep 2017 11:28:45 +0000 Subject: [FieldTrip] ICA warning messages Message-ID: <389DA1293690C94C93E3A53201F6C91E569EB8E6@exprd01.hosting.ru.nl> Hi Evryone, I was wondering why do i get this type of warnings when running ICA on my data. this is the script I am using: cfg.resamplefs = 300; cfg.detrend = 'no'; datads = ft_resampledata(cfg, data_clean); cfg=[]; cfg.bpfilter='yes'; % bandpass , use low freqs for alpha compponents cfg.bpfreq = [0.5 30]; datatmp= ft_preprocessing(cfg, datads) cfg.method = 'runica'; cfg.runica.maxsteps =30; comp_filt = ft_componentanalysis(cfg, datatmp); clear datads cfg = []; cfg.unmixing = comp_filt.unmixing; cfg.topolabel = comp_filt.topolabel; comp_origin = ft_componentanalysis(cfg, data_clean); clear comp cfg = []; cfg.viewmode = 'component'; cfg.layout = 'CTF275.lay'; ft_databrowser(cfg, comp_origin) cfg = []; cfg.component = input('bad comps = '); meg_ica = ft_rejectcomponent(cfg, comp_origin,data_clean); later on after having selected the bad components i get these messages : Warning: unexpected channel unit "unknown" in channel 158 (i get this for all the channels but i copy-pasted just one of them for obv reasons) Warning: copying input chantype to montage Warning: copying input chanunit to montage Thanks in advance for your hints! Cecilia Cecilia Mazzetti - Ph.D. Candidate Donders Centre for Cognitive Neuroimaging, room 1.170 Kapittelweg 29 | 6525 EN Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nirofir2 at gmail.com Thu Sep 14 14:10:46 2017 From: nirofir2 at gmail.com (Nir Ofir) Date: Thu, 14 Sep 2017 15:10:46 +0300 Subject: [FieldTrip] Using ft_redefinetrial with minlength and begsample/endsample option Message-ID: Hi fieldtrip users, I have a data structure containing MEG trials which are aligned to stimulus onset. I now want to realign them to the target onset, as well as removing trials which are too short. I thought the easiest way to do this would be to use ft_redefinetrial in the following way: offset = dat.trialinfo(:,5); % this column contains the duration of the stimulus-target intervel cfg = []; cfg.minlength = -dat.time{1}(1)+cfgx.pretarget+0.5; % prestim defined by dat sructure + 0.5 s ERF + cfgx.pretarget cfg.begsample = round((offset - cfgx.pretarget)*1000); cfg.endample = round(offset*1000); dat = ft_redefinetrial(cfg, dat); When I run this, I get the following error: Index exceeds matrix dimensions. Error in ft_redefinetrial (line 209) data.trial{i} = data.trial{i}(:, begsample(i):endsample(i)); So I looked into ft_redefinetrials a bit, and it seems like when minlength is defined, the trials themselves are removed, but the begample/endsample vector are not cut to contain only the relevant trials. For now I moved to a 2-step solution (first removing trials, than realigning), but it seems like this could have a relatively simple fix. Suggestions? Thanks! Nir Ofir -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Sep 15 12:45:01 2017 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 15 Sep 2017 12:45:01 +0200 Subject: [FieldTrip] Postdoc position: Magnetoencephalography and Tractography applied to Language in Neurological Populations Message-ID: *3-year postdoctoral position on the topic of magnetoencephalography and tractography applied to language in neurological populations* We are looking for a postdoctoral candidate with demonstrable experience in analysis of structural imaging and tractography to strengthen our research group. Our group aims at integrating brain measures with high temporal resolution, obtained using magnetoencephalography, with measures of structural connectivity to better understand language function in healthy and neurological populations. Ongoing projects include studying chronic stroke and brain tumour patients. More information on https://www.languageininteraction.nl/jobs/postdoc-position-388.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Sep 15 15:46:58 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 15 Sep 2017 13:46:58 +0000 Subject: [FieldTrip] Fwd: Question for Fieldtrip References: <4b2644a5.aff0.15e8581f6ac.Coremail.zhangwenjia2732@126.com> Message-ID: <420905E5-98A4-4C9C-96C4-1C8A28325786@donders.ru.nl> Begin forwarded message: From: 张文嘉 > Subject: Question for Fieldtrip Date: 15 September 2017 at 14:27:20 GMT+2 To: > Dear Fieldtrip expert, I am Wenjia from NYU Shanghai. I am doing timefrequency analysis with frildtrip. I have a question that I cannot solve. And, I am wondering whether you could help me. Specifically, I want to import the EGI data that has been preprocessed (after segmentation but no average) into fieldtrip, and further do timefrequency analysis. I donot know how to do this. I have found a script like following: cfg = []; cfg.triggertype = 'Stimulus'; cfg.prestim = 1.0; %1.0s before the onset cfg.poststim = 2.0; %2.0s after the onset cfg.inputfile = sprintf('s02_32_tf'); cfg.triggercode = 'S 32'; data_32 = read_analyzer_data(cfg); "s02_32_tf" is the name that I exported from EGI system, then included 3 files: asc, vhdr and vmrk. However an error poped up: Undefined function 'read_analyzer_data' for input arguments of type 'struct'. Any advice are appreciated. Thank you very much. -- Wenjia NYU Shanghai -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.chait at ucl.ac.uk Mon Sep 18 13:01:41 2017 From: m.chait at ucl.ac.uk (Chait, Maria) Date: Mon, 18 Sep 2017 11:01:41 +0000 Subject: [FieldTrip] Research Assistant Position at the UCL Ear Institute Message-ID: I would appreciate your help in forwarding the advert below to relevant members of your department. We are seeking to appoint an enthusiastic and motivated Research Assistant and Laboratory Manager to provide essential support for ongoing research aimed at developing transformative treatments for deafness and hearing problems. The post is funded for 12 months (with a possibility of extension for up to 5 years). The post will involve collection and analysis of audiometry as well as behavioral (psychophysics), eye tracking and EEG data in humans. The postholder will also be expected to contribute to the induction and direction of other research staff and students. The UCL Ear Institute, located in the heart of London, provides state-of-the-art research facilities across a wide range of disciplines and is one of the foremost centres for hearing, speech and language-related research within Europe. Applicants should hold a 1st class, or upper 2nd (or equivalent) BSc or MSc degree in an engineering or Neuroscience-related subject. Previous experience with neuroscience research, functional brain imaging and/or acoustics is desirable. More information and a link to the application site are in the following link: http://www.jobs.ac.uk/job/BEH401/research-assistant-in-auditory-neuroscience Closing Date: 15 October 2017 Maria Chait PhD m.chait at ucl.ac.uk Professor in Auditory Cognitive Neuroscience Lab site: http://www.ucl.ac.uk/ear/research/chaitlab/ UCL Ear Institute 332 Gray's Inn Road London WC1X 8EE -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Sep 18 13:57:51 2017 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Sep 2017 13:57:51 +0200 Subject: [FieldTrip] Normalizing log-transformed EEG power Message-ID: Dear all, I have a question regarding how to compute z-scores for log-transformed EEG power across all events separately for each electrode and frequency. I have searched everywhere on how to implement this in the fieldrip environment, however, I will be very grateful if someone can help me out on this. Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From lxykh0700073 at outlook.com Tue Sep 19 03:51:59 2017 From: lxykh0700073 at outlook.com (Xinyi Li) Date: Tue, 19 Sep 2017 01:51:59 +0000 Subject: [FieldTrip] simple main effects and permutation Message-ID: Hi all, I have a mixed design and my hypothesis is about simple main effects. So for example, I have two groups of people, and each person experience the same 2x2 factorial design with conditions A1, A2, B1, B2. And my hypotheses are something like the simple main effect of A within group 1 and condition B1. My questions: 1) Can I just subset the data to include only the group and condition I want (B1 & group 1) and do a t-test between condition A1 & A2 after subsetting? If I understand correctly, this approach will bias the standard error of the estimates? But I'm not sure if this matters in a permutation framework, and I also don't know if it's a common practice to do this in EEG analysis? 2) Alternatively, I can run a full mixed ANOVA model and then the simple main effect in R to get the test statistics I want. But for this approach I'm not sure how I should perform the permutation since fieldtrip doesn't support a mixed design. Should I only permute A1 & A2 within condition B1 and group 1? Or should I permute everything within both factors A & B? And what about the group labels? Any suggestions? Thanks! Xinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From da401 at kent.ac.uk Tue Sep 19 06:25:36 2017 From: da401 at kent.ac.uk (D.Abdallah) Date: Tue, 19 Sep 2017 04:25:36 +0000 Subject: [FieldTrip] Question about MVPA topographic map In-Reply-To: <1504785200819.38370@kent.ac.uk> References: <1504785200819.38370@kent.ac.uk> Message-ID: Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref ='yes'; cfg.channel = {'Cz','PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'}; cfg.refchannel ='Cz'; cfg.demean ='yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype ='?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype ='STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref ='no'; FaceTrials.keeptrials ='yes';% classifiers operate on individual trials FaceTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref ='no'; VaseTrials.keeptrials ='yes';% classifiers operate on individual trials VaseTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout ='biosemi64.lay'; cfg.method ='crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy''binomial''contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter ='mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments =''; cfg.colorbar ='yes'; cfg.interplimits='electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imagesc Subject 8.fig Type: application/x-xfig Size: 40249 bytes Desc: Imagesc Subject 8.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Subject 8 Topographical map.fig Type: application/x-xfig Size: 450612 bytes Desc: Subject 8 Topographical map.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tutorial topographic map.png Type: image/png Size: 10419 bytes Desc: tutorial topographic map.png URL: From jan.schoffelen at donders.ru.nl Tue Sep 19 07:47:49 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 05:47:49 +0000 Subject: [FieldTrip] Question about MVPA topographic map In-Reply-To: References: <1504785200819.38370@kent.ac.uk> Message-ID: Hi Diane, First of all, I would recommend to share figures not as a matlab-figure, but as a screenshot bitmap or so. This saves people who are reading your mail a lot of overhead if they want to look at it, because they don’t need to start a matlab session etc. Your topographical image looks ‘different’ from the one on the wiki because the distribution of your electrodes is more around the whole ‘rim’ of the head. The colored plane that shows up within the circle is the consequence of a spatial interpolation (in 2D) of the data points represented at the locations of the electrodes. For this reason also, there’s no need to be very explicit about the meaning of the x and y axes: they represent space. Best wishes and good luck, Jan-Mathijs On 19 Sep 2017, at 06:25, D.Abdallah > wrote: Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref ='yes'; cfg.channel = {'Cz','PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'}; cfg.refchannel ='Cz'; cfg.demean ='yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype ='?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype ='STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref ='no'; FaceTrials.keeptrials ='yes';% classifiers operate on individual trials FaceTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref ='no'; VaseTrials.keeptrials ='yes';% classifiers operate on individual trials VaseTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout ='biosemi64.lay'; cfg.method ='crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy''binomial''contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter ='mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments =''; cfg.colorbar ='yes'; cfg.interplimits='electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah _______________________________________________ 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 Tue Sep 19 08:02:53 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 06:02:53 +0000 Subject: [FieldTrip] Using ft_redefinetrial with minlength and begsample/endsample option In-Reply-To: References: Message-ID: <6728EEE0-D0EF-4A9D-AAEA-50A61E765FC9@donders.ru.nl> Dear Nir Ofir, Thanks for reporting this. It seems that you have also identified a possible solution, which would be to do the ‘too short trial removal’, only after the realignment of the time axis of the trials. I think the best way to proceed would be that you try to implement this fix in your own local version of the FieldTrip git repository, and initiate a pull request once you are sure it works well. We will then review the suggested fix, and merge it into Fieldtrip’s code base, so that everyone can benefit from your efforts. Best wishes, Jan-Mathijs > On 14 Sep 2017, at 14:10, Nir Ofir wrote: > > Hi fieldtrip users, > > I have a data structure containing MEG trials which are aligned to stimulus onset. I now want to realign them to the target onset, as well as removing trials which are too short. I thought the easiest way to do this would be to use ft_redefinetrial in the following way: > > offset = dat.trialinfo(:,5); % this column contains the duration of the stimulus-target intervel > cfg = []; > cfg.minlength = -dat.time{1}(1)+cfgx.pretarget+0.5; % prestim defined by dat sructure + 0.5 s ERF + cfgx.pretarget > cfg.begsample = round((offset - cfgx.pretarget)*1000); > cfg.endample = round(offset*1000); > dat = ft_redefinetrial(cfg, dat); > > When I run this, I get the following error: > > Index exceeds matrix dimensions. > > Error in ft_redefinetrial (line 209) > data.trial{i} = data.trial{i}(:, begsample(i):endsample(i)); > > So I looked into ft_redefinetrials a bit, and it seems like when minlength is defined, the trials themselves are removed, but the begample/endsample vector are not cut to contain only the relevant trials. For now I moved to a 2-step solution (first removing trials, than realigning), but it seems like this could have a relatively simple fix. Suggestions? > > Thanks! > Nir Ofir > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From isac.sehlstedt at psy.gu.se Tue Sep 19 08:07:41 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Tue, 19 Sep 2017 06:07:41 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis Message-ID: Dear fieldtripers, I have conducted a EEG experiement and am currently in a wedge. The PCA-function used in matlab ( i.e. pca() ) gives me the latent and coeff values that I want to use for further analysis. Sadly, I have cannot figure out how to perform a group level analysis using the matlab function and later "unmix" the group analysis to the subject level. The a group analysis ft_componentanalysis function is easier to "unmix" thanks to its description of how to do so. However, I have not found a way to extract the latent and coefficient variables from the variables included in the comp-structure. My question is: Can you extract the latent and coefficient variables from the ft_componentanalysis results? Alternatively: Is it possible to extract the subject level latent and coefficient variables using the matlab function pca() ? Very best, Isac -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Sep 19 08:57:52 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 06:57:52 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: <3197AF78-5B87-4F7C-A587-FFD8E8FF2071@donders.ru.nl> Hi Isac, My question is: Can you extract the latent and coefficient variables from the ft_componentanalysis results? I’d say that the ‘latent variables’ are in the comp.trial field, and the coefficients are in comp.topo Alternatively: Is it possible to extract the subject level latent and coefficient variables using the matlab function pca() ? I don’t know. Best wishes, Jan-Mathijs Very best, Isac _______________________________________________ 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 jean-michel.badier at univ-amu.fr Tue Sep 19 15:52:53 2017 From: jean-michel.badier at univ-amu.fr (Jean-Michel Badier) Date: Tue, 19 Sep 2017 15:52:53 +0200 Subject: [FieldTrip] Open positions at INS, Marseille. France Message-ID: /Post-doctoral position in the Theoretical Neuroscience Group - INS, Marseille, France/ *Summary* The Theoretical Neuroscience Group (Head: Viktor Jirsa) is seeking to fill a post-doctoral position in the context of the project EPINOV to work on statistical & dynamical modeling of seizure propagation using personalized brain modeling and neuroinformatics approaches on a cohort of hundreds of epilepsy patients. EPINOV is one of 10 large-scale projects selected in the 3rd round of French scientific excellence program «RHU» managed by the National Research Agency (ANR). The aim of the EPINOV project is to significantly improve presurgical interpretation, guide surgical strategies and translate computational tools into clinical routine of personalized medicine. We use individual MRI scans to reconstruct brain anatomy and connectivity, which are combined with a neural mass model and fit using the Bayesian modeling software Stan to individuals’ intracranial electrophysiology data (stereotactic EEG), validated by clinical data from other modalities, such as MEG, fMRI, and semiology. *Responsibilities* • Scale up statistical models “vertically” to handle more data and higher resolution anatomy, using model comparison techniques to evaluate the advantage of different model structures • Scale out models “horizontally”, performing coherent, reliable inference across a large cohort of patients using dedicated, on-site HPC resources • Develop routines to evaluate and visualize inference results, making them amenable to clinical interpretation • Integrate developed code into existing code bases and pipelines *Qualification * • Highly motivated to work on an interdisciplinary project and collaborate with the various members of the consortium. • PhD degree in computational neuroscience, mathematical or statistical modeling, machine learning or equivalent level of knowledge. • Significant, demonstrable experience in data fitting (Bayesian modeling, Dynamical Causal Modeling (DCM), Monte Carlo, etc) will be highly appreciated. • Experience with working in a Linux/HPC environment • Programming in a numerically oriented language (R, Python, MATLAB) • Familiarity with Git, unit testing, Docker/VMs is a plus *The Theoretical Neuroscience group * We are a multi-national team interested in understanding the mechanisms underlying the spatiotemporal organization of large-scale brain networks. Our work comprises mathematical and computational modeling of large-scale network dynamics and human brain imaging data, the development of neuroinformatics tools for studying large-scale brain networks applied to concrete functions, dysfunctions (epilepsy, dementia) and aging. *Terms of salary and employment * A 12-month renewable contract will be established. Salary will depend on the diploma and experience. Operating language in the laboratory is English. Applications including a cover letter, curriculum vitae and the names of two referees should be sent by September 30th 2017 to: Dr. Irene Yujnovsky at irene.yujnovsky at univ-amu.fr More information about the INS and the Theoretical Neurosciences Group can be found at: http://ins.univ-amu.fr *Clinical data manager for national consortium on epilepsy surgery - **Aix-Marseille Université * *Marseille, FRANCE* ** ** A position for an experienced clinical data manager is open to create and maintain an epileptic patient database including registration, normalization and security issues and to ensure the communication with the key partners in the academic, clinical and industry sectors with the aim of generating individual Virtual Patient models using The Virtual Brain (TVB) platform as framework (see http://www.thevirtualbrain.org).//This database will be generated in the context of the EPINOV (/Improving EPilepsy surgery management and progNOsis using Virtual brain technology) /projectled by Professor Fabrice Bartolomei (http://fr.ap-hm.fr/service/neurophysiologie-clinique-hopital-timone) funded by the RHU programme. *Qualification* ** Candidates must be highly motivated to work on an interdisciplinary project and collaborate with the various members of the consortium. They should have a degree in biomedical engineering, medical informatics or equivalent level of knowledge. Candidates must possess a solid experience in management of clinical and/or research data and programming (C, MATLAB, Python). Experience with neuroimaging data (stereotactic EEG, MRI, DTI, MEG, EEG), clinical trials, neuroinformatics and its standard formats (for instance DICOM, XNAT, BIDS), machine learning and Big Data would be considered an advantage. *The EPINOV project and consortium * We are a national consortium composed of clinicians, researchers and industrial partners interested in improving epilepsy surgical prognosis using large–scale brain modelling based on individual epileptic patient data. A prospective, randomized multicenter trial will be conducted with subjects suffering from drug-resistant epilepsy. The clinical trial will systematically evaluate the added value of personalized brain modelling in the surgical decision making. *Terms of salary and employment* Salary will depend on the diploma and previous experience. Operating languages in the consortium are both French and English. Applications including a cover letter, curriculum vitae and the names of two referees should be sent by October 31st 2017 to: *Dr. Irene Yujnovsky* at irene.yujnovsky at univ-amu.fr -- Jean michel Badier /- UMR S 1106 Institut de Neurosciences des Systèmes/ Aix-Marseille Université - Laboratoire MEG - TIMONE - 27 Boulevard Jean Moulin - 13005 Marseille Tél: +33(0)4 91 38 55 62 - Fax : +33(0)4 91 78 99 14 Site : http://www.univ-amu.fr - Email : jean-michel.badier at univ-amu.fr /Afin de respecter l'environnement, merci de n'imprimer cet email que si nécessaire./ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_amu.jpg Type: image/jpeg Size: 17847 bytes Desc: not available URL: From johnnguyen.education at gmail.com Tue Sep 19 18:41:34 2017 From: johnnguyen.education at gmail.com (John Nguyen) Date: Tue, 19 Sep 2017 12:41:34 -0400 Subject: [FieldTrip] Source analysis and sensor space differences Message-ID: Hi All, My Name is John Nguyen and I am working at the Reinhart Cognitive Neuroscience Lab at Boston University. I have been using Fieldtrip (Version 4/10/17)​​ for several months now and have decided to tackle SourceAnalysis. After a few weeks of struggling with it, I find myself still far from the goal post. A milestone I'm trying to achieve is plotting activity in the visual cortex due to a visual stimulus onset. This activity is easily reflected in my sensor-level plots but, in the source-level, it's projection is more than a bit wonky [image link, Negative sensor potential ,1.09-1.23s, following visual stimulus followed by positive sensor potential at 1.22-1.48s neither of which are present in source space.] [https://drive.google.com/file/d/0B2UdTHvTeS9NNWV6dGJKZ2JWbk0/ view?usp=sharing] In my current code I am using Fieldtrip templates to minimize error on my end as much as possible. "elec = ft_read_sens('standard_1020.elc'); load('standard_bem.mat','vol') load('standard_sourcemodel3d8mm.mat','sourcemodel') mri = ft_read_mri('single_subj_T1_1mm.nii');" My Sourceanalysis is timelocked LCMV with a relative baseline change at times -0.2 to 0.0s. I also preformed a relative baseline change on my sensor-level data because I was wondering if the disparity was a baseline issue. I've reached a dead-end and would appreciate any help. I've attached links to my script [https://drive.google.com/file/d/0B2UdTHvTeS9NT05uWUk4T0hDUjQ/ view?usp=sharing] and data (no rereference, no artifact reject) [https://drive.google.com/file/d/0B2UdTHvTeS9NSl8yaW9fcXZWSjQ/ view?usp=sharing] and sensor cap layout. [https://drive.google.com/file/d/0B2UdTHvTeS9NSGJXZUszOHBUbGM/ view?usp=sharing] Best regards, John Nguyen -------------- next part -------------- An HTML attachment was scrubbed... URL: From isac.sehlstedt at psy.gu.se Wed Sep 20 09:15:56 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Wed, 20 Sep 2017 07:15:56 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis Message-ID: Dear fieldtripers, This is a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (which are also attached) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see Unknown.tiff, or Unknown-1.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see Unknown.tiff-2) . Why am I not getting that in ft? Is it possible to get that using ft? Very Best, Isac ----------------- The code ----------------- clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end ----------------- The variables/results ----------------- [X] [X] [X] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown.tiff Type: image/tiff Size: 987824 bytes Desc: Unknown.tiff URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown-1.tiff Type: image/tiff Size: 1158488 bytes Desc: Unknown-1.tiff URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown-2.tiff Type: image/tiff Size: 293336 bytes Desc: Unknown-2.tiff URL: From litvak.vladimir at gmail.com Wed Sep 20 12:56:01 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 20 Sep 2017 11:56:01 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol Message-ID: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad0_5.png Type: image/png Size: 4854 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad1.png Type: image/png Size: 5013 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad10.png Type: image/png Size: 4663 bytes Desc: not available URL: From r.oostenveld at donders.ru.nl Wed Sep 20 16:26:37 2017 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 20 Sep 2017 16:26:37 +0200 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: Message-ID: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert > On 20 Sep 2017, at 12:56, Vladimir Litvak wrote: > > Dear Fieldtrippers, > > I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. > > Is this a bug or a feature? > > Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. > > Thanks, > > Vladimir > > > ------------------------------------- > > pad = 0.5;%1%10 > > > freqoi = 5:45; > timwin = 0.4+0*freqoi; > > [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... > 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); > > figure; > subplot(2,1,1) > plot(freqoi, s1); > subplot(2,1,2); > plot(freqoi, s1-s1(1)); > %% > [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... > 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); > > subplot(2,1,1) > hold on > plot(freqoi, s2, 'r'); > subplot(2,1,2) > hold on > plot(freqoi, s2-s2(1), 'r'); > _______________________________________________ > 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 stephen.whitmarsh at gmail.com Wed Sep 20 17:03:52 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 20 Sep 2017 17:03:52 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization Message-ID: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Wed Sep 20 20:00:47 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Wed, 20 Sep 2017 18:00:47 +0000 (UTC) Subject: [FieldTrip] Splitting EEG References: <1779089334.6211483.1505930447659.ref@mail.yahoo.com> Message-ID: <1779089334.6211483.1505930447659@mail.yahoo.com> Hello Fieldtrip users, I have a continues EEG data ( 80 seconds) and I would like to analyze some part of it.For instance, I want to analyse seconds 20 to 25 ( 5 seconds).Would you please let me know how can I select my times of interest.I've written a simple code but I don't know how can I split the data.  cfg    = []; cfg.dataset = '........  .eeg'; data_org                = ft_preprocessing(cfg); %Original Data % Step1:  Filtering Row Data cfg                        = []; cfg.bpfilter            = 'yes'; cfg.bpfreq             = [1 30]; data_Filtered        = ft_preprocessing(cfg,data_org); -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Wed Sep 20 22:22:51 2017 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Wed, 20 Sep 2017 20:22:51 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: Message-ID: <0A0286C7-606F-4B30-B8F4-6689EAAD9620@cfin.au.dk> Hi Stephen, We have a pipeline that can use either SPM8 or SPM12 to perform both segmentation and normalization, though perhaps in a way that’s different from the official FieldTrip tutorials. Have a look at: https://github.com/meeg-cfin/nemolab/blob/master/basics/nemo_mriproc.m ft_volumesegment should use whichever SPM is in your path (be careful about fieldtrip/external/spm8!), and (according to my memory) SPM12 sometimes can succeed where SPM8 doesn’t provide good segmentations. Note that for the normalization in SPM12, our script defines “/OldNorm/T1.nii” as the template, which indeed seems to give results equivalent to SPM8. I think you could change this to SPM12’s default template if you prefer. NB: we use MRI coordinates as the base coordinate system in our pipelines, so MEG/EEG is transformed to MRI, rather than MRI to MEG/EEG. Cheers, Sarang On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 cornelia.quaedflieg at uni-hamburg.de Wed Sep 20 22:51:57 2017 From: cornelia.quaedflieg at uni-hamburg.de (Conny Quaedflieg) Date: Wed, 20 Sep 2017 22:51:57 +0200 Subject: [FieldTrip] Splitting EEG In-Reply-To: <1779089334.6211483.1505930447659@mail.yahoo.com> References: <1779089334.6211483.1505930447659.ref@mail.yahoo.com> <1779089334.6211483.1505930447659@mail.yahoo.com> Message-ID: <20170920205155.9C930B5309@mailhost.uni-hamburg.de> Dear Hamed, You can use ft_select data with cfg.latency See http://www.fieldtriptoolbox.org/reference/ft_selectdata best Conny Van: Hamed Taheri Verzonden: woensdag 20 september 2017 20:12 Aan: fieldtrip at science.ru.nl Onderwerp: [FieldTrip] Splitting EEG Hello Fieldtrip users, I have a continues EEG data ( 80 seconds) and I would like to analyze some part of it. For instance, I want to analyse seconds 20 to 25 ( 5 seconds). Would you please let me know how can I select my times of interest. I've written a simple code but I don't know how can I split the data.  cfg    = []; cfg.dataset = '........  .eeg'; data_org                = ft_preprocessing(cfg); %Original Data % Step1:  Filtering Row Data cfg                        = []; cfg.bpfilter            = 'yes'; cfg.bpfreq             = [1 30]; data_Filtered        = ft_preprocessing(cfg,data_org); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 21 09:09:06 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 07:09:06 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: Message-ID: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Hi Stephen, Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). Best, Jan-Mathijs On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 litvak.vladimir at gmail.com Thu Sep 21 11:17:11 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 10:17:11 +0100 Subject: [FieldTrip] MEG technician post at UCL Message-ID: *Senior MEG Research Technician* Applications are invited for a Senior Research Technician in the Wellcome Centre for Human Neuroimaging, UCL Institute of Neurology. The Centre houses an Electroencephalography (EEG) system, two Magnetoencephalography (MEG) systems - a CTF 275 channel Omega System and an Optically Pumped Magnetometer (OPM) System - and Magnetic Resonance Imaging (MRI) facilities - two 3T Siemens Prisma scanners and a 3T Siemens Trio. The successful candidate will be responsible for coordinating and maintaining an efficient MEG and EEG service for a range of different research projects. This role will be constantly evolving as new and alternative technologies are incorporated into the functional imaging department. *Applicants are required to have:* · Experience of EEG/MEG or similar electrophysiological recording methods (e.g. cardiology/audiology) within a clinical or research environment. · A commitment to academic research. · MEG experience is not essential as training will be provided. *Salary - UCL Grade 7:* £34,653 to £41,864 inclusive of London Allowance. The post is available immediately and is funded until Nov 2021 in the first instance. Applications through UCL's online recruitment – www.ucl.ac.uk/hr/jobs where you can download a job description and person specification using ref: 1671016. Informal enquiries to Elaine Williams: elaine.williams at ucl.ac.uk . If you have any queries regarding the application process, please contact Samantha Robinson, HR Officer, Institute of Neurology, 23 Queen Square, London, WC1N 3BG (email: ion.hradmin at ucl.ac.uk). *Closing date: 26th September 2017* *Taking Action for Equality* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 21 11:53:05 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 09:53:05 +0000 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> Message-ID: <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Hi to all who’s reading along, Perhaps the two cases will become more similar once the ‘timwin’ is increased in length for the mtmconvol case…. Best wishes, JM On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); _______________________________________________ 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 litvak.vladimir at gmail.com Thu Sep 21 12:29:12 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 11:29:12 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Yes, you are right about Robert's example. But if you do: pad = 10; fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning', 'pad', pad); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); You will see the problem that I'm talking about. We discussed with Robert yesterday and this is indeed 'a feature' which has to do with the fact that the outputs of mtmfft and mtmconvol have different units. The former is spectral density whereas the latter is spectral power. Here is what Robert wrote me: the units of computations (also here) are a known and long-standing issue. I know for a long time that the two have different scaling, but did not think about it for a long time. I recall something like this: To compare TFRs over frequencies, you don't want the bandwidth to affect the estimate. Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral resolution over which the signal(and noise) spreads is different. If you were to compute the TFR in V^2/Hz, the same V at 20Hz would have a different value, because the length of the wavelet affects the 1/Hz. something related (but nevertheless different) applies to the mtmfft: if you want to estimate broadband activity in a window of 1 second or a window of 2 seconds, you would get different spectral resolutions. The nyquist is the same, but the power gets distributed over more bins between 0 and Fnyquist/2. That would cause the values to appear smaller in the 2-s case. Hence we compute spectral density, which somehow normalizes for this. I never found a really clear explanation, but google got me this https://dsp.stackexchange.com/questions/33957/what-is-the-difference-between-the-psd-and-the-power-spectrum what confuses me is that power (or variance) is already normalized, i.e. sum of squared values divided by N. So we have energy (which increases with length), power (which does not increase with length), and power density So one issue is that most people don't know about this including me and possibly you. I think a good solution would be to add an option to specify the output units for all the methods as there might be quite subtle considerations for choosing one over the other as Robert suggests. Vladimir On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi to all who’s reading along, > > Perhaps the two cases will become more similar once the ‘timwin’ is > increased in length for the mtmconvol case…. > > Best wishes, > > JM > > On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: > > Hi Vladimir, > > I suggest that you first start with a simpler case, like this > > fsample = 1000; > time = (1:1000)/fsample; > dat = randn(size(time)); > > [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', > 'hanning'); > > power1 = abs(spectrum1).^2; > power1 = squeeze(power1); > > [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, > 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); > > power2 = abs(spectrum2).^2; > power2 = squeeze(power2); > > figure > plot(freqoi1, power1); > hold on > plot(freqoi2, power2, 'r'); > > Note that these are not the same (albeit similar), which I had expected… > > best > Robert > > > > On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: > > Dear Fieldtrippers, > > I'm looking into an issue of one of SPM users who gets different results > when doing TF decomposition compared to computing a spectrum for the same > time window. I'm not sure I got to the bottom of it yet but one thing I > found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected > differently by increasing padding. For short padding the results are > similar but with increasing padding there are differences both in offset of > the spectrum and its overall shape. See attached images where the top one > shows original spectra and the bottom one aligns the lowermost bin to zero. > > Is this a bug or a feature? > > Below is the script that produces these plots. I could provide the data as > well but this could probably be reproduced with any data. > > Thanks, > > Vladimir > > > ------------------------------------- > > pad = 0.5;%1%10 > > > freqoi = 5:45; > timwin = 0.4+0*freqoi; > > [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, > 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... > 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); > > figure; > subplot(2,1,1) > plot(freqoi, s1); > subplot(2,1,2); > plot(freqoi, s1-s1(1)); > %% > [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', > 'hanning', 'freqoi', freqoi,... > 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); > > subplot(2,1,1) > hold on > plot(freqoi, s2, 'r'); > subplot(2,1,2) > hold on > plot(freqoi, s2-s2(1), 'r'); > __________________________ > _____________________ > 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 litvak.vladimir at gmail.com Thu Sep 21 12:34:23 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 11:34:23 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: Another thing that I noticed is that in the mtmconvol case padding is added to the entire trial, not to the short window over which FFT is actually computed. This might be because you actually use a wavelet which moves along the data (I didn't check that). Anyhow right now this doesn't make much difference because padding doesn't affect mtmconvol in such a dramatic way as mtmfft. However, if you do allow specifying the units as power rather than density then the way things are now mtmconvol and mtmfft with the same padding would not be equivalent. Vladimir On Thu, Sep 21, 2017 at 11:29 AM, Vladimir Litvak wrote: > Hi Jan-Mathijs, > > Yes, you are right about Robert's example. But if you do: > > pad = 10; > > fsample = 1000; > time = (1:1000)/fsample; > dat = randn(size(time)); > > [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', > 'hanning', 'pad', pad); > > power1 = abs(spectrum1).^2; > power1 = squeeze(power1); > > [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, > 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); > > power2 = abs(spectrum2).^2; > power2 = squeeze(power2); > > figure > plot(freqoi1, power1); > hold on > plot(freqoi2, power2, 'r'); > > > You will see the problem that I'm talking about. We discussed with Robert > yesterday and this is indeed 'a feature' which has to do with the fact that > the outputs of mtmfft and mtmconvol have different units. The former is > spectral density whereas the latter is spectral power. > > Here is what Robert wrote me: > > > the units of computations (also here) are a known and long-standing issue. > I know for a long time that the two have different scaling, but did not > think about it for a long time. I recall something like this: To compare > TFRs over frequencies, you don't want the bandwidth to affect the estimate. > Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect > those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with > conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral > resolution over which the signal(and noise) spreads is different. If you > were to compute the TFR in V^2/Hz, the same V at 20Hz would have a > different value, because the length of the wavelet affects the 1/Hz. > something related (but nevertheless different) applies to the mtmfft: if > you want to estimate broadband activity in a window of 1 second or a window > of 2 seconds, you would get different spectral resolutions. The nyquist is > the same, but the power gets distributed over more bins between 0 and > Fnyquist/2. That would cause the values to appear smaller in the 2-s case. > Hence we compute spectral density, which somehow normalizes for this. I > never found a really clear explanation, but google got me this > https://dsp.stackexchange.com/questions/33957/what-is-the- > difference-between-the-psd-and-the-power-spectrum > what confuses me is that power (or variance) is already normalized, i.e. > sum of squared values divided by N. So we have energy (which increases with > length), power (which does not increase with length), and power density > > > So one issue is that most people don't know about this including me and > possibly you. I think a good solution would be to add an option to specify > the output units for all the methods as there might be quite subtle > considerations for choosing one over the other as Robert suggests. > > Vladimir > > On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi to all who’s reading along, >> >> Perhaps the two cases will become more similar once the ‘timwin’ is >> increased in length for the mtmconvol case…. >> >> Best wishes, >> >> JM >> >> On 20 Sep 2017, at 16:26, Robert Oostenveld >> wrote: >> >> Hi Vladimir, >> >> I suggest that you first start with a simpler case, like this >> >> fsample = 1000; >> time = (1:1000)/fsample; >> dat = randn(size(time)); >> >> [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', >> 'hanning'); >> >> power1 = abs(spectrum1).^2; >> power1 = squeeze(power1); >> >> [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, >> 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); >> >> power2 = abs(spectrum2).^2; >> power2 = squeeze(power2); >> >> figure >> plot(freqoi1, power1); >> hold on >> plot(freqoi2, power2, 'r'); >> >> Note that these are not the same (albeit similar), which I had expected… >> >> best >> Robert >> >> >> >> On 20 Sep 2017, at 12:56, Vladimir Litvak >> wrote: >> >> Dear Fieldtrippers, >> >> I'm looking into an issue of one of SPM users who gets different results >> when doing TF decomposition compared to computing a spectrum for the same >> time window. I'm not sure I got to the bottom of it yet but one thing I >> found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected >> differently by increasing padding. For short padding the results are >> similar but with increasing padding there are differences both in offset of >> the spectrum and its overall shape. See attached images where the top one >> shows original spectra and the bottom one aligns the lowermost bin to zero. >> >> Is this a bug or a feature? >> >> Below is the script that produces these plots. I could provide the data >> as well but this could probably be reproduced with any data. >> >> Thanks, >> >> Vladimir >> >> >> ------------------------------------- >> >> pad = 0.5;%1%10 >> >> >> freqoi = 5:45; >> timwin = 0.4+0*freqoi; >> >> [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, >> 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... >> 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); >> >> s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); >> >> figure; >> subplot(2,1,1) >> plot(freqoi, s1); >> subplot(2,1,2); >> plot(freqoi, s1-s1(1)); >> %% >> [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', >> 'hanning', 'freqoi', freqoi,... >> 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); >> >> s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); >> >> subplot(2,1,1) >> hold on >> plot(freqoi, s2, 'r'); >> subplot(2,1,2) >> hold on >> plot(freqoi, s2-s2(1), 'r'); >> ___________________________ >> ____________________ >> 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 jan.schoffelen at donders.ru.nl Thu Sep 21 12:36:30 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 10:36:30 +0000 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: <612489C6-6EFD-4D56-A9FC-189A180CC961@donders.ru.nl> Don’t worry Vladimir, Robert and I have discussed these issues at length on several occasions in the past ;) Best wishes, JM On 21 Sep 2017, at 12:29, Vladimir Litvak > wrote: Hi Jan-Mathijs, Yes, you are right about Robert's example. But if you do: pad = 10; fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning', 'pad', pad); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); You will see the problem that I'm talking about. We discussed with Robert yesterday and this is indeed 'a feature' which has to do with the fact that the outputs of mtmfft and mtmconvol have different units. The former is spectral density whereas the latter is spectral power. Here is what Robert wrote me: the units of computations (also here) are a known and long-standing issue. I know for a long time that the two have different scaling, but did not think about it for a long time. I recall something like this: To compare TFRs over frequencies, you don't want the bandwidth to affect the estimate. Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral resolution over which the signal(and noise) spreads is different. If you were to compute the TFR in V^2/Hz, the same V at 20Hz would have a different value, because the length of the wavelet affects the 1/Hz. something related (but nevertheless different) applies to the mtmfft: if you want to estimate broadband activity in a window of 1 second or a window of 2 seconds, you would get different spectral resolutions. The nyquist is the same, but the power gets distributed over more bins between 0 and Fnyquist/2. That would cause the values to appear smaller in the 2-s case. Hence we compute spectral density, which somehow normalizes for this. I never found a really clear explanation, but google got me this https://dsp.stackexchange.com/questions/33957/what-is-the-difference-between-the-psd-and-the-power-spectrum what confuses me is that power (or variance) is already normalized, i.e. sum of squared values divided by N. So we have energy (which increases with length), power (which does not increase with length), and power density So one issue is that most people don't know about this including me and possibly you. I think a good solution would be to add an option to specify the output units for all the methods as there might be quite subtle considerations for choosing one over the other as Robert suggests. Vladimir On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi to all who’s reading along, Perhaps the two cases will become more similar once the ‘timwin’ is increased in length for the mtmconvol case…. Best wishes, JM On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); _______________________________________________ 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 stephen.whitmarsh at gmail.com Thu Sep 21 14:36:43 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 14:36:43 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Dear Sarang and Jan-Mathijs, Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. Best wishes and thanks again! Stephen On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Stephen, > > Please note that FT now has full support for SPM12, both using the > old-style segmentation, and the new one (the latter yielding 6 tissue > types). > > Best, > Jan-Mathijs > > On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: > > Dear all, > > I having some problems in normalizing MRIs for my study. Some have > improper segmentation for which changing individual brain/scalp thresholds > works in many cases but not all, e.g. when the scalp 'bleeds' into some > noise outside of the head. Also, changing parameters in spm8 for > normalization, such as number of iterations (directly in in spm_normalize, > since FT does not pass these parameters) improves the transformation. > > However, some scans I cannot deal with, either because they have noise > from outsides of the head 'bleed' onto the scalp, thereby preventing > optimal scalp-segmentation and thereby normalization. Others have an > inappropriate contrast MRI sequence. > > Some fMRI researchers advised me to use SPM12, because of its improved > preprocessing procedures. However, it does not seem supported in FT yet. > Does anyone have experience with this, and can perhaps share how they > extracted the transformation matrix from the resulting nifti's? > > Thanks, > Stephen > _______________________________________________ > 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 hgould at memphis.edu Thu Sep 21 15:56:38 2017 From: hgould at memphis.edu (Herbert J Gould (hgould)) Date: Thu, 21 Sep 2017 13:56:38 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl>, Message-ID: I have retired please remove me from the mail list Herbert Jay Gould Professor Emeritus The University of Memphis Sent from my Verizon Wireless 4G LTE smartphone -------- Original message -------- From: Stephen Whitmarsh Date:09/21/2017 7:43 AM (GMT-06:00) To: FieldTrip discussion list Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) normalization Dear Sarang and Jan-Mathijs, Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. Best wishes and thanks again! Stephen On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Stephen, Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). Best, Jan-Mathijs On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 a.stolk8 at gmail.com Thu Sep 21 17:00:20 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 21 Sep 2017 08:00:20 -0700 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hey Stephen, Look for discussions regarding spm12 and also dartel on bugzilla. It's been a while but as far as I can remember ft_volumenormalize is the only function now that has not been integrated. Reason being that it wasnt straightforward to house the dartel procedure under a single function, so this is ongoing work still. You can however use spm12's coregistration function with ft_volumerealign (for rigid body transformations), which Im using quite a bit and never let me down (and is much faster than before). But that wouldnt work for normalization to template space though (use spm8). Best > On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) wrote: > > I have retired please remove me from the mail list > > Herbert Jay Gould > Professor Emeritus > The University of Memphis > > > > Sent from my Verizon Wireless 4G LTE smartphone > > > -------- Original message -------- > From: Stephen Whitmarsh > Date:09/21/2017 7:43 AM (GMT-06:00) > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) normalization > > Dear Sarang and Jan-Mathijs, > > Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. > > Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. > > In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. > > Best wishes and thanks again! > Stephen > > > >> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Stephen, >> >> Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). >> >> Best, >> Jan-Mathijs >> >>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh wrote: >>> >>> Dear all, >>> >>> I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. >>> >>> However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. >>> >>> Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? >>> >>> Thanks, >>> Stephen >>> _______________________________________________ >>> 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 zhangwenjia2732 at 126.com Thu Sep 21 17:30:13 2017 From: zhangwenjia2732 at 126.com (=?GBK?B?1cXOxLzO?=) Date: Thu, 21 Sep 2017 23:30:13 +0800 (CST) Subject: [FieldTrip] Reading data too slow Message-ID: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> Dear all, I have some problems in reading data into fieldtrip. Specifically, I used EGI system to record EEG data and preprocessed them with Brainvison analyzer Then, I exported the preprocessed data into generic data format, making 3 files: .eeg, .vhdr and vmrk. Last, I used ft_definetrial and ft_preprocessing to read these data into FieldTrip. However, the reading is very very slow. I tried to make only 2 channels left and tried methods as follow: http://www.fieldtriptoolbox.org/faq/reading_is_slow_can_i_write_my_raw_data_to_a_more_efficient_file_format But, they all did not work. Does anyone know what I am doing wrong? Any advice very appreciated. Thank you -- Wenjia NYU Shanghai -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Thu Sep 21 17:52:31 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 17:52:31 +0200 Subject: [FieldTrip] Reading data too slow In-Reply-To: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> References: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> Message-ID: Hi Wenjia, It's impossible to give specific advice with no extra information. How slow? Is the data read at all? Any error messages? What script are you exactly running and what is the output? See: http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community I would also check your computer resources (CPU and memory) during loading to see if you are running into a memory/CPU problem specific for your system. Finally, I would start with no filters. They sometimes take a while. Cheers, Stephen On 21 September 2017 at 17:30, 张文嘉 wrote: > > > Dear all, > > I have some problems in reading data into fieldtrip. > Specifically, I used EGI system to record EEG data and preprocessed them > with Brainvison analyzer > Then, I exported the preprocessed data into generic data format, making 3 > files: .eeg, .vhdr and vmrk. > Last, I used ft_definetrial and ft_preprocessing to read these data into > FieldTrip. > However, the reading is very very slow. > > I tried to make only 2 channels left and tried methods as follow: > http://www.fieldtriptoolbox.org/faq/reading_is_slow_can_i_ > write_my_raw_data_to_a_more_efficient_file_format > But, they all did not work. > > Does anyone know what I am doing wrong? Any advice very appreciated. > Thank you > > -- > Wenjia > NYU Shanghai > > > > > _______________________________________________ > 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 stephen.whitmarsh at gmail.com Thu Sep 21 18:20:47 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 18:20:47 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Thanks, and good to hear you've not been let down yet. It might be the fact that I have some bad quality MRIs to deal with. However... does this problem (see attached) ring a bell for anyone?: Brain segmentation is proper, and co-registration with polhemus head-shape as well, but inverse warp to MNI result in a tilted grid. Linear vs. non-linear transformation gives the same result. Other subjects going through the same procedure work fine, except two others wherein I identified it as a problem in segmenting the scalp and therefor the first step of the normalization. This one looks absolutely fine in every other regard, however. I'm stumped... cfg = []; cfg.spmversion = 'spm12'; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri_realigned; cfg.grid.unit = 'mm'; subject_grid = ft_prepare_sourcemodel(cfg); Cheers, Stephen On 21 September 2017 at 17:00, Arjen Stolk wrote: > Hey Stephen, > > Look for discussions regarding spm12 and also dartel on bugzilla. It's > been a while but as far as I can remember ft_volumenormalize is the only > function now that has not been integrated. Reason being that it wasnt > straightforward to house the dartel procedure under a single function, so > this is ongoing work still. You can however use spm12's coregistration > function with ft_volumerealign (for rigid body transformations), which Im > using quite a bit and never let me down (and is much faster than before). > But that wouldnt work for normalization to template space though (use spm8). > > Best > > On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) > wrote: > > I have retired please remove me from the mail list > > Herbert Jay Gould > Professor Emeritus > The University of Memphis > > > > Sent from my Verizon Wireless 4G LTE smartphone > > > -------- Original message -------- > From: Stephen Whitmarsh > Date:09/21/2017 7:43 AM (GMT-06:00) > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) > normalization > > Dear Sarang and Jan-Mathijs, > > Thanks a lot. I am now able (after updating FT, which now includes SPM12 > in /external), to use SPM12 for segmentation of my template and my subject > MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big > improvement over 8 when it comes to brain-segmentation, which now does not > require individual treatments anymore. It also outputs more compartments > which gives me a little bit more to work with when dealing with scans that > have bad delineation of the scalp for normalization. > > Pleas note that defaults seems to differ - some FT functions default to > spm8, others to spm12. > > In fact, FT still reverts to spm8 in ft_volumenormalise when called in > ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = > 'spm12'. In other words the cfg.spmversion is not passed along. > > Best wishes and thanks again! > Stephen > > > > On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Stephen, >> >> Please note that FT now has full support for SPM12, both using the >> old-style segmentation, and the new one (the latter yielding 6 tissue >> types). >> >> Best, >> Jan-Mathijs >> >> On 20 Sep 2017, at 17:03, Stephen Whitmarsh >> wrote: >> >> Dear all, >> >> I having some problems in normalizing MRIs for my study. Some have >> improper segmentation for which changing individual brain/scalp thresholds >> works in many cases but not all, e.g. when the scalp 'bleeds' into some >> noise outside of the head. Also, changing parameters in spm8 for >> normalization, such as number of iterations (directly in in spm_normalize, >> since FT does not pass these parameters) improves the transformation. >> >> However, some scans I cannot deal with, either because they have noise >> from outsides of the head 'bleed' onto the scalp, thereby preventing >> optimal scalp-segmentation and thereby normalization. Others have an >> inappropriate contrast MRI sequence. >> >> Some fMRI researchers advised me to use SPM12, because of its improved >> preprocessing procedures. However, it does not seem supported in FT yet. >> Does anyone have experience with this, and can perhaps share how they >> extracted the transformation matrix from the resulting nifti's? >> >> Thanks, >> Stephen >> _______________________________________________ >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm3.jpg Type: image/jpeg Size: 83068 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm2.jpg Type: image/jpeg Size: 115317 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm1.jpg Type: image/jpeg Size: 54151 bytes Desc: not available URL: From a.stolk8 at gmail.com Thu Sep 21 18:45:46 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 21 Sep 2017 09:45:46 -0700 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: First thought is a registration of brain outline to skull (instead of brain), although at closer inspection the shift seems overall just a bit too large for that. You could try calculating the normalization parameters on skullstripped volumes (unless you want to keep non-brain tissue). On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < stephen.whitmarsh at gmail.com> wrote: > Hi Arjen, > > Thanks, and good to hear you've not been let down yet. It might be the > fact that I have some bad quality MRIs to deal with. However... does this > problem (see attached) ring a bell for anyone?: > > Brain segmentation is proper, and co-registration with polhemus > head-shape as well, but inverse warp to MNI result in a tilted grid. > Linear vs. non-linear transformation gives the same result. Other subjects > going through the same procedure work fine, except two others wherein I > identified it as a problem in segmenting the scalp and therefor the first > step of the normalization. This one looks absolutely fine in every other > regard, however. > > I'm stumped... > > cfg = []; > cfg.spmversion = 'spm12'; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri_realigned; > cfg.grid.unit = 'mm'; > subject_grid = ft_prepare_sourcemodel(cfg); > > Cheers, > Stephen > > > On 21 September 2017 at 17:00, Arjen Stolk wrote: > >> Hey Stephen, >> >> Look for discussions regarding spm12 and also dartel on bugzilla. It's >> been a while but as far as I can remember ft_volumenormalize is the only >> function now that has not been integrated. Reason being that it wasnt >> straightforward to house the dartel procedure under a single function, so >> this is ongoing work still. You can however use spm12's coregistration >> function with ft_volumerealign (for rigid body transformations), which Im >> using quite a bit and never let me down (and is much faster than before). >> But that wouldnt work for normalization to template space though (use spm8). >> >> Best >> >> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) >> wrote: >> >> I have retired please remove me from the mail list >> >> Herbert Jay Gould >> Professor Emeritus >> The University of Memphis >> >> >> >> Sent from my Verizon Wireless 4G LTE smartphone >> >> >> -------- Original message -------- >> From: Stephen Whitmarsh >> Date:09/21/2017 7:43 AM (GMT-06:00) >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >> normalization >> >> Dear Sarang and Jan-Mathijs, >> >> Thanks a lot. I am now able (after updating FT, which now includes SPM12 >> in /external), to use SPM12 for segmentation of my template and my subject >> MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >> improvement over 8 when it comes to brain-segmentation, which now does not >> require individual treatments anymore. It also outputs more compartments >> which gives me a little bit more to work with when dealing with scans that >> have bad delineation of the scalp for normalization. >> >> Pleas note that defaults seems to differ - some FT functions default to >> spm8, others to spm12. >> >> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >> 'spm12'. In other words the cfg.spmversion is not passed along. >> >> Best wishes and thanks again! >> Stephen >> >> >> >> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hi Stephen, >>> >>> Please note that FT now has full support for SPM12, both using the >>> old-style segmentation, and the new one (the latter yielding 6 tissue >>> types). >>> >>> Best, >>> Jan-Mathijs >>> >>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh >>> wrote: >>> >>> Dear all, >>> >>> I having some problems in normalizing MRIs for my study. Some have >>> improper segmentation for which changing individual brain/scalp thresholds >>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>> noise outside of the head. Also, changing parameters in spm8 for >>> normalization, such as number of iterations (directly in in spm_normalize, >>> since FT does not pass these parameters) improves the transformation. >>> >>> However, some scans I cannot deal with, either because they have noise >>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>> optimal scalp-segmentation and thereby normalization. Others have an >>> inappropriate contrast MRI sequence. >>> >>> Some fMRI researchers advised me to use SPM12, because of its improved >>> preprocessing procedures. However, it does not seem supported in FT yet. >>> Does anyone have experience with this, and can perhaps share how they >>> extracted the transformation matrix from the resulting nifti's? >>> >>> Thanks, >>> Stephen >>> _______________________________________________ >>> 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 sarang at cfin.au.dk Thu Sep 21 19:30:25 2017 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Thu, 21 Sep 2017 17:30:25 +0000 Subject: [FieldTrip] Using fixed orientations for men-source estimation In-Reply-To: <71D8A67A81D69A4CB5BE2B979021C26ECAFFE748@esen3.imed.uni-magdeburg.de> References: <71D8A67A81D69A4CB5BE2B979021C26ECAFFE748@esen3.imed.uni-magdeburg.de> Message-ID: <1506015025.9072.22.camel@cfin.au.dk> Hi Christian, I had flagged your email to follow-up later but lost track of it -- it seems you didn't get a response yet, but I hope mine is still useful! The strategy that the 'fixedori' implements for the beamformer variants (and sLORETA) are not based on the anatomical normal, but rather the direction that maximizes the theoretical SNR (adaptively determined from the signal characteristics). This optimal direction is dependent on the particular weight calculation formula for each source localization variant. Therefore, a similar SNR optimization strategy for minimum norm would actually require a different formula than you see used for the others. It's simple enough to implement if you know what that formula is. :-) It is likely to be contained in the book by Sekihara & Nagarajan (2008), if you'd like to have a go at it yourself. That said, min-norm is often (or perhaps usually) performed with the solution space constrained to gray matter voxels, and the orientations defined to be normal to the cortical surface. If you independently have a way to obtain anatomically derived orientations, then you can manually provide them in lf.ori. (Or maybe there is a FieldTrip function that could obtain these normals from the MRI segmentation procedure?) Cheers, Sarang On Tue, 2017-08-01 at 11:11 +0000, christian.merkel at med.ovgu.de wrote: Hello, I am running ft_sourceanalysis and am wondering why I can restrict the parameter-estimation in LCMV and sLORETA by setting the parameter 'fixedori' but not when using MNE. Shouldn't one be able to also just use the normal direction of each source position here as well? Can I just apply the same logic in the script 'minimumnormestimate' to change the field 'lf.ori' as, for example, in 'ft_sloreta' or would this be problematic down the line? Thank You, Christian _______________________________________________ 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 stephen.whitmarsh at gmail.com Fri Sep 22 10:09:11 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 10:09:11 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Indeed, I do not think there is a problem with segmentation of brain/skull, as can be seen on the image. Stripping some skin of two subjects (thresholding the 'soft_tissue' probability output of SPM12, then removing it) with a similar problem of solved the rotation, but resulted in too small grids... On this subject I attached this procedure has no effect. However, at least for those other subjects normalization on skullstripped, or rather, scalpstripped MRIs might do the trick. As I understand it, however, the spm8 procedure (and spm12 I think) is a two-stepped procedure, with (affine) transformation based on the scalp first, after which it optimizes it based on brain segmentation. I would not know how to therefor do normalization without scalp. In fact, it expects a full volumetric image, not a (pre-)segmented one. Cheers, Stephen On 21 September 2017 at 18:45, Arjen Stolk wrote: > First thought is a registration of brain outline to skull (instead of > brain), although at closer inspection the shift seems overall just a bit > too large for that. You could try calculating the normalization parameters > on skullstripped volumes (unless you want to keep non-brain tissue). > > On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < > stephen.whitmarsh at gmail.com> wrote: > >> Hi Arjen, >> >> Thanks, and good to hear you've not been let down yet. It might be the >> fact that I have some bad quality MRIs to deal with. However... does this >> problem (see attached) ring a bell for anyone?: >> >> Brain segmentation is proper, and co-registration with polhemus >> head-shape as well, but inverse warp to MNI result in a tilted grid. >> Linear vs. non-linear transformation gives the same result. Other subjects >> going through the same procedure work fine, except two others wherein I >> identified it as a problem in segmenting the scalp and therefor the first >> step of the normalization. This one looks absolutely fine in every other >> regard, however. >> >> I'm stumped... >> >> cfg = []; >> cfg.spmversion = 'spm12'; >> cfg.grid.warpmni = 'yes'; >> cfg.grid.template = template_grid; >> cfg.grid.nonlinear = 'yes'; >> cfg.mri = mri_realigned; >> cfg.grid.unit = 'mm'; >> subject_grid = ft_prepare_sourcemodel(cfg); >> >> Cheers, >> Stephen >> >> >> On 21 September 2017 at 17:00, Arjen Stolk wrote: >> >>> Hey Stephen, >>> >>> Look for discussions regarding spm12 and also dartel on bugzilla. It's >>> been a while but as far as I can remember ft_volumenormalize is the only >>> function now that has not been integrated. Reason being that it wasnt >>> straightforward to house the dartel procedure under a single function, so >>> this is ongoing work still. You can however use spm12's coregistration >>> function with ft_volumerealign (for rigid body transformations), which Im >>> using quite a bit and never let me down (and is much faster than before). >>> But that wouldnt work for normalization to template space though (use spm8). >>> >>> Best >>> >>> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) < >>> hgould at memphis.edu> wrote: >>> >>> I have retired please remove me from the mail list >>> >>> Herbert Jay Gould >>> Professor Emeritus >>> The University of Memphis >>> >>> >>> >>> Sent from my Verizon Wireless 4G LTE smartphone >>> >>> >>> -------- Original message -------- >>> From: Stephen Whitmarsh >>> Date:09/21/2017 7:43 AM (GMT-06:00) >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >>> normalization >>> >>> Dear Sarang and Jan-Mathijs, >>> >>> Thanks a lot. I am now able (after updating FT, which now includes SPM12 >>> in /external), to use SPM12 for segmentation of my template and my subject >>> MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >>> improvement over 8 when it comes to brain-segmentation, which now does not >>> require individual treatments anymore. It also outputs more compartments >>> which gives me a little bit more to work with when dealing with scans that >>> have bad delineation of the scalp for normalization. >>> >>> Pleas note that defaults seems to differ - some FT functions default to >>> spm8, others to spm12. >>> >>> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >>> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >>> 'spm12'. In other words the cfg.spmversion is not passed along. >>> >>> Best wishes and thanks again! >>> Stephen >>> >>> >>> >>> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >>> jan.schoffelen at donders.ru.nl> wrote: >>> >>>> Hi Stephen, >>>> >>>> Please note that FT now has full support for SPM12, both using the >>>> old-style segmentation, and the new one (the latter yielding 6 tissue >>>> types). >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh < >>>> stephen.whitmarsh at gmail.com> wrote: >>>> >>>> Dear all, >>>> >>>> I having some problems in normalizing MRIs for my study. Some have >>>> improper segmentation for which changing individual brain/scalp thresholds >>>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>>> noise outside of the head. Also, changing parameters in spm8 for >>>> normalization, such as number of iterations (directly in in spm_normalize, >>>> since FT does not pass these parameters) improves the transformation. >>>> >>>> However, some scans I cannot deal with, either because they have noise >>>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>>> optimal scalp-segmentation and thereby normalization. Others have an >>>> inappropriate contrast MRI sequence. >>>> >>>> Some fMRI researchers advised me to use SPM12, because of its improved >>>> preprocessing procedures. However, it does not seem supported in FT yet. >>>> Does anyone have experience with this, and can perhaps share how they >>>> extracted the transformation matrix from the resulting nifti's? >>>> >>>> Thanks, >>>> Stephen >>>> _______________________________________________ >>>> 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 stephen.whitmarsh at gmail.com Fri Sep 22 13:01:25 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 13:01:25 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Jan-Mathijs, et. al., It seems the rotation was caused by a bug my side. The segmentation using SPM12 solved problems caused by low quality MRIS. Thanks! Stephen On 22 September 2017 at 10:09, Stephen Whitmarsh < stephen.whitmarsh at gmail.com> wrote: > Hi Arjen, > > Indeed, I do not think there is a problem with segmentation of > brain/skull, as can be seen on the image. Stripping some skin of two > subjects (thresholding the 'soft_tissue' probability output of SPM12, then > removing it) with a similar problem of solved the rotation, but resulted in > too small grids... On this subject I attached this procedure has no effect. > > However, at least for those other subjects normalization on skullstripped, > or rather, scalpstripped MRIs might do the trick. As I understand it, > however, the spm8 procedure (and spm12 I think) is a two-stepped procedure, > with (affine) transformation based on the scalp first, after which it > optimizes it based on brain segmentation. I would not know how to therefor > do normalization without scalp. In fact, it expects a full volumetric > image, not a (pre-)segmented one. > > Cheers, > Stephen > > On 21 September 2017 at 18:45, Arjen Stolk wrote: > >> First thought is a registration of brain outline to skull (instead of >> brain), although at closer inspection the shift seems overall just a bit >> too large for that. You could try calculating the normalization parameters >> on skullstripped volumes (unless you want to keep non-brain tissue). >> >> On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < >> stephen.whitmarsh at gmail.com> wrote: >> >>> Hi Arjen, >>> >>> Thanks, and good to hear you've not been let down yet. It might be the >>> fact that I have some bad quality MRIs to deal with. However... does this >>> problem (see attached) ring a bell for anyone?: >>> >>> Brain segmentation is proper, and co-registration with polhemus >>> head-shape as well, but inverse warp to MNI result in a tilted grid. >>> Linear vs. non-linear transformation gives the same result. Other subjects >>> going through the same procedure work fine, except two others wherein I >>> identified it as a problem in segmenting the scalp and therefor the first >>> step of the normalization. This one looks absolutely fine in every other >>> regard, however. >>> >>> I'm stumped... >>> >>> cfg = []; >>> cfg.spmversion = 'spm12'; >>> cfg.grid.warpmni = 'yes'; >>> cfg.grid.template = template_grid; >>> cfg.grid.nonlinear = 'yes'; >>> cfg.mri = mri_realigned; >>> cfg.grid.unit = 'mm'; >>> subject_grid = ft_prepare_sourcemodel(cfg); >>> >>> Cheers, >>> Stephen >>> >>> >>> On 21 September 2017 at 17:00, Arjen Stolk wrote: >>> >>>> Hey Stephen, >>>> >>>> Look for discussions regarding spm12 and also dartel on bugzilla. It's >>>> been a while but as far as I can remember ft_volumenormalize is the only >>>> function now that has not been integrated. Reason being that it wasnt >>>> straightforward to house the dartel procedure under a single function, so >>>> this is ongoing work still. You can however use spm12's coregistration >>>> function with ft_volumerealign (for rigid body transformations), which Im >>>> using quite a bit and never let me down (and is much faster than before). >>>> But that wouldnt work for normalization to template space though (use spm8). >>>> >>>> Best >>>> >>>> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) < >>>> hgould at memphis.edu> wrote: >>>> >>>> I have retired please remove me from the mail list >>>> >>>> Herbert Jay Gould >>>> Professor Emeritus >>>> The University of Memphis >>>> >>>> >>>> >>>> Sent from my Verizon Wireless 4G LTE smartphone >>>> >>>> >>>> -------- Original message -------- >>>> From: Stephen Whitmarsh >>>> Date:09/21/2017 7:43 AM (GMT-06:00) >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >>>> normalization >>>> >>>> Dear Sarang and Jan-Mathijs, >>>> >>>> Thanks a lot. I am now able (after updating FT, which now includes >>>> SPM12 in /external), to use SPM12 for segmentation of my template and my >>>> subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >>>> improvement over 8 when it comes to brain-segmentation, which now does not >>>> require individual treatments anymore. It also outputs more compartments >>>> which gives me a little bit more to work with when dealing with scans that >>>> have bad delineation of the scalp for normalization. >>>> >>>> Pleas note that defaults seems to differ - some FT functions default to >>>> spm8, others to spm12. >>>> >>>> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >>>> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >>>> 'spm12'. In other words the cfg.spmversion is not passed along. >>>> >>>> Best wishes and thanks again! >>>> Stephen >>>> >>>> >>>> >>>> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >>>> jan.schoffelen at donders.ru.nl> wrote: >>>> >>>>> Hi Stephen, >>>>> >>>>> Please note that FT now has full support for SPM12, both using the >>>>> old-style segmentation, and the new one (the latter yielding 6 tissue >>>>> types). >>>>> >>>>> Best, >>>>> Jan-Mathijs >>>>> >>>>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh < >>>>> stephen.whitmarsh at gmail.com> wrote: >>>>> >>>>> Dear all, >>>>> >>>>> I having some problems in normalizing MRIs for my study. Some have >>>>> improper segmentation for which changing individual brain/scalp thresholds >>>>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>>>> noise outside of the head. Also, changing parameters in spm8 for >>>>> normalization, such as number of iterations (directly in in spm_normalize, >>>>> since FT does not pass these parameters) improves the transformation. >>>>> >>>>> However, some scans I cannot deal with, either because they have noise >>>>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>>>> optimal scalp-segmentation and thereby normalization. Others have an >>>>> inappropriate contrast MRI sequence. >>>>> >>>>> Some fMRI researchers advised me to use SPM12, because of its improved >>>>> preprocessing procedures. However, it does not seem supported in FT yet. >>>>> Does anyone have experience with this, and can perhaps share how they >>>>> extracted the transformation matrix from the resulting nifti's? >>>>> >>>>> Thanks, >>>>> Stephen >>>>> _______________________________________________ >>>>> 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 hamedtaheri at yahoo.com Fri Sep 22 13:53:44 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Fri, 22 Sep 2017 11:53:44 +0000 (UTC) Subject: [FieldTrip] Artifact Rejection Problem References: <258456736.7597235.1506081224221.ref@mail.yahoo.com> Message-ID: <258456736.7597235.1506081224221@mail.yahoo.com> Hello Dear Fieldtrip users, I have an EEG signal which I want to do artifact rejection on it.I've recorded the EEG during watching a video clip. My signal is 100 seconds and I've selected 50 seconds.I can find EOG artifact but I can't reject it. Would you please let me know how can I do it. cfg  = []; cfg.dataset   = 'myfile.eeg';  %BrainVision Recoreder EEG cfg.trialdef.triallength   = inf; cfg.trialdef.ntrials         = inf; cfg   = ft_definetrial(cfg); trl     = cfg.trl; data_org = ft_preprocessing(cfg); %Select 30sec of data cfg.latency        = 'all'; cfg.latency     = [0 30]; %start point and end point cfg.avgovertime = 'no'; cfg.nanmean     = 'no'; data_s = ft_selectdata(cfg, data_org); [cfg, artifact] = ft_artifact_eog(cfg,data_s);clean_data = ft_rejectartifact(cfg,data_s); -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Fri Sep 22 14:12:11 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 14:12:11 +0200 Subject: [FieldTrip] Warnings on CentOS break code? Message-ID: Hi there, Since upgrading to the latest FT version, some warnings throw an error because FT cannot determine it's in a CentOS distro. At least, that's what I think it is? Am I missing something? Best, Stephen cfg = []; cfg.artfctdef = artdef_MEG{ipart}; cfg.artfctdef.reject = 'partial'; cfg.artfctdef.minaccepttim = 3; data{ipart} = ft_rejectartifact(cfg,data{ipart}); results in: Error using ft_platform_supports (line 134) unsupported value for first argument: html Error in ft_notification (line 376) if ft_platform_supports('html') Error in ft_warning (line 63) ft_notification(varargin{:}); Error in getdimord>warning_dimord_could_not_be_determined (line 621) ft_warning('%s\n\n%s', msg,content); Error in getdimord (line 572) warning_dimord_could_not_be_determined(field,data); Error in ft_selectdata (line 201) dimord{i} = getdimord(varargin{1}, datfield{i}); Error in WANDER_common_filter_DICS (line 85) hdr = ft_selectdata(cfg,hdr); 134 error('unsupported value for first argument: %s', what); -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Fri Sep 22 19:06:53 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Fri, 22 Sep 2017 17:06:53 +0000 (UTC) Subject: [FieldTrip] Artifact Removing Problem References: <28989140.7825054.1506100013966.ref@mail.yahoo.com> Message-ID: <28989140.7825054.1506100013966@mail.yahoo.com> Hi all I've tried to remove EOG, jump and muscle artifact from my EEG.I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. ( No filter, remove) . I want to filter my signal no remove some part of mt signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG.Could you please help me what is my wrong? Best Regards,Hamed -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Sun Sep 24 17:37:43 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Sun, 24 Sep 2017 15:37:43 +0000 (UTC) Subject: [FieldTrip] Artifact Rejection Problem References: <383387083.4716793.1506267463295.ref@mail.yahoo.com> Message-ID: <383387083.4716793.1506267463295@mail.yahoo.com> Hi all I've tried to remove EOG, jump and muscle artifact from my EEG.I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. I want to filter my signal no remove some part of my signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG.Could you please help me what is my wrong? cfg.artfctdef.eog.artifact = artifact_EOG; cfg.artfctdef.jump.artifact = artifact_jump; cfg.artfctdef.muscle.artifact = artifact_muscle; cfg.artfctdef.reject = 'complet' ; data_no_artifacts = ft_rejectartifact(cfg,data_int); Best Regards,Hamed -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon Sep 25 03:23:35 2017 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 25 Sep 2017 11:23:35 +1000 Subject: [FieldTrip] Question regarding clusterplot Message-ID: Dear list, I am trying to plot significant clusters from the cluster based permutation test on the ERPs. I want to plot the p values on a binary fashion (p<.05). I just don't want to highlight the electrodes, but I want to interpolate the p values and plot topography (just like ERP topography, but in abinary fashion). I was wondering whether there is a way to do it? Thanks, Arti -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Sep 25 06:29:05 2017 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 25 Sep 2017 06:29:05 +0200 Subject: [FieldTrip] Question regarding clusterplot In-Reply-To: References: Message-ID: Hi Arti, you could specify cfg.parameter = ‘mask’; instead of ‘avg’ which is the default. best tzvetan > Am 25.09.2017 um 03:23 schrieb Arti Abhishek : > > Dear list, > > I am trying to plot significant clusters from the cluster based permutation test on the ERPs. I want to plot the p values on a binary fashion (p<.05). I just don't want to highlight the electrodes, but I want to interpolate the p values and plot topography (just like ERP topography, but in abinary fashion). I was wondering whether there is a way to do it? > > Thanks, > Arti > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From simeon.wong at sickkids.ca Mon Sep 25 16:45:04 2017 From: simeon.wong at sickkids.ca (Simeon Wong) Date: Mon, 25 Sep 2017 14:45:04 +0000 Subject: [FieldTrip] Artifact Rejection Problem In-Reply-To: <383387083.4716793.1506267463295@mail.yahoo.com> References: <383387083.4716793.1506267463295.ref@mail.yahoo.com>, <383387083.4716793.1506267463295@mail.yahoo.com> Message-ID: Hi Hamed, I believe ft_rejectartefact does not offer an option to simply remove any artefact. Removing artefacts is actually a non-trivial process that you can approach from several different ways. Try using ft_componentanalysis to apply ICA to remove eye blinks and some eye movement. I'm not too sure about muscle artefact in EEG but perhaps setting a bandpass filter from 1-30 Hz may help attenuate most of it. You probably don't need to worry about jump artifacts since that typically applies only to MEG. Regards, Simeon Wong ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Hamed Taheri Sent: September 24, 2017 11:37:43 AM To: FieldTrip Discussion List Subject: [FieldTrip] Artifact Rejection Problem Hi all I've tried to remove EOG, jump and muscle artifact from my EEG. I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. I want to filter my signal no remove some part of my signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG. Could you please help me what is my wrong? cfg.artfctdef.eog.artifact = artifact_EOG; cfg.artfctdef.jump.artifact = artifact_jump; cfg.artfctdef.muscle.artifact = artifact_muscle; cfg.artfctdef.reject = 'complet' ; data_no_artifacts = ft_rejectartifact(cfg,data_int); Best Regards, Hamed ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. From bqrosen at ucsd.edu Mon Sep 25 22:05:39 2017 From: bqrosen at ucsd.edu (Burke Rosen) Date: Mon, 25 Sep 2017 13:05:39 -0700 Subject: [FieldTrip] ft_combineplanar 'svd' method Message-ID: Hello, What is the principle behind the ‘svd’ and ‘absvd’ methods for ft_combineplanar? And/or is there a citation which introduces these methods? Thank you, Burke Rosen From michak at is.umk.pl Mon Sep 25 23:44:00 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Mon, 25 Sep 2017 23:44:00 +0200 Subject: [FieldTrip] AAL Surface plot - weird black spots In-Reply-To: References: Message-ID: Dear Fieldtrippers, I found the solution and it is simple. Just make sure that you have in your config follwing lines: cfg.projmethod = 'project' cfg.projvec = [0 5] Have a nice plots ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics 2017-07-31 14:15 GMT+02:00 Michał Komorowski : > Dear Fieldtrippers, > > I am trying to reproduce brain surface pictures from this paper (Fig.5) : > http://journals.plos.org/plosbiology/article?id=10. > 1371/journal.pbio.1002498 > > I wonder why I get weid black spots in surface plot (e.g. occipital area). > What should I do to get those nice picures from link above? > What I am doing wrong (code below)? > > Code for generating erroneous pictures (see attachment): > > mrifile = [FieldtripPath 'template/anatomy/single_subj_ > T1.nii'] > > mri = ft_read_mri(mrifile) > mri.coordsys = 'mni'; % to prevent manual fixing of coordsys > > atlaspath = [FieldtripPath 'template/atlas/aal/ROI_MNI_V4.nii']; > atlas = ft_read_atlas(atlaspath) > atlas.anatomy = mri.anatomy; > > cfg = []; > cfg.method = 'surface'; > cfg.projmethod = 'project'; > cfg.camlight = 'yes'; > %cfg.surffile = [FieldtripPath 'template/anatomy/surface_pial_left.mat']; > % uncomment to project half brain > cfg.locationcoordinates = 'voxel'; > cfg.cmap = jet(116); > cfg.cmap = [[0,0,0]; cfg.cmap] > cfg.funcolormap = cfg.cmap; > cfg.funparameter = 'tissue'; > cfg.atlas = atlaspath; > ft_sourceplot(cfg, atlas) > > > % check fit anatomy to atlas > cfg = []; > cfg.method = 'ortho'; > cfg.locationcoordinates = 'voxel'; > cfg.cmap = jet(116); > cfg.cmap = [[0,0,0]; cfg.cmap] % color map > cfg.funcolormap = cfg.cmap; > cfg.funparameter = 'tissue'; > ft_sourceplot(cfg, atlas) > > Best wishes. > > Michał Komorowski > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nirofir2 at gmail.com Tue Sep 26 15:12:30 2017 From: nirofir2 at gmail.com (Nir Ofir) Date: Tue, 26 Sep 2017 16:12:30 +0300 Subject: [FieldTrip] Variable Number of Tapers in 'mtmfft' Frequency Analysis Message-ID: Hi Fieldtrip users, ft_freqanalysis (FT version 20170404) does not allow using a variable number of tapers in 'mtmfft' mode (lines 462-465 display a warning and keep only the first element of cfg.tapsmofrq), but it seems like ft_specest_mtmfft does have an implementation of a variable number of tapers (lines 286-348). It also seems like mtm_specest_mtmconvol, which allows variable number of tapers, calls ft_specest_mtmfft. So 2 questions: 1. Is the variable number of tapers option used in mtmfft in some other way? 2. What is the reason for not allowing a variable number of tapers in mtmfft generally? Thanks! Nir Ofir -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog.louisa at gmail.com Wed Sep 27 22:01:53 2017 From: bog.louisa at gmail.com (Louisa Bogaerts) Date: Wed, 27 Sep 2017 23:01:53 +0300 Subject: [FieldTrip] reading in and preprocessing gtec_mat data Message-ID: Hello everyone, In the lab or Dr. Landau we recently started using a *g.tech EEG setup* and *Simulink* record the data. We used the newest version of Fieldtrip to try analyze the data. Simulink outputs the data as a .mat file (an example here: https://www.dropbox.com/s/6xgio9w81qx94bq/example.mat?dl=0), and according to the fieldtrip documentation this data format should now be supported: e.g., https://github.com/fieldtrip/fieldtrip/blob/master/fileio/ft_read_data.m, lines 274-276: if any(strcmp(dataformat, {'bci2000_dat', 'eyelink_asc', 'gtec_mat', 'gtec_hdf5', 'mega_neurone'})) However, it seems that multiple Fieldtrip functions are “looking” for a header file that is not found. - When reading in the data with ft_read_data() we get the following error messages (whereas simply loading them with load() works fine): Error using ft_notification (line 340) unsupported header format "matlab" Error in ft_error (line 39) ft_notification(varargin{:}); Error in ft_read_header (line 2325) ft_error('unsupported header format "%s"', headerformat); Error in ft_read_data (line 200) hdr = ft_read_header(filename, 'headerformat', headerformat, 'chanindx', chanindx, 'checkmaxfilter', checkmaxfilter); - The same error messages show when using ft_preprocessing(). Does anyone have experience reading in and preprocessing gtech_mat data and can he/she help us understand how to save the header info so that fieldtrip can read it and recognise the data as gtec_mat? Any help will be very much appreciated. Louisa, Omri & Flor -------------- next part -------------- An HTML attachment was scrubbed... URL: From isac.sehlstedt at psy.gu.se Fri Sep 29 12:19:51 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Fri, 29 Sep 2017 10:19:51 +0000 Subject: [FieldTrip] Follow up question: Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: Dear fieldtripers, This is a kind reminder of a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (follow dropbox-link below) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see ft_componentanalysis-result1.tiff, or ft_componentanalysis-result2.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see matlab_pca_results.tiff) . Why am I not getting that in ft? Is it possible to get that using ft? Pictures are found using this link: https://www.dropbox.com/sh/k6ax6bvjb5yi13l/AADvwBzGduIXlCLaPBS4_ELya?dl=0 Very Best, Isac ————————————————— The code ————————————————— clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Sep 29 12:36:30 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 29 Sep 2017 10:36:30 +0000 Subject: [FieldTrip] Follow up question: Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: <97B82971-ABD0-49F2-81C4-235AE4D09162@donders.ru.nl> perhaps you may want to check the ‘avg’ field. JM On 29 Sep 2017, at 12:19, Isac Sehlstedt > wrote: Dear fieldtripers, This is a kind reminder of a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (follow dropbox-link below) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see ft_componentanalysis-result1.tiff, or ft_componentanalysis-result2.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see matlab_pca_results.tiff) . Why am I not getting that in ft? Is it possible to get that using ft? Pictures are found using this link: https://www.dropbox.com/sh/k6ax6bvjb5yi13l/AADvwBzGduIXlCLaPBS4_ELya?dl=0 Very Best, Isac ————————————————— The code ————————————————— clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end _______________________________________________ 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 stephen.whitmarsh at gmail.com Fri Sep 29 12:42:41 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 29 Sep 2017 12:42:41 +0200 Subject: [FieldTrip] reading in and preprocessing gtec_mat data In-Reply-To: References: Message-ID: Hi Louisa et al, It seems that you are actually not trying to read data in the Gtec data format, but that of simulink (which was saved as a mat file, as a matlab file). So, you should be able to just read your mat file and then put your data in a fieldtrip data structure. See: http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat Cheers, Stephen On 27 September 2017 at 22:01, Louisa Bogaerts wrote: > Hello everyone, > > > > In the lab or Dr. Landau we recently started using a *g.tech EEG setup* > and *Simulink* record the data. We used the newest version of Fieldtrip > to try analyze the data. > > > > Simulink outputs the data as a .mat file (an example here: > https://www.dropbox.com/s/6xgio9w81qx94bq/example.mat?dl=0), and > according to the fieldtrip documentation this data format should now be > supported: e.g., https://github.com/fieldtrip/f > ieldtrip/blob/master/fileio/ft_read_data.m, lines 274-276: > > if any(strcmp(dataformat, {'bci2000_dat', 'eyelink_asc', 'gtec_mat', > > 'gtec_hdf5', 'mega_neurone'})) > > > > However, it seems that multiple Fieldtrip functions are “looking” for a > header file that is not found. > > - When reading in the data with ft_read_data() we get the following > error messages (whereas simply loading them with load() works fine): > > Error using ft_notification (line 340) > > unsupported header format "matlab" > > > > Error in ft_error (line 39) > > ft_notification(varargin{:}); > > > > Error in ft_read_header (line 2325) > > ft_error('unsupported header format "%s"', headerformat); > > > > Error in ft_read_data (line 200) > > hdr = ft_read_header(filename, 'headerformat', headerformat, 'chanindx', > > chanindx, 'checkmaxfilter', checkmaxfilter); > > > > - The same error messages show when using ft_preprocessing(). > > > > Does anyone have experience reading in and preprocessing gtech_mat data > and can he/she help us understand how to save the header info so that > fieldtrip can read it and recognise the data as gtec_mat? > > > > Any help will be very much appreciated. > > > > Louisa, Omri & Flor > > _______________________________________________ > 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 psc.dav at gmail.com Sat Sep 2 16:45:47 2017 From: psc.dav at gmail.com (David Pascucci) Date: Sat, 2 Sep 2017 16:45:47 +0200 Subject: [FieldTrip] Fwd: single trials eLoreta In-Reply-To: References: Message-ID: Dear fieldtrip experts, I am posting again my questions, hoping that someone has experience with a similar pipeline and can give some feedback. I am trying to use the eLoreta method to get single-trial estimates of source activity from specific ROIs, in the following way: % eLORETA cfg = []; cfg.method = 'eloreta'; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.eloreta.keepfilter = 'yes'; cfg.eloreta.normalize = 'yes'; cfg.eloreta.lambda = 0.05; *(1) cfg.eloreta.projectnoise = 'yes'; eLO_source = ft_sourceanalysis(cfg,data); % in the above line, "data" is the results of ft_timelockanalysis % with cfg.covariance = 'yes'; *(2) % then I put the source positions from the MNI template I % used for the sourcemodel (see: % http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject- % specific_grids_that_are_equivalent_across_subjects_in_normalized_space eLO_source.pos = template_grid.pos; iPOS = eLO_source.pos; iPOS(eLO_source.inside==0,:) = NaN; % only points inside gray matter % Then I select ROIs (here only one for simplicity) to extract single-trial source activity: [v,I] = min(pdist2(iPOS, ROIs_mni , 'euclidean')); % And I multiply the spatial filter for the EEG data in each trial W = eLO_source.avg.filter{I}; % filter at my ROI of interest for tr = 1:size(data.trial,1) % loop over trials trials{tr} = W * squeeze(data.trial(tr,:,:)); *(3) end Is this approach correct? My main questions are: *(1) Is there a way to select the best lambda parameter (e.g., selecting the one that best approximates the activity at the EEG channels level)? *(2) I am confused about the role of the covariance, since it doesn't seem to be used when source activity is estimated using the set of spatial filters at the single trial *(3) Is the "trials{tr} = W * squeeze(data.trial(tr,:,:)); " approach correct to get time-series of source activity in a ROI? Looking forward for your feedback. Best, David -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From juliacoopiza at gmail.com Sun Sep 3 17:14:06 2017 From: juliacoopiza at gmail.com (Julia Coopi) Date: Sun, 3 Sep 2017 09:14:06 -0600 Subject: [FieldTrip] Using PPC method In-Reply-To: References: Message-ID: Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz wrote: > Dear Tianyang, > > maybe it's a good idea to download the accompanying sample data from the > tutorial and look if you can recreate the shown data structure. Then look > closer into the values of the respective fields. That should give you a > better grasp on what is required there. > > I have not fully looked into the code but my feeling is that > spikeTrials.timestamp is not of any further use and is just carried from > the data structure before (which was not cut into trials and where the raw > timestamps were useful). The timing of spikes relative to the trial zero > point is fully described in the fields ".time", ".trial" and ".trialtime". > Best, > Andreas > > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of 马天阳 [tianyangma2013 at gmail.com] > *Sent:* Monday, August 28, 2017 5:31 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Using PPC method > > Dear Andreas, > > I still don't quite understand the tutorial. > > spikeTrials = > label: {'sig002a_wf' 'sig003a_wf'} > timestamp: {[1x83601 int32 ] [1x61513 int32 ]} > waveform: {[1x32x83601 double ] [1x32x61513 double ]} > unit: {[1x83601 double ] [1x61513 double ]} > hdr: [1x1 struct ] > dimord: '{chan}_lead_time_spike' > cfg: [1x1 struct ] > time: {[1x83601 double ] [1x61513 double ]} > trial: {[1x83601 double ] [1x61513 double ]} > trialtime: [600x2 double ] > > Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? > > I feel I am quite lost. > > Best, > > Tianyang > > > _______________________________________________ > 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.lehongre-ihu at icm-institute.org Mon Sep 4 11:26:52 2017 From: k.lehongre-ihu at icm-institute.org (Katia Lehongre) Date: Mon, 4 Sep 2017 11:26:52 +0200 Subject: [FieldTrip] Workshop on intracranial recordings in human, October 3-4, Paris Message-ID: <6eba6c50-169d-a0f0-ab1e-73d808e81d24@icm-institute.org> Dear all, The first*WIRED*(*W*orkshop on *I*ntracranial *R*ecordings in humans : *E*pilepsy, *D*BS), will be held in Paris, France, at the Brain and Spine Institute (ICM) on October 3 and 4. Registration is opened and*free*. Conferences, technical discussions, poster session (prize worth 800€ to be awarded), commercial solutions, wine and cheese…  All information and registration to this event on our website: http://wired-icm.org _Note that_ only *a few spots are left* for poster presentation and that we have reach *70% of full capacity* including people from 10 Parisian institutes, 6 major French cities and 9 countries. We hope to see you there! The organizers _Organization_ : Katia Lehongre, Adrien Schramm – _Scientific Committee_: Vincent Navarro, Katia Lehongre, Brian Lau, Nathalie George, Michel Le Van Quyen, Marie Laure Welter, Lionel Naccache *_Program_* *Tuesday October 3^rd * *AM* *Research Lecture Session* ** 9:00 *   – /Welcome breakfast/* 9:30*    –   Event Introduction* 
/V. Navarro,  K. Lehongre/ 9:45*     –   Keynote : Epileptic ictal wavefront* */C. Schevon/ */ (Columbia, USA)/ 10:45 *– /Break/* 11:00*   –   DBS: Title to be determined* /J. Bastin (Grenoble, France)/ 11:45*   –   DBS: **Title to be determined* 12:30*    – /Lunch & Poster session/* *PM* *Methodological aspects* ** 14:00 *   –   Equipment : Focus on new electrodes* 
 /L. Valton/ / (Toulouse, France)/ 15:00*    –   Analysis : Spike sorting techniques* 
 /F. Mormann/ / (Bonn, Germany)/ 16:00 *– /Coffe Break/* 16:30*   –   Imaging: Electrode localization* */S. Fernandez/ */ (Paris, France/) 18:00*   –   Wine and Cheese session* ** *Wednesday October 4^th * *AM* *Research Lecture Session* 8:45 *   – /Breakfast/* 9:00*    –   Keynote : Title to be determined* */P. Brown/ */ (Oxford, UK)/ 10:00*   –   Memory encoding* */N. Axmacher/ */ (Bochum, Germany)/ 10:45 *–   Visual processing* /L. Reddy / /(Toulouse, France/) 11:30*   – /Coffee Break/* 11:45*   –   Focus: Imaging and electrophysiology* /C. Ciumas-Gaumond (Lyon, France)/ 12:45*    –  Conclusion & poster award* *PM – Off event* *Réunion du groupe Français Microelectrode* * * *Note that *The *Blackrock Microsystems’ Clinical Electrophysiology Workshop* will occur on Monday 2nd. All info and registration on this satellite event click here . ** -- Katia Lehongre Ingénieure de recherche IHU-A-ICM PF STIM CENIR, bureau -1.041 ICM, UPMC/Inserm U1127/CNRS UMR7225 Institut du Cerveau et de la Moelle épinière Hôpital Pitié-Salpêtrière 47 Boulevard de l'Hôpital CS 21414 75646 PARIS CEDEX 13 tel: 01 57 27 47 14 -------------- next part -------------- An HTML attachment was scrubbed... URL: From linzhangysu at outlook.com Mon Sep 4 13:09:45 2017 From: linzhangysu at outlook.com (linzhangysu at outlook.com) Date: Mon, 4 Sep 2017 11:09:45 +0000 Subject: [FieldTrip] WPLI Message-ID: [cid:image002.png at 01D325AA.E537BE20] I want to calculate the WPLI of 64 channels for one subject. But I met some questions. Firstly, I didn’t understand the meaning of repetitions (just as the maker of the figure ). The dimension of repetitions was 1 in my MATLAB code , which resulted in the WPLI result are NaN vectors. How can I solve the problem about ‘repetitions’? I am looking forward to your reply very urgently, Thank you ! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: 41C8A441EE344C5FB6F9EBCBE63CA91A.png URL: From michelic72 at gmail.com Mon Sep 4 13:19:27 2017 From: michelic72 at gmail.com (Cristiano Micheli) Date: Mon, 4 Sep 2017 13:19:27 +0200 Subject: [FieldTrip] WPLI In-Reply-To: References: Message-ID: Dear Linzhangysu the wPLI metric requires you to have your experimental design matrix organized in 'repetitions' or 'trials'. This is typically the case (but not only) of an evoked related design, where the repetitions dimension is used to calculate your 'average' wPLI across trials, and this is what the FT code is doing for you in the *ft_connectivity_wpli* function. In summary, with this formula you will not be able to apply wPLI to a single trial (e.g. like in resting state). If your experiment allows organizing the experimental data into 'trials' (with the operation of epoching) then you can solve your problem, otherwise you will have to use other metrics of phase coupling. IHTH Cris Micheli On Mon, Sep 4, 2017 at 1:09 PM, linzhangysu at outlook.com < linzhangysu at outlook.com> wrote: > > > [image: cid:image002.png at 01D325AA.E537BE20] > > > > I want to calculate the WPLI of 64 channels for one subject. But I met > some questions. > > Firstly, I didn’t understand the meaning of repetitions (just as the > maker of the figure ). The dimension of repetitions was 1 in my MATLAB code > , which resulted in the WPLI result are NaN vectors. How can I solve the > problem about ‘repetitions’? > > I am looking forward to your reply very urgently, Thank you ! > > > > _______________________________________________ > 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: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: not available URL: From awutz at mit.edu Mon Sep 4 14:24:47 2017 From: awutz at mit.edu (Andreas Wutz) Date: Mon, 4 Sep 2017 12:24:47 +0000 Subject: [FieldTrip] Using PPC method In-Reply-To: References: , Message-ID: Dear Julia, I did not see your error message. Maybe, your lfp data structure is still in a continuous recording format without a trial definition? ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Sunday, September 03, 2017 11:14 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz > wrote: Dear Tianyang, maybe it's a good idea to download the accompanying sample data from the tutorial and look if you can recreate the shown data structure. Then look closer into the values of the respective fields. That should give you a better grasp on what is required there. I have not fully looked into the code but my feeling is that spikeTrials.timestamp is not of any further use and is just carried from the data structure before (which was not cut into trials and where the raw timestamps were useful). The timing of spikes relative to the trial zero point is fully described in the fields ".time", ".trial" and ".trialtime". Best, Andreas From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of 马天阳 [tianyangma2013 at gmail.com] Sent: Monday, August 28, 2017 5:31 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, I still don't quite understand the tutorial. spikeTrials = label: {'sig002a_wf' 'sig003a_wf'} timestamp: {[1x83601 int32] [1x61513 int32]} waveform: {[1x32x83601 double] [1x32x61513 double]} unit: {[1x83601 double] [1x61513 double]} hdr: [1x1 struct] dimord: '{chan}_lead_time_spike' cfg: [1x1 struct] time: {[1x83601 double] [1x61513 double]} trial: {[1x83601 double] [1x61513 double]} trialtime: [600x2 double] Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? I feel I am quite lost. Best, Tianyang _______________________________________________ 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 christine.blume at sbg.ac.at Mon Sep 4 14:28:47 2017 From: christine.blume at sbg.ac.at (Blume Christine) Date: Mon, 4 Sep 2017 12:28:47 +0000 Subject: [FieldTrip] Effect size measure for cluster-based permutation tests In-Reply-To: References: Message-ID: Hi Alik, Thanks a lot for your suggestion, which I hoped would prompt more answers. Does anyone have suggestions on how exactly to implement the calculation of an effect size measure? Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Alik Widge Gesendet: Mittwoch, 23. August 2017 16:42 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Effect size measure for cluster-based permutation tests My naive answer, which perhaps will provoke Eric to provide a better one: you have the actual cluster statistic and its permutation distribution under the null hypothesis. It seems as though that distribution could be assumed Gaussian and something like Cohen's d calculated. On Aug 23, 2017 9:35 AM, "Blume Christine" > wrote: Dear all, I came across a question posted by someone about a year ago, which concerned effect size measures for cluster-based permutation tests. Unfortunately, the question does not seem to have been answered… Q: I am using cluster-based permutation tests (depsamplesT, on time-frequency data) and am wondering how to best calculate an effect size from that. Best, Christine _______________________________________________ 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 xiew1202 at gmail.com Mon Sep 4 14:44:26 2017 From: xiew1202 at gmail.com (Xie Wanze) Date: Mon, 04 Sep 2017 12:44:26 +0000 Subject: [FieldTrip] WPLI In-Reply-To: References: Message-ID: Dear Linzhang, As Cris mentioned, you cannot calculate the WPLi value with one trial. The WPLI toolbox calculates the CSD and PSD for each single trial, and then get the "correlation" of the phase information across trials. This apparently could not be done with one trial. If you have continuous data you may try to segment it into epochs. Wanze Cristiano Micheli 于2017年9月4日 周一上午7:35写道: > Dear Linzhangysu > > the wPLI metric requires you to have your experimental design matrix > organized in 'repetitions' or 'trials'. > This is typically the case (but not only) of an evoked related design, > where the repetitions dimension is used to calculate your 'average' wPLI > across trials, and this is what the FT code is doing for you in the > *ft_connectivity_wpli* function. > In summary, with this formula you will not be able to apply wPLI to a > single trial (e.g. like in resting state). If your experiment allows > organizing the experimental data into 'trials' (with the operation of > epoching) then you can solve your problem, otherwise you will have to use > other metrics of phase coupling. > > IHTH > Cris Micheli > > > > On Mon, Sep 4, 2017 at 1:09 PM, linzhangysu at outlook.com < > linzhangysu at outlook.com> wrote: > >> >> >> [image: cid:image002.png at 01D325AA.E537BE20] >> >> >> >> I want to calculate the WPLI of 64 channels for one subject. But I met >> some questions. >> >> Firstly, I didn’t understand the meaning of repetitions (just as the >> maker of the figure ). The dimension of repetitions was 1 in my MATLAB code >> , which resulted in the WPLI result are NaN vectors. How can I solve the >> problem about ‘repetitions’? >> >> I am looking forward to your reply very urgently, Thank you ! >> >> >> >> _______________________________________________ >> 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: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: not available URL: From e.maris at donders.ru.nl Tue Sep 5 14:12:52 2017 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Tue, 5 Sep 2017 12:12:52 +0000 Subject: [FieldTrip] Effect size measure for cluster-based permutation tests In-Reply-To: References: Message-ID: <59403DFC-9FBC-4585-928E-84787AE7E99F@donders.ru.nl> Dear discussion list readers & contributors (especially Christine Blume), There have been many questions (not only on the FT discussion list) about the calculation of effect size measures in the context of cluster-based permutation tests. I will continue my reply under the quotes below. From: Blume Christine > Subject: Re: [FieldTrip] Effect size measure for cluster-based permutation tests Date: 4 September 2017 at 14:28:47 GMT+2 To: FieldTrip discussion list > Reply-To: FieldTrip discussion list > Hi Alik, Thanks a lot for your suggestion, which I hoped would prompt more answers. Does anyone have suggestions on how exactly to implement the calculation of an effect size measure? Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Alik Widge Gesendet: Mittwoch, 23. August 2017 16:42 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Effect size measure for cluster-based permutation tests My naive answer, which perhaps will provoke Eric to provide a better one: you have the actual cluster statistic and its permutation distribution under the null hypothesis. It seems as though that distribution could be assumed Gaussian and something like Cohen's d calculated. On Aug 23, 2017 9:35 AM, "Blume Christine" > wrote: Dear all, I came across a question posted by someone about a year ago, which concerned effect size measures for cluster-based permutation tests. Unfortunately, the question does not seem to have been answered… Q: I am using cluster-based permutation tests (depsamplesT, on time-frequency data) and am wondering how to best calculate an effect size from that. Best, Christine Giving a useful answer to this question requires that one knows for what this effect size measure will be used. Typically, a standardised effect size measure is required to perform a power calculation. A power calculation is possible for a number of parametric statistical tests such as the T- and the F-test. As input for this power calculation, Cohen’s d is required. A sensible value for Cohen’s d can sometimes be found in published studies (preferably with large sample sizes). Cohen’s d can easily be obtained from the outcome of a cluster-based permutation test: 1. Calculate the non-standardised effect sizes by averaging the (sensor, frequency, time)-specific effects within the cluster of interest. Typically, the (sensor, frequency, time)-specific effects are raw differences between the subject averages for the experimental conditions that are being compared. 2. Calculate the standard deviation over the subjects of these non-standardised effect sizes. 3. Calculate Cohen’s d by dividing the grand average of the non-standardised effect sizes by the standard deviation obtained in 2. Unfortunately, Cohen’s d calculated in this way, will be biased, and therefore cannot be used for a power calculation. This type of bias is sometimes denoted as “double dipping”. In general, it is extremely challenging to perform a power calculations for statistical analyses that involve high-dimensional data. This does not only hold for electrophysiological, but also for fMRI data. To get idea about the difficulties that one encounters, have a look at this paper from the fMRI community: http://www.biorxiv.org/content/early/2016/04/20/049429. For the analysis of high-dimensional electrophysiological data, quite some statistical work still has to be done. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From bioeng.yoosofzadeh at gmail.com Wed Sep 6 04:22:10 2017 From: bioeng.yoosofzadeh at gmail.com (Vahab Yousofzadeh) Date: Tue, 5 Sep 2017 22:22:10 -0400 Subject: [FieldTrip] Effect size measure for cluster-based Message-ID: Hi Christine, Based on my understanding from the following link the effect size (that correspond to the significant clusters) can not be derived from p (or t)-values by ft_sourcestatistics: http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test Cheers, Vahab From christine.blume at sbg.ac.at Wed Sep 6 09:10:25 2017 From: christine.blume at sbg.ac.at (Blume Christine) Date: Wed, 6 Sep 2017 07:10:25 +0000 Subject: [FieldTrip] Effect size measure for cluster-based In-Reply-To: References: Message-ID: Dear all, Thank you so much for all the suggestions and hints. I will look into them! Best, Christine ________________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Vahab Yousofzadeh [bioeng.yoosofzadeh at gmail.com] Gesendet: Mittwoch, 06. September 2017 04:22 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Effect size measure for cluster-based Hi Christine, Based on my understanding from the following link the effect size (that correspond to the significant clusters) can not be derived from p (or t)-values by ft_sourcestatistics: http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test Cheers, Vahab _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From preted at mcmaster.ca Wed Sep 6 16:48:26 2017 From: preted at mcmaster.ca (David) Date: Wed, 6 Sep 2017 10:48:26 -0400 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I’ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I’m running into is stated below as well as my code and I’ve attached an image of what the data looks like. I’ve tried following the tutorials and searching through the mailing list and can’t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: “Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);” Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot (16).png Type: image/png Size: 161547 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Sep 6 17:18:53 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 6 Sep 2017 15:18:53 +0000 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> References: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570@donders.ru.nl> Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I’ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I’m running into is stated below as well as my code and I’ve attached an image of what the data looks like. I’ve tried following the tutorials and searching through the mailing list and can’t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: “Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);” Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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 tokimoto at mejiro.ac.jp Wed Sep 6 17:57:17 2017 From: tokimoto at mejiro.ac.jp (=?utf-8?B?5pmC5pys55yf5ZC+?=) Date: Thu, 7 Sep 2017 00:57:17 +0900 Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: From smoratti at psi.ucm.es Wed Sep 6 18:25:54 2017 From: smoratti at psi.ucm.es (STEPHAN MORATTI) Date: Wed, 6 Sep 2017 18:25:54 +0200 Subject: [FieldTrip] Learning agreementbuybr 8 In-Reply-To: References: Message-ID: C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" escribió: Buenos días Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ¿Serías tan amable de enviármelo firmado? Gracias y perdón por las molestias, Sara -------------- next part -------------- An HTML attachment was scrubbed... URL: From preted at mcmaster.ca Wed Sep 6 18:43:41 2017 From: preted at mcmaster.ca (David) Date: Wed, 6 Sep 2017 12:43:41 -0400 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: References: Message-ID: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> Hi Jan-Mathijs, I’ve double checked and the label is written as ‘CZ’. So, it seems to be more than a typo, unfortunately. David From: fieldtrip-request at science.ru.nl Sent: September 6, 2017 12:26 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 82, Issue 8 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: Reshape Error Using ft_freqstatistics (Schoffelen, J.M. (Jan Mathijs)) 2. Cluster-based permutation tests for 3 conditions (????) 3. Re: Learning agreementbuybr 8 (STEPHAN MORATTI) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Sep 2017 15:18:53 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570 at donders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I?ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I?m running into is stated below as well as my code and I?ve attached an image of what the data looks like. I?ve tried following the tutorials and searching through the mailing list and can?t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: ?Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);? Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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: 2 Date: Thu, 7 Sep 2017 00:57:17 +0900 From: ???? To: FieldTrip discussion list Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: Content-Type: text/plain; charset="us-ascii" Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: ------------------------------ Message: 3 Date: Wed, 6 Sep 2017 18:25:54 +0200 From: STEPHAN MORATTI To: SARA RODRIGUEZ FREGENAL , FieldTrip discussion list Subject: Re: [FieldTrip] Learning agreementbuybr 8 Message-ID: Content-Type: text/plain; charset="utf-8" C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" escribi?: Buenos d?as Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ?Ser?as tan amable de envi?rmelo firmado? Gracias y perd?n por las molestias, Sara -------------- 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 82, Issue 8 **************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 7 07:19:09 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 7 Sep 2017 05:19:09 +0000 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> References: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> Message-ID: <5038FBE1-5E7B-4F6B-B152-4A500879F002@donders.ru.nl> In that case I recommend that you try and interpret the error message in a bit more detail. From the information you provide nobody can tell what’s going on, apart from the fact that it is a low-level matlab error. I suggest to use the matlab debugger to investigate the size of ‘meanreshapeddat', and the value of ‘nchan’ ‘nfreq’ ‘nrepl’ ‘ntime’ in this specific case. And also think about your specification of cfg.latency. Note that you only include positive latencies to be tested, but you ask for actvsblT as a test statistic, which name suggests to use a baseline (i.e. require latencies of < 0 in the data). JM On 6 Sep 2017, at 18:43, David > wrote: Hi Jan-Mathijs, I’ve double checked and the label is written as ‘CZ’. So, it seems to be more than a typo, unfortunately. David From: fieldtrip-request at science.ru.nl Sent: September 6, 2017 12:26 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 82, Issue 8 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: Reshape Error Using ft_freqstatistics (Schoffelen, J.M. (Jan Mathijs)) 2. Cluster-based permutation tests for 3 conditions (????) 3. Re: Learning agreementbuybr 8 (STEPHAN MORATTI) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Sep 2017 15:18:53 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570 at donders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I?ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I?m running into is stated below as well as my code and I?ve attached an image of what the data looks like. I?ve tried following the tutorials and searching through the mailing list and can?t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: ?Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);? Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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: 2 Date: Thu, 7 Sep 2017 00:57:17 +0900 From: ???? > To: FieldTrip discussion list > Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: > Content-Type: text/plain; charset="us-ascii" Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: ------------------------------ Message: 3 Date: Wed, 6 Sep 2017 18:25:54 +0200 From: STEPHAN MORATTI > To: SARA RODRIGUEZ FREGENAL >, FieldTrip discussion list > Subject: Re: [FieldTrip] Learning agreementbuybr 8 Message-ID: > Content-Type: text/plain; charset="utf-8" C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" > escribi?: Buenos d?as Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ?Ser?as tan amable de envi?rmelo firmado? Gracias y perd?n por las molestias, Sara -------------- 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 82, Issue 8 **************************************** _______________________________________________ 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 nugenta at mail.nih.gov Thu Sep 7 03:02:10 2017 From: nugenta at mail.nih.gov (Nugent, Allison C. (NIH/NIMH) [E]) Date: Thu, 7 Sep 2017 01:02:10 +0000 Subject: [FieldTrip] 2nd MEG North America Meeting - Abstract Submission Reminder Message-ID: This is a reminder that we are currently accepting abstracts for the 2nd MEG-North America meeting, to be held in Bethesda, Maryland November 8th and 9th. Committee meetings will be held on November 8th, with the scientific session on November 9th. There will be a poster session and oral sessions on November 9th. We are attempting to secure funding to present several speaker honoraria for excellent abstracts submitted by early career investigators and trainees. If you would like to be considered for this, please indicate your preference, along with your position, on your abstract submission. Abstracts may be submitted any time up until Wednesday, September 13th at 11:59pm, directly to NIHMEGworkshop at gmail.com (note the deadline has been extended). Please visit our website at https://megworkshop.nih.gov/MEGWorkshop/ - We have added additional information regarding the program! Or register at: https://www.eventbrite.com/e/meg-north-america-2017-tickets-36315511673 We hope to see you there! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alice.bollini at yahoo.com Thu Sep 7 10:18:22 2017 From: alice.bollini at yahoo.com (Alice B) Date: Thu, 7 Sep 2017 08:18:22 +0000 (UTC) Subject: [FieldTrip] Source reconstruction issues References: <283732377.7662318.1504772302305.ref@mail.yahoo.com> Message-ID: <283732377.7662318.1504772302305@mail.yahoo.com> Hello everyone, I would like to use fieldtrip for extracting source activity from specific ROIs (using the eLoreta approach). Here is my script, there are few things I am not sure in the pipeline (marked with numbers on the right) % eLORETA cfg = []; cfg.method                          = 'eloreta';cfg.grid                                  = leadfield;cfg.headmodel                       = headmodel;cfg.eloreta.keepfilter              = 'yes';cfg.eloreta.normalize               = 'yes';cfg.eloreta.lambda                  = 0.05;                                      *(1)cfg.eloreta.projectnoise            = 'yes';eLO_source                          = ft_sourceanalysis(cfg,data); % in the above line, "data" is the results of ft_timelockanalysis% with cfg.covariance = 'yes';                                                  *(2) % then I put the source positions from the MNI template% used for the sourcemodel (http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space)eLO_source.pos                      = template_grid.pos;iPOS                                        = eLO_source.pos;iPOS(eLO_source.inside==0,:)        = NaN; % only points inside gray matter % Then I select ROIs (here only one for simplicity) to extract single-trial source activity:[v,I]       = min(pdist2(iPOS, ROIs_mni , 'euclidean')); % And I multiply the spatial filter for the EEG data in each trialW            = eLO_source.avg.filter{I}; % filter at my ROI of interestfor tr = 1:size(data.trial,1)       % loop over trials         trials{tr} = W * squeeze(data.trial(tr,:,:));                            *(3)end Is this approach correct?My main questions are: *(1) Is there a way to select the best lambda parameter (e.g., selecting the one that best approximates the activity at the EEG channels level)? *(2) I am confused about the role of the covariance, since it doesn't seem to be used when source activity is estimated using the set of spatial filters at the single trial *(3) Is the "trials{tr} = W * squeeze(data.trial(tr,:,:)); " approach correct to get time-series of source activity in a ROI? Best,Alice -------------- next part -------------- An HTML attachment was scrubbed... URL: From da401 at kent.ac.uk Thu Sep 7 13:53:20 2017 From: da401 at kent.ac.uk (D.Abdallah) Date: Thu, 7 Sep 2017 11:53:20 +0000 Subject: [FieldTrip] Question about MVPA topographic map Message-ID: <1504785200819.38370@kent.ac.uk> Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref = 'yes'; cfg.channel = {'Cz', 'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; cfg.refchannel = 'Cz'; cfg.demean = 'yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype = '?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref = 'no'; FaceTrials.keeptrials = 'yes'; % classifiers operate on individual trials FaceTrials.channel = {'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; % occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref = 'no'; VaseTrials.keeptrials = 'yes'; % classifiers operate on individual trials VaseTrials.channel = {'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; % occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout = 'biosemi64.lay'; cfg.method = 'crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy' 'binomial' 'contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter = 'mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments = ''; cfg.colorbar = 'yes'; cfg.interplimits= 'electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Subject 8 Topographical map.fig Type: application/octet-stream Size: 450612 bytes Desc: Subject 8 Topographical map.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imagesc Subject 8.fig Type: application/octet-stream Size: 40249 bytes Desc: Imagesc Subject 8.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tutorial topographic map.png Type: image/png Size: 10419 bytes Desc: tutorial topographic map.png URL: From Patrick.Rollo at uth.tmc.edu Fri Sep 8 20:38:22 2017 From: Patrick.Rollo at uth.tmc.edu (Rollo, Patrick) Date: Fri, 8 Sep 2017 18:38:22 +0000 Subject: [FieldTrip] Job Posting on FieldTrip message board Message-ID: <6484964699b24059ba1dd00807892d06@uth.tmc.edu> FieldTrip Moderators, I have a job posting that I would like to make on this message board, our lab, Tandon Lab, has posted in the past. The advert is attached here. Please let me know if you have any questions, Thank you, Patrick Rollo Research Assistant Department of Neurosurgery UTHealth McGovern Medical School at Houston 6431 Fannin St MSB G.550G Houston TX 77030 phone: 713-500-5475 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Postdocs_U01_updated 5:17.pdf Type: application/pdf Size: 236167 bytes Desc: Postdocs_U01_updated 5:17.pdf URL: From lxykh0700073 at outlook.com Sun Sep 10 03:53:24 2017 From: lxykh0700073 at outlook.com (Xinyi Li) Date: Sun, 10 Sep 2017 01:53:24 +0000 Subject: [FieldTrip] mixed design permutation tests on time-frequency data? Message-ID: Hi all, I'm wondering how to do a mixed design permutation test on time-frequency data, specifically, how to specify the design matrix. I followed the instructions in this post https://mailman.science.ru.nl/pipermail/fieldtrip/2008-March/001500.html for design matrix, but got an error 'the design matrix variables should be constant within a block'. Any suggestions? Thanks! Xinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Miguel.Granjaespiritosanto at nottingham.ac.uk Mon Sep 11 11:19:13 2017 From: Miguel.Granjaespiritosanto at nottingham.ac.uk (Miguel Granja Espirito Santo) Date: Mon, 11 Sep 2017 09:19:13 +0000 Subject: [FieldTrip] Any update on the group-level source MNE stats? Message-ID: Hi fieldtripers, I was wondering if there is any update on doing group level stats after conducting an MNE source analysis. I found several threads on the mailings list which I have successfully replicated, but I was wondering if there is any official FT approved way. At the end of the MNE page it says that this is under development, so is anyone privy to what the status of documentation is? Just asking because of supervisor enquiry for publication of our results. Best, Miguel PhD Student School of Psychology University of Nottingham 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 Manuel.Bange at unimedizin-mainz.de Mon Sep 11 14:32:57 2017 From: Manuel.Bange at unimedizin-mainz.de (Bange, Manuel) Date: Mon, 11 Sep 2017 12:32:57 +0000 Subject: [FieldTrip] Time normalisation for trials of different lenghts Message-ID: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> Dear fieldtrip community, My name is Manuel Bange and I am working in the Movement Disorder and Neurostimulation Lab in Mainz, Germany. Currently I am working on a project where we recorded EEG and EMG data combined with simultaneously recorded ground reaction forces during walking on a treadmill. I intend to use complete gait cycles as trials in order to, for example, calculate the inter-trial coherence. The issue I now face is that every cycle lasts a different amount of time. In a first step I have separated the continuous data into trials that correspond to whole gait cycles. One cycle starts with the onset of the right foot and ends one sample before the following onset of the same foot. This results in a number of trials (around 18 per subject) of different lengths. Following this, I performed a time-frequency analysis for each individual trial by 1. selecting a specific trial cfg.trials = 2; % select a a trial, here trial 2 trial2 = ft_selectdata(cfg, data) 2. performing time-frequency analysis cfg = []; cfg.output = 'pow'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [1:1:40]; cfg.t_ftimwin = ones(length(cfg.foi),1).*1; cfg.toi = trial2.time{1,1}(1,125):0.01:trial2.time{1,1}(1,end-125-1); cfg.keeptrials = 'yes' data_tfa1 = ft_freqanalysis(cfg, trial2); resulting in data_tfa1 = struct with fields: label: {257×1 cell} dimord: 'rpt_chan_freq_time' freq: [1×40 double] time: [1×172 double] % differs for each trial powspctrm: [1×257×40×172 double] cumtapcnt: [1×40 double] cfg: [1×1 struct] Now my question is: Is there a way to normalise this data over the time-axis, so that all trials have the same length? This is important to calculate an average time-frequency representation, or in another step, to calculate the inter-trial coherence. I have thought of normalising the time axis and interpolating the corresponding power-values. Thanks and best regards, Manuel Bange M.Sc. Sports Science Johannes-Gutenberg-University Hospital Movement Disorders and Neurostimulation Department of Neurology Langenbeckstr. 1 55131 Mainz, Germany www.unimedizin-mainz.de Email: manuel.bange at unimedizin-mainz.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From juliacoopiza at gmail.com Mon Sep 11 15:24:35 2017 From: juliacoopiza at gmail.com (Julia Coopi) Date: Mon, 11 Sep 2017 07:24:35 -0600 Subject: [FieldTrip] Using PPC method In-Reply-To: References: Message-ID: Dear Andreas, Finally, I managed to get PPC result from fliedtrip, now I have a problem: I am using mtmfft as method I wnat to have fine frequency resolution atleast I wan to have a point for each 1 hz. I have used cfg.foi =2:1:80; But it did't work, my output has a frequncy vector like this:[ 5 10 15 20 ... 80]; do you have any suggestion for better frequency resolution. If any body has a suggestion, that woulb be great to share it. Thanks, Julia On Mon, Sep 4, 2017 at 6:24 AM, Andreas Wutz wrote: > Dear Julia, > > I did not see your error message. Maybe, your lfp data structure is still > in a continuous recording format without a trial definition? > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Julia Coopi [juliacoopiza at gmail.com] > *Sent:* Sunday, September 03, 2017 11:14 AM > > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Using PPC method > > Dear Andreas, > > Thanks for your response, I am going through your suggestion. did you have > any problem regarding the appending spikes and lfp. I got this error: > > Error using ft_appendspike (line 112) > could not find the trial information in the continuous data > > thanks. > Julia > > On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz wrote: > >> Dear Tianyang, >> >> maybe it's a good idea to download the accompanying sample data from the >> tutorial and look if you can recreate the shown data structure. Then look >> closer into the values of the respective fields. That should give you a >> better grasp on what is required there. >> >> I have not fully looked into the code but my feeling is that >> spikeTrials.timestamp is not of any further use and is just carried from >> the data structure before (which was not cut into trials and where the raw >> timestamps were useful). The timing of spikes relative to the trial zero >> point is fully described in the fields ".time", ".trial" and ".trialtime". >> Best, >> Andreas >> >> >> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] >> on behalf of 马天阳 [tianyangma2013 at gmail.com] >> *Sent:* Monday, August 28, 2017 5:31 PM >> *To:* FieldTrip discussion list >> *Subject:* Re: [FieldTrip] Using PPC method >> >> Dear Andreas, >> >> I still don't quite understand the tutorial. >> >> spikeTrials = >> label: {'sig002a_wf' 'sig003a_wf'} >> timestamp: {[1x83601 int32 ] [1x61513 int32 ]} >> waveform: {[1x32x83601 double ] [1x32x61513 double ]} >> unit: {[1x83601 double ] [1x61513 double ]} >> hdr: [1x1 struct ] >> dimord: '{chan}_lead_time_spike' >> cfg: [1x1 struct ] >> time: {[1x83601 double ] [1x61513 double ]} >> trial: {[1x83601 double ] [1x61513 double ]} >> trialtime: [600x2 double ] >> >> Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? >> >> I feel I am quite lost. >> >> Best, >> >> Tianyang >> >> >> _______________________________________________ >> 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 awutz at mit.edu Mon Sep 11 15:57:02 2017 From: awutz at mit.edu (Andreas Wutz) Date: Mon, 11 Sep 2017 13:57:02 +0000 Subject: [FieldTrip] Using PPC method In-Reply-To: References: , Message-ID: Dear Julia, your frequency resolution depends on the time window you give to the FFT (cfg.timwin). Increasing that window will increase your freq resolution. ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Monday, September 11, 2017 9:24 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Finally, I managed to get PPC result from fliedtrip, now I have a problem: I am using mtmfft as method I wnat to have fine frequency resolution atleast I wan to have a point for each 1 hz. I have used cfg.foi =2:1:80; But it did't work, my output has a frequncy vector like this:[ 5 10 15 20 ... 80]; do you have any suggestion for better frequency resolution. If any body has a suggestion, that woulb be great to share it. Thanks, Julia On Mon, Sep 4, 2017 at 6:24 AM, Andreas Wutz > wrote: Dear Julia, I did not see your error message. Maybe, your lfp data structure is still in a continuous recording format without a trial definition? ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Sunday, September 03, 2017 11:14 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz > wrote: Dear Tianyang, maybe it's a good idea to download the accompanying sample data from the tutorial and look if you can recreate the shown data structure. Then look closer into the values of the respective fields. That should give you a better grasp on what is required there. I have not fully looked into the code but my feeling is that spikeTrials.timestamp is not of any further use and is just carried from the data structure before (which was not cut into trials and where the raw timestamps were useful). The timing of spikes relative to the trial zero point is fully described in the fields ".time", ".trial" and ".trialtime". Best, Andreas From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of 马天阳 [tianyangma2013 at gmail.com] Sent: Monday, August 28, 2017 5:31 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, I still don't quite understand the tutorial. spikeTrials = label: {'sig002a_wf' 'sig003a_wf'} timestamp: {[1x83601 int32] [1x61513 int32]} waveform: {[1x32x83601 double] [1x32x61513 double]} unit: {[1x83601 double] [1x61513 double]} hdr: [1x1 struct] dimord: '{chan}_lead_time_spike' cfg: [1x1 struct] time: {[1x83601 double] [1x61513 double]} trial: {[1x83601 double] [1x61513 double]} trialtime: [600x2 double] Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? I feel I am quite lost. Best, Tianyang _______________________________________________ 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 nasseroleslami at gmail.com Mon Sep 11 19:09:52 2017 From: nasseroleslami at gmail.com (Bahman Nasseroleslami) Date: Mon, 11 Sep 2017 18:09:52 +0100 Subject: [FieldTrip] Research Assistant in Position Neural Engineering Position - Trinity College Dublin, the University of Dublin, Dublin, Ireland Message-ID: Dear all, There is a research assistant position available in Academic Unit of Neurology, Trinity College Dublin, the University of Dublin, Dublin, Ireland. --------------------------------------- Job ID : 032518 Post Title: Research Assistant in Neural Engineering Post Status: 12 month contract, full-time Research Group / Department / School Academic Unit of Neurology, School of Medicine, Trinity College Dublin, the University of Dublin Location: Trinity Biomedical Sciences Institute, Trinity College Dublin, the University of Dublin, College Green, Dublin D02 R590, Ireland Reports to: Professor Orla Hardiman/Dr Bahman Nasseroleslami Salary: Research Assistant Level based on Irish Universities Association (IUA) Guideline, Point 1: €21,459 per annum (or above commensurate with experience). Closing Date: 5pm on Wednesday 27th September 2017 Please note that Garda vetting will be sought in respect of individuals who come under consideration for a post. Post Summary Applications are invited for a motivated and self-driven individual for the position of research assistant with the Irish ALS Research Group, hosted in the Trinity Biomedical Sciences Institute (TBSI)'s Academic Unit of Neurology. The ideal candidate will have an undergraduate or master's degree in engineering, bioengineering, mathematics, computational biology, or a cognate area. Familiarity with and/or the ability to quickly acquire skills in electrophysiological recordings and analysis (e.g. EEG/EMG), would be highly desirable as would a knowledge of computer programming (MATLAB). --------------------------------------- The detailed job description file (PDF) and the application instructions can be found online at http://jobs.tcd.ie. It would be really appreciated if you could share this with those that may be interested. Sincerely Bahman –––––––––––– Bahman Nasseroleslami Senior Research Fellow, IRC Postdoctoral Fellow Academic Unit of Neurology, School of Medicine Trinity College Dublin, the University of Dublin Dublin 2, Ireland. Room 5.43, Trinity Biomedical Sciences Institute 152-160 Pearse Street, Dublin D02 R590, Ireland. nasserob at tcd.ie, nasseroleslami at gmail.com www.tcd.ie Trinity College Dublin, the University of Dublin is ranked 1st in Ireland and in the top 100 world universities by the QS World University Rankings. –––––––––––– -------------- next part -------------- An HTML attachment was scrubbed... URL: From michak at is.umk.pl Mon Sep 11 23:16:54 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Mon, 11 Sep 2017 23:16:54 +0200 Subject: [FieldTrip] MRI low contrast Message-ID: Dear Fieldtrippers, How to correct low contrast in MR image when using ft_mri_read and ft_sourceplot to read and display MR image? (see attachment mri00_lowctrst.png) For comparison, same .nii opened with mricron software ( http://people.cas.sc.edu/rorden/mricron/install.html) displays with proper contrast (see attachment mri00_hictrst.png) Code: ss = 'sub1'; f = ['../data/ind/', ss, '/mri/mri00.nii']; mri00 = ft_read_mri(f) ft_sourceplot([],mri00) Thank you in advance ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mri00_hictrst.png Type: image/png Size: 460834 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mri00_lowctrst.png Type: image/png Size: 88547 bytes Desc: not available URL: From a.stolk8 at gmail.com Mon Sep 11 23:48:47 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 11 Sep 2017 14:48:47 -0700 Subject: [FieldTrip] MRI low contrast In-Reply-To: References: Message-ID: Hi Michal, There's a (undocumented) keyboard shortcut, shift+equal sign (numpad +) to adjust the contrast scaling (use numpad - for the opposite direction). Perhaps ft_sourceplot should additionally require the same cfg.lim option that for instance ft_determine_coordsys uses. Will propose in a PR. Best, Arjen On Mon, Sep 11, 2017 at 2:16 PM, Michał Komorowski wrote: > Dear Fieldtrippers, > > How to correct low contrast in MR image when using ft_mri_read and > ft_sourceplot to read and display MR image? (see attachment > mri00_lowctrst.png) > > For comparison, same .nii opened with mricron software ( > http://people.cas.sc.edu/rorden/mricron/install.html) displays with > proper contrast (see attachment mri00_hictrst.png) > > Code: > > ss = 'sub1'; > f = ['../data/ind/', ss, '/mri/mri00.nii']; > mri00 = ft_read_mri(f) > ft_sourceplot([],mri00) > > > Thank you in advance ! > > Michał Komorowski, MSc > Nicolaus Copernicus University in Toruń > Faculty of Physics, Astronomy and Informatics > Department of Informatics > > _______________________________________________ > 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 anne.urai at gmail.com Tue Sep 12 09:01:03 2017 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 12 Sep 2017 09:01:03 +0200 Subject: [FieldTrip] BIDS data format survey Message-ID: Dear FieldTrippers, Recently, a number of people have been working on developing a common data standard for MEG called BIDS (Brain Imaging Data Structure). They are now requesting community feedback, so please have a look at the brief survey here and help them out: https://t.co/BjAFmR7yhN *Magnetoencephalography (MEG) studies produce enormous amounts of data that need to be stored, organized and analyzed. However, naming conventions and metadata are often incomplete or inexistent, which is an impediment to the transfer of scientific data and knowledge, the reproducibility of research results, and the curation of large data repositories with entries from heterogenous origins. * *Building on recent efforts from the MRI community, MEG-BIDS is a proposition to standardize the arrangement of data structures in MEG. Please refer to the MEG-BIDS manuscript and to the MEG-BIDS detailed specifications for all details concerning the proposed structure:- MEG-BIDS Manuscript: http://www.biorxiv.org/content/early/2017/08/08/172684 * *- MEG-BIDS Specifications: http://www.biorxiv.org/content/biorxiv/suppl/2017/08/08/172684.DC1/172684-1.pdf * *We wish to survey the MEG community on its present needs with respect to data management, and design the MEG-BIDS standard to best respond to these presently unmet needs.* *Your participation is truly appreciated.* ... — Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie Universitätsklinikum Hamburg-Eppendorf | Martinistrasse 52, 20246 | Hamburg, Germany www.anneurai.net / @AnneEUrai -------------- next part -------------- An HTML attachment was scrubbed... URL: From michak at is.umk.pl Tue Sep 12 09:56:58 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Tue, 12 Sep 2017 09:56:58 +0200 Subject: [FieldTrip] MRI low contrast In-Reply-To: References: Message-ID: Yaay ! + and - works ! :D For determining coordsys one should type: % clim adjusts contrast (default [0 1], the lower the brighter) [dataout] = ft_determine_coordsys(mri00, 'clim', [0 0.25]) Thank you very much ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics 2017-09-11 23:48 GMT+02:00 Arjen Stolk : > Hi Michal, > > There's a (undocumented) keyboard shortcut, shift+equal sign (numpad +) to > adjust the contrast scaling (use numpad - for the opposite direction). > > Perhaps ft_sourceplot should additionally require the same cfg.lim option > that for instance ft_determine_coordsys uses. Will propose in a PR. > > Best, > Arjen > > > > > On Mon, Sep 11, 2017 at 2:16 PM, Michał Komorowski > wrote: > >> Dear Fieldtrippers, >> >> How to correct low contrast in MR image when using ft_mri_read and >> ft_sourceplot to read and display MR image? (see attachment >> mri00_lowctrst.png) >> >> For comparison, same .nii opened with mricron software ( >> http://people.cas.sc.edu/rorden/mricron/install.html) displays with >> proper contrast (see attachment mri00_hictrst.png) >> >> Code: >> >> ss = 'sub1'; >> f = ['../data/ind/', ss, '/mri/mri00.nii']; >> mri00 = ft_read_mri(f) >> ft_sourceplot([],mri00) >> >> >> Thank you in advance ! >> >> Michał Komorowski, MSc >> Nicolaus Copernicus University in Toruń >> Faculty of Physics, Astronomy and Informatics >> Department of Informatics >> >> _______________________________________________ >> 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 behinger at uos.de Tue Sep 12 20:14:22 2017 From: behinger at uos.de (Benedikt Ehinger) Date: Tue, 12 Sep 2017 20:14:22 +0200 Subject: [FieldTrip] Time normalisation for trials of different lenghts In-Reply-To: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> References: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> Message-ID: <1311033b-5017-443e-9cd9-0f4e4486f112@uos.de> Dear Manuel, first off, I do not know if or how you can do this in fieldtrip. But in eeglab you can do something they call "timewarping". One calculates a time-frequency (TF) decomposition for each trial and then warps/interpolates the TF so that some given events align. This is very similar (identical?) to what you describe and you might find more information either in the papers or the eeglab implementation. The method has been described in Gwin 2010 [1] and we also used it in on of our own studies [2]. Whether you can do the same also for phase (=> coherence) I don't know. I hope that helps in your analysis. Best, Benedikt [1] https://www.ncbi.nlm.nih.gov/pubmed/20410364 [2] https://www.ncbi.nlm.nih.gov/pubmed/24616681 Am 11.09.2017 um 14:32 schrieb Bange, Manuel: > Dear fieldtrip community, > >   > > My name is Manuel Bange and I am working in the Movement Disorder and > Neurostimulation Lab in Mainz, Germany. Currently I am working on a > project where we recorded EEG and EMG data combined with simultaneously > recorded ground reaction forces during walking on a treadmill. I intend > to use complete gait cycles as trials in order to, for example, > calculate the inter-trial coherence. The issue I now face is that every > cycle lasts a different amount of time. > > In a first step I have separated the continuous data into trials that > correspond to whole gait cycles. One cycle starts with the onset of the > right foot and ends one sample before the following onset of the same > foot. This results in a number of trials (around 18 per subject) of > different lengths. > > Following this, I performed a time-frequency analysis for each > individual trial by > >   > > 1.       selecting a specific trial > > /cfg.trials      = 2; >                                                               % select a > a trial, here trial 2/ > > /trial2 = ft_selectdata(cfg, data)/ > > / / > > 2.       performing time-frequency analysis > > /cfg          = [];/ > > /cfg.output   = 'pow';/ > > /cfg.method   = 'mtmconvol';/ > > /cfg.taper    = 'hanning';/ > > /cfg.foi      = [1:1:40];/ > > /cfg.t_ftimwin    = ones(length(cfg.foi),1).*1;/ > > /cfg.toi          = > trial2.time{1,1}(1,125):0.01:trial2.time{1,1}(1,end-125-1);            / > > /cfg.keeptrials = 'yes'/ > > /data_tfa1     = ft_freqanalysis(cfg, trial2);/ > > /resulting in/ > > /  data_tfa1 = / > > /  struct with fields:/ > > /label: {257×1 cell}/ > > /dimord: 'rpt_chan_freq_time'/ > > /freq: [1×40 double]/ > > /time: [1×172 > double]                                                                    > % differs for each trial/ > > /powspctrm: [1×257×40×172 double]/ > > /cumtapcnt: [1×40 double]/ > > /cfg: [1×1 struct]/ > >   > > Now my question is: > > Is there a way to normalise this data over the time-axis, so that all > trials have the same length? This is important to calculate an average > time-frequency representation, or in another step, to calculate the > inter-trial coherence. I have thought of normalising the time axis and > interpolating the corresponding power-values. > >   > > Thanks and best regards, > >   > > Manuel Bange > > M.Sc. Sports Science > >   > >   > > Johannes-Gutenberg-University Hospital > > Movement Disorders and Neurostimulation > > Department of Neurology > > Langenbeckstr. 1 > > 55131 Mainz, Germany > > www.unimedizin-mainz.de > >   > > Email: manuel.bange at unimedizin-mainz.de > >   > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From psc.dav at gmail.com Tue Sep 12 20:47:15 2017 From: psc.dav at gmail.com (David Pascucci) Date: Tue, 12 Sep 2017 20:47:15 +0200 Subject: [FieldTrip] inverse imaging Message-ID: Dear fieldtrip experts, I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Sep 13 12:22:01 2017 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 13 Sep 2017 12:22:01 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Hi David, do you want to obtain single-trial activity in source space? In that case, have you looked at the „virtual sensors“-tutorial? http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors In the tutorial, LCMV is used for the source analysis, but it should also work with sloreta, as the output-structure of the source-analysis is identical. I’m not sure about MNE though. Good luck, Julian > Am 12.09.2017 um 20:47 schrieb David Pascucci : > > Dear fieldtrip experts, > > I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… > > > > Thanks in advance > > _______________________________________________ > 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 psc.dav at gmail.com Wed Sep 13 13:22:46 2017 From: psc.dav at gmail.com (David Pascucci) Date: Wed, 13 Sep 2017 13:22:46 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Thaks Julian, that is the approach I was using, with eLoreta. I am not sure about two steps,though. One is the estimate and use of the signal covariance to input for single-trial activity in source space. The other is the choice of the optimal lambda. If you have some advice, that wold be very helpful. Thanks, David 2017-09-13 12:22 GMT+02:00 Julian Keil : > Hi David, > > do you want to obtain single-trial activity in source space? In that case, > have you looked at the „virtual sensors“-tutorial? http://www. > fieldtriptoolbox.org/tutorial/shared/virtual_sensors > In the tutorial, LCMV is used for the source analysis, but it should also > work with sloreta, as the output-structure of the source-analysis is > identical. I’m not sure about MNE though. > > Good luck, > > Julian > > > Am 12.09.2017 um 20:47 schrieb David Pascucci : > > Dear fieldtrip experts, > > I was wondering if anyone has experience with extracting single trials > estimates of source activity (using MNE or Loreta-based approaches) from > regions of interest, and what would be the best procedure… > > > Thanks in advance > _______________________________________________ > 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 > -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Sep 13 13:41:22 2017 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 13 Sep 2017 13:41:22 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Hi David, regarding the lambda, I think there are different ideas floating around the fieldtrip discussion-list. I suggest searching for the term „lambda“ to get a rough idea. Personally, for our EEG-data I usually use 10%. What is your question exactly regarding the covariance as input? Cheers, Julian > Am 13.09.2017 um 13:22 schrieb David Pascucci : > > Thaks Julian, > that is the approach I was using, with eLoreta. > I am not sure about two steps,though. > One is the estimate and use of the signal covariance to input for single-trial activity in source space. > The other is the choice of the optimal lambda. > > If you have some advice, that wold be very helpful. > > Thanks, > David > > 2017-09-13 12:22 GMT+02:00 Julian Keil >: > Hi David, > > do you want to obtain single-trial activity in source space? In that case, have you looked at the „virtual sensors“-tutorial? http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors > In the tutorial, LCMV is used for the source analysis, but it should also work with sloreta, as the output-structure of the source-analysis is identical. I’m not sure about MNE though. > > Good luck, > > Julian > > >> Am 12.09.2017 um 20:47 schrieb David Pascucci >: >> >> Dear fieldtrip experts, >> >> I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… >> >> >> >> Thanks in advance >> >> _______________________________________________ >> 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 > > > > -- > --------------------- > David Pascucci > > Postdoctoral Fellow > University of Fribourg > Department of Psychology > Rue de Faucigny 2 > 1700 Fribourg > Switzerland > _______________________________________________ > 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 evelyn.muschter at unitn.it Wed Sep 13 13:50:06 2017 From: evelyn.muschter at unitn.it (Evelyn Muschter) Date: Wed, 13 Sep 2017 13:50:06 +0200 Subject: [FieldTrip] Any update on the group-level source MNE stats?/ Vol 82, Issue 13 In-Reply-To: References: Message-ID: <88486D75-ED4E-40E0-8EE1-95A1A21E60CB@unitn.it> Hi Miguel and all, I have been wondering this myself! I have also followed various tutorial snippets here, but I am stuck with how to properly do group level stats. Any suggestions and input would be greatly appreciated! Best, Evelyn > On Sep 11, 2017, at 12:00 PM, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > 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. Any update on the group-level source MNE stats? > (Miguel Granja Espirito Santo) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 11 Sep 2017 09:19:13 +0000 > From: Miguel Granja Espirito Santo > > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Any update on the group-level source MNE stats? > Message-ID: > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi fieldtripers, > > > I was wondering if there is any update on doing group level stats after conducting an MNE source analysis. I found several threads on the mailings list which I have successfully replicated, but I was wondering if there is any official FT approved way. > > > At the end of the MNE page it says that this is under development, so is anyone privy to what the status of documentation is? > > Just asking because of supervisor enquiry for publication of our results. > > > Best, > > Miguel > PhD Student > School of Psychology > University of Nottingham > > > > > > 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: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 82, Issue 13 > ***************************************** From psc.dav at gmail.com Wed Sep 13 15:33:57 2017 From: psc.dav at gmail.com (David Pascucci) Date: Wed, 13 Sep 2017 15:33:57 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Thanks again Julian, About the covariance, I am not sure about its usage in the reconstruction of single-trials activity. According to the example, this is done by multiplying the spatial filters with the EEG data. Whereas the covariance (Cf) is used to compute the avg.pow and ori in ft_eloreta (line 160-168) % get the power dip.pow = zeros(size(dip.pos,1),1); dip.ori = cell(size(dip.pos,1),1); for i=1:size(dip.pos,1) csd = dip.filter{i}**Cf**dip.filter{i}'; [u,s,vv] = svd(real(csd)); dip.pow(i) = s(1); dip.ori{i} = u(:,1); end It does not seem to be considered when creating and storing spatial filters (later used for single-trials reconstruction) (line 152-158, ft_eloreta) % use existing filters, or compute them if ~isfield(dip, 'filter') filt = mkfilt_eloreta_v2(leadfield, lambda); for i=1:size(dip.pos,1) dip.filter{i,1} = squeeze(filt(:,i,:))'; end end My question is, am I getting this wrong? and if not, should I ignore the covariance estimation in the case of single-trials reconstructed via filters*data? Cheers, David 2017-09-13 13:41 GMT+02:00 Julian Keil : > Hi David, > > regarding the lambda, I think there are different ideas floating around > the fieldtrip discussion-list. I suggest searching for the term „lambda“ to > get a rough idea. Personally, for our EEG-data I usually use 10%. > > What is your question exactly regarding the covariance as input? > > Cheers, > > Julian > > Am 13.09.2017 um 13:22 schrieb David Pascucci : > > Thaks Julian, > that is the approach I was using, with eLoreta. > I am not sure about two steps,though. > One is the estimate and use of the signal covariance to input for single-trial > activity in source space. > The other is the choice of the optimal lambda. > > If you have some advice, that wold be very helpful. > > Thanks, > David > > 2017-09-13 12:22 GMT+02:00 Julian Keil : > >> Hi David, >> >> do you want to obtain single-trial activity in source space? In that >> case, have you looked at the „virtual sensors“-tutorial? http://www. >> fieldtriptoolbox.org/tutorial/shared/virtual_sensors >> In the tutorial, LCMV is used for the source analysis, but it should also >> work with sloreta, as the output-structure of the source-analysis is >> identical. I’m not sure about MNE though. >> >> Good luck, >> >> Julian >> >> >> Am 12.09.2017 um 20:47 schrieb David Pascucci : >> >> Dear fieldtrip experts, >> >> I was wondering if anyone has experience with extracting single trials >> estimates of source activity (using MNE or Loreta-based approaches) from >> regions of interest, and what would be the best procedure… >> >> >> Thanks in advance >> _______________________________________________ >> 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 >> > > > > -- > --------------------- > David Pascucci > > Postdoctoral Fellow > University of Fribourg > Department of Psychology > Rue de Faucigny 2 > 1700 Fribourg > Switzerland > _______________________________________________ > 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 > -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From Adeen.Flinker at nyumc.org Wed Sep 13 20:23:40 2017 From: Adeen.Flinker at nyumc.org (Flinker, Adeen) Date: Wed, 13 Sep 2017 18:23:40 +0000 Subject: [FieldTrip] ECoG postdoc position Message-ID: <99026305-0472-4915-871A-C55374055912@nyumc.org> NYU School of Medicine is looking for candidates for two post-doctoral positions in Human Electrocortigoraphy (ECoG) research. Both positions will be under the supervision of Dr. Adeen Flinker, investigating speech processing and cortical network dynamics. The research will be conducted at NYU Comprehensive Epilepsy Center working with a population of surgical patients undergoing treatment for refractory epilepsy. Research paradigms will be conducted in close collaboration with the clinical neurology team. The candidate will conduct neurophysiological research in patients implanted with intracranial electrodes (surface, depth, laminar, Utah arrays) and in intraoperative patients undergoing acute recording, stimulation or cooling. The ideal applicant must have a Ph.D. in Neuroscience, Psychology, Biomedical Engineering or a related field. Proficiency in oral and written English is mandatory. A solid background in programming, statistics and scientific writing is required. The candidate is expected to be autonomous and to have a track-record of peer-reviewed publication. Previous experience with human electrophysiology or machine learning will be an asset. One postdoctoral position is funded by a MURI grant investigating event segmentation and episodic memory. The candidate will have an opportunity to work closely with collaborators in Princeton (Dr. Hasson, Dr. Norman), Harvard (Dr. Gershman), UC Davis (Dr. Ranganath) and Washington University (Dr. Zacks). Interested individuals should send an email to adeen.flinker at nyumc.org, including a cover letter describing research experience and qualifications, academic CV, and contact information of referees. Adeen Flinker, PhD Assistant Professor Department of Neurology NYU School of Medicine 145 East 32nd Street New York, NY 10016 646-754-2228 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1377 bytes Desc: not available URL: -------------- next part -------------- ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From C.Mazzetti at donders.ru.nl Thu Sep 14 13:28:45 2017 From: C.Mazzetti at donders.ru.nl (Mazzetti, C. (Cecilia)) Date: Thu, 14 Sep 2017 11:28:45 +0000 Subject: [FieldTrip] ICA warning messages Message-ID: <389DA1293690C94C93E3A53201F6C91E569EB8E6@exprd01.hosting.ru.nl> Hi Evryone, I was wondering why do i get this type of warnings when running ICA on my data. this is the script I am using: cfg.resamplefs = 300; cfg.detrend = 'no'; datads = ft_resampledata(cfg, data_clean); cfg=[]; cfg.bpfilter='yes'; % bandpass , use low freqs for alpha compponents cfg.bpfreq = [0.5 30]; datatmp= ft_preprocessing(cfg, datads) cfg.method = 'runica'; cfg.runica.maxsteps =30; comp_filt = ft_componentanalysis(cfg, datatmp); clear datads cfg = []; cfg.unmixing = comp_filt.unmixing; cfg.topolabel = comp_filt.topolabel; comp_origin = ft_componentanalysis(cfg, data_clean); clear comp cfg = []; cfg.viewmode = 'component'; cfg.layout = 'CTF275.lay'; ft_databrowser(cfg, comp_origin) cfg = []; cfg.component = input('bad comps = '); meg_ica = ft_rejectcomponent(cfg, comp_origin,data_clean); later on after having selected the bad components i get these messages : Warning: unexpected channel unit "unknown" in channel 158 (i get this for all the channels but i copy-pasted just one of them for obv reasons) Warning: copying input chantype to montage Warning: copying input chanunit to montage Thanks in advance for your hints! Cecilia Cecilia Mazzetti - Ph.D. Candidate Donders Centre for Cognitive Neuroimaging, room 1.170 Kapittelweg 29 | 6525 EN Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nirofir2 at gmail.com Thu Sep 14 14:10:46 2017 From: nirofir2 at gmail.com (Nir Ofir) Date: Thu, 14 Sep 2017 15:10:46 +0300 Subject: [FieldTrip] Using ft_redefinetrial with minlength and begsample/endsample option Message-ID: Hi fieldtrip users, I have a data structure containing MEG trials which are aligned to stimulus onset. I now want to realign them to the target onset, as well as removing trials which are too short. I thought the easiest way to do this would be to use ft_redefinetrial in the following way: offset = dat.trialinfo(:,5); % this column contains the duration of the stimulus-target intervel cfg = []; cfg.minlength = -dat.time{1}(1)+cfgx.pretarget+0.5; % prestim defined by dat sructure + 0.5 s ERF + cfgx.pretarget cfg.begsample = round((offset - cfgx.pretarget)*1000); cfg.endample = round(offset*1000); dat = ft_redefinetrial(cfg, dat); When I run this, I get the following error: Index exceeds matrix dimensions. Error in ft_redefinetrial (line 209) data.trial{i} = data.trial{i}(:, begsample(i):endsample(i)); So I looked into ft_redefinetrials a bit, and it seems like when minlength is defined, the trials themselves are removed, but the begample/endsample vector are not cut to contain only the relevant trials. For now I moved to a 2-step solution (first removing trials, than realigning), but it seems like this could have a relatively simple fix. Suggestions? Thanks! Nir Ofir -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Sep 15 12:45:01 2017 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 15 Sep 2017 12:45:01 +0200 Subject: [FieldTrip] Postdoc position: Magnetoencephalography and Tractography applied to Language in Neurological Populations Message-ID: *3-year postdoctoral position on the topic of magnetoencephalography and tractography applied to language in neurological populations* We are looking for a postdoctoral candidate with demonstrable experience in analysis of structural imaging and tractography to strengthen our research group. Our group aims at integrating brain measures with high temporal resolution, obtained using magnetoencephalography, with measures of structural connectivity to better understand language function in healthy and neurological populations. Ongoing projects include studying chronic stroke and brain tumour patients. More information on https://www.languageininteraction.nl/jobs/postdoc-position-388.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Sep 15 15:46:58 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 15 Sep 2017 13:46:58 +0000 Subject: [FieldTrip] Fwd: Question for Fieldtrip References: <4b2644a5.aff0.15e8581f6ac.Coremail.zhangwenjia2732@126.com> Message-ID: <420905E5-98A4-4C9C-96C4-1C8A28325786@donders.ru.nl> Begin forwarded message: From: 张文嘉 > Subject: Question for Fieldtrip Date: 15 September 2017 at 14:27:20 GMT+2 To: > Dear Fieldtrip expert, I am Wenjia from NYU Shanghai. I am doing timefrequency analysis with frildtrip. I have a question that I cannot solve. And, I am wondering whether you could help me. Specifically, I want to import the EGI data that has been preprocessed (after segmentation but no average) into fieldtrip, and further do timefrequency analysis. I donot know how to do this. I have found a script like following: cfg = []; cfg.triggertype = 'Stimulus'; cfg.prestim = 1.0; %1.0s before the onset cfg.poststim = 2.0; %2.0s after the onset cfg.inputfile = sprintf('s02_32_tf'); cfg.triggercode = 'S 32'; data_32 = read_analyzer_data(cfg); "s02_32_tf" is the name that I exported from EGI system, then included 3 files: asc, vhdr and vmrk. However an error poped up: Undefined function 'read_analyzer_data' for input arguments of type 'struct'. Any advice are appreciated. Thank you very much. -- Wenjia NYU Shanghai -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.chait at ucl.ac.uk Mon Sep 18 13:01:41 2017 From: m.chait at ucl.ac.uk (Chait, Maria) Date: Mon, 18 Sep 2017 11:01:41 +0000 Subject: [FieldTrip] Research Assistant Position at the UCL Ear Institute Message-ID: I would appreciate your help in forwarding the advert below to relevant members of your department. We are seeking to appoint an enthusiastic and motivated Research Assistant and Laboratory Manager to provide essential support for ongoing research aimed at developing transformative treatments for deafness and hearing problems. The post is funded for 12 months (with a possibility of extension for up to 5 years). The post will involve collection and analysis of audiometry as well as behavioral (psychophysics), eye tracking and EEG data in humans. The postholder will also be expected to contribute to the induction and direction of other research staff and students. The UCL Ear Institute, located in the heart of London, provides state-of-the-art research facilities across a wide range of disciplines and is one of the foremost centres for hearing, speech and language-related research within Europe. Applicants should hold a 1st class, or upper 2nd (or equivalent) BSc or MSc degree in an engineering or Neuroscience-related subject. Previous experience with neuroscience research, functional brain imaging and/or acoustics is desirable. More information and a link to the application site are in the following link: http://www.jobs.ac.uk/job/BEH401/research-assistant-in-auditory-neuroscience Closing Date: 15 October 2017 Maria Chait PhD m.chait at ucl.ac.uk Professor in Auditory Cognitive Neuroscience Lab site: http://www.ucl.ac.uk/ear/research/chaitlab/ UCL Ear Institute 332 Gray's Inn Road London WC1X 8EE -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Sep 18 13:57:51 2017 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Sep 2017 13:57:51 +0200 Subject: [FieldTrip] Normalizing log-transformed EEG power Message-ID: Dear all, I have a question regarding how to compute z-scores for log-transformed EEG power across all events separately for each electrode and frequency. I have searched everywhere on how to implement this in the fieldrip environment, however, I will be very grateful if someone can help me out on this. Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From lxykh0700073 at outlook.com Tue Sep 19 03:51:59 2017 From: lxykh0700073 at outlook.com (Xinyi Li) Date: Tue, 19 Sep 2017 01:51:59 +0000 Subject: [FieldTrip] simple main effects and permutation Message-ID: Hi all, I have a mixed design and my hypothesis is about simple main effects. So for example, I have two groups of people, and each person experience the same 2x2 factorial design with conditions A1, A2, B1, B2. And my hypotheses are something like the simple main effect of A within group 1 and condition B1. My questions: 1) Can I just subset the data to include only the group and condition I want (B1 & group 1) and do a t-test between condition A1 & A2 after subsetting? If I understand correctly, this approach will bias the standard error of the estimates? But I'm not sure if this matters in a permutation framework, and I also don't know if it's a common practice to do this in EEG analysis? 2) Alternatively, I can run a full mixed ANOVA model and then the simple main effect in R to get the test statistics I want. But for this approach I'm not sure how I should perform the permutation since fieldtrip doesn't support a mixed design. Should I only permute A1 & A2 within condition B1 and group 1? Or should I permute everything within both factors A & B? And what about the group labels? Any suggestions? Thanks! Xinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From da401 at kent.ac.uk Tue Sep 19 06:25:36 2017 From: da401 at kent.ac.uk (D.Abdallah) Date: Tue, 19 Sep 2017 04:25:36 +0000 Subject: [FieldTrip] Question about MVPA topographic map In-Reply-To: <1504785200819.38370@kent.ac.uk> References: <1504785200819.38370@kent.ac.uk> Message-ID: Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref ='yes'; cfg.channel = {'Cz','PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'}; cfg.refchannel ='Cz'; cfg.demean ='yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype ='?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype ='STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref ='no'; FaceTrials.keeptrials ='yes';% classifiers operate on individual trials FaceTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref ='no'; VaseTrials.keeptrials ='yes';% classifiers operate on individual trials VaseTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout ='biosemi64.lay'; cfg.method ='crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy''binomial''contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter ='mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments =''; cfg.colorbar ='yes'; cfg.interplimits='electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imagesc Subject 8.fig Type: application/x-xfig Size: 40249 bytes Desc: Imagesc Subject 8.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Subject 8 Topographical map.fig Type: application/x-xfig Size: 450612 bytes Desc: Subject 8 Topographical map.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tutorial topographic map.png Type: image/png Size: 10419 bytes Desc: tutorial topographic map.png URL: From jan.schoffelen at donders.ru.nl Tue Sep 19 07:47:49 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 05:47:49 +0000 Subject: [FieldTrip] Question about MVPA topographic map In-Reply-To: References: <1504785200819.38370@kent.ac.uk> Message-ID: Hi Diane, First of all, I would recommend to share figures not as a matlab-figure, but as a screenshot bitmap or so. This saves people who are reading your mail a lot of overhead if they want to look at it, because they don’t need to start a matlab session etc. Your topographical image looks ‘different’ from the one on the wiki because the distribution of your electrodes is more around the whole ‘rim’ of the head. The colored plane that shows up within the circle is the consequence of a spatial interpolation (in 2D) of the data points represented at the locations of the electrodes. For this reason also, there’s no need to be very explicit about the meaning of the x and y axes: they represent space. Best wishes and good luck, Jan-Mathijs On 19 Sep 2017, at 06:25, D.Abdallah > wrote: Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref ='yes'; cfg.channel = {'Cz','PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'}; cfg.refchannel ='Cz'; cfg.demean ='yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype ='?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype ='STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref ='no'; FaceTrials.keeptrials ='yes';% classifiers operate on individual trials FaceTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref ='no'; VaseTrials.keeptrials ='yes';% classifiers operate on individual trials VaseTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout ='biosemi64.lay'; cfg.method ='crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy''binomial''contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter ='mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments =''; cfg.colorbar ='yes'; cfg.interplimits='electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah _______________________________________________ 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 Tue Sep 19 08:02:53 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 06:02:53 +0000 Subject: [FieldTrip] Using ft_redefinetrial with minlength and begsample/endsample option In-Reply-To: References: Message-ID: <6728EEE0-D0EF-4A9D-AAEA-50A61E765FC9@donders.ru.nl> Dear Nir Ofir, Thanks for reporting this. It seems that you have also identified a possible solution, which would be to do the ‘too short trial removal’, only after the realignment of the time axis of the trials. I think the best way to proceed would be that you try to implement this fix in your own local version of the FieldTrip git repository, and initiate a pull request once you are sure it works well. We will then review the suggested fix, and merge it into Fieldtrip’s code base, so that everyone can benefit from your efforts. Best wishes, Jan-Mathijs > On 14 Sep 2017, at 14:10, Nir Ofir wrote: > > Hi fieldtrip users, > > I have a data structure containing MEG trials which are aligned to stimulus onset. I now want to realign them to the target onset, as well as removing trials which are too short. I thought the easiest way to do this would be to use ft_redefinetrial in the following way: > > offset = dat.trialinfo(:,5); % this column contains the duration of the stimulus-target intervel > cfg = []; > cfg.minlength = -dat.time{1}(1)+cfgx.pretarget+0.5; % prestim defined by dat sructure + 0.5 s ERF + cfgx.pretarget > cfg.begsample = round((offset - cfgx.pretarget)*1000); > cfg.endample = round(offset*1000); > dat = ft_redefinetrial(cfg, dat); > > When I run this, I get the following error: > > Index exceeds matrix dimensions. > > Error in ft_redefinetrial (line 209) > data.trial{i} = data.trial{i}(:, begsample(i):endsample(i)); > > So I looked into ft_redefinetrials a bit, and it seems like when minlength is defined, the trials themselves are removed, but the begample/endsample vector are not cut to contain only the relevant trials. For now I moved to a 2-step solution (first removing trials, than realigning), but it seems like this could have a relatively simple fix. Suggestions? > > Thanks! > Nir Ofir > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From isac.sehlstedt at psy.gu.se Tue Sep 19 08:07:41 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Tue, 19 Sep 2017 06:07:41 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis Message-ID: Dear fieldtripers, I have conducted a EEG experiement and am currently in a wedge. The PCA-function used in matlab ( i.e. pca() ) gives me the latent and coeff values that I want to use for further analysis. Sadly, I have cannot figure out how to perform a group level analysis using the matlab function and later "unmix" the group analysis to the subject level. The a group analysis ft_componentanalysis function is easier to "unmix" thanks to its description of how to do so. However, I have not found a way to extract the latent and coefficient variables from the variables included in the comp-structure. My question is: Can you extract the latent and coefficient variables from the ft_componentanalysis results? Alternatively: Is it possible to extract the subject level latent and coefficient variables using the matlab function pca() ? Very best, Isac -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Sep 19 08:57:52 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 06:57:52 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: <3197AF78-5B87-4F7C-A587-FFD8E8FF2071@donders.ru.nl> Hi Isac, My question is: Can you extract the latent and coefficient variables from the ft_componentanalysis results? I’d say that the ‘latent variables’ are in the comp.trial field, and the coefficients are in comp.topo Alternatively: Is it possible to extract the subject level latent and coefficient variables using the matlab function pca() ? I don’t know. Best wishes, Jan-Mathijs Very best, Isac _______________________________________________ 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 jean-michel.badier at univ-amu.fr Tue Sep 19 15:52:53 2017 From: jean-michel.badier at univ-amu.fr (Jean-Michel Badier) Date: Tue, 19 Sep 2017 15:52:53 +0200 Subject: [FieldTrip] Open positions at INS, Marseille. France Message-ID: /Post-doctoral position in the Theoretical Neuroscience Group - INS, Marseille, France/ *Summary* The Theoretical Neuroscience Group (Head: Viktor Jirsa) is seeking to fill a post-doctoral position in the context of the project EPINOV to work on statistical & dynamical modeling of seizure propagation using personalized brain modeling and neuroinformatics approaches on a cohort of hundreds of epilepsy patients. EPINOV is one of 10 large-scale projects selected in the 3rd round of French scientific excellence program «RHU» managed by the National Research Agency (ANR). The aim of the EPINOV project is to significantly improve presurgical interpretation, guide surgical strategies and translate computational tools into clinical routine of personalized medicine. We use individual MRI scans to reconstruct brain anatomy and connectivity, which are combined with a neural mass model and fit using the Bayesian modeling software Stan to individuals’ intracranial electrophysiology data (stereotactic EEG), validated by clinical data from other modalities, such as MEG, fMRI, and semiology. *Responsibilities* • Scale up statistical models “vertically” to handle more data and higher resolution anatomy, using model comparison techniques to evaluate the advantage of different model structures • Scale out models “horizontally”, performing coherent, reliable inference across a large cohort of patients using dedicated, on-site HPC resources • Develop routines to evaluate and visualize inference results, making them amenable to clinical interpretation • Integrate developed code into existing code bases and pipelines *Qualification * • Highly motivated to work on an interdisciplinary project and collaborate with the various members of the consortium. • PhD degree in computational neuroscience, mathematical or statistical modeling, machine learning or equivalent level of knowledge. • Significant, demonstrable experience in data fitting (Bayesian modeling, Dynamical Causal Modeling (DCM), Monte Carlo, etc) will be highly appreciated. • Experience with working in a Linux/HPC environment • Programming in a numerically oriented language (R, Python, MATLAB) • Familiarity with Git, unit testing, Docker/VMs is a plus *The Theoretical Neuroscience group * We are a multi-national team interested in understanding the mechanisms underlying the spatiotemporal organization of large-scale brain networks. Our work comprises mathematical and computational modeling of large-scale network dynamics and human brain imaging data, the development of neuroinformatics tools for studying large-scale brain networks applied to concrete functions, dysfunctions (epilepsy, dementia) and aging. *Terms of salary and employment * A 12-month renewable contract will be established. Salary will depend on the diploma and experience. Operating language in the laboratory is English. Applications including a cover letter, curriculum vitae and the names of two referees should be sent by September 30th 2017 to: Dr. Irene Yujnovsky at irene.yujnovsky at univ-amu.fr More information about the INS and the Theoretical Neurosciences Group can be found at: http://ins.univ-amu.fr *Clinical data manager for national consortium on epilepsy surgery - **Aix-Marseille Université * *Marseille, FRANCE* ** ** A position for an experienced clinical data manager is open to create and maintain an epileptic patient database including registration, normalization and security issues and to ensure the communication with the key partners in the academic, clinical and industry sectors with the aim of generating individual Virtual Patient models using The Virtual Brain (TVB) platform as framework (see http://www.thevirtualbrain.org).//This database will be generated in the context of the EPINOV (/Improving EPilepsy surgery management and progNOsis using Virtual brain technology) /projectled by Professor Fabrice Bartolomei (http://fr.ap-hm.fr/service/neurophysiologie-clinique-hopital-timone) funded by the RHU programme. *Qualification* ** Candidates must be highly motivated to work on an interdisciplinary project and collaborate with the various members of the consortium. They should have a degree in biomedical engineering, medical informatics or equivalent level of knowledge. Candidates must possess a solid experience in management of clinical and/or research data and programming (C, MATLAB, Python). Experience with neuroimaging data (stereotactic EEG, MRI, DTI, MEG, EEG), clinical trials, neuroinformatics and its standard formats (for instance DICOM, XNAT, BIDS), machine learning and Big Data would be considered an advantage. *The EPINOV project and consortium * We are a national consortium composed of clinicians, researchers and industrial partners interested in improving epilepsy surgical prognosis using large–scale brain modelling based on individual epileptic patient data. A prospective, randomized multicenter trial will be conducted with subjects suffering from drug-resistant epilepsy. The clinical trial will systematically evaluate the added value of personalized brain modelling in the surgical decision making. *Terms of salary and employment* Salary will depend on the diploma and previous experience. Operating languages in the consortium are both French and English. Applications including a cover letter, curriculum vitae and the names of two referees should be sent by October 31st 2017 to: *Dr. Irene Yujnovsky* at irene.yujnovsky at univ-amu.fr -- Jean michel Badier /- UMR S 1106 Institut de Neurosciences des Systèmes/ Aix-Marseille Université - Laboratoire MEG - TIMONE - 27 Boulevard Jean Moulin - 13005 Marseille Tél: +33(0)4 91 38 55 62 - Fax : +33(0)4 91 78 99 14 Site : http://www.univ-amu.fr - Email : jean-michel.badier at univ-amu.fr /Afin de respecter l'environnement, merci de n'imprimer cet email que si nécessaire./ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_amu.jpg Type: image/jpeg Size: 17847 bytes Desc: not available URL: From johnnguyen.education at gmail.com Tue Sep 19 18:41:34 2017 From: johnnguyen.education at gmail.com (John Nguyen) Date: Tue, 19 Sep 2017 12:41:34 -0400 Subject: [FieldTrip] Source analysis and sensor space differences Message-ID: Hi All, My Name is John Nguyen and I am working at the Reinhart Cognitive Neuroscience Lab at Boston University. I have been using Fieldtrip (Version 4/10/17)​​ for several months now and have decided to tackle SourceAnalysis. After a few weeks of struggling with it, I find myself still far from the goal post. A milestone I'm trying to achieve is plotting activity in the visual cortex due to a visual stimulus onset. This activity is easily reflected in my sensor-level plots but, in the source-level, it's projection is more than a bit wonky [image link, Negative sensor potential ,1.09-1.23s, following visual stimulus followed by positive sensor potential at 1.22-1.48s neither of which are present in source space.] [https://drive.google.com/file/d/0B2UdTHvTeS9NNWV6dGJKZ2JWbk0/ view?usp=sharing] In my current code I am using Fieldtrip templates to minimize error on my end as much as possible. "elec = ft_read_sens('standard_1020.elc'); load('standard_bem.mat','vol') load('standard_sourcemodel3d8mm.mat','sourcemodel') mri = ft_read_mri('single_subj_T1_1mm.nii');" My Sourceanalysis is timelocked LCMV with a relative baseline change at times -0.2 to 0.0s. I also preformed a relative baseline change on my sensor-level data because I was wondering if the disparity was a baseline issue. I've reached a dead-end and would appreciate any help. I've attached links to my script [https://drive.google.com/file/d/0B2UdTHvTeS9NT05uWUk4T0hDUjQ/ view?usp=sharing] and data (no rereference, no artifact reject) [https://drive.google.com/file/d/0B2UdTHvTeS9NSl8yaW9fcXZWSjQ/ view?usp=sharing] and sensor cap layout. [https://drive.google.com/file/d/0B2UdTHvTeS9NSGJXZUszOHBUbGM/ view?usp=sharing] Best regards, John Nguyen -------------- next part -------------- An HTML attachment was scrubbed... URL: From isac.sehlstedt at psy.gu.se Wed Sep 20 09:15:56 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Wed, 20 Sep 2017 07:15:56 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis Message-ID: Dear fieldtripers, This is a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (which are also attached) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see Unknown.tiff, or Unknown-1.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see Unknown.tiff-2) . Why am I not getting that in ft? Is it possible to get that using ft? Very Best, Isac ----------------- The code ----------------- clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end ----------------- The variables/results ----------------- [X] [X] [X] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown.tiff Type: image/tiff Size: 987824 bytes Desc: Unknown.tiff URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown-1.tiff Type: image/tiff Size: 1158488 bytes Desc: Unknown-1.tiff URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown-2.tiff Type: image/tiff Size: 293336 bytes Desc: Unknown-2.tiff URL: From litvak.vladimir at gmail.com Wed Sep 20 12:56:01 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 20 Sep 2017 11:56:01 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol Message-ID: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad0_5.png Type: image/png Size: 4854 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad1.png Type: image/png Size: 5013 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad10.png Type: image/png Size: 4663 bytes Desc: not available URL: From r.oostenveld at donders.ru.nl Wed Sep 20 16:26:37 2017 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 20 Sep 2017 16:26:37 +0200 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: Message-ID: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert > On 20 Sep 2017, at 12:56, Vladimir Litvak wrote: > > Dear Fieldtrippers, > > I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. > > Is this a bug or a feature? > > Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. > > Thanks, > > Vladimir > > > ------------------------------------- > > pad = 0.5;%1%10 > > > freqoi = 5:45; > timwin = 0.4+0*freqoi; > > [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... > 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); > > figure; > subplot(2,1,1) > plot(freqoi, s1); > subplot(2,1,2); > plot(freqoi, s1-s1(1)); > %% > [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... > 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); > > subplot(2,1,1) > hold on > plot(freqoi, s2, 'r'); > subplot(2,1,2) > hold on > plot(freqoi, s2-s2(1), 'r'); > _______________________________________________ > 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 stephen.whitmarsh at gmail.com Wed Sep 20 17:03:52 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 20 Sep 2017 17:03:52 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization Message-ID: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Wed Sep 20 20:00:47 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Wed, 20 Sep 2017 18:00:47 +0000 (UTC) Subject: [FieldTrip] Splitting EEG References: <1779089334.6211483.1505930447659.ref@mail.yahoo.com> Message-ID: <1779089334.6211483.1505930447659@mail.yahoo.com> Hello Fieldtrip users, I have a continues EEG data ( 80 seconds) and I would like to analyze some part of it.For instance, I want to analyse seconds 20 to 25 ( 5 seconds).Would you please let me know how can I select my times of interest.I've written a simple code but I don't know how can I split the data.  cfg    = []; cfg.dataset = '........  .eeg'; data_org                = ft_preprocessing(cfg); %Original Data % Step1:  Filtering Row Data cfg                        = []; cfg.bpfilter            = 'yes'; cfg.bpfreq             = [1 30]; data_Filtered        = ft_preprocessing(cfg,data_org); -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Wed Sep 20 22:22:51 2017 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Wed, 20 Sep 2017 20:22:51 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: Message-ID: <0A0286C7-606F-4B30-B8F4-6689EAAD9620@cfin.au.dk> Hi Stephen, We have a pipeline that can use either SPM8 or SPM12 to perform both segmentation and normalization, though perhaps in a way that’s different from the official FieldTrip tutorials. Have a look at: https://github.com/meeg-cfin/nemolab/blob/master/basics/nemo_mriproc.m ft_volumesegment should use whichever SPM is in your path (be careful about fieldtrip/external/spm8!), and (according to my memory) SPM12 sometimes can succeed where SPM8 doesn’t provide good segmentations. Note that for the normalization in SPM12, our script defines “/OldNorm/T1.nii” as the template, which indeed seems to give results equivalent to SPM8. I think you could change this to SPM12’s default template if you prefer. NB: we use MRI coordinates as the base coordinate system in our pipelines, so MEG/EEG is transformed to MRI, rather than MRI to MEG/EEG. Cheers, Sarang On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 cornelia.quaedflieg at uni-hamburg.de Wed Sep 20 22:51:57 2017 From: cornelia.quaedflieg at uni-hamburg.de (Conny Quaedflieg) Date: Wed, 20 Sep 2017 22:51:57 +0200 Subject: [FieldTrip] Splitting EEG In-Reply-To: <1779089334.6211483.1505930447659@mail.yahoo.com> References: <1779089334.6211483.1505930447659.ref@mail.yahoo.com> <1779089334.6211483.1505930447659@mail.yahoo.com> Message-ID: <20170920205155.9C930B5309@mailhost.uni-hamburg.de> Dear Hamed, You can use ft_select data with cfg.latency See http://www.fieldtriptoolbox.org/reference/ft_selectdata best Conny Van: Hamed Taheri Verzonden: woensdag 20 september 2017 20:12 Aan: fieldtrip at science.ru.nl Onderwerp: [FieldTrip] Splitting EEG Hello Fieldtrip users, I have a continues EEG data ( 80 seconds) and I would like to analyze some part of it. For instance, I want to analyse seconds 20 to 25 ( 5 seconds). Would you please let me know how can I select my times of interest. I've written a simple code but I don't know how can I split the data.  cfg    = []; cfg.dataset = '........  .eeg'; data_org                = ft_preprocessing(cfg); %Original Data % Step1:  Filtering Row Data cfg                        = []; cfg.bpfilter            = 'yes'; cfg.bpfreq             = [1 30]; data_Filtered        = ft_preprocessing(cfg,data_org); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 21 09:09:06 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 07:09:06 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: Message-ID: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Hi Stephen, Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). Best, Jan-Mathijs On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 litvak.vladimir at gmail.com Thu Sep 21 11:17:11 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 10:17:11 +0100 Subject: [FieldTrip] MEG technician post at UCL Message-ID: *Senior MEG Research Technician* Applications are invited for a Senior Research Technician in the Wellcome Centre for Human Neuroimaging, UCL Institute of Neurology. The Centre houses an Electroencephalography (EEG) system, two Magnetoencephalography (MEG) systems - a CTF 275 channel Omega System and an Optically Pumped Magnetometer (OPM) System - and Magnetic Resonance Imaging (MRI) facilities - two 3T Siemens Prisma scanners and a 3T Siemens Trio. The successful candidate will be responsible for coordinating and maintaining an efficient MEG and EEG service for a range of different research projects. This role will be constantly evolving as new and alternative technologies are incorporated into the functional imaging department. *Applicants are required to have:* · Experience of EEG/MEG or similar electrophysiological recording methods (e.g. cardiology/audiology) within a clinical or research environment. · A commitment to academic research. · MEG experience is not essential as training will be provided. *Salary - UCL Grade 7:* £34,653 to £41,864 inclusive of London Allowance. The post is available immediately and is funded until Nov 2021 in the first instance. Applications through UCL's online recruitment – www.ucl.ac.uk/hr/jobs where you can download a job description and person specification using ref: 1671016. Informal enquiries to Elaine Williams: elaine.williams at ucl.ac.uk . If you have any queries regarding the application process, please contact Samantha Robinson, HR Officer, Institute of Neurology, 23 Queen Square, London, WC1N 3BG (email: ion.hradmin at ucl.ac.uk). *Closing date: 26th September 2017* *Taking Action for Equality* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 21 11:53:05 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 09:53:05 +0000 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> Message-ID: <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Hi to all who’s reading along, Perhaps the two cases will become more similar once the ‘timwin’ is increased in length for the mtmconvol case…. Best wishes, JM On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); _______________________________________________ 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 litvak.vladimir at gmail.com Thu Sep 21 12:29:12 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 11:29:12 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Yes, you are right about Robert's example. But if you do: pad = 10; fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning', 'pad', pad); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); You will see the problem that I'm talking about. We discussed with Robert yesterday and this is indeed 'a feature' which has to do with the fact that the outputs of mtmfft and mtmconvol have different units. The former is spectral density whereas the latter is spectral power. Here is what Robert wrote me: the units of computations (also here) are a known and long-standing issue. I know for a long time that the two have different scaling, but did not think about it for a long time. I recall something like this: To compare TFRs over frequencies, you don't want the bandwidth to affect the estimate. Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral resolution over which the signal(and noise) spreads is different. If you were to compute the TFR in V^2/Hz, the same V at 20Hz would have a different value, because the length of the wavelet affects the 1/Hz. something related (but nevertheless different) applies to the mtmfft: if you want to estimate broadband activity in a window of 1 second or a window of 2 seconds, you would get different spectral resolutions. The nyquist is the same, but the power gets distributed over more bins between 0 and Fnyquist/2. That would cause the values to appear smaller in the 2-s case. Hence we compute spectral density, which somehow normalizes for this. I never found a really clear explanation, but google got me this https://dsp.stackexchange.com/questions/33957/what-is-the-difference-between-the-psd-and-the-power-spectrum what confuses me is that power (or variance) is already normalized, i.e. sum of squared values divided by N. So we have energy (which increases with length), power (which does not increase with length), and power density So one issue is that most people don't know about this including me and possibly you. I think a good solution would be to add an option to specify the output units for all the methods as there might be quite subtle considerations for choosing one over the other as Robert suggests. Vladimir On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi to all who’s reading along, > > Perhaps the two cases will become more similar once the ‘timwin’ is > increased in length for the mtmconvol case…. > > Best wishes, > > JM > > On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: > > Hi Vladimir, > > I suggest that you first start with a simpler case, like this > > fsample = 1000; > time = (1:1000)/fsample; > dat = randn(size(time)); > > [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', > 'hanning'); > > power1 = abs(spectrum1).^2; > power1 = squeeze(power1); > > [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, > 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); > > power2 = abs(spectrum2).^2; > power2 = squeeze(power2); > > figure > plot(freqoi1, power1); > hold on > plot(freqoi2, power2, 'r'); > > Note that these are not the same (albeit similar), which I had expected… > > best > Robert > > > > On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: > > Dear Fieldtrippers, > > I'm looking into an issue of one of SPM users who gets different results > when doing TF decomposition compared to computing a spectrum for the same > time window. I'm not sure I got to the bottom of it yet but one thing I > found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected > differently by increasing padding. For short padding the results are > similar but with increasing padding there are differences both in offset of > the spectrum and its overall shape. See attached images where the top one > shows original spectra and the bottom one aligns the lowermost bin to zero. > > Is this a bug or a feature? > > Below is the script that produces these plots. I could provide the data as > well but this could probably be reproduced with any data. > > Thanks, > > Vladimir > > > ------------------------------------- > > pad = 0.5;%1%10 > > > freqoi = 5:45; > timwin = 0.4+0*freqoi; > > [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, > 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... > 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); > > figure; > subplot(2,1,1) > plot(freqoi, s1); > subplot(2,1,2); > plot(freqoi, s1-s1(1)); > %% > [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', > 'hanning', 'freqoi', freqoi,... > 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); > > subplot(2,1,1) > hold on > plot(freqoi, s2, 'r'); > subplot(2,1,2) > hold on > plot(freqoi, s2-s2(1), 'r'); > __________________________ > _____________________ > 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 litvak.vladimir at gmail.com Thu Sep 21 12:34:23 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 11:34:23 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: Another thing that I noticed is that in the mtmconvol case padding is added to the entire trial, not to the short window over which FFT is actually computed. This might be because you actually use a wavelet which moves along the data (I didn't check that). Anyhow right now this doesn't make much difference because padding doesn't affect mtmconvol in such a dramatic way as mtmfft. However, if you do allow specifying the units as power rather than density then the way things are now mtmconvol and mtmfft with the same padding would not be equivalent. Vladimir On Thu, Sep 21, 2017 at 11:29 AM, Vladimir Litvak wrote: > Hi Jan-Mathijs, > > Yes, you are right about Robert's example. But if you do: > > pad = 10; > > fsample = 1000; > time = (1:1000)/fsample; > dat = randn(size(time)); > > [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', > 'hanning', 'pad', pad); > > power1 = abs(spectrum1).^2; > power1 = squeeze(power1); > > [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, > 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); > > power2 = abs(spectrum2).^2; > power2 = squeeze(power2); > > figure > plot(freqoi1, power1); > hold on > plot(freqoi2, power2, 'r'); > > > You will see the problem that I'm talking about. We discussed with Robert > yesterday and this is indeed 'a feature' which has to do with the fact that > the outputs of mtmfft and mtmconvol have different units. The former is > spectral density whereas the latter is spectral power. > > Here is what Robert wrote me: > > > the units of computations (also here) are a known and long-standing issue. > I know for a long time that the two have different scaling, but did not > think about it for a long time. I recall something like this: To compare > TFRs over frequencies, you don't want the bandwidth to affect the estimate. > Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect > those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with > conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral > resolution over which the signal(and noise) spreads is different. If you > were to compute the TFR in V^2/Hz, the same V at 20Hz would have a > different value, because the length of the wavelet affects the 1/Hz. > something related (but nevertheless different) applies to the mtmfft: if > you want to estimate broadband activity in a window of 1 second or a window > of 2 seconds, you would get different spectral resolutions. The nyquist is > the same, but the power gets distributed over more bins between 0 and > Fnyquist/2. That would cause the values to appear smaller in the 2-s case. > Hence we compute spectral density, which somehow normalizes for this. I > never found a really clear explanation, but google got me this > https://dsp.stackexchange.com/questions/33957/what-is-the- > difference-between-the-psd-and-the-power-spectrum > what confuses me is that power (or variance) is already normalized, i.e. > sum of squared values divided by N. So we have energy (which increases with > length), power (which does not increase with length), and power density > > > So one issue is that most people don't know about this including me and > possibly you. I think a good solution would be to add an option to specify > the output units for all the methods as there might be quite subtle > considerations for choosing one over the other as Robert suggests. > > Vladimir > > On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi to all who’s reading along, >> >> Perhaps the two cases will become more similar once the ‘timwin’ is >> increased in length for the mtmconvol case…. >> >> Best wishes, >> >> JM >> >> On 20 Sep 2017, at 16:26, Robert Oostenveld >> wrote: >> >> Hi Vladimir, >> >> I suggest that you first start with a simpler case, like this >> >> fsample = 1000; >> time = (1:1000)/fsample; >> dat = randn(size(time)); >> >> [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', >> 'hanning'); >> >> power1 = abs(spectrum1).^2; >> power1 = squeeze(power1); >> >> [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, >> 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); >> >> power2 = abs(spectrum2).^2; >> power2 = squeeze(power2); >> >> figure >> plot(freqoi1, power1); >> hold on >> plot(freqoi2, power2, 'r'); >> >> Note that these are not the same (albeit similar), which I had expected… >> >> best >> Robert >> >> >> >> On 20 Sep 2017, at 12:56, Vladimir Litvak >> wrote: >> >> Dear Fieldtrippers, >> >> I'm looking into an issue of one of SPM users who gets different results >> when doing TF decomposition compared to computing a spectrum for the same >> time window. I'm not sure I got to the bottom of it yet but one thing I >> found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected >> differently by increasing padding. For short padding the results are >> similar but with increasing padding there are differences both in offset of >> the spectrum and its overall shape. See attached images where the top one >> shows original spectra and the bottom one aligns the lowermost bin to zero. >> >> Is this a bug or a feature? >> >> Below is the script that produces these plots. I could provide the data >> as well but this could probably be reproduced with any data. >> >> Thanks, >> >> Vladimir >> >> >> ------------------------------------- >> >> pad = 0.5;%1%10 >> >> >> freqoi = 5:45; >> timwin = 0.4+0*freqoi; >> >> [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, >> 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... >> 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); >> >> s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); >> >> figure; >> subplot(2,1,1) >> plot(freqoi, s1); >> subplot(2,1,2); >> plot(freqoi, s1-s1(1)); >> %% >> [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', >> 'hanning', 'freqoi', freqoi,... >> 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); >> >> s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); >> >> subplot(2,1,1) >> hold on >> plot(freqoi, s2, 'r'); >> subplot(2,1,2) >> hold on >> plot(freqoi, s2-s2(1), 'r'); >> ___________________________ >> ____________________ >> 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 jan.schoffelen at donders.ru.nl Thu Sep 21 12:36:30 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 10:36:30 +0000 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: <612489C6-6EFD-4D56-A9FC-189A180CC961@donders.ru.nl> Don’t worry Vladimir, Robert and I have discussed these issues at length on several occasions in the past ;) Best wishes, JM On 21 Sep 2017, at 12:29, Vladimir Litvak > wrote: Hi Jan-Mathijs, Yes, you are right about Robert's example. But if you do: pad = 10; fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning', 'pad', pad); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); You will see the problem that I'm talking about. We discussed with Robert yesterday and this is indeed 'a feature' which has to do with the fact that the outputs of mtmfft and mtmconvol have different units. The former is spectral density whereas the latter is spectral power. Here is what Robert wrote me: the units of computations (also here) are a known and long-standing issue. I know for a long time that the two have different scaling, but did not think about it for a long time. I recall something like this: To compare TFRs over frequencies, you don't want the bandwidth to affect the estimate. Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral resolution over which the signal(and noise) spreads is different. If you were to compute the TFR in V^2/Hz, the same V at 20Hz would have a different value, because the length of the wavelet affects the 1/Hz. something related (but nevertheless different) applies to the mtmfft: if you want to estimate broadband activity in a window of 1 second or a window of 2 seconds, you would get different spectral resolutions. The nyquist is the same, but the power gets distributed over more bins between 0 and Fnyquist/2. That would cause the values to appear smaller in the 2-s case. Hence we compute spectral density, which somehow normalizes for this. I never found a really clear explanation, but google got me this https://dsp.stackexchange.com/questions/33957/what-is-the-difference-between-the-psd-and-the-power-spectrum what confuses me is that power (or variance) is already normalized, i.e. sum of squared values divided by N. So we have energy (which increases with length), power (which does not increase with length), and power density So one issue is that most people don't know about this including me and possibly you. I think a good solution would be to add an option to specify the output units for all the methods as there might be quite subtle considerations for choosing one over the other as Robert suggests. Vladimir On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi to all who’s reading along, Perhaps the two cases will become more similar once the ‘timwin’ is increased in length for the mtmconvol case…. Best wishes, JM On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); _______________________________________________ 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 stephen.whitmarsh at gmail.com Thu Sep 21 14:36:43 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 14:36:43 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Dear Sarang and Jan-Mathijs, Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. Best wishes and thanks again! Stephen On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Stephen, > > Please note that FT now has full support for SPM12, both using the > old-style segmentation, and the new one (the latter yielding 6 tissue > types). > > Best, > Jan-Mathijs > > On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: > > Dear all, > > I having some problems in normalizing MRIs for my study. Some have > improper segmentation for which changing individual brain/scalp thresholds > works in many cases but not all, e.g. when the scalp 'bleeds' into some > noise outside of the head. Also, changing parameters in spm8 for > normalization, such as number of iterations (directly in in spm_normalize, > since FT does not pass these parameters) improves the transformation. > > However, some scans I cannot deal with, either because they have noise > from outsides of the head 'bleed' onto the scalp, thereby preventing > optimal scalp-segmentation and thereby normalization. Others have an > inappropriate contrast MRI sequence. > > Some fMRI researchers advised me to use SPM12, because of its improved > preprocessing procedures. However, it does not seem supported in FT yet. > Does anyone have experience with this, and can perhaps share how they > extracted the transformation matrix from the resulting nifti's? > > Thanks, > Stephen > _______________________________________________ > 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 hgould at memphis.edu Thu Sep 21 15:56:38 2017 From: hgould at memphis.edu (Herbert J Gould (hgould)) Date: Thu, 21 Sep 2017 13:56:38 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl>, Message-ID: I have retired please remove me from the mail list Herbert Jay Gould Professor Emeritus The University of Memphis Sent from my Verizon Wireless 4G LTE smartphone -------- Original message -------- From: Stephen Whitmarsh Date:09/21/2017 7:43 AM (GMT-06:00) To: FieldTrip discussion list Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) normalization Dear Sarang and Jan-Mathijs, Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. Best wishes and thanks again! Stephen On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Stephen, Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). Best, Jan-Mathijs On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 a.stolk8 at gmail.com Thu Sep 21 17:00:20 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 21 Sep 2017 08:00:20 -0700 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hey Stephen, Look for discussions regarding spm12 and also dartel on bugzilla. It's been a while but as far as I can remember ft_volumenormalize is the only function now that has not been integrated. Reason being that it wasnt straightforward to house the dartel procedure under a single function, so this is ongoing work still. You can however use spm12's coregistration function with ft_volumerealign (for rigid body transformations), which Im using quite a bit and never let me down (and is much faster than before). But that wouldnt work for normalization to template space though (use spm8). Best > On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) wrote: > > I have retired please remove me from the mail list > > Herbert Jay Gould > Professor Emeritus > The University of Memphis > > > > Sent from my Verizon Wireless 4G LTE smartphone > > > -------- Original message -------- > From: Stephen Whitmarsh > Date:09/21/2017 7:43 AM (GMT-06:00) > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) normalization > > Dear Sarang and Jan-Mathijs, > > Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. > > Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. > > In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. > > Best wishes and thanks again! > Stephen > > > >> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Stephen, >> >> Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). >> >> Best, >> Jan-Mathijs >> >>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh wrote: >>> >>> Dear all, >>> >>> I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. >>> >>> However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. >>> >>> Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? >>> >>> Thanks, >>> Stephen >>> _______________________________________________ >>> 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 zhangwenjia2732 at 126.com Thu Sep 21 17:30:13 2017 From: zhangwenjia2732 at 126.com (=?GBK?B?1cXOxLzO?=) Date: Thu, 21 Sep 2017 23:30:13 +0800 (CST) Subject: [FieldTrip] Reading data too slow Message-ID: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> Dear all, I have some problems in reading data into fieldtrip. Specifically, I used EGI system to record EEG data and preprocessed them with Brainvison analyzer Then, I exported the preprocessed data into generic data format, making 3 files: .eeg, .vhdr and vmrk. Last, I used ft_definetrial and ft_preprocessing to read these data into FieldTrip. However, the reading is very very slow. I tried to make only 2 channels left and tried methods as follow: http://www.fieldtriptoolbox.org/faq/reading_is_slow_can_i_write_my_raw_data_to_a_more_efficient_file_format But, they all did not work. Does anyone know what I am doing wrong? Any advice very appreciated. Thank you -- Wenjia NYU Shanghai -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Thu Sep 21 17:52:31 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 17:52:31 +0200 Subject: [FieldTrip] Reading data too slow In-Reply-To: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> References: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> Message-ID: Hi Wenjia, It's impossible to give specific advice with no extra information. How slow? Is the data read at all? Any error messages? What script are you exactly running and what is the output? See: http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community I would also check your computer resources (CPU and memory) during loading to see if you are running into a memory/CPU problem specific for your system. Finally, I would start with no filters. They sometimes take a while. Cheers, Stephen On 21 September 2017 at 17:30, 张文嘉 wrote: > > > Dear all, > > I have some problems in reading data into fieldtrip. > Specifically, I used EGI system to record EEG data and preprocessed them > with Brainvison analyzer > Then, I exported the preprocessed data into generic data format, making 3 > files: .eeg, .vhdr and vmrk. > Last, I used ft_definetrial and ft_preprocessing to read these data into > FieldTrip. > However, the reading is very very slow. > > I tried to make only 2 channels left and tried methods as follow: > http://www.fieldtriptoolbox.org/faq/reading_is_slow_can_i_ > write_my_raw_data_to_a_more_efficient_file_format > But, they all did not work. > > Does anyone know what I am doing wrong? Any advice very appreciated. > Thank you > > -- > Wenjia > NYU Shanghai > > > > > _______________________________________________ > 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 stephen.whitmarsh at gmail.com Thu Sep 21 18:20:47 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 18:20:47 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Thanks, and good to hear you've not been let down yet. It might be the fact that I have some bad quality MRIs to deal with. However... does this problem (see attached) ring a bell for anyone?: Brain segmentation is proper, and co-registration with polhemus head-shape as well, but inverse warp to MNI result in a tilted grid. Linear vs. non-linear transformation gives the same result. Other subjects going through the same procedure work fine, except two others wherein I identified it as a problem in segmenting the scalp and therefor the first step of the normalization. This one looks absolutely fine in every other regard, however. I'm stumped... cfg = []; cfg.spmversion = 'spm12'; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri_realigned; cfg.grid.unit = 'mm'; subject_grid = ft_prepare_sourcemodel(cfg); Cheers, Stephen On 21 September 2017 at 17:00, Arjen Stolk wrote: > Hey Stephen, > > Look for discussions regarding spm12 and also dartel on bugzilla. It's > been a while but as far as I can remember ft_volumenormalize is the only > function now that has not been integrated. Reason being that it wasnt > straightforward to house the dartel procedure under a single function, so > this is ongoing work still. You can however use spm12's coregistration > function with ft_volumerealign (for rigid body transformations), which Im > using quite a bit and never let me down (and is much faster than before). > But that wouldnt work for normalization to template space though (use spm8). > > Best > > On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) > wrote: > > I have retired please remove me from the mail list > > Herbert Jay Gould > Professor Emeritus > The University of Memphis > > > > Sent from my Verizon Wireless 4G LTE smartphone > > > -------- Original message -------- > From: Stephen Whitmarsh > Date:09/21/2017 7:43 AM (GMT-06:00) > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) > normalization > > Dear Sarang and Jan-Mathijs, > > Thanks a lot. I am now able (after updating FT, which now includes SPM12 > in /external), to use SPM12 for segmentation of my template and my subject > MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big > improvement over 8 when it comes to brain-segmentation, which now does not > require individual treatments anymore. It also outputs more compartments > which gives me a little bit more to work with when dealing with scans that > have bad delineation of the scalp for normalization. > > Pleas note that defaults seems to differ - some FT functions default to > spm8, others to spm12. > > In fact, FT still reverts to spm8 in ft_volumenormalise when called in > ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = > 'spm12'. In other words the cfg.spmversion is not passed along. > > Best wishes and thanks again! > Stephen > > > > On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Stephen, >> >> Please note that FT now has full support for SPM12, both using the >> old-style segmentation, and the new one (the latter yielding 6 tissue >> types). >> >> Best, >> Jan-Mathijs >> >> On 20 Sep 2017, at 17:03, Stephen Whitmarsh >> wrote: >> >> Dear all, >> >> I having some problems in normalizing MRIs for my study. Some have >> improper segmentation for which changing individual brain/scalp thresholds >> works in many cases but not all, e.g. when the scalp 'bleeds' into some >> noise outside of the head. Also, changing parameters in spm8 for >> normalization, such as number of iterations (directly in in spm_normalize, >> since FT does not pass these parameters) improves the transformation. >> >> However, some scans I cannot deal with, either because they have noise >> from outsides of the head 'bleed' onto the scalp, thereby preventing >> optimal scalp-segmentation and thereby normalization. Others have an >> inappropriate contrast MRI sequence. >> >> Some fMRI researchers advised me to use SPM12, because of its improved >> preprocessing procedures. However, it does not seem supported in FT yet. >> Does anyone have experience with this, and can perhaps share how they >> extracted the transformation matrix from the resulting nifti's? >> >> Thanks, >> Stephen >> _______________________________________________ >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm3.jpg Type: image/jpeg Size: 83068 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm2.jpg Type: image/jpeg Size: 115317 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm1.jpg Type: image/jpeg Size: 54151 bytes Desc: not available URL: From a.stolk8 at gmail.com Thu Sep 21 18:45:46 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 21 Sep 2017 09:45:46 -0700 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: First thought is a registration of brain outline to skull (instead of brain), although at closer inspection the shift seems overall just a bit too large for that. You could try calculating the normalization parameters on skullstripped volumes (unless you want to keep non-brain tissue). On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < stephen.whitmarsh at gmail.com> wrote: > Hi Arjen, > > Thanks, and good to hear you've not been let down yet. It might be the > fact that I have some bad quality MRIs to deal with. However... does this > problem (see attached) ring a bell for anyone?: > > Brain segmentation is proper, and co-registration with polhemus > head-shape as well, but inverse warp to MNI result in a tilted grid. > Linear vs. non-linear transformation gives the same result. Other subjects > going through the same procedure work fine, except two others wherein I > identified it as a problem in segmenting the scalp and therefor the first > step of the normalization. This one looks absolutely fine in every other > regard, however. > > I'm stumped... > > cfg = []; > cfg.spmversion = 'spm12'; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri_realigned; > cfg.grid.unit = 'mm'; > subject_grid = ft_prepare_sourcemodel(cfg); > > Cheers, > Stephen > > > On 21 September 2017 at 17:00, Arjen Stolk wrote: > >> Hey Stephen, >> >> Look for discussions regarding spm12 and also dartel on bugzilla. It's >> been a while but as far as I can remember ft_volumenormalize is the only >> function now that has not been integrated. Reason being that it wasnt >> straightforward to house the dartel procedure under a single function, so >> this is ongoing work still. You can however use spm12's coregistration >> function with ft_volumerealign (for rigid body transformations), which Im >> using quite a bit and never let me down (and is much faster than before). >> But that wouldnt work for normalization to template space though (use spm8). >> >> Best >> >> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) >> wrote: >> >> I have retired please remove me from the mail list >> >> Herbert Jay Gould >> Professor Emeritus >> The University of Memphis >> >> >> >> Sent from my Verizon Wireless 4G LTE smartphone >> >> >> -------- Original message -------- >> From: Stephen Whitmarsh >> Date:09/21/2017 7:43 AM (GMT-06:00) >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >> normalization >> >> Dear Sarang and Jan-Mathijs, >> >> Thanks a lot. I am now able (after updating FT, which now includes SPM12 >> in /external), to use SPM12 for segmentation of my template and my subject >> MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >> improvement over 8 when it comes to brain-segmentation, which now does not >> require individual treatments anymore. It also outputs more compartments >> which gives me a little bit more to work with when dealing with scans that >> have bad delineation of the scalp for normalization. >> >> Pleas note that defaults seems to differ - some FT functions default to >> spm8, others to spm12. >> >> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >> 'spm12'. In other words the cfg.spmversion is not passed along. >> >> Best wishes and thanks again! >> Stephen >> >> >> >> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hi Stephen, >>> >>> Please note that FT now has full support for SPM12, both using the >>> old-style segmentation, and the new one (the latter yielding 6 tissue >>> types). >>> >>> Best, >>> Jan-Mathijs >>> >>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh >>> wrote: >>> >>> Dear all, >>> >>> I having some problems in normalizing MRIs for my study. Some have >>> improper segmentation for which changing individual brain/scalp thresholds >>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>> noise outside of the head. Also, changing parameters in spm8 for >>> normalization, such as number of iterations (directly in in spm_normalize, >>> since FT does not pass these parameters) improves the transformation. >>> >>> However, some scans I cannot deal with, either because they have noise >>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>> optimal scalp-segmentation and thereby normalization. Others have an >>> inappropriate contrast MRI sequence. >>> >>> Some fMRI researchers advised me to use SPM12, because of its improved >>> preprocessing procedures. However, it does not seem supported in FT yet. >>> Does anyone have experience with this, and can perhaps share how they >>> extracted the transformation matrix from the resulting nifti's? >>> >>> Thanks, >>> Stephen >>> _______________________________________________ >>> 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 sarang at cfin.au.dk Thu Sep 21 19:30:25 2017 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Thu, 21 Sep 2017 17:30:25 +0000 Subject: [FieldTrip] Using fixed orientations for men-source estimation In-Reply-To: <71D8A67A81D69A4CB5BE2B979021C26ECAFFE748@esen3.imed.uni-magdeburg.de> References: <71D8A67A81D69A4CB5BE2B979021C26ECAFFE748@esen3.imed.uni-magdeburg.de> Message-ID: <1506015025.9072.22.camel@cfin.au.dk> Hi Christian, I had flagged your email to follow-up later but lost track of it -- it seems you didn't get a response yet, but I hope mine is still useful! The strategy that the 'fixedori' implements for the beamformer variants (and sLORETA) are not based on the anatomical normal, but rather the direction that maximizes the theoretical SNR (adaptively determined from the signal characteristics). This optimal direction is dependent on the particular weight calculation formula for each source localization variant. Therefore, a similar SNR optimization strategy for minimum norm would actually require a different formula than you see used for the others. It's simple enough to implement if you know what that formula is. :-) It is likely to be contained in the book by Sekihara & Nagarajan (2008), if you'd like to have a go at it yourself. That said, min-norm is often (or perhaps usually) performed with the solution space constrained to gray matter voxels, and the orientations defined to be normal to the cortical surface. If you independently have a way to obtain anatomically derived orientations, then you can manually provide them in lf.ori. (Or maybe there is a FieldTrip function that could obtain these normals from the MRI segmentation procedure?) Cheers, Sarang On Tue, 2017-08-01 at 11:11 +0000, christian.merkel at med.ovgu.de wrote: Hello, I am running ft_sourceanalysis and am wondering why I can restrict the parameter-estimation in LCMV and sLORETA by setting the parameter 'fixedori' but not when using MNE. Shouldn't one be able to also just use the normal direction of each source position here as well? Can I just apply the same logic in the script 'minimumnormestimate' to change the field 'lf.ori' as, for example, in 'ft_sloreta' or would this be problematic down the line? Thank You, Christian _______________________________________________ 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 stephen.whitmarsh at gmail.com Fri Sep 22 10:09:11 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 10:09:11 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Indeed, I do not think there is a problem with segmentation of brain/skull, as can be seen on the image. Stripping some skin of two subjects (thresholding the 'soft_tissue' probability output of SPM12, then removing it) with a similar problem of solved the rotation, but resulted in too small grids... On this subject I attached this procedure has no effect. However, at least for those other subjects normalization on skullstripped, or rather, scalpstripped MRIs might do the trick. As I understand it, however, the spm8 procedure (and spm12 I think) is a two-stepped procedure, with (affine) transformation based on the scalp first, after which it optimizes it based on brain segmentation. I would not know how to therefor do normalization without scalp. In fact, it expects a full volumetric image, not a (pre-)segmented one. Cheers, Stephen On 21 September 2017 at 18:45, Arjen Stolk wrote: > First thought is a registration of brain outline to skull (instead of > brain), although at closer inspection the shift seems overall just a bit > too large for that. You could try calculating the normalization parameters > on skullstripped volumes (unless you want to keep non-brain tissue). > > On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < > stephen.whitmarsh at gmail.com> wrote: > >> Hi Arjen, >> >> Thanks, and good to hear you've not been let down yet. It might be the >> fact that I have some bad quality MRIs to deal with. However... does this >> problem (see attached) ring a bell for anyone?: >> >> Brain segmentation is proper, and co-registration with polhemus >> head-shape as well, but inverse warp to MNI result in a tilted grid. >> Linear vs. non-linear transformation gives the same result. Other subjects >> going through the same procedure work fine, except two others wherein I >> identified it as a problem in segmenting the scalp and therefor the first >> step of the normalization. This one looks absolutely fine in every other >> regard, however. >> >> I'm stumped... >> >> cfg = []; >> cfg.spmversion = 'spm12'; >> cfg.grid.warpmni = 'yes'; >> cfg.grid.template = template_grid; >> cfg.grid.nonlinear = 'yes'; >> cfg.mri = mri_realigned; >> cfg.grid.unit = 'mm'; >> subject_grid = ft_prepare_sourcemodel(cfg); >> >> Cheers, >> Stephen >> >> >> On 21 September 2017 at 17:00, Arjen Stolk wrote: >> >>> Hey Stephen, >>> >>> Look for discussions regarding spm12 and also dartel on bugzilla. It's >>> been a while but as far as I can remember ft_volumenormalize is the only >>> function now that has not been integrated. Reason being that it wasnt >>> straightforward to house the dartel procedure under a single function, so >>> this is ongoing work still. You can however use spm12's coregistration >>> function with ft_volumerealign (for rigid body transformations), which Im >>> using quite a bit and never let me down (and is much faster than before). >>> But that wouldnt work for normalization to template space though (use spm8). >>> >>> Best >>> >>> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) < >>> hgould at memphis.edu> wrote: >>> >>> I have retired please remove me from the mail list >>> >>> Herbert Jay Gould >>> Professor Emeritus >>> The University of Memphis >>> >>> >>> >>> Sent from my Verizon Wireless 4G LTE smartphone >>> >>> >>> -------- Original message -------- >>> From: Stephen Whitmarsh >>> Date:09/21/2017 7:43 AM (GMT-06:00) >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >>> normalization >>> >>> Dear Sarang and Jan-Mathijs, >>> >>> Thanks a lot. I am now able (after updating FT, which now includes SPM12 >>> in /external), to use SPM12 for segmentation of my template and my subject >>> MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >>> improvement over 8 when it comes to brain-segmentation, which now does not >>> require individual treatments anymore. It also outputs more compartments >>> which gives me a little bit more to work with when dealing with scans that >>> have bad delineation of the scalp for normalization. >>> >>> Pleas note that defaults seems to differ - some FT functions default to >>> spm8, others to spm12. >>> >>> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >>> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >>> 'spm12'. In other words the cfg.spmversion is not passed along. >>> >>> Best wishes and thanks again! >>> Stephen >>> >>> >>> >>> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >>> jan.schoffelen at donders.ru.nl> wrote: >>> >>>> Hi Stephen, >>>> >>>> Please note that FT now has full support for SPM12, both using the >>>> old-style segmentation, and the new one (the latter yielding 6 tissue >>>> types). >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh < >>>> stephen.whitmarsh at gmail.com> wrote: >>>> >>>> Dear all, >>>> >>>> I having some problems in normalizing MRIs for my study. Some have >>>> improper segmentation for which changing individual brain/scalp thresholds >>>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>>> noise outside of the head. Also, changing parameters in spm8 for >>>> normalization, such as number of iterations (directly in in spm_normalize, >>>> since FT does not pass these parameters) improves the transformation. >>>> >>>> However, some scans I cannot deal with, either because they have noise >>>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>>> optimal scalp-segmentation and thereby normalization. Others have an >>>> inappropriate contrast MRI sequence. >>>> >>>> Some fMRI researchers advised me to use SPM12, because of its improved >>>> preprocessing procedures. However, it does not seem supported in FT yet. >>>> Does anyone have experience with this, and can perhaps share how they >>>> extracted the transformation matrix from the resulting nifti's? >>>> >>>> Thanks, >>>> Stephen >>>> _______________________________________________ >>>> 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 stephen.whitmarsh at gmail.com Fri Sep 22 13:01:25 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 13:01:25 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Jan-Mathijs, et. al., It seems the rotation was caused by a bug my side. The segmentation using SPM12 solved problems caused by low quality MRIS. Thanks! Stephen On 22 September 2017 at 10:09, Stephen Whitmarsh < stephen.whitmarsh at gmail.com> wrote: > Hi Arjen, > > Indeed, I do not think there is a problem with segmentation of > brain/skull, as can be seen on the image. Stripping some skin of two > subjects (thresholding the 'soft_tissue' probability output of SPM12, then > removing it) with a similar problem of solved the rotation, but resulted in > too small grids... On this subject I attached this procedure has no effect. > > However, at least for those other subjects normalization on skullstripped, > or rather, scalpstripped MRIs might do the trick. As I understand it, > however, the spm8 procedure (and spm12 I think) is a two-stepped procedure, > with (affine) transformation based on the scalp first, after which it > optimizes it based on brain segmentation. I would not know how to therefor > do normalization without scalp. In fact, it expects a full volumetric > image, not a (pre-)segmented one. > > Cheers, > Stephen > > On 21 September 2017 at 18:45, Arjen Stolk wrote: > >> First thought is a registration of brain outline to skull (instead of >> brain), although at closer inspection the shift seems overall just a bit >> too large for that. You could try calculating the normalization parameters >> on skullstripped volumes (unless you want to keep non-brain tissue). >> >> On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < >> stephen.whitmarsh at gmail.com> wrote: >> >>> Hi Arjen, >>> >>> Thanks, and good to hear you've not been let down yet. It might be the >>> fact that I have some bad quality MRIs to deal with. However... does this >>> problem (see attached) ring a bell for anyone?: >>> >>> Brain segmentation is proper, and co-registration with polhemus >>> head-shape as well, but inverse warp to MNI result in a tilted grid. >>> Linear vs. non-linear transformation gives the same result. Other subjects >>> going through the same procedure work fine, except two others wherein I >>> identified it as a problem in segmenting the scalp and therefor the first >>> step of the normalization. This one looks absolutely fine in every other >>> regard, however. >>> >>> I'm stumped... >>> >>> cfg = []; >>> cfg.spmversion = 'spm12'; >>> cfg.grid.warpmni = 'yes'; >>> cfg.grid.template = template_grid; >>> cfg.grid.nonlinear = 'yes'; >>> cfg.mri = mri_realigned; >>> cfg.grid.unit = 'mm'; >>> subject_grid = ft_prepare_sourcemodel(cfg); >>> >>> Cheers, >>> Stephen >>> >>> >>> On 21 September 2017 at 17:00, Arjen Stolk wrote: >>> >>>> Hey Stephen, >>>> >>>> Look for discussions regarding spm12 and also dartel on bugzilla. It's >>>> been a while but as far as I can remember ft_volumenormalize is the only >>>> function now that has not been integrated. Reason being that it wasnt >>>> straightforward to house the dartel procedure under a single function, so >>>> this is ongoing work still. You can however use spm12's coregistration >>>> function with ft_volumerealign (for rigid body transformations), which Im >>>> using quite a bit and never let me down (and is much faster than before). >>>> But that wouldnt work for normalization to template space though (use spm8). >>>> >>>> Best >>>> >>>> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) < >>>> hgould at memphis.edu> wrote: >>>> >>>> I have retired please remove me from the mail list >>>> >>>> Herbert Jay Gould >>>> Professor Emeritus >>>> The University of Memphis >>>> >>>> >>>> >>>> Sent from my Verizon Wireless 4G LTE smartphone >>>> >>>> >>>> -------- Original message -------- >>>> From: Stephen Whitmarsh >>>> Date:09/21/2017 7:43 AM (GMT-06:00) >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >>>> normalization >>>> >>>> Dear Sarang and Jan-Mathijs, >>>> >>>> Thanks a lot. I am now able (after updating FT, which now includes >>>> SPM12 in /external), to use SPM12 for segmentation of my template and my >>>> subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >>>> improvement over 8 when it comes to brain-segmentation, which now does not >>>> require individual treatments anymore. It also outputs more compartments >>>> which gives me a little bit more to work with when dealing with scans that >>>> have bad delineation of the scalp for normalization. >>>> >>>> Pleas note that defaults seems to differ - some FT functions default to >>>> spm8, others to spm12. >>>> >>>> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >>>> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >>>> 'spm12'. In other words the cfg.spmversion is not passed along. >>>> >>>> Best wishes and thanks again! >>>> Stephen >>>> >>>> >>>> >>>> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >>>> jan.schoffelen at donders.ru.nl> wrote: >>>> >>>>> Hi Stephen, >>>>> >>>>> Please note that FT now has full support for SPM12, both using the >>>>> old-style segmentation, and the new one (the latter yielding 6 tissue >>>>> types). >>>>> >>>>> Best, >>>>> Jan-Mathijs >>>>> >>>>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh < >>>>> stephen.whitmarsh at gmail.com> wrote: >>>>> >>>>> Dear all, >>>>> >>>>> I having some problems in normalizing MRIs for my study. Some have >>>>> improper segmentation for which changing individual brain/scalp thresholds >>>>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>>>> noise outside of the head. Also, changing parameters in spm8 for >>>>> normalization, such as number of iterations (directly in in spm_normalize, >>>>> since FT does not pass these parameters) improves the transformation. >>>>> >>>>> However, some scans I cannot deal with, either because they have noise >>>>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>>>> optimal scalp-segmentation and thereby normalization. Others have an >>>>> inappropriate contrast MRI sequence. >>>>> >>>>> Some fMRI researchers advised me to use SPM12, because of its improved >>>>> preprocessing procedures. However, it does not seem supported in FT yet. >>>>> Does anyone have experience with this, and can perhaps share how they >>>>> extracted the transformation matrix from the resulting nifti's? >>>>> >>>>> Thanks, >>>>> Stephen >>>>> _______________________________________________ >>>>> 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 hamedtaheri at yahoo.com Fri Sep 22 13:53:44 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Fri, 22 Sep 2017 11:53:44 +0000 (UTC) Subject: [FieldTrip] Artifact Rejection Problem References: <258456736.7597235.1506081224221.ref@mail.yahoo.com> Message-ID: <258456736.7597235.1506081224221@mail.yahoo.com> Hello Dear Fieldtrip users, I have an EEG signal which I want to do artifact rejection on it.I've recorded the EEG during watching a video clip. My signal is 100 seconds and I've selected 50 seconds.I can find EOG artifact but I can't reject it. Would you please let me know how can I do it. cfg  = []; cfg.dataset   = 'myfile.eeg';  %BrainVision Recoreder EEG cfg.trialdef.triallength   = inf; cfg.trialdef.ntrials         = inf; cfg   = ft_definetrial(cfg); trl     = cfg.trl; data_org = ft_preprocessing(cfg); %Select 30sec of data cfg.latency        = 'all'; cfg.latency     = [0 30]; %start point and end point cfg.avgovertime = 'no'; cfg.nanmean     = 'no'; data_s = ft_selectdata(cfg, data_org); [cfg, artifact] = ft_artifact_eog(cfg,data_s);clean_data = ft_rejectartifact(cfg,data_s); -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Fri Sep 22 14:12:11 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 14:12:11 +0200 Subject: [FieldTrip] Warnings on CentOS break code? Message-ID: Hi there, Since upgrading to the latest FT version, some warnings throw an error because FT cannot determine it's in a CentOS distro. At least, that's what I think it is? Am I missing something? Best, Stephen cfg = []; cfg.artfctdef = artdef_MEG{ipart}; cfg.artfctdef.reject = 'partial'; cfg.artfctdef.minaccepttim = 3; data{ipart} = ft_rejectartifact(cfg,data{ipart}); results in: Error using ft_platform_supports (line 134) unsupported value for first argument: html Error in ft_notification (line 376) if ft_platform_supports('html') Error in ft_warning (line 63) ft_notification(varargin{:}); Error in getdimord>warning_dimord_could_not_be_determined (line 621) ft_warning('%s\n\n%s', msg,content); Error in getdimord (line 572) warning_dimord_could_not_be_determined(field,data); Error in ft_selectdata (line 201) dimord{i} = getdimord(varargin{1}, datfield{i}); Error in WANDER_common_filter_DICS (line 85) hdr = ft_selectdata(cfg,hdr); 134 error('unsupported value for first argument: %s', what); -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Fri Sep 22 19:06:53 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Fri, 22 Sep 2017 17:06:53 +0000 (UTC) Subject: [FieldTrip] Artifact Removing Problem References: <28989140.7825054.1506100013966.ref@mail.yahoo.com> Message-ID: <28989140.7825054.1506100013966@mail.yahoo.com> Hi all I've tried to remove EOG, jump and muscle artifact from my EEG.I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. ( No filter, remove) . I want to filter my signal no remove some part of mt signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG.Could you please help me what is my wrong? Best Regards,Hamed -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Sun Sep 24 17:37:43 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Sun, 24 Sep 2017 15:37:43 +0000 (UTC) Subject: [FieldTrip] Artifact Rejection Problem References: <383387083.4716793.1506267463295.ref@mail.yahoo.com> Message-ID: <383387083.4716793.1506267463295@mail.yahoo.com> Hi all I've tried to remove EOG, jump and muscle artifact from my EEG.I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. I want to filter my signal no remove some part of my signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG.Could you please help me what is my wrong? cfg.artfctdef.eog.artifact = artifact_EOG; cfg.artfctdef.jump.artifact = artifact_jump; cfg.artfctdef.muscle.artifact = artifact_muscle; cfg.artfctdef.reject = 'complet' ; data_no_artifacts = ft_rejectartifact(cfg,data_int); Best Regards,Hamed -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon Sep 25 03:23:35 2017 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 25 Sep 2017 11:23:35 +1000 Subject: [FieldTrip] Question regarding clusterplot Message-ID: Dear list, I am trying to plot significant clusters from the cluster based permutation test on the ERPs. I want to plot the p values on a binary fashion (p<.05). I just don't want to highlight the electrodes, but I want to interpolate the p values and plot topography (just like ERP topography, but in abinary fashion). I was wondering whether there is a way to do it? Thanks, Arti -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Sep 25 06:29:05 2017 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 25 Sep 2017 06:29:05 +0200 Subject: [FieldTrip] Question regarding clusterplot In-Reply-To: References: Message-ID: Hi Arti, you could specify cfg.parameter = ‘mask’; instead of ‘avg’ which is the default. best tzvetan > Am 25.09.2017 um 03:23 schrieb Arti Abhishek : > > Dear list, > > I am trying to plot significant clusters from the cluster based permutation test on the ERPs. I want to plot the p values on a binary fashion (p<.05). I just don't want to highlight the electrodes, but I want to interpolate the p values and plot topography (just like ERP topography, but in abinary fashion). I was wondering whether there is a way to do it? > > Thanks, > Arti > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From simeon.wong at sickkids.ca Mon Sep 25 16:45:04 2017 From: simeon.wong at sickkids.ca (Simeon Wong) Date: Mon, 25 Sep 2017 14:45:04 +0000 Subject: [FieldTrip] Artifact Rejection Problem In-Reply-To: <383387083.4716793.1506267463295@mail.yahoo.com> References: <383387083.4716793.1506267463295.ref@mail.yahoo.com>, <383387083.4716793.1506267463295@mail.yahoo.com> Message-ID: Hi Hamed, I believe ft_rejectartefact does not offer an option to simply remove any artefact. Removing artefacts is actually a non-trivial process that you can approach from several different ways. Try using ft_componentanalysis to apply ICA to remove eye blinks and some eye movement. I'm not too sure about muscle artefact in EEG but perhaps setting a bandpass filter from 1-30 Hz may help attenuate most of it. You probably don't need to worry about jump artifacts since that typically applies only to MEG. Regards, Simeon Wong ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Hamed Taheri Sent: September 24, 2017 11:37:43 AM To: FieldTrip Discussion List Subject: [FieldTrip] Artifact Rejection Problem Hi all I've tried to remove EOG, jump and muscle artifact from my EEG. I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. I want to filter my signal no remove some part of my signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG. Could you please help me what is my wrong? cfg.artfctdef.eog.artifact = artifact_EOG; cfg.artfctdef.jump.artifact = artifact_jump; cfg.artfctdef.muscle.artifact = artifact_muscle; cfg.artfctdef.reject = 'complet' ; data_no_artifacts = ft_rejectartifact(cfg,data_int); Best Regards, Hamed ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. From bqrosen at ucsd.edu Mon Sep 25 22:05:39 2017 From: bqrosen at ucsd.edu (Burke Rosen) Date: Mon, 25 Sep 2017 13:05:39 -0700 Subject: [FieldTrip] ft_combineplanar 'svd' method Message-ID: Hello, What is the principle behind the ‘svd’ and ‘absvd’ methods for ft_combineplanar? And/or is there a citation which introduces these methods? Thank you, Burke Rosen From michak at is.umk.pl Mon Sep 25 23:44:00 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Mon, 25 Sep 2017 23:44:00 +0200 Subject: [FieldTrip] AAL Surface plot - weird black spots In-Reply-To: References: Message-ID: Dear Fieldtrippers, I found the solution and it is simple. Just make sure that you have in your config follwing lines: cfg.projmethod = 'project' cfg.projvec = [0 5] Have a nice plots ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics 2017-07-31 14:15 GMT+02:00 Michał Komorowski : > Dear Fieldtrippers, > > I am trying to reproduce brain surface pictures from this paper (Fig.5) : > http://journals.plos.org/plosbiology/article?id=10. > 1371/journal.pbio.1002498 > > I wonder why I get weid black spots in surface plot (e.g. occipital area). > What should I do to get those nice picures from link above? > What I am doing wrong (code below)? > > Code for generating erroneous pictures (see attachment): > > mrifile = [FieldtripPath 'template/anatomy/single_subj_ > T1.nii'] > > mri = ft_read_mri(mrifile) > mri.coordsys = 'mni'; % to prevent manual fixing of coordsys > > atlaspath = [FieldtripPath 'template/atlas/aal/ROI_MNI_V4.nii']; > atlas = ft_read_atlas(atlaspath) > atlas.anatomy = mri.anatomy; > > cfg = []; > cfg.method = 'surface'; > cfg.projmethod = 'project'; > cfg.camlight = 'yes'; > %cfg.surffile = [FieldtripPath 'template/anatomy/surface_pial_left.mat']; > % uncomment to project half brain > cfg.locationcoordinates = 'voxel'; > cfg.cmap = jet(116); > cfg.cmap = [[0,0,0]; cfg.cmap] > cfg.funcolormap = cfg.cmap; > cfg.funparameter = 'tissue'; > cfg.atlas = atlaspath; > ft_sourceplot(cfg, atlas) > > > % check fit anatomy to atlas > cfg = []; > cfg.method = 'ortho'; > cfg.locationcoordinates = 'voxel'; > cfg.cmap = jet(116); > cfg.cmap = [[0,0,0]; cfg.cmap] % color map > cfg.funcolormap = cfg.cmap; > cfg.funparameter = 'tissue'; > ft_sourceplot(cfg, atlas) > > Best wishes. > > Michał Komorowski > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nirofir2 at gmail.com Tue Sep 26 15:12:30 2017 From: nirofir2 at gmail.com (Nir Ofir) Date: Tue, 26 Sep 2017 16:12:30 +0300 Subject: [FieldTrip] Variable Number of Tapers in 'mtmfft' Frequency Analysis Message-ID: Hi Fieldtrip users, ft_freqanalysis (FT version 20170404) does not allow using a variable number of tapers in 'mtmfft' mode (lines 462-465 display a warning and keep only the first element of cfg.tapsmofrq), but it seems like ft_specest_mtmfft does have an implementation of a variable number of tapers (lines 286-348). It also seems like mtm_specest_mtmconvol, which allows variable number of tapers, calls ft_specest_mtmfft. So 2 questions: 1. Is the variable number of tapers option used in mtmfft in some other way? 2. What is the reason for not allowing a variable number of tapers in mtmfft generally? Thanks! Nir Ofir -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog.louisa at gmail.com Wed Sep 27 22:01:53 2017 From: bog.louisa at gmail.com (Louisa Bogaerts) Date: Wed, 27 Sep 2017 23:01:53 +0300 Subject: [FieldTrip] reading in and preprocessing gtec_mat data Message-ID: Hello everyone, In the lab or Dr. Landau we recently started using a *g.tech EEG setup* and *Simulink* record the data. We used the newest version of Fieldtrip to try analyze the data. Simulink outputs the data as a .mat file (an example here: https://www.dropbox.com/s/6xgio9w81qx94bq/example.mat?dl=0), and according to the fieldtrip documentation this data format should now be supported: e.g., https://github.com/fieldtrip/fieldtrip/blob/master/fileio/ft_read_data.m, lines 274-276: if any(strcmp(dataformat, {'bci2000_dat', 'eyelink_asc', 'gtec_mat', 'gtec_hdf5', 'mega_neurone'})) However, it seems that multiple Fieldtrip functions are “looking” for a header file that is not found. - When reading in the data with ft_read_data() we get the following error messages (whereas simply loading them with load() works fine): Error using ft_notification (line 340) unsupported header format "matlab" Error in ft_error (line 39) ft_notification(varargin{:}); Error in ft_read_header (line 2325) ft_error('unsupported header format "%s"', headerformat); Error in ft_read_data (line 200) hdr = ft_read_header(filename, 'headerformat', headerformat, 'chanindx', chanindx, 'checkmaxfilter', checkmaxfilter); - The same error messages show when using ft_preprocessing(). Does anyone have experience reading in and preprocessing gtech_mat data and can he/she help us understand how to save the header info so that fieldtrip can read it and recognise the data as gtec_mat? Any help will be very much appreciated. Louisa, Omri & Flor -------------- next part -------------- An HTML attachment was scrubbed... URL: From isac.sehlstedt at psy.gu.se Fri Sep 29 12:19:51 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Fri, 29 Sep 2017 10:19:51 +0000 Subject: [FieldTrip] Follow up question: Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: Dear fieldtripers, This is a kind reminder of a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (follow dropbox-link below) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see ft_componentanalysis-result1.tiff, or ft_componentanalysis-result2.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see matlab_pca_results.tiff) . Why am I not getting that in ft? Is it possible to get that using ft? Pictures are found using this link: https://www.dropbox.com/sh/k6ax6bvjb5yi13l/AADvwBzGduIXlCLaPBS4_ELya?dl=0 Very Best, Isac ————————————————— The code ————————————————— clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Sep 29 12:36:30 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 29 Sep 2017 10:36:30 +0000 Subject: [FieldTrip] Follow up question: Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: <97B82971-ABD0-49F2-81C4-235AE4D09162@donders.ru.nl> perhaps you may want to check the ‘avg’ field. JM On 29 Sep 2017, at 12:19, Isac Sehlstedt > wrote: Dear fieldtripers, This is a kind reminder of a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (follow dropbox-link below) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see ft_componentanalysis-result1.tiff, or ft_componentanalysis-result2.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see matlab_pca_results.tiff) . Why am I not getting that in ft? Is it possible to get that using ft? Pictures are found using this link: https://www.dropbox.com/sh/k6ax6bvjb5yi13l/AADvwBzGduIXlCLaPBS4_ELya?dl=0 Very Best, Isac ————————————————— The code ————————————————— clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end _______________________________________________ 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 stephen.whitmarsh at gmail.com Fri Sep 29 12:42:41 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 29 Sep 2017 12:42:41 +0200 Subject: [FieldTrip] reading in and preprocessing gtec_mat data In-Reply-To: References: Message-ID: Hi Louisa et al, It seems that you are actually not trying to read data in the Gtec data format, but that of simulink (which was saved as a mat file, as a matlab file). So, you should be able to just read your mat file and then put your data in a fieldtrip data structure. See: http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat Cheers, Stephen On 27 September 2017 at 22:01, Louisa Bogaerts wrote: > Hello everyone, > > > > In the lab or Dr. Landau we recently started using a *g.tech EEG setup* > and *Simulink* record the data. We used the newest version of Fieldtrip > to try analyze the data. > > > > Simulink outputs the data as a .mat file (an example here: > https://www.dropbox.com/s/6xgio9w81qx94bq/example.mat?dl=0), and > according to the fieldtrip documentation this data format should now be > supported: e.g., https://github.com/fieldtrip/f > ieldtrip/blob/master/fileio/ft_read_data.m, lines 274-276: > > if any(strcmp(dataformat, {'bci2000_dat', 'eyelink_asc', 'gtec_mat', > > 'gtec_hdf5', 'mega_neurone'})) > > > > However, it seems that multiple Fieldtrip functions are “looking” for a > header file that is not found. > > - When reading in the data with ft_read_data() we get the following > error messages (whereas simply loading them with load() works fine): > > Error using ft_notification (line 340) > > unsupported header format "matlab" > > > > Error in ft_error (line 39) > > ft_notification(varargin{:}); > > > > Error in ft_read_header (line 2325) > > ft_error('unsupported header format "%s"', headerformat); > > > > Error in ft_read_data (line 200) > > hdr = ft_read_header(filename, 'headerformat', headerformat, 'chanindx', > > chanindx, 'checkmaxfilter', checkmaxfilter); > > > > - The same error messages show when using ft_preprocessing(). > > > > Does anyone have experience reading in and preprocessing gtech_mat data > and can he/she help us understand how to save the header info so that > fieldtrip can read it and recognise the data as gtec_mat? > > > > Any help will be very much appreciated. > > > > Louisa, Omri & Flor > > _______________________________________________ > 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 psc.dav at gmail.com Sat Sep 2 16:45:47 2017 From: psc.dav at gmail.com (David Pascucci) Date: Sat, 2 Sep 2017 16:45:47 +0200 Subject: [FieldTrip] Fwd: single trials eLoreta In-Reply-To: References: Message-ID: Dear fieldtrip experts, I am posting again my questions, hoping that someone has experience with a similar pipeline and can give some feedback. I am trying to use the eLoreta method to get single-trial estimates of source activity from specific ROIs, in the following way: % eLORETA cfg = []; cfg.method = 'eloreta'; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.eloreta.keepfilter = 'yes'; cfg.eloreta.normalize = 'yes'; cfg.eloreta.lambda = 0.05; *(1) cfg.eloreta.projectnoise = 'yes'; eLO_source = ft_sourceanalysis(cfg,data); % in the above line, "data" is the results of ft_timelockanalysis % with cfg.covariance = 'yes'; *(2) % then I put the source positions from the MNI template I % used for the sourcemodel (see: % http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject- % specific_grids_that_are_equivalent_across_subjects_in_normalized_space eLO_source.pos = template_grid.pos; iPOS = eLO_source.pos; iPOS(eLO_source.inside==0,:) = NaN; % only points inside gray matter % Then I select ROIs (here only one for simplicity) to extract single-trial source activity: [v,I] = min(pdist2(iPOS, ROIs_mni , 'euclidean')); % And I multiply the spatial filter for the EEG data in each trial W = eLO_source.avg.filter{I}; % filter at my ROI of interest for tr = 1:size(data.trial,1) % loop over trials trials{tr} = W * squeeze(data.trial(tr,:,:)); *(3) end Is this approach correct? My main questions are: *(1) Is there a way to select the best lambda parameter (e.g., selecting the one that best approximates the activity at the EEG channels level)? *(2) I am confused about the role of the covariance, since it doesn't seem to be used when source activity is estimated using the set of spatial filters at the single trial *(3) Is the "trials{tr} = W * squeeze(data.trial(tr,:,:)); " approach correct to get time-series of source activity in a ROI? Looking forward for your feedback. Best, David -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From juliacoopiza at gmail.com Sun Sep 3 17:14:06 2017 From: juliacoopiza at gmail.com (Julia Coopi) Date: Sun, 3 Sep 2017 09:14:06 -0600 Subject: [FieldTrip] Using PPC method In-Reply-To: References: Message-ID: Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz wrote: > Dear Tianyang, > > maybe it's a good idea to download the accompanying sample data from the > tutorial and look if you can recreate the shown data structure. Then look > closer into the values of the respective fields. That should give you a > better grasp on what is required there. > > I have not fully looked into the code but my feeling is that > spikeTrials.timestamp is not of any further use and is just carried from > the data structure before (which was not cut into trials and where the raw > timestamps were useful). The timing of spikes relative to the trial zero > point is fully described in the fields ".time", ".trial" and ".trialtime". > Best, > Andreas > > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of 马天阳 [tianyangma2013 at gmail.com] > *Sent:* Monday, August 28, 2017 5:31 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Using PPC method > > Dear Andreas, > > I still don't quite understand the tutorial. > > spikeTrials = > label: {'sig002a_wf' 'sig003a_wf'} > timestamp: {[1x83601 int32 ] [1x61513 int32 ]} > waveform: {[1x32x83601 double ] [1x32x61513 double ]} > unit: {[1x83601 double ] [1x61513 double ]} > hdr: [1x1 struct ] > dimord: '{chan}_lead_time_spike' > cfg: [1x1 struct ] > time: {[1x83601 double ] [1x61513 double ]} > trial: {[1x83601 double ] [1x61513 double ]} > trialtime: [600x2 double ] > > Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? > > I feel I am quite lost. > > Best, > > Tianyang > > > _______________________________________________ > 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.lehongre-ihu at icm-institute.org Mon Sep 4 11:26:52 2017 From: k.lehongre-ihu at icm-institute.org (Katia Lehongre) Date: Mon, 4 Sep 2017 11:26:52 +0200 Subject: [FieldTrip] Workshop on intracranial recordings in human, October 3-4, Paris Message-ID: <6eba6c50-169d-a0f0-ab1e-73d808e81d24@icm-institute.org> Dear all, The first*WIRED*(*W*orkshop on *I*ntracranial *R*ecordings in humans : *E*pilepsy, *D*BS), will be held in Paris, France, at the Brain and Spine Institute (ICM) on October 3 and 4. Registration is opened and*free*. Conferences, technical discussions, poster session (prize worth 800€ to be awarded), commercial solutions, wine and cheese…  All information and registration to this event on our website: http://wired-icm.org _Note that_ only *a few spots are left* for poster presentation and that we have reach *70% of full capacity* including people from 10 Parisian institutes, 6 major French cities and 9 countries. We hope to see you there! The organizers _Organization_ : Katia Lehongre, Adrien Schramm – _Scientific Committee_: Vincent Navarro, Katia Lehongre, Brian Lau, Nathalie George, Michel Le Van Quyen, Marie Laure Welter, Lionel Naccache *_Program_* *Tuesday October 3^rd * *AM* *Research Lecture Session* ** 9:00 *   – /Welcome breakfast/* 9:30*    –   Event Introduction* 
/V. Navarro,  K. Lehongre/ 9:45*     –   Keynote : Epileptic ictal wavefront* */C. Schevon/ */ (Columbia, USA)/ 10:45 *– /Break/* 11:00*   –   DBS: Title to be determined* /J. Bastin (Grenoble, France)/ 11:45*   –   DBS: **Title to be determined* 12:30*    – /Lunch & Poster session/* *PM* *Methodological aspects* ** 14:00 *   –   Equipment : Focus on new electrodes* 
 /L. Valton/ / (Toulouse, France)/ 15:00*    –   Analysis : Spike sorting techniques* 
 /F. Mormann/ / (Bonn, Germany)/ 16:00 *– /Coffe Break/* 16:30*   –   Imaging: Electrode localization* */S. Fernandez/ */ (Paris, France/) 18:00*   –   Wine and Cheese session* ** *Wednesday October 4^th * *AM* *Research Lecture Session* 8:45 *   – /Breakfast/* 9:00*    –   Keynote : Title to be determined* */P. Brown/ */ (Oxford, UK)/ 10:00*   –   Memory encoding* */N. Axmacher/ */ (Bochum, Germany)/ 10:45 *–   Visual processing* /L. Reddy / /(Toulouse, France/) 11:30*   – /Coffee Break/* 11:45*   –   Focus: Imaging and electrophysiology* /C. Ciumas-Gaumond (Lyon, France)/ 12:45*    –  Conclusion & poster award* *PM – Off event* *Réunion du groupe Français Microelectrode* * * *Note that *The *Blackrock Microsystems’ Clinical Electrophysiology Workshop* will occur on Monday 2nd. All info and registration on this satellite event click here . ** -- Katia Lehongre Ingénieure de recherche IHU-A-ICM PF STIM CENIR, bureau -1.041 ICM, UPMC/Inserm U1127/CNRS UMR7225 Institut du Cerveau et de la Moelle épinière Hôpital Pitié-Salpêtrière 47 Boulevard de l'Hôpital CS 21414 75646 PARIS CEDEX 13 tel: 01 57 27 47 14 -------------- next part -------------- An HTML attachment was scrubbed... URL: From linzhangysu at outlook.com Mon Sep 4 13:09:45 2017 From: linzhangysu at outlook.com (linzhangysu at outlook.com) Date: Mon, 4 Sep 2017 11:09:45 +0000 Subject: [FieldTrip] WPLI Message-ID: [cid:image002.png at 01D325AA.E537BE20] I want to calculate the WPLI of 64 channels for one subject. But I met some questions. Firstly, I didn’t understand the meaning of repetitions (just as the maker of the figure ). The dimension of repetitions was 1 in my MATLAB code , which resulted in the WPLI result are NaN vectors. How can I solve the problem about ‘repetitions’? I am looking forward to your reply very urgently, Thank you ! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: 41C8A441EE344C5FB6F9EBCBE63CA91A.png URL: From michelic72 at gmail.com Mon Sep 4 13:19:27 2017 From: michelic72 at gmail.com (Cristiano Micheli) Date: Mon, 4 Sep 2017 13:19:27 +0200 Subject: [FieldTrip] WPLI In-Reply-To: References: Message-ID: Dear Linzhangysu the wPLI metric requires you to have your experimental design matrix organized in 'repetitions' or 'trials'. This is typically the case (but not only) of an evoked related design, where the repetitions dimension is used to calculate your 'average' wPLI across trials, and this is what the FT code is doing for you in the *ft_connectivity_wpli* function. In summary, with this formula you will not be able to apply wPLI to a single trial (e.g. like in resting state). If your experiment allows organizing the experimental data into 'trials' (with the operation of epoching) then you can solve your problem, otherwise you will have to use other metrics of phase coupling. IHTH Cris Micheli On Mon, Sep 4, 2017 at 1:09 PM, linzhangysu at outlook.com < linzhangysu at outlook.com> wrote: > > > [image: cid:image002.png at 01D325AA.E537BE20] > > > > I want to calculate the WPLI of 64 channels for one subject. But I met > some questions. > > Firstly, I didn’t understand the meaning of repetitions (just as the > maker of the figure ). The dimension of repetitions was 1 in my MATLAB code > , which resulted in the WPLI result are NaN vectors. How can I solve the > problem about ‘repetitions’? > > I am looking forward to your reply very urgently, Thank you ! > > > > _______________________________________________ > 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: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: not available URL: From awutz at mit.edu Mon Sep 4 14:24:47 2017 From: awutz at mit.edu (Andreas Wutz) Date: Mon, 4 Sep 2017 12:24:47 +0000 Subject: [FieldTrip] Using PPC method In-Reply-To: References: , Message-ID: Dear Julia, I did not see your error message. Maybe, your lfp data structure is still in a continuous recording format without a trial definition? ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Sunday, September 03, 2017 11:14 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz > wrote: Dear Tianyang, maybe it's a good idea to download the accompanying sample data from the tutorial and look if you can recreate the shown data structure. Then look closer into the values of the respective fields. That should give you a better grasp on what is required there. I have not fully looked into the code but my feeling is that spikeTrials.timestamp is not of any further use and is just carried from the data structure before (which was not cut into trials and where the raw timestamps were useful). The timing of spikes relative to the trial zero point is fully described in the fields ".time", ".trial" and ".trialtime". Best, Andreas From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of 马天阳 [tianyangma2013 at gmail.com] Sent: Monday, August 28, 2017 5:31 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, I still don't quite understand the tutorial. spikeTrials = label: {'sig002a_wf' 'sig003a_wf'} timestamp: {[1x83601 int32] [1x61513 int32]} waveform: {[1x32x83601 double] [1x32x61513 double]} unit: {[1x83601 double] [1x61513 double]} hdr: [1x1 struct] dimord: '{chan}_lead_time_spike' cfg: [1x1 struct] time: {[1x83601 double] [1x61513 double]} trial: {[1x83601 double] [1x61513 double]} trialtime: [600x2 double] Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? I feel I am quite lost. Best, Tianyang _______________________________________________ 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 christine.blume at sbg.ac.at Mon Sep 4 14:28:47 2017 From: christine.blume at sbg.ac.at (Blume Christine) Date: Mon, 4 Sep 2017 12:28:47 +0000 Subject: [FieldTrip] Effect size measure for cluster-based permutation tests In-Reply-To: References: Message-ID: Hi Alik, Thanks a lot for your suggestion, which I hoped would prompt more answers. Does anyone have suggestions on how exactly to implement the calculation of an effect size measure? Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Alik Widge Gesendet: Mittwoch, 23. August 2017 16:42 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Effect size measure for cluster-based permutation tests My naive answer, which perhaps will provoke Eric to provide a better one: you have the actual cluster statistic and its permutation distribution under the null hypothesis. It seems as though that distribution could be assumed Gaussian and something like Cohen's d calculated. On Aug 23, 2017 9:35 AM, "Blume Christine" > wrote: Dear all, I came across a question posted by someone about a year ago, which concerned effect size measures for cluster-based permutation tests. Unfortunately, the question does not seem to have been answered… Q: I am using cluster-based permutation tests (depsamplesT, on time-frequency data) and am wondering how to best calculate an effect size from that. Best, Christine _______________________________________________ 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 xiew1202 at gmail.com Mon Sep 4 14:44:26 2017 From: xiew1202 at gmail.com (Xie Wanze) Date: Mon, 04 Sep 2017 12:44:26 +0000 Subject: [FieldTrip] WPLI In-Reply-To: References: Message-ID: Dear Linzhang, As Cris mentioned, you cannot calculate the WPLi value with one trial. The WPLI toolbox calculates the CSD and PSD for each single trial, and then get the "correlation" of the phase information across trials. This apparently could not be done with one trial. If you have continuous data you may try to segment it into epochs. Wanze Cristiano Micheli 于2017年9月4日 周一上午7:35写道: > Dear Linzhangysu > > the wPLI metric requires you to have your experimental design matrix > organized in 'repetitions' or 'trials'. > This is typically the case (but not only) of an evoked related design, > where the repetitions dimension is used to calculate your 'average' wPLI > across trials, and this is what the FT code is doing for you in the > *ft_connectivity_wpli* function. > In summary, with this formula you will not be able to apply wPLI to a > single trial (e.g. like in resting state). If your experiment allows > organizing the experimental data into 'trials' (with the operation of > epoching) then you can solve your problem, otherwise you will have to use > other metrics of phase coupling. > > IHTH > Cris Micheli > > > > On Mon, Sep 4, 2017 at 1:09 PM, linzhangysu at outlook.com < > linzhangysu at outlook.com> wrote: > >> >> >> [image: cid:image002.png at 01D325AA.E537BE20] >> >> >> >> I want to calculate the WPLI of 64 channels for one subject. But I met >> some questions. >> >> Firstly, I didn’t understand the meaning of repetitions (just as the >> maker of the figure ). The dimension of repetitions was 1 in my MATLAB code >> , which resulted in the WPLI result are NaN vectors. How can I solve the >> problem about ‘repetitions’? >> >> I am looking forward to your reply very urgently, Thank you ! >> >> >> >> _______________________________________________ >> 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: 41C8A441EE344C5FB6F9EBCBE63CA91A.png Type: image/png Size: 103525 bytes Desc: not available URL: From e.maris at donders.ru.nl Tue Sep 5 14:12:52 2017 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Tue, 5 Sep 2017 12:12:52 +0000 Subject: [FieldTrip] Effect size measure for cluster-based permutation tests In-Reply-To: References: Message-ID: <59403DFC-9FBC-4585-928E-84787AE7E99F@donders.ru.nl> Dear discussion list readers & contributors (especially Christine Blume), There have been many questions (not only on the FT discussion list) about the calculation of effect size measures in the context of cluster-based permutation tests. I will continue my reply under the quotes below. From: Blume Christine > Subject: Re: [FieldTrip] Effect size measure for cluster-based permutation tests Date: 4 September 2017 at 14:28:47 GMT+2 To: FieldTrip discussion list > Reply-To: FieldTrip discussion list > Hi Alik, Thanks a lot for your suggestion, which I hoped would prompt more answers. Does anyone have suggestions on how exactly to implement the calculation of an effect size measure? Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Alik Widge Gesendet: Mittwoch, 23. August 2017 16:42 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Effect size measure for cluster-based permutation tests My naive answer, which perhaps will provoke Eric to provide a better one: you have the actual cluster statistic and its permutation distribution under the null hypothesis. It seems as though that distribution could be assumed Gaussian and something like Cohen's d calculated. On Aug 23, 2017 9:35 AM, "Blume Christine" > wrote: Dear all, I came across a question posted by someone about a year ago, which concerned effect size measures for cluster-based permutation tests. Unfortunately, the question does not seem to have been answered… Q: I am using cluster-based permutation tests (depsamplesT, on time-frequency data) and am wondering how to best calculate an effect size from that. Best, Christine Giving a useful answer to this question requires that one knows for what this effect size measure will be used. Typically, a standardised effect size measure is required to perform a power calculation. A power calculation is possible for a number of parametric statistical tests such as the T- and the F-test. As input for this power calculation, Cohen’s d is required. A sensible value for Cohen’s d can sometimes be found in published studies (preferably with large sample sizes). Cohen’s d can easily be obtained from the outcome of a cluster-based permutation test: 1. Calculate the non-standardised effect sizes by averaging the (sensor, frequency, time)-specific effects within the cluster of interest. Typically, the (sensor, frequency, time)-specific effects are raw differences between the subject averages for the experimental conditions that are being compared. 2. Calculate the standard deviation over the subjects of these non-standardised effect sizes. 3. Calculate Cohen’s d by dividing the grand average of the non-standardised effect sizes by the standard deviation obtained in 2. Unfortunately, Cohen’s d calculated in this way, will be biased, and therefore cannot be used for a power calculation. This type of bias is sometimes denoted as “double dipping”. In general, it is extremely challenging to perform a power calculations for statistical analyses that involve high-dimensional data. This does not only hold for electrophysiological, but also for fMRI data. To get idea about the difficulties that one encounters, have a look at this paper from the fMRI community: http://www.biorxiv.org/content/early/2016/04/20/049429. For the analysis of high-dimensional electrophysiological data, quite some statistical work still has to be done. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From bioeng.yoosofzadeh at gmail.com Wed Sep 6 04:22:10 2017 From: bioeng.yoosofzadeh at gmail.com (Vahab Yousofzadeh) Date: Tue, 5 Sep 2017 22:22:10 -0400 Subject: [FieldTrip] Effect size measure for cluster-based Message-ID: Hi Christine, Based on my understanding from the following link the effect size (that correspond to the significant clusters) can not be derived from p (or t)-values by ft_sourcestatistics: http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test Cheers, Vahab From christine.blume at sbg.ac.at Wed Sep 6 09:10:25 2017 From: christine.blume at sbg.ac.at (Blume Christine) Date: Wed, 6 Sep 2017 07:10:25 +0000 Subject: [FieldTrip] Effect size measure for cluster-based In-Reply-To: References: Message-ID: Dear all, Thank you so much for all the suggestions and hints. I will look into them! Best, Christine ________________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Vahab Yousofzadeh [bioeng.yoosofzadeh at gmail.com] Gesendet: Mittwoch, 06. September 2017 04:22 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Effect size measure for cluster-based Hi Christine, Based on my understanding from the following link the effect size (that correspond to the significant clusters) can not be derived from p (or t)-values by ft_sourcestatistics: http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test Cheers, Vahab _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From preted at mcmaster.ca Wed Sep 6 16:48:26 2017 From: preted at mcmaster.ca (David) Date: Wed, 6 Sep 2017 10:48:26 -0400 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I’ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I’m running into is stated below as well as my code and I’ve attached an image of what the data looks like. I’ve tried following the tutorials and searching through the mailing list and can’t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: “Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);” Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot (16).png Type: image/png Size: 161547 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Sep 6 17:18:53 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 6 Sep 2017 15:18:53 +0000 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> References: <201709061448.v86EmJec019710@pinegw03.uts.mcmaster.ca> Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570@donders.ru.nl> Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I’ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I’m running into is stated below as well as my code and I’ve attached an image of what the data looks like. I’ve tried following the tutorials and searching through the mailing list and can’t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: “Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);” Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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 tokimoto at mejiro.ac.jp Wed Sep 6 17:57:17 2017 From: tokimoto at mejiro.ac.jp (=?utf-8?B?5pmC5pys55yf5ZC+?=) Date: Thu, 7 Sep 2017 00:57:17 +0900 Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: From smoratti at psi.ucm.es Wed Sep 6 18:25:54 2017 From: smoratti at psi.ucm.es (STEPHAN MORATTI) Date: Wed, 6 Sep 2017 18:25:54 +0200 Subject: [FieldTrip] Learning agreementbuybr 8 In-Reply-To: References: Message-ID: C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" escribió: Buenos días Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ¿Serías tan amable de enviármelo firmado? Gracias y perdón por las molestias, Sara -------------- next part -------------- An HTML attachment was scrubbed... URL: From preted at mcmaster.ca Wed Sep 6 18:43:41 2017 From: preted at mcmaster.ca (David) Date: Wed, 6 Sep 2017 12:43:41 -0400 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: References: Message-ID: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> Hi Jan-Mathijs, I’ve double checked and the label is written as ‘CZ’. So, it seems to be more than a typo, unfortunately. David From: fieldtrip-request at science.ru.nl Sent: September 6, 2017 12:26 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 82, Issue 8 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: Reshape Error Using ft_freqstatistics (Schoffelen, J.M. (Jan Mathijs)) 2. Cluster-based permutation tests for 3 conditions (????) 3. Re: Learning agreementbuybr 8 (STEPHAN MORATTI) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Sep 2017 15:18:53 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570 at donders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I?ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I?m running into is stated below as well as my code and I?ve attached an image of what the data looks like. I?ve tried following the tutorials and searching through the mailing list and can?t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: ?Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);? Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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: 2 Date: Thu, 7 Sep 2017 00:57:17 +0900 From: ???? To: FieldTrip discussion list Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: Content-Type: text/plain; charset="us-ascii" Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: ------------------------------ Message: 3 Date: Wed, 6 Sep 2017 18:25:54 +0200 From: STEPHAN MORATTI To: SARA RODRIGUEZ FREGENAL , FieldTrip discussion list Subject: Re: [FieldTrip] Learning agreementbuybr 8 Message-ID: Content-Type: text/plain; charset="utf-8" C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" escribi?: Buenos d?as Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ?Ser?as tan amable de envi?rmelo firmado? Gracias y perd?n por las molestias, Sara -------------- 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 82, Issue 8 **************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 7 07:19:09 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 7 Sep 2017 05:19:09 +0000 Subject: [FieldTrip] Reshape Error Using ft_freqstatistics In-Reply-To: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> References: <201709061643.v86GhZqL004768@pinegw03.uts.mcmaster.ca> Message-ID: <5038FBE1-5E7B-4F6B-B152-4A500879F002@donders.ru.nl> In that case I recommend that you try and interpret the error message in a bit more detail. From the information you provide nobody can tell what’s going on, apart from the fact that it is a low-level matlab error. I suggest to use the matlab debugger to investigate the size of ‘meanreshapeddat', and the value of ‘nchan’ ‘nfreq’ ‘nrepl’ ‘ntime’ in this specific case. And also think about your specification of cfg.latency. Note that you only include positive latencies to be tested, but you ask for actvsblT as a test statistic, which name suggests to use a baseline (i.e. require latencies of < 0 in the data). JM On 6 Sep 2017, at 18:43, David > wrote: Hi Jan-Mathijs, I’ve double checked and the label is written as ‘CZ’. So, it seems to be more than a typo, unfortunately. David From: fieldtrip-request at science.ru.nl Sent: September 6, 2017 12:26 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 82, Issue 8 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: Reshape Error Using ft_freqstatistics (Schoffelen, J.M. (Jan Mathijs)) 2. Cluster-based permutation tests for 3 conditions (????) 3. Re: Learning agreementbuybr 8 (STEPHAN MORATTI) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Sep 2017 15:18:53 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Reshape Error Using ft_freqstatistics Message-ID: <0DE2CF55-749C-4F63-9DFA-FE226A971570 at donders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi David, Have you checked whether this could be due to a potential typo in the specification of your cfg.channel (e.g.: CZ versus Cz)? Best, Jan-Mathijs On 6 Sep 2017, at 16:48, David > wrote: Hello everyone, I am running into an error when I try to compute the cluster based permutation test in the frequency-time domain comparing baseline to when the stimulus is present. I?ve calculated the power for 300 milliseconds (1 millisecond is equal to one time point) before the onset of the stimulus and 300ms during the stimulus for a range of 10 frequencies. The error I?m running into is stated below as well as my code and I?ve attached an image of what the data looks like. I?ve tried following the tutorials and searching through the mailing list and can?t seem to find a solution. Has anyone else run into this problem and found a solution or am I making an error somewhere in my analysis? MY CODE: cfg = []; cfg.channel = 'CZ'; cfg.latency = [0.1 0.4]; cfg.method = 'montecarlo'; cfg.frequency = 'all'; cfg.statistic = 'ft_statfun_actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; ntrials = size(TFR_FFR.powspctrm,1); design = zeros(2,2*ntrials); design(1,1:ntrials) = 1; design(1,ntrials+1:2*ntrials) = 2; design(2,1:ntrials) = [1:ntrials]; design(2,ntrials+1:2*ntrials) = [1:ntrials]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline); THE ERROR MESSAGE: ?Error using reshape To RESHAPE the number of elements must not change. Error in ft_statfun_actvsblT (line 115) timeavgdat=repmat(reshape(meanreshapeddat,(nchan*nfreq),nrepl),ntime,1); Error in ft_statistics_montecarlo (line 267) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 194) [stat, cfg] = statmethod(cfg, dat, design); Error in TFRClusterBasedStats (line 54) TFR_FFR_stat = ft_freqstatistics(cfg, TFR_FFR, TFR_FFRbaseline);? Thank you, David Prete Ph.D. Candidate McMaster Institute for Music and the Mind Department Psychology, Neuroscience and Behaviour McMaster University _______________________________________________ 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: 2 Date: Thu, 7 Sep 2017 00:57:17 +0900 From: ???? > To: FieldTrip discussion list > Subject: [FieldTrip] Cluster-based permutation tests for 3 conditions Message-ID: > Content-Type: text/plain; charset="us-ascii" Dear FieldTrip users, I usually perform cluster-based permutation tests for my EEG analyses. The test is exact and useful, and I am deeply grateful for the developers. I understand permutation tests are a test between two conditions. However, I have realized that the test results can be presented for the comparison of three conditions, as is shown by the attached file. I usually perform the test from the GUI of EEGLAB. Could anyone tell me how I should understand the test results? Thank you in advance. ****************************************** Shingo Tokimoto, Ph.D. in Linguistics and Psychology Department of Foreign Languages Mejiro University 4-31-1, Naka-Ochiai, Shinjuku, Tokyo, 161-8539, Japan tokimoto at mejiro.ac.jp ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERSP_sample.jpg Type: image/jpeg Size: 126118 bytes Desc: not available URL: ------------------------------ Message: 3 Date: Wed, 6 Sep 2017 18:25:54 +0200 From: STEPHAN MORATTI > To: SARA RODRIGUEZ FREGENAL >, FieldTrip discussion list > Subject: Re: [FieldTrip] Learning agreementbuybr 8 Message-ID: > Content-Type: text/plain; charset="utf-8" C ck El 5 sept. 2017 14:37, "SARA RODRIGUEZ FREGENAL" > escribi?: Buenos d?as Stephan, Soy una de tus tuteladas del Erasmus en Glasgow. Tuve que cambiar unas cosas en el learning agreement y me piden que me lo vuelvas a firmar. ?Ser?as tan amable de envi?rmelo firmado? Gracias y perd?n por las molestias, Sara -------------- 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 82, Issue 8 **************************************** _______________________________________________ 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 nugenta at mail.nih.gov Thu Sep 7 03:02:10 2017 From: nugenta at mail.nih.gov (Nugent, Allison C. (NIH/NIMH) [E]) Date: Thu, 7 Sep 2017 01:02:10 +0000 Subject: [FieldTrip] 2nd MEG North America Meeting - Abstract Submission Reminder Message-ID: This is a reminder that we are currently accepting abstracts for the 2nd MEG-North America meeting, to be held in Bethesda, Maryland November 8th and 9th. Committee meetings will be held on November 8th, with the scientific session on November 9th. There will be a poster session and oral sessions on November 9th. We are attempting to secure funding to present several speaker honoraria for excellent abstracts submitted by early career investigators and trainees. If you would like to be considered for this, please indicate your preference, along with your position, on your abstract submission. Abstracts may be submitted any time up until Wednesday, September 13th at 11:59pm, directly to NIHMEGworkshop at gmail.com (note the deadline has been extended). Please visit our website at https://megworkshop.nih.gov/MEGWorkshop/ - We have added additional information regarding the program! Or register at: https://www.eventbrite.com/e/meg-north-america-2017-tickets-36315511673 We hope to see you there! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alice.bollini at yahoo.com Thu Sep 7 10:18:22 2017 From: alice.bollini at yahoo.com (Alice B) Date: Thu, 7 Sep 2017 08:18:22 +0000 (UTC) Subject: [FieldTrip] Source reconstruction issues References: <283732377.7662318.1504772302305.ref@mail.yahoo.com> Message-ID: <283732377.7662318.1504772302305@mail.yahoo.com> Hello everyone, I would like to use fieldtrip for extracting source activity from specific ROIs (using the eLoreta approach). Here is my script, there are few things I am not sure in the pipeline (marked with numbers on the right) % eLORETA cfg = []; cfg.method                          = 'eloreta';cfg.grid                                  = leadfield;cfg.headmodel                       = headmodel;cfg.eloreta.keepfilter              = 'yes';cfg.eloreta.normalize               = 'yes';cfg.eloreta.lambda                  = 0.05;                                      *(1)cfg.eloreta.projectnoise            = 'yes';eLO_source                          = ft_sourceanalysis(cfg,data); % in the above line, "data" is the results of ft_timelockanalysis% with cfg.covariance = 'yes';                                                  *(2) % then I put the source positions from the MNI template% used for the sourcemodel (http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space)eLO_source.pos                      = template_grid.pos;iPOS                                        = eLO_source.pos;iPOS(eLO_source.inside==0,:)        = NaN; % only points inside gray matter % Then I select ROIs (here only one for simplicity) to extract single-trial source activity:[v,I]       = min(pdist2(iPOS, ROIs_mni , 'euclidean')); % And I multiply the spatial filter for the EEG data in each trialW            = eLO_source.avg.filter{I}; % filter at my ROI of interestfor tr = 1:size(data.trial,1)       % loop over trials         trials{tr} = W * squeeze(data.trial(tr,:,:));                            *(3)end Is this approach correct?My main questions are: *(1) Is there a way to select the best lambda parameter (e.g., selecting the one that best approximates the activity at the EEG channels level)? *(2) I am confused about the role of the covariance, since it doesn't seem to be used when source activity is estimated using the set of spatial filters at the single trial *(3) Is the "trials{tr} = W * squeeze(data.trial(tr,:,:)); " approach correct to get time-series of source activity in a ROI? Best,Alice -------------- next part -------------- An HTML attachment was scrubbed... URL: From da401 at kent.ac.uk Thu Sep 7 13:53:20 2017 From: da401 at kent.ac.uk (D.Abdallah) Date: Thu, 7 Sep 2017 11:53:20 +0000 Subject: [FieldTrip] Question about MVPA topographic map Message-ID: <1504785200819.38370@kent.ac.uk> Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref = 'yes'; cfg.channel = {'Cz', 'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; cfg.refchannel = 'Cz'; cfg.demean = 'yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype = '?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref = 'no'; FaceTrials.keeptrials = 'yes'; % classifiers operate on individual trials FaceTrials.channel = {'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; % occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref = 'no'; VaseTrials.keeptrials = 'yes'; % classifiers operate on individual trials VaseTrials.channel = {'PO9', 'PO7', 'PO3', 'PO', 'PO4', 'PO8' 'PO10', 'O1', 'Oz', 'O2','O9', 'O10'}; % occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout = 'biosemi64.lay'; cfg.method = 'crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy' 'binomial' 'contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter = 'mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments = ''; cfg.colorbar = 'yes'; cfg.interplimits= 'electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Subject 8 Topographical map.fig Type: application/octet-stream Size: 450612 bytes Desc: Subject 8 Topographical map.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imagesc Subject 8.fig Type: application/octet-stream Size: 40249 bytes Desc: Imagesc Subject 8.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tutorial topographic map.png Type: image/png Size: 10419 bytes Desc: tutorial topographic map.png URL: From Patrick.Rollo at uth.tmc.edu Fri Sep 8 20:38:22 2017 From: Patrick.Rollo at uth.tmc.edu (Rollo, Patrick) Date: Fri, 8 Sep 2017 18:38:22 +0000 Subject: [FieldTrip] Job Posting on FieldTrip message board Message-ID: <6484964699b24059ba1dd00807892d06@uth.tmc.edu> FieldTrip Moderators, I have a job posting that I would like to make on this message board, our lab, Tandon Lab, has posted in the past. The advert is attached here. Please let me know if you have any questions, Thank you, Patrick Rollo Research Assistant Department of Neurosurgery UTHealth McGovern Medical School at Houston 6431 Fannin St MSB G.550G Houston TX 77030 phone: 713-500-5475 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Postdocs_U01_updated 5:17.pdf Type: application/pdf Size: 236167 bytes Desc: Postdocs_U01_updated 5:17.pdf URL: From lxykh0700073 at outlook.com Sun Sep 10 03:53:24 2017 From: lxykh0700073 at outlook.com (Xinyi Li) Date: Sun, 10 Sep 2017 01:53:24 +0000 Subject: [FieldTrip] mixed design permutation tests on time-frequency data? Message-ID: Hi all, I'm wondering how to do a mixed design permutation test on time-frequency data, specifically, how to specify the design matrix. I followed the instructions in this post https://mailman.science.ru.nl/pipermail/fieldtrip/2008-March/001500.html for design matrix, but got an error 'the design matrix variables should be constant within a block'. Any suggestions? Thanks! Xinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Miguel.Granjaespiritosanto at nottingham.ac.uk Mon Sep 11 11:19:13 2017 From: Miguel.Granjaespiritosanto at nottingham.ac.uk (Miguel Granja Espirito Santo) Date: Mon, 11 Sep 2017 09:19:13 +0000 Subject: [FieldTrip] Any update on the group-level source MNE stats? Message-ID: Hi fieldtripers, I was wondering if there is any update on doing group level stats after conducting an MNE source analysis. I found several threads on the mailings list which I have successfully replicated, but I was wondering if there is any official FT approved way. At the end of the MNE page it says that this is under development, so is anyone privy to what the status of documentation is? Just asking because of supervisor enquiry for publication of our results. Best, Miguel PhD Student School of Psychology University of Nottingham 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 Manuel.Bange at unimedizin-mainz.de Mon Sep 11 14:32:57 2017 From: Manuel.Bange at unimedizin-mainz.de (Bange, Manuel) Date: Mon, 11 Sep 2017 12:32:57 +0000 Subject: [FieldTrip] Time normalisation for trials of different lenghts Message-ID: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> Dear fieldtrip community, My name is Manuel Bange and I am working in the Movement Disorder and Neurostimulation Lab in Mainz, Germany. Currently I am working on a project where we recorded EEG and EMG data combined with simultaneously recorded ground reaction forces during walking on a treadmill. I intend to use complete gait cycles as trials in order to, for example, calculate the inter-trial coherence. The issue I now face is that every cycle lasts a different amount of time. In a first step I have separated the continuous data into trials that correspond to whole gait cycles. One cycle starts with the onset of the right foot and ends one sample before the following onset of the same foot. This results in a number of trials (around 18 per subject) of different lengths. Following this, I performed a time-frequency analysis for each individual trial by 1. selecting a specific trial cfg.trials = 2; % select a a trial, here trial 2 trial2 = ft_selectdata(cfg, data) 2. performing time-frequency analysis cfg = []; cfg.output = 'pow'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [1:1:40]; cfg.t_ftimwin = ones(length(cfg.foi),1).*1; cfg.toi = trial2.time{1,1}(1,125):0.01:trial2.time{1,1}(1,end-125-1); cfg.keeptrials = 'yes' data_tfa1 = ft_freqanalysis(cfg, trial2); resulting in data_tfa1 = struct with fields: label: {257×1 cell} dimord: 'rpt_chan_freq_time' freq: [1×40 double] time: [1×172 double] % differs for each trial powspctrm: [1×257×40×172 double] cumtapcnt: [1×40 double] cfg: [1×1 struct] Now my question is: Is there a way to normalise this data over the time-axis, so that all trials have the same length? This is important to calculate an average time-frequency representation, or in another step, to calculate the inter-trial coherence. I have thought of normalising the time axis and interpolating the corresponding power-values. Thanks and best regards, Manuel Bange M.Sc. Sports Science Johannes-Gutenberg-University Hospital Movement Disorders and Neurostimulation Department of Neurology Langenbeckstr. 1 55131 Mainz, Germany www.unimedizin-mainz.de Email: manuel.bange at unimedizin-mainz.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From juliacoopiza at gmail.com Mon Sep 11 15:24:35 2017 From: juliacoopiza at gmail.com (Julia Coopi) Date: Mon, 11 Sep 2017 07:24:35 -0600 Subject: [FieldTrip] Using PPC method In-Reply-To: References: Message-ID: Dear Andreas, Finally, I managed to get PPC result from fliedtrip, now I have a problem: I am using mtmfft as method I wnat to have fine frequency resolution atleast I wan to have a point for each 1 hz. I have used cfg.foi =2:1:80; But it did't work, my output has a frequncy vector like this:[ 5 10 15 20 ... 80]; do you have any suggestion for better frequency resolution. If any body has a suggestion, that woulb be great to share it. Thanks, Julia On Mon, Sep 4, 2017 at 6:24 AM, Andreas Wutz wrote: > Dear Julia, > > I did not see your error message. Maybe, your lfp data structure is still > in a continuous recording format without a trial definition? > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Julia Coopi [juliacoopiza at gmail.com] > *Sent:* Sunday, September 03, 2017 11:14 AM > > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Using PPC method > > Dear Andreas, > > Thanks for your response, I am going through your suggestion. did you have > any problem regarding the appending spikes and lfp. I got this error: > > Error using ft_appendspike (line 112) > could not find the trial information in the continuous data > > thanks. > Julia > > On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz wrote: > >> Dear Tianyang, >> >> maybe it's a good idea to download the accompanying sample data from the >> tutorial and look if you can recreate the shown data structure. Then look >> closer into the values of the respective fields. That should give you a >> better grasp on what is required there. >> >> I have not fully looked into the code but my feeling is that >> spikeTrials.timestamp is not of any further use and is just carried from >> the data structure before (which was not cut into trials and where the raw >> timestamps were useful). The timing of spikes relative to the trial zero >> point is fully described in the fields ".time", ".trial" and ".trialtime". >> Best, >> Andreas >> >> >> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] >> on behalf of 马天阳 [tianyangma2013 at gmail.com] >> *Sent:* Monday, August 28, 2017 5:31 PM >> *To:* FieldTrip discussion list >> *Subject:* Re: [FieldTrip] Using PPC method >> >> Dear Andreas, >> >> I still don't quite understand the tutorial. >> >> spikeTrials = >> label: {'sig002a_wf' 'sig003a_wf'} >> timestamp: {[1x83601 int32 ] [1x61513 int32 ]} >> waveform: {[1x32x83601 double ] [1x32x61513 double ]} >> unit: {[1x83601 double ] [1x61513 double ]} >> hdr: [1x1 struct ] >> dimord: '{chan}_lead_time_spike' >> cfg: [1x1 struct ] >> time: {[1x83601 double ] [1x61513 double ]} >> trial: {[1x83601 double ] [1x61513 double ]} >> trialtime: [600x2 double ] >> >> Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? >> >> I feel I am quite lost. >> >> Best, >> >> Tianyang >> >> >> _______________________________________________ >> 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 awutz at mit.edu Mon Sep 11 15:57:02 2017 From: awutz at mit.edu (Andreas Wutz) Date: Mon, 11 Sep 2017 13:57:02 +0000 Subject: [FieldTrip] Using PPC method In-Reply-To: References: , Message-ID: Dear Julia, your frequency resolution depends on the time window you give to the FFT (cfg.timwin). Increasing that window will increase your freq resolution. ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Monday, September 11, 2017 9:24 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Finally, I managed to get PPC result from fliedtrip, now I have a problem: I am using mtmfft as method I wnat to have fine frequency resolution atleast I wan to have a point for each 1 hz. I have used cfg.foi =2:1:80; But it did't work, my output has a frequncy vector like this:[ 5 10 15 20 ... 80]; do you have any suggestion for better frequency resolution. If any body has a suggestion, that woulb be great to share it. Thanks, Julia On Mon, Sep 4, 2017 at 6:24 AM, Andreas Wutz > wrote: Dear Julia, I did not see your error message. Maybe, your lfp data structure is still in a continuous recording format without a trial definition? ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julia Coopi [juliacoopiza at gmail.com] Sent: Sunday, September 03, 2017 11:14 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, Thanks for your response, I am going through your suggestion. did you have any problem regarding the appending spikes and lfp. I got this error: Error using ft_appendspike (line 112) could not find the trial information in the continuous data thanks. Julia On Mon, Aug 28, 2017 at 4:55 PM, Andreas Wutz > wrote: Dear Tianyang, maybe it's a good idea to download the accompanying sample data from the tutorial and look if you can recreate the shown data structure. Then look closer into the values of the respective fields. That should give you a better grasp on what is required there. I have not fully looked into the code but my feeling is that spikeTrials.timestamp is not of any further use and is just carried from the data structure before (which was not cut into trials and where the raw timestamps were useful). The timing of spikes relative to the trial zero point is fully described in the fields ".time", ".trial" and ".trialtime". Best, Andreas From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of 马天阳 [tianyangma2013 at gmail.com] Sent: Monday, August 28, 2017 5:31 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Using PPC method Dear Andreas, I still don't quite understand the tutorial. spikeTrials = label: {'sig002a_wf' 'sig003a_wf'} timestamp: {[1x83601 int32] [1x61513 int32]} waveform: {[1x32x83601 double] [1x32x61513 double]} unit: {[1x83601 double] [1x61513 double]} hdr: [1x1 struct] dimord: '{chan}_lead_time_spike' cfg: [1x1 struct] time: {[1x83601 double] [1x61513 double]} trial: {[1x83601 double] [1x61513 double]} trialtime: [600x2 double] Like here, I don't know why for timestamp,time and trial, there are same number of values. If I have one unit, 60 trials and focus on -0.5 s to 0.5 s around stimulus event, I think trial means which trial of the 60 trials has spikes in this 1 s. The time means time point of spikes located in the 1 s around stimulus for each trial. Is it correct? But what about the timestamp? It means from the beginning of recording to the end and has nothing to do with trials? I feel I am quite lost. Best, Tianyang _______________________________________________ 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 nasseroleslami at gmail.com Mon Sep 11 19:09:52 2017 From: nasseroleslami at gmail.com (Bahman Nasseroleslami) Date: Mon, 11 Sep 2017 18:09:52 +0100 Subject: [FieldTrip] Research Assistant in Position Neural Engineering Position - Trinity College Dublin, the University of Dublin, Dublin, Ireland Message-ID: Dear all, There is a research assistant position available in Academic Unit of Neurology, Trinity College Dublin, the University of Dublin, Dublin, Ireland. --------------------------------------- Job ID : 032518 Post Title: Research Assistant in Neural Engineering Post Status: 12 month contract, full-time Research Group / Department / School Academic Unit of Neurology, School of Medicine, Trinity College Dublin, the University of Dublin Location: Trinity Biomedical Sciences Institute, Trinity College Dublin, the University of Dublin, College Green, Dublin D02 R590, Ireland Reports to: Professor Orla Hardiman/Dr Bahman Nasseroleslami Salary: Research Assistant Level based on Irish Universities Association (IUA) Guideline, Point 1: €21,459 per annum (or above commensurate with experience). Closing Date: 5pm on Wednesday 27th September 2017 Please note that Garda vetting will be sought in respect of individuals who come under consideration for a post. Post Summary Applications are invited for a motivated and self-driven individual for the position of research assistant with the Irish ALS Research Group, hosted in the Trinity Biomedical Sciences Institute (TBSI)'s Academic Unit of Neurology. The ideal candidate will have an undergraduate or master's degree in engineering, bioengineering, mathematics, computational biology, or a cognate area. Familiarity with and/or the ability to quickly acquire skills in electrophysiological recordings and analysis (e.g. EEG/EMG), would be highly desirable as would a knowledge of computer programming (MATLAB). --------------------------------------- The detailed job description file (PDF) and the application instructions can be found online at http://jobs.tcd.ie. It would be really appreciated if you could share this with those that may be interested. Sincerely Bahman –––––––––––– Bahman Nasseroleslami Senior Research Fellow, IRC Postdoctoral Fellow Academic Unit of Neurology, School of Medicine Trinity College Dublin, the University of Dublin Dublin 2, Ireland. Room 5.43, Trinity Biomedical Sciences Institute 152-160 Pearse Street, Dublin D02 R590, Ireland. nasserob at tcd.ie, nasseroleslami at gmail.com www.tcd.ie Trinity College Dublin, the University of Dublin is ranked 1st in Ireland and in the top 100 world universities by the QS World University Rankings. –––––––––––– -------------- next part -------------- An HTML attachment was scrubbed... URL: From michak at is.umk.pl Mon Sep 11 23:16:54 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Mon, 11 Sep 2017 23:16:54 +0200 Subject: [FieldTrip] MRI low contrast Message-ID: Dear Fieldtrippers, How to correct low contrast in MR image when using ft_mri_read and ft_sourceplot to read and display MR image? (see attachment mri00_lowctrst.png) For comparison, same .nii opened with mricron software ( http://people.cas.sc.edu/rorden/mricron/install.html) displays with proper contrast (see attachment mri00_hictrst.png) Code: ss = 'sub1'; f = ['../data/ind/', ss, '/mri/mri00.nii']; mri00 = ft_read_mri(f) ft_sourceplot([],mri00) Thank you in advance ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mri00_hictrst.png Type: image/png Size: 460834 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mri00_lowctrst.png Type: image/png Size: 88547 bytes Desc: not available URL: From a.stolk8 at gmail.com Mon Sep 11 23:48:47 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 11 Sep 2017 14:48:47 -0700 Subject: [FieldTrip] MRI low contrast In-Reply-To: References: Message-ID: Hi Michal, There's a (undocumented) keyboard shortcut, shift+equal sign (numpad +) to adjust the contrast scaling (use numpad - for the opposite direction). Perhaps ft_sourceplot should additionally require the same cfg.lim option that for instance ft_determine_coordsys uses. Will propose in a PR. Best, Arjen On Mon, Sep 11, 2017 at 2:16 PM, Michał Komorowski wrote: > Dear Fieldtrippers, > > How to correct low contrast in MR image when using ft_mri_read and > ft_sourceplot to read and display MR image? (see attachment > mri00_lowctrst.png) > > For comparison, same .nii opened with mricron software ( > http://people.cas.sc.edu/rorden/mricron/install.html) displays with > proper contrast (see attachment mri00_hictrst.png) > > Code: > > ss = 'sub1'; > f = ['../data/ind/', ss, '/mri/mri00.nii']; > mri00 = ft_read_mri(f) > ft_sourceplot([],mri00) > > > Thank you in advance ! > > Michał Komorowski, MSc > Nicolaus Copernicus University in Toruń > Faculty of Physics, Astronomy and Informatics > Department of Informatics > > _______________________________________________ > 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 anne.urai at gmail.com Tue Sep 12 09:01:03 2017 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 12 Sep 2017 09:01:03 +0200 Subject: [FieldTrip] BIDS data format survey Message-ID: Dear FieldTrippers, Recently, a number of people have been working on developing a common data standard for MEG called BIDS (Brain Imaging Data Structure). They are now requesting community feedback, so please have a look at the brief survey here and help them out: https://t.co/BjAFmR7yhN *Magnetoencephalography (MEG) studies produce enormous amounts of data that need to be stored, organized and analyzed. However, naming conventions and metadata are often incomplete or inexistent, which is an impediment to the transfer of scientific data and knowledge, the reproducibility of research results, and the curation of large data repositories with entries from heterogenous origins. * *Building on recent efforts from the MRI community, MEG-BIDS is a proposition to standardize the arrangement of data structures in MEG. Please refer to the MEG-BIDS manuscript and to the MEG-BIDS detailed specifications for all details concerning the proposed structure:- MEG-BIDS Manuscript: http://www.biorxiv.org/content/early/2017/08/08/172684 * *- MEG-BIDS Specifications: http://www.biorxiv.org/content/biorxiv/suppl/2017/08/08/172684.DC1/172684-1.pdf * *We wish to survey the MEG community on its present needs with respect to data management, and design the MEG-BIDS standard to best respond to these presently unmet needs.* *Your participation is truly appreciated.* ... — Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie Universitätsklinikum Hamburg-Eppendorf | Martinistrasse 52, 20246 | Hamburg, Germany www.anneurai.net / @AnneEUrai -------------- next part -------------- An HTML attachment was scrubbed... URL: From michak at is.umk.pl Tue Sep 12 09:56:58 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Tue, 12 Sep 2017 09:56:58 +0200 Subject: [FieldTrip] MRI low contrast In-Reply-To: References: Message-ID: Yaay ! + and - works ! :D For determining coordsys one should type: % clim adjusts contrast (default [0 1], the lower the brighter) [dataout] = ft_determine_coordsys(mri00, 'clim', [0 0.25]) Thank you very much ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics 2017-09-11 23:48 GMT+02:00 Arjen Stolk : > Hi Michal, > > There's a (undocumented) keyboard shortcut, shift+equal sign (numpad +) to > adjust the contrast scaling (use numpad - for the opposite direction). > > Perhaps ft_sourceplot should additionally require the same cfg.lim option > that for instance ft_determine_coordsys uses. Will propose in a PR. > > Best, > Arjen > > > > > On Mon, Sep 11, 2017 at 2:16 PM, Michał Komorowski > wrote: > >> Dear Fieldtrippers, >> >> How to correct low contrast in MR image when using ft_mri_read and >> ft_sourceplot to read and display MR image? (see attachment >> mri00_lowctrst.png) >> >> For comparison, same .nii opened with mricron software ( >> http://people.cas.sc.edu/rorden/mricron/install.html) displays with >> proper contrast (see attachment mri00_hictrst.png) >> >> Code: >> >> ss = 'sub1'; >> f = ['../data/ind/', ss, '/mri/mri00.nii']; >> mri00 = ft_read_mri(f) >> ft_sourceplot([],mri00) >> >> >> Thank you in advance ! >> >> Michał Komorowski, MSc >> Nicolaus Copernicus University in Toruń >> Faculty of Physics, Astronomy and Informatics >> Department of Informatics >> >> _______________________________________________ >> 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 behinger at uos.de Tue Sep 12 20:14:22 2017 From: behinger at uos.de (Benedikt Ehinger) Date: Tue, 12 Sep 2017 20:14:22 +0200 Subject: [FieldTrip] Time normalisation for trials of different lenghts In-Reply-To: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> References: <39A4BCA62730D84A95C53BCFC661677C01FEA9BD@mbx-02.it.klinik.uni-mainz.de> Message-ID: <1311033b-5017-443e-9cd9-0f4e4486f112@uos.de> Dear Manuel, first off, I do not know if or how you can do this in fieldtrip. But in eeglab you can do something they call "timewarping". One calculates a time-frequency (TF) decomposition for each trial and then warps/interpolates the TF so that some given events align. This is very similar (identical?) to what you describe and you might find more information either in the papers or the eeglab implementation. The method has been described in Gwin 2010 [1] and we also used it in on of our own studies [2]. Whether you can do the same also for phase (=> coherence) I don't know. I hope that helps in your analysis. Best, Benedikt [1] https://www.ncbi.nlm.nih.gov/pubmed/20410364 [2] https://www.ncbi.nlm.nih.gov/pubmed/24616681 Am 11.09.2017 um 14:32 schrieb Bange, Manuel: > Dear fieldtrip community, > >   > > My name is Manuel Bange and I am working in the Movement Disorder and > Neurostimulation Lab in Mainz, Germany. Currently I am working on a > project where we recorded EEG and EMG data combined with simultaneously > recorded ground reaction forces during walking on a treadmill. I intend > to use complete gait cycles as trials in order to, for example, > calculate the inter-trial coherence. The issue I now face is that every > cycle lasts a different amount of time. > > In a first step I have separated the continuous data into trials that > correspond to whole gait cycles. One cycle starts with the onset of the > right foot and ends one sample before the following onset of the same > foot. This results in a number of trials (around 18 per subject) of > different lengths. > > Following this, I performed a time-frequency analysis for each > individual trial by > >   > > 1.       selecting a specific trial > > /cfg.trials      = 2; >                                                               % select a > a trial, here trial 2/ > > /trial2 = ft_selectdata(cfg, data)/ > > / / > > 2.       performing time-frequency analysis > > /cfg          = [];/ > > /cfg.output   = 'pow';/ > > /cfg.method   = 'mtmconvol';/ > > /cfg.taper    = 'hanning';/ > > /cfg.foi      = [1:1:40];/ > > /cfg.t_ftimwin    = ones(length(cfg.foi),1).*1;/ > > /cfg.toi          = > trial2.time{1,1}(1,125):0.01:trial2.time{1,1}(1,end-125-1);            / > > /cfg.keeptrials = 'yes'/ > > /data_tfa1     = ft_freqanalysis(cfg, trial2);/ > > /resulting in/ > > /  data_tfa1 = / > > /  struct with fields:/ > > /label: {257×1 cell}/ > > /dimord: 'rpt_chan_freq_time'/ > > /freq: [1×40 double]/ > > /time: [1×172 > double]                                                                    > % differs for each trial/ > > /powspctrm: [1×257×40×172 double]/ > > /cumtapcnt: [1×40 double]/ > > /cfg: [1×1 struct]/ > >   > > Now my question is: > > Is there a way to normalise this data over the time-axis, so that all > trials have the same length? This is important to calculate an average > time-frequency representation, or in another step, to calculate the > inter-trial coherence. I have thought of normalising the time axis and > interpolating the corresponding power-values. > >   > > Thanks and best regards, > >   > > Manuel Bange > > M.Sc. Sports Science > >   > >   > > Johannes-Gutenberg-University Hospital > > Movement Disorders and Neurostimulation > > Department of Neurology > > Langenbeckstr. 1 > > 55131 Mainz, Germany > > www.unimedizin-mainz.de > >   > > Email: manuel.bange at unimedizin-mainz.de > >   > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From psc.dav at gmail.com Tue Sep 12 20:47:15 2017 From: psc.dav at gmail.com (David Pascucci) Date: Tue, 12 Sep 2017 20:47:15 +0200 Subject: [FieldTrip] inverse imaging Message-ID: Dear fieldtrip experts, I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Sep 13 12:22:01 2017 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 13 Sep 2017 12:22:01 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Hi David, do you want to obtain single-trial activity in source space? In that case, have you looked at the „virtual sensors“-tutorial? http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors In the tutorial, LCMV is used for the source analysis, but it should also work with sloreta, as the output-structure of the source-analysis is identical. I’m not sure about MNE though. Good luck, Julian > Am 12.09.2017 um 20:47 schrieb David Pascucci : > > Dear fieldtrip experts, > > I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… > > > > Thanks in advance > > _______________________________________________ > 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 psc.dav at gmail.com Wed Sep 13 13:22:46 2017 From: psc.dav at gmail.com (David Pascucci) Date: Wed, 13 Sep 2017 13:22:46 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Thaks Julian, that is the approach I was using, with eLoreta. I am not sure about two steps,though. One is the estimate and use of the signal covariance to input for single-trial activity in source space. The other is the choice of the optimal lambda. If you have some advice, that wold be very helpful. Thanks, David 2017-09-13 12:22 GMT+02:00 Julian Keil : > Hi David, > > do you want to obtain single-trial activity in source space? In that case, > have you looked at the „virtual sensors“-tutorial? http://www. > fieldtriptoolbox.org/tutorial/shared/virtual_sensors > In the tutorial, LCMV is used for the source analysis, but it should also > work with sloreta, as the output-structure of the source-analysis is > identical. I’m not sure about MNE though. > > Good luck, > > Julian > > > Am 12.09.2017 um 20:47 schrieb David Pascucci : > > Dear fieldtrip experts, > > I was wondering if anyone has experience with extracting single trials > estimates of source activity (using MNE or Loreta-based approaches) from > regions of interest, and what would be the best procedure… > > > Thanks in advance > _______________________________________________ > 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 > -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Sep 13 13:41:22 2017 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 13 Sep 2017 13:41:22 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Hi David, regarding the lambda, I think there are different ideas floating around the fieldtrip discussion-list. I suggest searching for the term „lambda“ to get a rough idea. Personally, for our EEG-data I usually use 10%. What is your question exactly regarding the covariance as input? Cheers, Julian > Am 13.09.2017 um 13:22 schrieb David Pascucci : > > Thaks Julian, > that is the approach I was using, with eLoreta. > I am not sure about two steps,though. > One is the estimate and use of the signal covariance to input for single-trial activity in source space. > The other is the choice of the optimal lambda. > > If you have some advice, that wold be very helpful. > > Thanks, > David > > 2017-09-13 12:22 GMT+02:00 Julian Keil >: > Hi David, > > do you want to obtain single-trial activity in source space? In that case, have you looked at the „virtual sensors“-tutorial? http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors > In the tutorial, LCMV is used for the source analysis, but it should also work with sloreta, as the output-structure of the source-analysis is identical. I’m not sure about MNE though. > > Good luck, > > Julian > > >> Am 12.09.2017 um 20:47 schrieb David Pascucci >: >> >> Dear fieldtrip experts, >> >> I was wondering if anyone has experience with extracting single trials estimates of source activity (using MNE or Loreta-based approaches) from regions of interest, and what would be the best procedure… >> >> >> >> Thanks in advance >> >> _______________________________________________ >> 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 > > > > -- > --------------------- > David Pascucci > > Postdoctoral Fellow > University of Fribourg > Department of Psychology > Rue de Faucigny 2 > 1700 Fribourg > Switzerland > _______________________________________________ > 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 evelyn.muschter at unitn.it Wed Sep 13 13:50:06 2017 From: evelyn.muschter at unitn.it (Evelyn Muschter) Date: Wed, 13 Sep 2017 13:50:06 +0200 Subject: [FieldTrip] Any update on the group-level source MNE stats?/ Vol 82, Issue 13 In-Reply-To: References: Message-ID: <88486D75-ED4E-40E0-8EE1-95A1A21E60CB@unitn.it> Hi Miguel and all, I have been wondering this myself! I have also followed various tutorial snippets here, but I am stuck with how to properly do group level stats. Any suggestions and input would be greatly appreciated! Best, Evelyn > On Sep 11, 2017, at 12:00 PM, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > 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. Any update on the group-level source MNE stats? > (Miguel Granja Espirito Santo) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 11 Sep 2017 09:19:13 +0000 > From: Miguel Granja Espirito Santo > > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Any update on the group-level source MNE stats? > Message-ID: > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi fieldtripers, > > > I was wondering if there is any update on doing group level stats after conducting an MNE source analysis. I found several threads on the mailings list which I have successfully replicated, but I was wondering if there is any official FT approved way. > > > At the end of the MNE page it says that this is under development, so is anyone privy to what the status of documentation is? > > Just asking because of supervisor enquiry for publication of our results. > > > Best, > > Miguel > PhD Student > School of Psychology > University of Nottingham > > > > > > 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: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 82, Issue 13 > ***************************************** From psc.dav at gmail.com Wed Sep 13 15:33:57 2017 From: psc.dav at gmail.com (David Pascucci) Date: Wed, 13 Sep 2017 15:33:57 +0200 Subject: [FieldTrip] inverse imaging In-Reply-To: References: Message-ID: Thanks again Julian, About the covariance, I am not sure about its usage in the reconstruction of single-trials activity. According to the example, this is done by multiplying the spatial filters with the EEG data. Whereas the covariance (Cf) is used to compute the avg.pow and ori in ft_eloreta (line 160-168) % get the power dip.pow = zeros(size(dip.pos,1),1); dip.ori = cell(size(dip.pos,1),1); for i=1:size(dip.pos,1) csd = dip.filter{i}**Cf**dip.filter{i}'; [u,s,vv] = svd(real(csd)); dip.pow(i) = s(1); dip.ori{i} = u(:,1); end It does not seem to be considered when creating and storing spatial filters (later used for single-trials reconstruction) (line 152-158, ft_eloreta) % use existing filters, or compute them if ~isfield(dip, 'filter') filt = mkfilt_eloreta_v2(leadfield, lambda); for i=1:size(dip.pos,1) dip.filter{i,1} = squeeze(filt(:,i,:))'; end end My question is, am I getting this wrong? and if not, should I ignore the covariance estimation in the case of single-trials reconstructed via filters*data? Cheers, David 2017-09-13 13:41 GMT+02:00 Julian Keil : > Hi David, > > regarding the lambda, I think there are different ideas floating around > the fieldtrip discussion-list. I suggest searching for the term „lambda“ to > get a rough idea. Personally, for our EEG-data I usually use 10%. > > What is your question exactly regarding the covariance as input? > > Cheers, > > Julian > > Am 13.09.2017 um 13:22 schrieb David Pascucci : > > Thaks Julian, > that is the approach I was using, with eLoreta. > I am not sure about two steps,though. > One is the estimate and use of the signal covariance to input for single-trial > activity in source space. > The other is the choice of the optimal lambda. > > If you have some advice, that wold be very helpful. > > Thanks, > David > > 2017-09-13 12:22 GMT+02:00 Julian Keil : > >> Hi David, >> >> do you want to obtain single-trial activity in source space? In that >> case, have you looked at the „virtual sensors“-tutorial? http://www. >> fieldtriptoolbox.org/tutorial/shared/virtual_sensors >> In the tutorial, LCMV is used for the source analysis, but it should also >> work with sloreta, as the output-structure of the source-analysis is >> identical. I’m not sure about MNE though. >> >> Good luck, >> >> Julian >> >> >> Am 12.09.2017 um 20:47 schrieb David Pascucci : >> >> Dear fieldtrip experts, >> >> I was wondering if anyone has experience with extracting single trials >> estimates of source activity (using MNE or Loreta-based approaches) from >> regions of interest, and what would be the best procedure… >> >> >> Thanks in advance >> _______________________________________________ >> 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 >> > > > > -- > --------------------- > David Pascucci > > Postdoctoral Fellow > University of Fribourg > Department of Psychology > Rue de Faucigny 2 > 1700 Fribourg > Switzerland > _______________________________________________ > 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 > -- --------------------- David Pascucci Postdoctoral Fellow University of Fribourg Department of Psychology Rue de Faucigny 2 1700 Fribourg Switzerland -------------- next part -------------- An HTML attachment was scrubbed... URL: From Adeen.Flinker at nyumc.org Wed Sep 13 20:23:40 2017 From: Adeen.Flinker at nyumc.org (Flinker, Adeen) Date: Wed, 13 Sep 2017 18:23:40 +0000 Subject: [FieldTrip] ECoG postdoc position Message-ID: <99026305-0472-4915-871A-C55374055912@nyumc.org> NYU School of Medicine is looking for candidates for two post-doctoral positions in Human Electrocortigoraphy (ECoG) research. Both positions will be under the supervision of Dr. Adeen Flinker, investigating speech processing and cortical network dynamics. The research will be conducted at NYU Comprehensive Epilepsy Center working with a population of surgical patients undergoing treatment for refractory epilepsy. Research paradigms will be conducted in close collaboration with the clinical neurology team. The candidate will conduct neurophysiological research in patients implanted with intracranial electrodes (surface, depth, laminar, Utah arrays) and in intraoperative patients undergoing acute recording, stimulation or cooling. The ideal applicant must have a Ph.D. in Neuroscience, Psychology, Biomedical Engineering or a related field. Proficiency in oral and written English is mandatory. A solid background in programming, statistics and scientific writing is required. The candidate is expected to be autonomous and to have a track-record of peer-reviewed publication. Previous experience with human electrophysiology or machine learning will be an asset. One postdoctoral position is funded by a MURI grant investigating event segmentation and episodic memory. The candidate will have an opportunity to work closely with collaborators in Princeton (Dr. Hasson, Dr. Norman), Harvard (Dr. Gershman), UC Davis (Dr. Ranganath) and Washington University (Dr. Zacks). Interested individuals should send an email to adeen.flinker at nyumc.org, including a cover letter describing research experience and qualifications, academic CV, and contact information of referees. Adeen Flinker, PhD Assistant Professor Department of Neurology NYU School of Medicine 145 East 32nd Street New York, NY 10016 646-754-2228 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1377 bytes Desc: not available URL: -------------- next part -------------- ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From C.Mazzetti at donders.ru.nl Thu Sep 14 13:28:45 2017 From: C.Mazzetti at donders.ru.nl (Mazzetti, C. (Cecilia)) Date: Thu, 14 Sep 2017 11:28:45 +0000 Subject: [FieldTrip] ICA warning messages Message-ID: <389DA1293690C94C93E3A53201F6C91E569EB8E6@exprd01.hosting.ru.nl> Hi Evryone, I was wondering why do i get this type of warnings when running ICA on my data. this is the script I am using: cfg.resamplefs = 300; cfg.detrend = 'no'; datads = ft_resampledata(cfg, data_clean); cfg=[]; cfg.bpfilter='yes'; % bandpass , use low freqs for alpha compponents cfg.bpfreq = [0.5 30]; datatmp= ft_preprocessing(cfg, datads) cfg.method = 'runica'; cfg.runica.maxsteps =30; comp_filt = ft_componentanalysis(cfg, datatmp); clear datads cfg = []; cfg.unmixing = comp_filt.unmixing; cfg.topolabel = comp_filt.topolabel; comp_origin = ft_componentanalysis(cfg, data_clean); clear comp cfg = []; cfg.viewmode = 'component'; cfg.layout = 'CTF275.lay'; ft_databrowser(cfg, comp_origin) cfg = []; cfg.component = input('bad comps = '); meg_ica = ft_rejectcomponent(cfg, comp_origin,data_clean); later on after having selected the bad components i get these messages : Warning: unexpected channel unit "unknown" in channel 158 (i get this for all the channels but i copy-pasted just one of them for obv reasons) Warning: copying input chantype to montage Warning: copying input chanunit to montage Thanks in advance for your hints! Cecilia Cecilia Mazzetti - Ph.D. Candidate Donders Centre for Cognitive Neuroimaging, room 1.170 Kapittelweg 29 | 6525 EN Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nirofir2 at gmail.com Thu Sep 14 14:10:46 2017 From: nirofir2 at gmail.com (Nir Ofir) Date: Thu, 14 Sep 2017 15:10:46 +0300 Subject: [FieldTrip] Using ft_redefinetrial with minlength and begsample/endsample option Message-ID: Hi fieldtrip users, I have a data structure containing MEG trials which are aligned to stimulus onset. I now want to realign them to the target onset, as well as removing trials which are too short. I thought the easiest way to do this would be to use ft_redefinetrial in the following way: offset = dat.trialinfo(:,5); % this column contains the duration of the stimulus-target intervel cfg = []; cfg.minlength = -dat.time{1}(1)+cfgx.pretarget+0.5; % prestim defined by dat sructure + 0.5 s ERF + cfgx.pretarget cfg.begsample = round((offset - cfgx.pretarget)*1000); cfg.endample = round(offset*1000); dat = ft_redefinetrial(cfg, dat); When I run this, I get the following error: Index exceeds matrix dimensions. Error in ft_redefinetrial (line 209) data.trial{i} = data.trial{i}(:, begsample(i):endsample(i)); So I looked into ft_redefinetrials a bit, and it seems like when minlength is defined, the trials themselves are removed, but the begample/endsample vector are not cut to contain only the relevant trials. For now I moved to a 2-step solution (first removing trials, than realigning), but it seems like this could have a relatively simple fix. Suggestions? Thanks! Nir Ofir -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Sep 15 12:45:01 2017 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 15 Sep 2017 12:45:01 +0200 Subject: [FieldTrip] Postdoc position: Magnetoencephalography and Tractography applied to Language in Neurological Populations Message-ID: *3-year postdoctoral position on the topic of magnetoencephalography and tractography applied to language in neurological populations* We are looking for a postdoctoral candidate with demonstrable experience in analysis of structural imaging and tractography to strengthen our research group. Our group aims at integrating brain measures with high temporal resolution, obtained using magnetoencephalography, with measures of structural connectivity to better understand language function in healthy and neurological populations. Ongoing projects include studying chronic stroke and brain tumour patients. More information on https://www.languageininteraction.nl/jobs/postdoc-position-388.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Sep 15 15:46:58 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 15 Sep 2017 13:46:58 +0000 Subject: [FieldTrip] Fwd: Question for Fieldtrip References: <4b2644a5.aff0.15e8581f6ac.Coremail.zhangwenjia2732@126.com> Message-ID: <420905E5-98A4-4C9C-96C4-1C8A28325786@donders.ru.nl> Begin forwarded message: From: 张文嘉 > Subject: Question for Fieldtrip Date: 15 September 2017 at 14:27:20 GMT+2 To: > Dear Fieldtrip expert, I am Wenjia from NYU Shanghai. I am doing timefrequency analysis with frildtrip. I have a question that I cannot solve. And, I am wondering whether you could help me. Specifically, I want to import the EGI data that has been preprocessed (after segmentation but no average) into fieldtrip, and further do timefrequency analysis. I donot know how to do this. I have found a script like following: cfg = []; cfg.triggertype = 'Stimulus'; cfg.prestim = 1.0; %1.0s before the onset cfg.poststim = 2.0; %2.0s after the onset cfg.inputfile = sprintf('s02_32_tf'); cfg.triggercode = 'S 32'; data_32 = read_analyzer_data(cfg); "s02_32_tf" is the name that I exported from EGI system, then included 3 files: asc, vhdr and vmrk. However an error poped up: Undefined function 'read_analyzer_data' for input arguments of type 'struct'. Any advice are appreciated. Thank you very much. -- Wenjia NYU Shanghai -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.chait at ucl.ac.uk Mon Sep 18 13:01:41 2017 From: m.chait at ucl.ac.uk (Chait, Maria) Date: Mon, 18 Sep 2017 11:01:41 +0000 Subject: [FieldTrip] Research Assistant Position at the UCL Ear Institute Message-ID: I would appreciate your help in forwarding the advert below to relevant members of your department. We are seeking to appoint an enthusiastic and motivated Research Assistant and Laboratory Manager to provide essential support for ongoing research aimed at developing transformative treatments for deafness and hearing problems. The post is funded for 12 months (with a possibility of extension for up to 5 years). The post will involve collection and analysis of audiometry as well as behavioral (psychophysics), eye tracking and EEG data in humans. The postholder will also be expected to contribute to the induction and direction of other research staff and students. The UCL Ear Institute, located in the heart of London, provides state-of-the-art research facilities across a wide range of disciplines and is one of the foremost centres for hearing, speech and language-related research within Europe. Applicants should hold a 1st class, or upper 2nd (or equivalent) BSc or MSc degree in an engineering or Neuroscience-related subject. Previous experience with neuroscience research, functional brain imaging and/or acoustics is desirable. More information and a link to the application site are in the following link: http://www.jobs.ac.uk/job/BEH401/research-assistant-in-auditory-neuroscience Closing Date: 15 October 2017 Maria Chait PhD m.chait at ucl.ac.uk Professor in Auditory Cognitive Neuroscience Lab site: http://www.ucl.ac.uk/ear/research/chaitlab/ UCL Ear Institute 332 Gray's Inn Road London WC1X 8EE -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Sep 18 13:57:51 2017 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Sep 2017 13:57:51 +0200 Subject: [FieldTrip] Normalizing log-transformed EEG power Message-ID: Dear all, I have a question regarding how to compute z-scores for log-transformed EEG power across all events separately for each electrode and frequency. I have searched everywhere on how to implement this in the fieldrip environment, however, I will be very grateful if someone can help me out on this. Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From lxykh0700073 at outlook.com Tue Sep 19 03:51:59 2017 From: lxykh0700073 at outlook.com (Xinyi Li) Date: Tue, 19 Sep 2017 01:51:59 +0000 Subject: [FieldTrip] simple main effects and permutation Message-ID: Hi all, I have a mixed design and my hypothesis is about simple main effects. So for example, I have two groups of people, and each person experience the same 2x2 factorial design with conditions A1, A2, B1, B2. And my hypotheses are something like the simple main effect of A within group 1 and condition B1. My questions: 1) Can I just subset the data to include only the group and condition I want (B1 & group 1) and do a t-test between condition A1 & A2 after subsetting? If I understand correctly, this approach will bias the standard error of the estimates? But I'm not sure if this matters in a permutation framework, and I also don't know if it's a common practice to do this in EEG analysis? 2) Alternatively, I can run a full mixed ANOVA model and then the simple main effect in R to get the test statistics I want. But for this approach I'm not sure how I should perform the permutation since fieldtrip doesn't support a mixed design. Should I only permute A1 & A2 within condition B1 and group 1? Or should I permute everything within both factors A & B? And what about the group labels? Any suggestions? Thanks! Xinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From da401 at kent.ac.uk Tue Sep 19 06:25:36 2017 From: da401 at kent.ac.uk (D.Abdallah) Date: Tue, 19 Sep 2017 04:25:36 +0000 Subject: [FieldTrip] Question about MVPA topographic map In-Reply-To: <1504785200819.38370@kent.ac.uk> References: <1504785200819.38370@kent.ac.uk> Message-ID: Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref ='yes'; cfg.channel = {'Cz','PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'}; cfg.refchannel ='Cz'; cfg.demean ='yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype ='?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype ='STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref ='no'; FaceTrials.keeptrials ='yes';% classifiers operate on individual trials FaceTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref ='no'; VaseTrials.keeptrials ='yes';% classifiers operate on individual trials VaseTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout ='biosemi64.lay'; cfg.method ='crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy''binomial''contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter ='mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments =''; cfg.colorbar ='yes'; cfg.interplimits='electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imagesc Subject 8.fig Type: application/x-xfig Size: 40249 bytes Desc: Imagesc Subject 8.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Subject 8 Topographical map.fig Type: application/x-xfig Size: 450612 bytes Desc: Subject 8 Topographical map.fig URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tutorial topographic map.png Type: image/png Size: 10419 bytes Desc: tutorial topographic map.png URL: From jan.schoffelen at donders.ru.nl Tue Sep 19 07:47:49 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 05:47:49 +0000 Subject: [FieldTrip] Question about MVPA topographic map In-Reply-To: References: <1504785200819.38370@kent.ac.uk> Message-ID: Hi Diane, First of all, I would recommend to share figures not as a matlab-figure, but as a screenshot bitmap or so. This saves people who are reading your mail a lot of overhead if they want to look at it, because they don’t need to start a matlab session etc. Your topographical image looks ‘different’ from the one on the wiki because the distribution of your electrodes is more around the whole ‘rim’ of the head. The colored plane that shows up within the circle is the consequence of a spatial interpolation (in 2D) of the data points represented at the locations of the electrodes. For this reason also, there’s no need to be very explicit about the meaning of the x and y axes: they represent space. Best wishes and good luck, Jan-Mathijs On 19 Sep 2017, at 06:25, D.Abdallah > wrote: Dear all, I've had a bit of trouble understanding the results that I get when using the ft_topoplotER. I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent. The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA. This is the code we are running on one of the subjects that we collected: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PREPROCESSING %Reading the data cfg = []; cfg.dataset = filename1; cfg.reref ='yes'; cfg.channel = {'Cz','PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'}; cfg.refchannel ='Cz'; cfg.demean ='yes'; data_eeg1 = ft_preprocessing(cfg); %Segmenting data cfg.trialdef.eventtype ='?'; Dummy = ft_definetrial(cfg); cfg.trialdef.prestim = 0.1; cfg.trialdef.poststim = 0.6; cfg.baselinewindow = [-0.1 0]; cfg.trialdef.eventtype ='STATUS'; cfg.trialdef.eventvalue = [100]; stimulusTrigger = ft_definetrial(cfg); cfg.trialdef.eventvalue = [1]; FaceTrials = ft_definetrial(cfg); cfg.trialdef.eventvalue = [2]; VaseTrials = ft_definetrial(cfg); %Definitions of Triggers stimulusTrigger = 100; faceResponseTrigger = 1; vaseResponseTrigger = 2; %Define Face Trials and Conduct Preprocessing [trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); FaceData = ft_preprocessing(FaceTrials); FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]'; FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]'; Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Define Vase Trials and Conduct Preprocessing [trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger); hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); VaseData = ft_preprocessing(VaseTrials); VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]'; Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]'; Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs); Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs); %Calculate Face ERP FaceTrials.reref ='no'; FaceTrials.keeptrials ='yes';% classifiers operate on individual trials FaceTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only FaceERP = ft_timelockanalysis(FaceTrials,FaceData); %Calculate Vase ERP VaseTrials.reref ='no'; VaseTrials.keeptrials ='yes';% classifiers operate on individual trials VaseTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only VaseERP = ft_timelockanalysis(VaseTrials,VaseData); %MVPA cfg.layout ='biosemi64.lay'; cfg.method ='crossvalidate'; cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)]; cfg.nfolds = 4; cfg.latency = [-0.1 0.6]; cfg.statistic = {'accuracy''binomial''contingency'}; stat = ft_timelockstatistics (cfg, FaceERP,VaseERP); stat.statistic.contingency %Plot MVPA Results stat.mymodel = stat.model{2}.primal; cfg.parameter ='mymodel'; cfg.xlim = [-0.1 0.6]; cfg.comments =''; cfg.colorbar ='yes'; cfg.interplimits='electrodes'; ft_topoplotER(cfg,stat); Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed. We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file). Why are the patterns very different? Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map). All the best, Diane Abdallah _______________________________________________ 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 Tue Sep 19 08:02:53 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 06:02:53 +0000 Subject: [FieldTrip] Using ft_redefinetrial with minlength and begsample/endsample option In-Reply-To: References: Message-ID: <6728EEE0-D0EF-4A9D-AAEA-50A61E765FC9@donders.ru.nl> Dear Nir Ofir, Thanks for reporting this. It seems that you have also identified a possible solution, which would be to do the ‘too short trial removal’, only after the realignment of the time axis of the trials. I think the best way to proceed would be that you try to implement this fix in your own local version of the FieldTrip git repository, and initiate a pull request once you are sure it works well. We will then review the suggested fix, and merge it into Fieldtrip’s code base, so that everyone can benefit from your efforts. Best wishes, Jan-Mathijs > On 14 Sep 2017, at 14:10, Nir Ofir wrote: > > Hi fieldtrip users, > > I have a data structure containing MEG trials which are aligned to stimulus onset. I now want to realign them to the target onset, as well as removing trials which are too short. I thought the easiest way to do this would be to use ft_redefinetrial in the following way: > > offset = dat.trialinfo(:,5); % this column contains the duration of the stimulus-target intervel > cfg = []; > cfg.minlength = -dat.time{1}(1)+cfgx.pretarget+0.5; % prestim defined by dat sructure + 0.5 s ERF + cfgx.pretarget > cfg.begsample = round((offset - cfgx.pretarget)*1000); > cfg.endample = round(offset*1000); > dat = ft_redefinetrial(cfg, dat); > > When I run this, I get the following error: > > Index exceeds matrix dimensions. > > Error in ft_redefinetrial (line 209) > data.trial{i} = data.trial{i}(:, begsample(i):endsample(i)); > > So I looked into ft_redefinetrials a bit, and it seems like when minlength is defined, the trials themselves are removed, but the begample/endsample vector are not cut to contain only the relevant trials. For now I moved to a 2-step solution (first removing trials, than realigning), but it seems like this could have a relatively simple fix. Suggestions? > > Thanks! > Nir Ofir > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From isac.sehlstedt at psy.gu.se Tue Sep 19 08:07:41 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Tue, 19 Sep 2017 06:07:41 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis Message-ID: Dear fieldtripers, I have conducted a EEG experiement and am currently in a wedge. The PCA-function used in matlab ( i.e. pca() ) gives me the latent and coeff values that I want to use for further analysis. Sadly, I have cannot figure out how to perform a group level analysis using the matlab function and later "unmix" the group analysis to the subject level. The a group analysis ft_componentanalysis function is easier to "unmix" thanks to its description of how to do so. However, I have not found a way to extract the latent and coefficient variables from the variables included in the comp-structure. My question is: Can you extract the latent and coefficient variables from the ft_componentanalysis results? Alternatively: Is it possible to extract the subject level latent and coefficient variables using the matlab function pca() ? Very best, Isac -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Sep 19 08:57:52 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 19 Sep 2017 06:57:52 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: <3197AF78-5B87-4F7C-A587-FFD8E8FF2071@donders.ru.nl> Hi Isac, My question is: Can you extract the latent and coefficient variables from the ft_componentanalysis results? I’d say that the ‘latent variables’ are in the comp.trial field, and the coefficients are in comp.topo Alternatively: Is it possible to extract the subject level latent and coefficient variables using the matlab function pca() ? I don’t know. Best wishes, Jan-Mathijs Very best, Isac _______________________________________________ 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 jean-michel.badier at univ-amu.fr Tue Sep 19 15:52:53 2017 From: jean-michel.badier at univ-amu.fr (Jean-Michel Badier) Date: Tue, 19 Sep 2017 15:52:53 +0200 Subject: [FieldTrip] Open positions at INS, Marseille. France Message-ID: /Post-doctoral position in the Theoretical Neuroscience Group - INS, Marseille, France/ *Summary* The Theoretical Neuroscience Group (Head: Viktor Jirsa) is seeking to fill a post-doctoral position in the context of the project EPINOV to work on statistical & dynamical modeling of seizure propagation using personalized brain modeling and neuroinformatics approaches on a cohort of hundreds of epilepsy patients. EPINOV is one of 10 large-scale projects selected in the 3rd round of French scientific excellence program «RHU» managed by the National Research Agency (ANR). The aim of the EPINOV project is to significantly improve presurgical interpretation, guide surgical strategies and translate computational tools into clinical routine of personalized medicine. We use individual MRI scans to reconstruct brain anatomy and connectivity, which are combined with a neural mass model and fit using the Bayesian modeling software Stan to individuals’ intracranial electrophysiology data (stereotactic EEG), validated by clinical data from other modalities, such as MEG, fMRI, and semiology. *Responsibilities* • Scale up statistical models “vertically” to handle more data and higher resolution anatomy, using model comparison techniques to evaluate the advantage of different model structures • Scale out models “horizontally”, performing coherent, reliable inference across a large cohort of patients using dedicated, on-site HPC resources • Develop routines to evaluate and visualize inference results, making them amenable to clinical interpretation • Integrate developed code into existing code bases and pipelines *Qualification * • Highly motivated to work on an interdisciplinary project and collaborate with the various members of the consortium. • PhD degree in computational neuroscience, mathematical or statistical modeling, machine learning or equivalent level of knowledge. • Significant, demonstrable experience in data fitting (Bayesian modeling, Dynamical Causal Modeling (DCM), Monte Carlo, etc) will be highly appreciated. • Experience with working in a Linux/HPC environment • Programming in a numerically oriented language (R, Python, MATLAB) • Familiarity with Git, unit testing, Docker/VMs is a plus *The Theoretical Neuroscience group * We are a multi-national team interested in understanding the mechanisms underlying the spatiotemporal organization of large-scale brain networks. Our work comprises mathematical and computational modeling of large-scale network dynamics and human brain imaging data, the development of neuroinformatics tools for studying large-scale brain networks applied to concrete functions, dysfunctions (epilepsy, dementia) and aging. *Terms of salary and employment * A 12-month renewable contract will be established. Salary will depend on the diploma and experience. Operating language in the laboratory is English. Applications including a cover letter, curriculum vitae and the names of two referees should be sent by September 30th 2017 to: Dr. Irene Yujnovsky at irene.yujnovsky at univ-amu.fr More information about the INS and the Theoretical Neurosciences Group can be found at: http://ins.univ-amu.fr *Clinical data manager for national consortium on epilepsy surgery - **Aix-Marseille Université * *Marseille, FRANCE* ** ** A position for an experienced clinical data manager is open to create and maintain an epileptic patient database including registration, normalization and security issues and to ensure the communication with the key partners in the academic, clinical and industry sectors with the aim of generating individual Virtual Patient models using The Virtual Brain (TVB) platform as framework (see http://www.thevirtualbrain.org).//This database will be generated in the context of the EPINOV (/Improving EPilepsy surgery management and progNOsis using Virtual brain technology) /projectled by Professor Fabrice Bartolomei (http://fr.ap-hm.fr/service/neurophysiologie-clinique-hopital-timone) funded by the RHU programme. *Qualification* ** Candidates must be highly motivated to work on an interdisciplinary project and collaborate with the various members of the consortium. They should have a degree in biomedical engineering, medical informatics or equivalent level of knowledge. Candidates must possess a solid experience in management of clinical and/or research data and programming (C, MATLAB, Python). Experience with neuroimaging data (stereotactic EEG, MRI, DTI, MEG, EEG), clinical trials, neuroinformatics and its standard formats (for instance DICOM, XNAT, BIDS), machine learning and Big Data would be considered an advantage. *The EPINOV project and consortium * We are a national consortium composed of clinicians, researchers and industrial partners interested in improving epilepsy surgical prognosis using large–scale brain modelling based on individual epileptic patient data. A prospective, randomized multicenter trial will be conducted with subjects suffering from drug-resistant epilepsy. The clinical trial will systematically evaluate the added value of personalized brain modelling in the surgical decision making. *Terms of salary and employment* Salary will depend on the diploma and previous experience. Operating languages in the consortium are both French and English. Applications including a cover letter, curriculum vitae and the names of two referees should be sent by October 31st 2017 to: *Dr. Irene Yujnovsky* at irene.yujnovsky at univ-amu.fr -- Jean michel Badier /- UMR S 1106 Institut de Neurosciences des Systèmes/ Aix-Marseille Université - Laboratoire MEG - TIMONE - 27 Boulevard Jean Moulin - 13005 Marseille Tél: +33(0)4 91 38 55 62 - Fax : +33(0)4 91 78 99 14 Site : http://www.univ-amu.fr - Email : jean-michel.badier at univ-amu.fr /Afin de respecter l'environnement, merci de n'imprimer cet email que si nécessaire./ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_amu.jpg Type: image/jpeg Size: 17847 bytes Desc: not available URL: From johnnguyen.education at gmail.com Tue Sep 19 18:41:34 2017 From: johnnguyen.education at gmail.com (John Nguyen) Date: Tue, 19 Sep 2017 12:41:34 -0400 Subject: [FieldTrip] Source analysis and sensor space differences Message-ID: Hi All, My Name is John Nguyen and I am working at the Reinhart Cognitive Neuroscience Lab at Boston University. I have been using Fieldtrip (Version 4/10/17)​​ for several months now and have decided to tackle SourceAnalysis. After a few weeks of struggling with it, I find myself still far from the goal post. A milestone I'm trying to achieve is plotting activity in the visual cortex due to a visual stimulus onset. This activity is easily reflected in my sensor-level plots but, in the source-level, it's projection is more than a bit wonky [image link, Negative sensor potential ,1.09-1.23s, following visual stimulus followed by positive sensor potential at 1.22-1.48s neither of which are present in source space.] [https://drive.google.com/file/d/0B2UdTHvTeS9NNWV6dGJKZ2JWbk0/ view?usp=sharing] In my current code I am using Fieldtrip templates to minimize error on my end as much as possible. "elec = ft_read_sens('standard_1020.elc'); load('standard_bem.mat','vol') load('standard_sourcemodel3d8mm.mat','sourcemodel') mri = ft_read_mri('single_subj_T1_1mm.nii');" My Sourceanalysis is timelocked LCMV with a relative baseline change at times -0.2 to 0.0s. I also preformed a relative baseline change on my sensor-level data because I was wondering if the disparity was a baseline issue. I've reached a dead-end and would appreciate any help. I've attached links to my script [https://drive.google.com/file/d/0B2UdTHvTeS9NT05uWUk4T0hDUjQ/ view?usp=sharing] and data (no rereference, no artifact reject) [https://drive.google.com/file/d/0B2UdTHvTeS9NSl8yaW9fcXZWSjQ/ view?usp=sharing] and sensor cap layout. [https://drive.google.com/file/d/0B2UdTHvTeS9NSGJXZUszOHBUbGM/ view?usp=sharing] Best regards, John Nguyen -------------- next part -------------- An HTML attachment was scrubbed... URL: From isac.sehlstedt at psy.gu.se Wed Sep 20 09:15:56 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Wed, 20 Sep 2017 07:15:56 +0000 Subject: [FieldTrip] Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis Message-ID: Dear fieldtripers, This is a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (which are also attached) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see Unknown.tiff, or Unknown-1.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see Unknown.tiff-2) . Why am I not getting that in ft? Is it possible to get that using ft? Very Best, Isac ----------------- The code ----------------- clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end ----------------- The variables/results ----------------- [X] [X] [X] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown.tiff Type: image/tiff Size: 987824 bytes Desc: Unknown.tiff URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown-1.tiff Type: image/tiff Size: 1158488 bytes Desc: Unknown-1.tiff URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Unknown-2.tiff Type: image/tiff Size: 293336 bytes Desc: Unknown-2.tiff URL: From litvak.vladimir at gmail.com Wed Sep 20 12:56:01 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 20 Sep 2017 11:56:01 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol Message-ID: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad0_5.png Type: image/png Size: 4854 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad1.png Type: image/png Size: 5013 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pad10.png Type: image/png Size: 4663 bytes Desc: not available URL: From r.oostenveld at donders.ru.nl Wed Sep 20 16:26:37 2017 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 20 Sep 2017 16:26:37 +0200 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: Message-ID: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert > On 20 Sep 2017, at 12:56, Vladimir Litvak wrote: > > Dear Fieldtrippers, > > I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. > > Is this a bug or a feature? > > Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. > > Thanks, > > Vladimir > > > ------------------------------------- > > pad = 0.5;%1%10 > > > freqoi = 5:45; > timwin = 0.4+0*freqoi; > > [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... > 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); > > figure; > subplot(2,1,1) > plot(freqoi, s1); > subplot(2,1,2); > plot(freqoi, s1-s1(1)); > %% > [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... > 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); > > subplot(2,1,1) > hold on > plot(freqoi, s2, 'r'); > subplot(2,1,2) > hold on > plot(freqoi, s2-s2(1), 'r'); > _______________________________________________ > 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 stephen.whitmarsh at gmail.com Wed Sep 20 17:03:52 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 20 Sep 2017 17:03:52 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization Message-ID: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Wed Sep 20 20:00:47 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Wed, 20 Sep 2017 18:00:47 +0000 (UTC) Subject: [FieldTrip] Splitting EEG References: <1779089334.6211483.1505930447659.ref@mail.yahoo.com> Message-ID: <1779089334.6211483.1505930447659@mail.yahoo.com> Hello Fieldtrip users, I have a continues EEG data ( 80 seconds) and I would like to analyze some part of it.For instance, I want to analyse seconds 20 to 25 ( 5 seconds).Would you please let me know how can I select my times of interest.I've written a simple code but I don't know how can I split the data.  cfg    = []; cfg.dataset = '........  .eeg'; data_org                = ft_preprocessing(cfg); %Original Data % Step1:  Filtering Row Data cfg                        = []; cfg.bpfilter            = 'yes'; cfg.bpfreq             = [1 30]; data_Filtered        = ft_preprocessing(cfg,data_org); -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Wed Sep 20 22:22:51 2017 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Wed, 20 Sep 2017 20:22:51 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: Message-ID: <0A0286C7-606F-4B30-B8F4-6689EAAD9620@cfin.au.dk> Hi Stephen, We have a pipeline that can use either SPM8 or SPM12 to perform both segmentation and normalization, though perhaps in a way that’s different from the official FieldTrip tutorials. Have a look at: https://github.com/meeg-cfin/nemolab/blob/master/basics/nemo_mriproc.m ft_volumesegment should use whichever SPM is in your path (be careful about fieldtrip/external/spm8!), and (according to my memory) SPM12 sometimes can succeed where SPM8 doesn’t provide good segmentations. Note that for the normalization in SPM12, our script defines “/OldNorm/T1.nii” as the template, which indeed seems to give results equivalent to SPM8. I think you could change this to SPM12’s default template if you prefer. NB: we use MRI coordinates as the base coordinate system in our pipelines, so MEG/EEG is transformed to MRI, rather than MRI to MEG/EEG. Cheers, Sarang On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 cornelia.quaedflieg at uni-hamburg.de Wed Sep 20 22:51:57 2017 From: cornelia.quaedflieg at uni-hamburg.de (Conny Quaedflieg) Date: Wed, 20 Sep 2017 22:51:57 +0200 Subject: [FieldTrip] Splitting EEG In-Reply-To: <1779089334.6211483.1505930447659@mail.yahoo.com> References: <1779089334.6211483.1505930447659.ref@mail.yahoo.com> <1779089334.6211483.1505930447659@mail.yahoo.com> Message-ID: <20170920205155.9C930B5309@mailhost.uni-hamburg.de> Dear Hamed, You can use ft_select data with cfg.latency See http://www.fieldtriptoolbox.org/reference/ft_selectdata best Conny Van: Hamed Taheri Verzonden: woensdag 20 september 2017 20:12 Aan: fieldtrip at science.ru.nl Onderwerp: [FieldTrip] Splitting EEG Hello Fieldtrip users, I have a continues EEG data ( 80 seconds) and I would like to analyze some part of it. For instance, I want to analyse seconds 20 to 25 ( 5 seconds). Would you please let me know how can I select my times of interest. I've written a simple code but I don't know how can I split the data.  cfg    = []; cfg.dataset = '........  .eeg'; data_org                = ft_preprocessing(cfg); %Original Data % Step1:  Filtering Row Data cfg                        = []; cfg.bpfilter            = 'yes'; cfg.bpfreq             = [1 30]; data_Filtered        = ft_preprocessing(cfg,data_org); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 21 09:09:06 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 07:09:06 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: Message-ID: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Hi Stephen, Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). Best, Jan-Mathijs On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 litvak.vladimir at gmail.com Thu Sep 21 11:17:11 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 10:17:11 +0100 Subject: [FieldTrip] MEG technician post at UCL Message-ID: *Senior MEG Research Technician* Applications are invited for a Senior Research Technician in the Wellcome Centre for Human Neuroimaging, UCL Institute of Neurology. The Centre houses an Electroencephalography (EEG) system, two Magnetoencephalography (MEG) systems - a CTF 275 channel Omega System and an Optically Pumped Magnetometer (OPM) System - and Magnetic Resonance Imaging (MRI) facilities - two 3T Siemens Prisma scanners and a 3T Siemens Trio. The successful candidate will be responsible for coordinating and maintaining an efficient MEG and EEG service for a range of different research projects. This role will be constantly evolving as new and alternative technologies are incorporated into the functional imaging department. *Applicants are required to have:* · Experience of EEG/MEG or similar electrophysiological recording methods (e.g. cardiology/audiology) within a clinical or research environment. · A commitment to academic research. · MEG experience is not essential as training will be provided. *Salary - UCL Grade 7:* £34,653 to £41,864 inclusive of London Allowance. The post is available immediately and is funded until Nov 2021 in the first instance. Applications through UCL's online recruitment – www.ucl.ac.uk/hr/jobs where you can download a job description and person specification using ref: 1671016. Informal enquiries to Elaine Williams: elaine.williams at ucl.ac.uk . If you have any queries regarding the application process, please contact Samantha Robinson, HR Officer, Institute of Neurology, 23 Queen Square, London, WC1N 3BG (email: ion.hradmin at ucl.ac.uk). *Closing date: 26th September 2017* *Taking Action for Equality* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Sep 21 11:53:05 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 09:53:05 +0000 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> Message-ID: <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Hi to all who’s reading along, Perhaps the two cases will become more similar once the ‘timwin’ is increased in length for the mtmconvol case…. Best wishes, JM On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); _______________________________________________ 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 litvak.vladimir at gmail.com Thu Sep 21 12:29:12 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 11:29:12 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Yes, you are right about Robert's example. But if you do: pad = 10; fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning', 'pad', pad); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); You will see the problem that I'm talking about. We discussed with Robert yesterday and this is indeed 'a feature' which has to do with the fact that the outputs of mtmfft and mtmconvol have different units. The former is spectral density whereas the latter is spectral power. Here is what Robert wrote me: the units of computations (also here) are a known and long-standing issue. I know for a long time that the two have different scaling, but did not think about it for a long time. I recall something like this: To compare TFRs over frequencies, you don't want the bandwidth to affect the estimate. Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral resolution over which the signal(and noise) spreads is different. If you were to compute the TFR in V^2/Hz, the same V at 20Hz would have a different value, because the length of the wavelet affects the 1/Hz. something related (but nevertheless different) applies to the mtmfft: if you want to estimate broadband activity in a window of 1 second or a window of 2 seconds, you would get different spectral resolutions. The nyquist is the same, but the power gets distributed over more bins between 0 and Fnyquist/2. That would cause the values to appear smaller in the 2-s case. Hence we compute spectral density, which somehow normalizes for this. I never found a really clear explanation, but google got me this https://dsp.stackexchange.com/questions/33957/what-is-the-difference-between-the-psd-and-the-power-spectrum what confuses me is that power (or variance) is already normalized, i.e. sum of squared values divided by N. So we have energy (which increases with length), power (which does not increase with length), and power density So one issue is that most people don't know about this including me and possibly you. I think a good solution would be to add an option to specify the output units for all the methods as there might be quite subtle considerations for choosing one over the other as Robert suggests. Vladimir On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi to all who’s reading along, > > Perhaps the two cases will become more similar once the ‘timwin’ is > increased in length for the mtmconvol case…. > > Best wishes, > > JM > > On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: > > Hi Vladimir, > > I suggest that you first start with a simpler case, like this > > fsample = 1000; > time = (1:1000)/fsample; > dat = randn(size(time)); > > [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', > 'hanning'); > > power1 = abs(spectrum1).^2; > power1 = squeeze(power1); > > [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, > 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); > > power2 = abs(spectrum2).^2; > power2 = squeeze(power2); > > figure > plot(freqoi1, power1); > hold on > plot(freqoi2, power2, 'r'); > > Note that these are not the same (albeit similar), which I had expected… > > best > Robert > > > > On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: > > Dear Fieldtrippers, > > I'm looking into an issue of one of SPM users who gets different results > when doing TF decomposition compared to computing a spectrum for the same > time window. I'm not sure I got to the bottom of it yet but one thing I > found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected > differently by increasing padding. For short padding the results are > similar but with increasing padding there are differences both in offset of > the spectrum and its overall shape. See attached images where the top one > shows original spectra and the bottom one aligns the lowermost bin to zero. > > Is this a bug or a feature? > > Below is the script that produces these plots. I could provide the data as > well but this could probably be reproduced with any data. > > Thanks, > > Vladimir > > > ------------------------------------- > > pad = 0.5;%1%10 > > > freqoi = 5:45; > timwin = 0.4+0*freqoi; > > [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, > 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... > 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); > > figure; > subplot(2,1,1) > plot(freqoi, s1); > subplot(2,1,2); > plot(freqoi, s1-s1(1)); > %% > [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', > 'hanning', 'freqoi', freqoi,... > 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); > > s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); > > subplot(2,1,1) > hold on > plot(freqoi, s2, 'r'); > subplot(2,1,2) > hold on > plot(freqoi, s2-s2(1), 'r'); > __________________________ > _____________________ > 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 litvak.vladimir at gmail.com Thu Sep 21 12:34:23 2017 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 21 Sep 2017 11:34:23 +0100 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: Another thing that I noticed is that in the mtmconvol case padding is added to the entire trial, not to the short window over which FFT is actually computed. This might be because you actually use a wavelet which moves along the data (I didn't check that). Anyhow right now this doesn't make much difference because padding doesn't affect mtmconvol in such a dramatic way as mtmfft. However, if you do allow specifying the units as power rather than density then the way things are now mtmconvol and mtmfft with the same padding would not be equivalent. Vladimir On Thu, Sep 21, 2017 at 11:29 AM, Vladimir Litvak wrote: > Hi Jan-Mathijs, > > Yes, you are right about Robert's example. But if you do: > > pad = 10; > > fsample = 1000; > time = (1:1000)/fsample; > dat = randn(size(time)); > > [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', > 'hanning', 'pad', pad); > > power1 = abs(spectrum1).^2; > power1 = squeeze(power1); > > [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, > 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); > > power2 = abs(spectrum2).^2; > power2 = squeeze(power2); > > figure > plot(freqoi1, power1); > hold on > plot(freqoi2, power2, 'r'); > > > You will see the problem that I'm talking about. We discussed with Robert > yesterday and this is indeed 'a feature' which has to do with the fact that > the outputs of mtmfft and mtmconvol have different units. The former is > spectral density whereas the latter is spectral power. > > Here is what Robert wrote me: > > > the units of computations (also here) are a known and long-standing issue. > I know for a long time that the two have different scaling, but did not > think about it for a long time. I recall something like this: To compare > TFRs over frequencies, you don't want the bandwidth to affect the estimate. > Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect > those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with > conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral > resolution over which the signal(and noise) spreads is different. If you > were to compute the TFR in V^2/Hz, the same V at 20Hz would have a > different value, because the length of the wavelet affects the 1/Hz. > something related (but nevertheless different) applies to the mtmfft: if > you want to estimate broadband activity in a window of 1 second or a window > of 2 seconds, you would get different spectral resolutions. The nyquist is > the same, but the power gets distributed over more bins between 0 and > Fnyquist/2. That would cause the values to appear smaller in the 2-s case. > Hence we compute spectral density, which somehow normalizes for this. I > never found a really clear explanation, but google got me this > https://dsp.stackexchange.com/questions/33957/what-is-the- > difference-between-the-psd-and-the-power-spectrum > what confuses me is that power (or variance) is already normalized, i.e. > sum of squared values divided by N. So we have energy (which increases with > length), power (which does not increase with length), and power density > > > So one issue is that most people don't know about this including me and > possibly you. I think a good solution would be to add an option to specify > the output units for all the methods as there might be quite subtle > considerations for choosing one over the other as Robert suggests. > > Vladimir > > On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi to all who’s reading along, >> >> Perhaps the two cases will become more similar once the ‘timwin’ is >> increased in length for the mtmconvol case…. >> >> Best wishes, >> >> JM >> >> On 20 Sep 2017, at 16:26, Robert Oostenveld >> wrote: >> >> Hi Vladimir, >> >> I suggest that you first start with a simpler case, like this >> >> fsample = 1000; >> time = (1:1000)/fsample; >> dat = randn(size(time)); >> >> [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', >> 'hanning'); >> >> power1 = abs(spectrum1).^2; >> power1 = squeeze(power1); >> >> [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, >> 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); >> >> power2 = abs(spectrum2).^2; >> power2 = squeeze(power2); >> >> figure >> plot(freqoi1, power1); >> hold on >> plot(freqoi2, power2, 'r'); >> >> Note that these are not the same (albeit similar), which I had expected… >> >> best >> Robert >> >> >> >> On 20 Sep 2017, at 12:56, Vladimir Litvak >> wrote: >> >> Dear Fieldtrippers, >> >> I'm looking into an issue of one of SPM users who gets different results >> when doing TF decomposition compared to computing a spectrum for the same >> time window. I'm not sure I got to the bottom of it yet but one thing I >> found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected >> differently by increasing padding. For short padding the results are >> similar but with increasing padding there are differences both in offset of >> the spectrum and its overall shape. See attached images where the top one >> shows original spectra and the bottom one aligns the lowermost bin to zero. >> >> Is this a bug or a feature? >> >> Below is the script that produces these plots. I could provide the data >> as well but this could probably be reproduced with any data. >> >> Thanks, >> >> Vladimir >> >> >> ------------------------------------- >> >> pad = 0.5;%1%10 >> >> >> freqoi = 5:45; >> timwin = 0.4+0*freqoi; >> >> [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, >> 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... >> 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); >> >> s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); >> >> figure; >> subplot(2,1,1) >> plot(freqoi, s1); >> subplot(2,1,2); >> plot(freqoi, s1-s1(1)); >> %% >> [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', >> 'hanning', 'freqoi', freqoi,... >> 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); >> >> s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); >> >> subplot(2,1,1) >> hold on >> plot(freqoi, s2, 'r'); >> subplot(2,1,2) >> hold on >> plot(freqoi, s2-s2(1), 'r'); >> ___________________________ >> ____________________ >> 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 jan.schoffelen at donders.ru.nl Thu Sep 21 12:36:30 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 21 Sep 2017 10:36:30 +0000 Subject: [FieldTrip] Padding with mtmfft and mtmconvol In-Reply-To: References: <28E8B0F3-716D-4B19-83CF-88633BAE0B5D@donders.ru.nl> <54500427-7820-4544-970C-3C77C71739DA@donders.ru.nl> Message-ID: <612489C6-6EFD-4D56-A9FC-189A180CC961@donders.ru.nl> Don’t worry Vladimir, Robert and I have discussed these issues at length on several occasions in the past ;) Best wishes, JM On 21 Sep 2017, at 12:29, Vladimir Litvak > wrote: Hi Jan-Mathijs, Yes, you are right about Robert's example. But if you do: pad = 10; fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning', 'pad', pad); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.99, 'pad', pad); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); You will see the problem that I'm talking about. We discussed with Robert yesterday and this is indeed 'a feature' which has to do with the fact that the outputs of mtmfft and mtmconvol have different units. The former is spectral density whereas the latter is spectral power. Here is what Robert wrote me: the units of computations (also here) are a known and long-standing issue. I know for a long time that the two have different scaling, but did not think about it for a long time. I recall something like this: To compare TFRs over frequencies, you don't want the bandwidth to affect the estimate. Shorter wavelets have a larger bandwidth, hence the 1/Hz would affect those. E.g. imagine a 10Hz and a 20Hz sine wave, and do a TFR with conventional wavelets: at 20Hz the wavelet is 2x shorter, so the spectral resolution over which the signal(and noise) spreads is different. If you were to compute the TFR in V^2/Hz, the same V at 20Hz would have a different value, because the length of the wavelet affects the 1/Hz. something related (but nevertheless different) applies to the mtmfft: if you want to estimate broadband activity in a window of 1 second or a window of 2 seconds, you would get different spectral resolutions. The nyquist is the same, but the power gets distributed over more bins between 0 and Fnyquist/2. That would cause the values to appear smaller in the 2-s case. Hence we compute spectral density, which somehow normalizes for this. I never found a really clear explanation, but google got me this https://dsp.stackexchange.com/questions/33957/what-is-the-difference-between-the-psd-and-the-power-spectrum what confuses me is that power (or variance) is already normalized, i.e. sum of squared values divided by N. So we have energy (which increases with length), power (which does not increase with length), and power density So one issue is that most people don't know about this including me and possibly you. I think a good solution would be to add an option to specify the output units for all the methods as there might be quite subtle considerations for choosing one over the other as Robert suggests. Vladimir On Thu, Sep 21, 2017 at 10:53 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi to all who’s reading along, Perhaps the two cases will become more similar once the ‘timwin’ is increased in length for the mtmconvol case…. Best wishes, JM On 20 Sep 2017, at 16:26, Robert Oostenveld > wrote: Hi Vladimir, I suggest that you first start with a simpler case, like this fsample = 1000; time = (1:1000)/fsample; dat = randn(size(time)); [spectrum1,ntaper1,freqoi1] = ft_specest_mtmfft(dat, time, 'taper', 'hanning'); power1 = abs(spectrum1).^2; power1 = squeeze(power1); [spectrum2,ntaper2,freqoi2,timeoi2] = ft_specest_mtmconvol(dat, time, 'taper', 'hanning', 'timeoi', mean(time), 'timwin', 0.5); power2 = abs(spectrum2).^2; power2 = squeeze(power2); figure plot(freqoi1, power1); hold on plot(freqoi2, power2, 'r'); Note that these are not the same (albeit similar), which I had expected… best Robert On 20 Sep 2017, at 12:56, Vladimir Litvak > wrote: Dear Fieldtrippers, I'm looking into an issue of one of SPM users who gets different results when doing TF decomposition compared to computing a spectrum for the same time window. I'm not sure I got to the bottom of it yet but one thing I found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected differently by increasing padding. For short padding the results are similar but with increasing padding there are differences both in offset of the spectrum and its overall shape. See attached images where the top one shows original spectra and the bottom one aligns the lowermost bin to zero. Is this a bug or a feature? Below is the script that produces these plots. I could provide the data as well but this could probably be reproduced with any data. Thanks, Vladimir ------------------------------------- pad = 0.5;%1%10 freqoi = 5:45; timwin = 0.4+0*freqoi; [spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper', 'hanning', 'timeoi', 1.2, 'freqoi', freqoi,... 'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s1 = squeeze(mean(mean(abs(spectrum), 4), 2)); figure; subplot(2,1,1) plot(freqoi, s1); subplot(2,1,2); plot(freqoi, s1-s1(1)); %% [spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper', 'hanning', 'freqoi', freqoi,... 'tapsmofrq', 1, 'verbose', 0, 'pad', pad); s2 = squeeze(mean(mean(abs(spectrum), 2), 1)); subplot(2,1,1) hold on plot(freqoi, s2, 'r'); subplot(2,1,2) hold on plot(freqoi, s2-s2(1), 'r'); _______________________________________________ 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 stephen.whitmarsh at gmail.com Thu Sep 21 14:36:43 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 14:36:43 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Dear Sarang and Jan-Mathijs, Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. Best wishes and thanks again! Stephen On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Stephen, > > Please note that FT now has full support for SPM12, both using the > old-style segmentation, and the new one (the latter yielding 6 tissue > types). > > Best, > Jan-Mathijs > > On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: > > Dear all, > > I having some problems in normalizing MRIs for my study. Some have > improper segmentation for which changing individual brain/scalp thresholds > works in many cases but not all, e.g. when the scalp 'bleeds' into some > noise outside of the head. Also, changing parameters in spm8 for > normalization, such as number of iterations (directly in in spm_normalize, > since FT does not pass these parameters) improves the transformation. > > However, some scans I cannot deal with, either because they have noise > from outsides of the head 'bleed' onto the scalp, thereby preventing > optimal scalp-segmentation and thereby normalization. Others have an > inappropriate contrast MRI sequence. > > Some fMRI researchers advised me to use SPM12, because of its improved > preprocessing procedures. However, it does not seem supported in FT yet. > Does anyone have experience with this, and can perhaps share how they > extracted the transformation matrix from the resulting nifti's? > > Thanks, > Stephen > _______________________________________________ > 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 hgould at memphis.edu Thu Sep 21 15:56:38 2017 From: hgould at memphis.edu (Herbert J Gould (hgould)) Date: Thu, 21 Sep 2017 13:56:38 +0000 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl>, Message-ID: I have retired please remove me from the mail list Herbert Jay Gould Professor Emeritus The University of Memphis Sent from my Verizon Wireless 4G LTE smartphone -------- Original message -------- From: Stephen Whitmarsh Date:09/21/2017 7:43 AM (GMT-06:00) To: FieldTrip discussion list Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) normalization Dear Sarang and Jan-Mathijs, Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. Best wishes and thanks again! Stephen On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Stephen, Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). Best, Jan-Mathijs On 20 Sep 2017, at 17:03, Stephen Whitmarsh > wrote: Dear all, I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? Thanks, Stephen _______________________________________________ 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 a.stolk8 at gmail.com Thu Sep 21 17:00:20 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 21 Sep 2017 08:00:20 -0700 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hey Stephen, Look for discussions regarding spm12 and also dartel on bugzilla. It's been a while but as far as I can remember ft_volumenormalize is the only function now that has not been integrated. Reason being that it wasnt straightforward to house the dartel procedure under a single function, so this is ongoing work still. You can however use spm12's coregistration function with ft_volumerealign (for rigid body transformations), which Im using quite a bit and never let me down (and is much faster than before). But that wouldnt work for normalization to template space though (use spm8). Best > On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) wrote: > > I have retired please remove me from the mail list > > Herbert Jay Gould > Professor Emeritus > The University of Memphis > > > > Sent from my Verizon Wireless 4G LTE smartphone > > > -------- Original message -------- > From: Stephen Whitmarsh > Date:09/21/2017 7:43 AM (GMT-06:00) > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) normalization > > Dear Sarang and Jan-Mathijs, > > Thanks a lot. I am now able (after updating FT, which now includes SPM12 in /external), to use SPM12 for segmentation of my template and my subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big improvement over 8 when it comes to brain-segmentation, which now does not require individual treatments anymore. It also outputs more compartments which gives me a little bit more to work with when dealing with scans that have bad delineation of the scalp for normalization. > > Pleas note that defaults seems to differ - some FT functions default to spm8, others to spm12. > > In fact, FT still reverts to spm8 in ft_volumenormalise when called in ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = 'spm12'. In other words the cfg.spmversion is not passed along. > > Best wishes and thanks again! > Stephen > > > >> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Stephen, >> >> Please note that FT now has full support for SPM12, both using the old-style segmentation, and the new one (the latter yielding 6 tissue types). >> >> Best, >> Jan-Mathijs >> >>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh wrote: >>> >>> Dear all, >>> >>> I having some problems in normalizing MRIs for my study. Some have improper segmentation for which changing individual brain/scalp thresholds works in many cases but not all, e.g. when the scalp 'bleeds' into some noise outside of the head. Also, changing parameters in spm8 for normalization, such as number of iterations (directly in in spm_normalize, since FT does not pass these parameters) improves the transformation. >>> >>> However, some scans I cannot deal with, either because they have noise from outsides of the head 'bleed' onto the scalp, thereby preventing optimal scalp-segmentation and thereby normalization. Others have an inappropriate contrast MRI sequence. >>> >>> Some fMRI researchers advised me to use SPM12, because of its improved preprocessing procedures. However, it does not seem supported in FT yet. Does anyone have experience with this, and can perhaps share how they extracted the transformation matrix from the resulting nifti's? >>> >>> Thanks, >>> Stephen >>> _______________________________________________ >>> 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 zhangwenjia2732 at 126.com Thu Sep 21 17:30:13 2017 From: zhangwenjia2732 at 126.com (=?GBK?B?1cXOxLzO?=) Date: Thu, 21 Sep 2017 23:30:13 +0800 (CST) Subject: [FieldTrip] Reading data too slow Message-ID: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> Dear all, I have some problems in reading data into fieldtrip. Specifically, I used EGI system to record EEG data and preprocessed them with Brainvison analyzer Then, I exported the preprocessed data into generic data format, making 3 files: .eeg, .vhdr and vmrk. Last, I used ft_definetrial and ft_preprocessing to read these data into FieldTrip. However, the reading is very very slow. I tried to make only 2 channels left and tried methods as follow: http://www.fieldtriptoolbox.org/faq/reading_is_slow_can_i_write_my_raw_data_to_a_more_efficient_file_format But, they all did not work. Does anyone know what I am doing wrong? Any advice very appreciated. Thank you -- Wenjia NYU Shanghai -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Thu Sep 21 17:52:31 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 17:52:31 +0200 Subject: [FieldTrip] Reading data too slow In-Reply-To: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> References: <21cb46ef.bd6f.15ea50f8baa.Coremail.zhangwenjia2732@126.com> Message-ID: Hi Wenjia, It's impossible to give specific advice with no extra information. How slow? Is the data read at all? Any error messages? What script are you exactly running and what is the output? See: http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community I would also check your computer resources (CPU and memory) during loading to see if you are running into a memory/CPU problem specific for your system. Finally, I would start with no filters. They sometimes take a while. Cheers, Stephen On 21 September 2017 at 17:30, 张文嘉 wrote: > > > Dear all, > > I have some problems in reading data into fieldtrip. > Specifically, I used EGI system to record EEG data and preprocessed them > with Brainvison analyzer > Then, I exported the preprocessed data into generic data format, making 3 > files: .eeg, .vhdr and vmrk. > Last, I used ft_definetrial and ft_preprocessing to read these data into > FieldTrip. > However, the reading is very very slow. > > I tried to make only 2 channels left and tried methods as follow: > http://www.fieldtriptoolbox.org/faq/reading_is_slow_can_i_ > write_my_raw_data_to_a_more_efficient_file_format > But, they all did not work. > > Does anyone know what I am doing wrong? Any advice very appreciated. > Thank you > > -- > Wenjia > NYU Shanghai > > > > > _______________________________________________ > 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 stephen.whitmarsh at gmail.com Thu Sep 21 18:20:47 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 21 Sep 2017 18:20:47 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Thanks, and good to hear you've not been let down yet. It might be the fact that I have some bad quality MRIs to deal with. However... does this problem (see attached) ring a bell for anyone?: Brain segmentation is proper, and co-registration with polhemus head-shape as well, but inverse warp to MNI result in a tilted grid. Linear vs. non-linear transformation gives the same result. Other subjects going through the same procedure work fine, except two others wherein I identified it as a problem in segmenting the scalp and therefor the first step of the normalization. This one looks absolutely fine in every other regard, however. I'm stumped... cfg = []; cfg.spmversion = 'spm12'; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri_realigned; cfg.grid.unit = 'mm'; subject_grid = ft_prepare_sourcemodel(cfg); Cheers, Stephen On 21 September 2017 at 17:00, Arjen Stolk wrote: > Hey Stephen, > > Look for discussions regarding spm12 and also dartel on bugzilla. It's > been a while but as far as I can remember ft_volumenormalize is the only > function now that has not been integrated. Reason being that it wasnt > straightforward to house the dartel procedure under a single function, so > this is ongoing work still. You can however use spm12's coregistration > function with ft_volumerealign (for rigid body transformations), which Im > using quite a bit and never let me down (and is much faster than before). > But that wouldnt work for normalization to template space though (use spm8). > > Best > > On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) > wrote: > > I have retired please remove me from the mail list > > Herbert Jay Gould > Professor Emeritus > The University of Memphis > > > > Sent from my Verizon Wireless 4G LTE smartphone > > > -------- Original message -------- > From: Stephen Whitmarsh > Date:09/21/2017 7:43 AM (GMT-06:00) > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) > normalization > > Dear Sarang and Jan-Mathijs, > > Thanks a lot. I am now able (after updating FT, which now includes SPM12 > in /external), to use SPM12 for segmentation of my template and my subject > MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big > improvement over 8 when it comes to brain-segmentation, which now does not > require individual treatments anymore. It also outputs more compartments > which gives me a little bit more to work with when dealing with scans that > have bad delineation of the scalp for normalization. > > Pleas note that defaults seems to differ - some FT functions default to > spm8, others to spm12. > > In fact, FT still reverts to spm8 in ft_volumenormalise when called in > ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = > 'spm12'. In other words the cfg.spmversion is not passed along. > > Best wishes and thanks again! > Stephen > > > > On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Stephen, >> >> Please note that FT now has full support for SPM12, both using the >> old-style segmentation, and the new one (the latter yielding 6 tissue >> types). >> >> Best, >> Jan-Mathijs >> >> On 20 Sep 2017, at 17:03, Stephen Whitmarsh >> wrote: >> >> Dear all, >> >> I having some problems in normalizing MRIs for my study. Some have >> improper segmentation for which changing individual brain/scalp thresholds >> works in many cases but not all, e.g. when the scalp 'bleeds' into some >> noise outside of the head. Also, changing parameters in spm8 for >> normalization, such as number of iterations (directly in in spm_normalize, >> since FT does not pass these parameters) improves the transformation. >> >> However, some scans I cannot deal with, either because they have noise >> from outsides of the head 'bleed' onto the scalp, thereby preventing >> optimal scalp-segmentation and thereby normalization. Others have an >> inappropriate contrast MRI sequence. >> >> Some fMRI researchers advised me to use SPM12, because of its improved >> preprocessing procedures. However, it does not seem supported in FT yet. >> Does anyone have experience with this, and can perhaps share how they >> extracted the transformation matrix from the resulting nifti's? >> >> Thanks, >> Stephen >> _______________________________________________ >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm3.jpg Type: image/jpeg Size: 83068 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm2.jpg Type: image/jpeg Size: 115317 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: badnorm1.jpg Type: image/jpeg Size: 54151 bytes Desc: not available URL: From a.stolk8 at gmail.com Thu Sep 21 18:45:46 2017 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 21 Sep 2017 09:45:46 -0700 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: First thought is a registration of brain outline to skull (instead of brain), although at closer inspection the shift seems overall just a bit too large for that. You could try calculating the normalization parameters on skullstripped volumes (unless you want to keep non-brain tissue). On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < stephen.whitmarsh at gmail.com> wrote: > Hi Arjen, > > Thanks, and good to hear you've not been let down yet. It might be the > fact that I have some bad quality MRIs to deal with. However... does this > problem (see attached) ring a bell for anyone?: > > Brain segmentation is proper, and co-registration with polhemus > head-shape as well, but inverse warp to MNI result in a tilted grid. > Linear vs. non-linear transformation gives the same result. Other subjects > going through the same procedure work fine, except two others wherein I > identified it as a problem in segmenting the scalp and therefor the first > step of the normalization. This one looks absolutely fine in every other > regard, however. > > I'm stumped... > > cfg = []; > cfg.spmversion = 'spm12'; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri_realigned; > cfg.grid.unit = 'mm'; > subject_grid = ft_prepare_sourcemodel(cfg); > > Cheers, > Stephen > > > On 21 September 2017 at 17:00, Arjen Stolk wrote: > >> Hey Stephen, >> >> Look for discussions regarding spm12 and also dartel on bugzilla. It's >> been a while but as far as I can remember ft_volumenormalize is the only >> function now that has not been integrated. Reason being that it wasnt >> straightforward to house the dartel procedure under a single function, so >> this is ongoing work still. You can however use spm12's coregistration >> function with ft_volumerealign (for rigid body transformations), which Im >> using quite a bit and never let me down (and is much faster than before). >> But that wouldnt work for normalization to template space though (use spm8). >> >> Best >> >> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) >> wrote: >> >> I have retired please remove me from the mail list >> >> Herbert Jay Gould >> Professor Emeritus >> The University of Memphis >> >> >> >> Sent from my Verizon Wireless 4G LTE smartphone >> >> >> -------- Original message -------- >> From: Stephen Whitmarsh >> Date:09/21/2017 7:43 AM (GMT-06:00) >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >> normalization >> >> Dear Sarang and Jan-Mathijs, >> >> Thanks a lot. I am now able (after updating FT, which now includes SPM12 >> in /external), to use SPM12 for segmentation of my template and my subject >> MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >> improvement over 8 when it comes to brain-segmentation, which now does not >> require individual treatments anymore. It also outputs more compartments >> which gives me a little bit more to work with when dealing with scans that >> have bad delineation of the scalp for normalization. >> >> Pleas note that defaults seems to differ - some FT functions default to >> spm8, others to spm12. >> >> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >> 'spm12'. In other words the cfg.spmversion is not passed along. >> >> Best wishes and thanks again! >> Stephen >> >> >> >> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hi Stephen, >>> >>> Please note that FT now has full support for SPM12, both using the >>> old-style segmentation, and the new one (the latter yielding 6 tissue >>> types). >>> >>> Best, >>> Jan-Mathijs >>> >>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh >>> wrote: >>> >>> Dear all, >>> >>> I having some problems in normalizing MRIs for my study. Some have >>> improper segmentation for which changing individual brain/scalp thresholds >>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>> noise outside of the head. Also, changing parameters in spm8 for >>> normalization, such as number of iterations (directly in in spm_normalize, >>> since FT does not pass these parameters) improves the transformation. >>> >>> However, some scans I cannot deal with, either because they have noise >>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>> optimal scalp-segmentation and thereby normalization. Others have an >>> inappropriate contrast MRI sequence. >>> >>> Some fMRI researchers advised me to use SPM12, because of its improved >>> preprocessing procedures. However, it does not seem supported in FT yet. >>> Does anyone have experience with this, and can perhaps share how they >>> extracted the transformation matrix from the resulting nifti's? >>> >>> Thanks, >>> Stephen >>> _______________________________________________ >>> 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 sarang at cfin.au.dk Thu Sep 21 19:30:25 2017 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Thu, 21 Sep 2017 17:30:25 +0000 Subject: [FieldTrip] Using fixed orientations for men-source estimation In-Reply-To: <71D8A67A81D69A4CB5BE2B979021C26ECAFFE748@esen3.imed.uni-magdeburg.de> References: <71D8A67A81D69A4CB5BE2B979021C26ECAFFE748@esen3.imed.uni-magdeburg.de> Message-ID: <1506015025.9072.22.camel@cfin.au.dk> Hi Christian, I had flagged your email to follow-up later but lost track of it -- it seems you didn't get a response yet, but I hope mine is still useful! The strategy that the 'fixedori' implements for the beamformer variants (and sLORETA) are not based on the anatomical normal, but rather the direction that maximizes the theoretical SNR (adaptively determined from the signal characteristics). This optimal direction is dependent on the particular weight calculation formula for each source localization variant. Therefore, a similar SNR optimization strategy for minimum norm would actually require a different formula than you see used for the others. It's simple enough to implement if you know what that formula is. :-) It is likely to be contained in the book by Sekihara & Nagarajan (2008), if you'd like to have a go at it yourself. That said, min-norm is often (or perhaps usually) performed with the solution space constrained to gray matter voxels, and the orientations defined to be normal to the cortical surface. If you independently have a way to obtain anatomically derived orientations, then you can manually provide them in lf.ori. (Or maybe there is a FieldTrip function that could obtain these normals from the MRI segmentation procedure?) Cheers, Sarang On Tue, 2017-08-01 at 11:11 +0000, christian.merkel at med.ovgu.de wrote: Hello, I am running ft_sourceanalysis and am wondering why I can restrict the parameter-estimation in LCMV and sLORETA by setting the parameter 'fixedori' but not when using MNE. Shouldn't one be able to also just use the normal direction of each source position here as well? Can I just apply the same logic in the script 'minimumnormestimate' to change the field 'lf.ori' as, for example, in 'ft_sloreta' or would this be problematic down the line? Thank You, Christian _______________________________________________ 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 stephen.whitmarsh at gmail.com Fri Sep 22 10:09:11 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 10:09:11 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Indeed, I do not think there is a problem with segmentation of brain/skull, as can be seen on the image. Stripping some skin of two subjects (thresholding the 'soft_tissue' probability output of SPM12, then removing it) with a similar problem of solved the rotation, but resulted in too small grids... On this subject I attached this procedure has no effect. However, at least for those other subjects normalization on skullstripped, or rather, scalpstripped MRIs might do the trick. As I understand it, however, the spm8 procedure (and spm12 I think) is a two-stepped procedure, with (affine) transformation based on the scalp first, after which it optimizes it based on brain segmentation. I would not know how to therefor do normalization without scalp. In fact, it expects a full volumetric image, not a (pre-)segmented one. Cheers, Stephen On 21 September 2017 at 18:45, Arjen Stolk wrote: > First thought is a registration of brain outline to skull (instead of > brain), although at closer inspection the shift seems overall just a bit > too large for that. You could try calculating the normalization parameters > on skullstripped volumes (unless you want to keep non-brain tissue). > > On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < > stephen.whitmarsh at gmail.com> wrote: > >> Hi Arjen, >> >> Thanks, and good to hear you've not been let down yet. It might be the >> fact that I have some bad quality MRIs to deal with. However... does this >> problem (see attached) ring a bell for anyone?: >> >> Brain segmentation is proper, and co-registration with polhemus >> head-shape as well, but inverse warp to MNI result in a tilted grid. >> Linear vs. non-linear transformation gives the same result. Other subjects >> going through the same procedure work fine, except two others wherein I >> identified it as a problem in segmenting the scalp and therefor the first >> step of the normalization. This one looks absolutely fine in every other >> regard, however. >> >> I'm stumped... >> >> cfg = []; >> cfg.spmversion = 'spm12'; >> cfg.grid.warpmni = 'yes'; >> cfg.grid.template = template_grid; >> cfg.grid.nonlinear = 'yes'; >> cfg.mri = mri_realigned; >> cfg.grid.unit = 'mm'; >> subject_grid = ft_prepare_sourcemodel(cfg); >> >> Cheers, >> Stephen >> >> >> On 21 September 2017 at 17:00, Arjen Stolk wrote: >> >>> Hey Stephen, >>> >>> Look for discussions regarding spm12 and also dartel on bugzilla. It's >>> been a while but as far as I can remember ft_volumenormalize is the only >>> function now that has not been integrated. Reason being that it wasnt >>> straightforward to house the dartel procedure under a single function, so >>> this is ongoing work still. You can however use spm12's coregistration >>> function with ft_volumerealign (for rigid body transformations), which Im >>> using quite a bit and never let me down (and is much faster than before). >>> But that wouldnt work for normalization to template space though (use spm8). >>> >>> Best >>> >>> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) < >>> hgould at memphis.edu> wrote: >>> >>> I have retired please remove me from the mail list >>> >>> Herbert Jay Gould >>> Professor Emeritus >>> The University of Memphis >>> >>> >>> >>> Sent from my Verizon Wireless 4G LTE smartphone >>> >>> >>> -------- Original message -------- >>> From: Stephen Whitmarsh >>> Date:09/21/2017 7:43 AM (GMT-06:00) >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >>> normalization >>> >>> Dear Sarang and Jan-Mathijs, >>> >>> Thanks a lot. I am now able (after updating FT, which now includes SPM12 >>> in /external), to use SPM12 for segmentation of my template and my subject >>> MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >>> improvement over 8 when it comes to brain-segmentation, which now does not >>> require individual treatments anymore. It also outputs more compartments >>> which gives me a little bit more to work with when dealing with scans that >>> have bad delineation of the scalp for normalization. >>> >>> Pleas note that defaults seems to differ - some FT functions default to >>> spm8, others to spm12. >>> >>> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >>> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >>> 'spm12'. In other words the cfg.spmversion is not passed along. >>> >>> Best wishes and thanks again! >>> Stephen >>> >>> >>> >>> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >>> jan.schoffelen at donders.ru.nl> wrote: >>> >>>> Hi Stephen, >>>> >>>> Please note that FT now has full support for SPM12, both using the >>>> old-style segmentation, and the new one (the latter yielding 6 tissue >>>> types). >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh < >>>> stephen.whitmarsh at gmail.com> wrote: >>>> >>>> Dear all, >>>> >>>> I having some problems in normalizing MRIs for my study. Some have >>>> improper segmentation for which changing individual brain/scalp thresholds >>>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>>> noise outside of the head. Also, changing parameters in spm8 for >>>> normalization, such as number of iterations (directly in in spm_normalize, >>>> since FT does not pass these parameters) improves the transformation. >>>> >>>> However, some scans I cannot deal with, either because they have noise >>>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>>> optimal scalp-segmentation and thereby normalization. Others have an >>>> inappropriate contrast MRI sequence. >>>> >>>> Some fMRI researchers advised me to use SPM12, because of its improved >>>> preprocessing procedures. However, it does not seem supported in FT yet. >>>> Does anyone have experience with this, and can perhaps share how they >>>> extracted the transformation matrix from the resulting nifti's? >>>> >>>> Thanks, >>>> Stephen >>>> _______________________________________________ >>>> 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 stephen.whitmarsh at gmail.com Fri Sep 22 13:01:25 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 13:01:25 +0200 Subject: [FieldTrip] SPM12 for segmentation and (inverse) normalization In-Reply-To: References: <2D212529-D5FF-4803-8A21-3A22F290A77B@donders.ru.nl> Message-ID: Hi Arjen, Jan-Mathijs, et. al., It seems the rotation was caused by a bug my side. The segmentation using SPM12 solved problems caused by low quality MRIS. Thanks! Stephen On 22 September 2017 at 10:09, Stephen Whitmarsh < stephen.whitmarsh at gmail.com> wrote: > Hi Arjen, > > Indeed, I do not think there is a problem with segmentation of > brain/skull, as can be seen on the image. Stripping some skin of two > subjects (thresholding the 'soft_tissue' probability output of SPM12, then > removing it) with a similar problem of solved the rotation, but resulted in > too small grids... On this subject I attached this procedure has no effect. > > However, at least for those other subjects normalization on skullstripped, > or rather, scalpstripped MRIs might do the trick. As I understand it, > however, the spm8 procedure (and spm12 I think) is a two-stepped procedure, > with (affine) transformation based on the scalp first, after which it > optimizes it based on brain segmentation. I would not know how to therefor > do normalization without scalp. In fact, it expects a full volumetric > image, not a (pre-)segmented one. > > Cheers, > Stephen > > On 21 September 2017 at 18:45, Arjen Stolk wrote: > >> First thought is a registration of brain outline to skull (instead of >> brain), although at closer inspection the shift seems overall just a bit >> too large for that. You could try calculating the normalization parameters >> on skullstripped volumes (unless you want to keep non-brain tissue). >> >> On Thu, Sep 21, 2017 at 9:20 AM, Stephen Whitmarsh < >> stephen.whitmarsh at gmail.com> wrote: >> >>> Hi Arjen, >>> >>> Thanks, and good to hear you've not been let down yet. It might be the >>> fact that I have some bad quality MRIs to deal with. However... does this >>> problem (see attached) ring a bell for anyone?: >>> >>> Brain segmentation is proper, and co-registration with polhemus >>> head-shape as well, but inverse warp to MNI result in a tilted grid. >>> Linear vs. non-linear transformation gives the same result. Other subjects >>> going through the same procedure work fine, except two others wherein I >>> identified it as a problem in segmenting the scalp and therefor the first >>> step of the normalization. This one looks absolutely fine in every other >>> regard, however. >>> >>> I'm stumped... >>> >>> cfg = []; >>> cfg.spmversion = 'spm12'; >>> cfg.grid.warpmni = 'yes'; >>> cfg.grid.template = template_grid; >>> cfg.grid.nonlinear = 'yes'; >>> cfg.mri = mri_realigned; >>> cfg.grid.unit = 'mm'; >>> subject_grid = ft_prepare_sourcemodel(cfg); >>> >>> Cheers, >>> Stephen >>> >>> >>> On 21 September 2017 at 17:00, Arjen Stolk wrote: >>> >>>> Hey Stephen, >>>> >>>> Look for discussions regarding spm12 and also dartel on bugzilla. It's >>>> been a while but as far as I can remember ft_volumenormalize is the only >>>> function now that has not been integrated. Reason being that it wasnt >>>> straightforward to house the dartel procedure under a single function, so >>>> this is ongoing work still. You can however use spm12's coregistration >>>> function with ft_volumerealign (for rigid body transformations), which Im >>>> using quite a bit and never let me down (and is much faster than before). >>>> But that wouldnt work for normalization to template space though (use spm8). >>>> >>>> Best >>>> >>>> On Sep 21, 2017, at 6:56 AM, Herbert J Gould (hgould) < >>>> hgould at memphis.edu> wrote: >>>> >>>> I have retired please remove me from the mail list >>>> >>>> Herbert Jay Gould >>>> Professor Emeritus >>>> The University of Memphis >>>> >>>> >>>> >>>> Sent from my Verizon Wireless 4G LTE smartphone >>>> >>>> >>>> -------- Original message -------- >>>> From: Stephen Whitmarsh >>>> Date:09/21/2017 7:43 AM (GMT-06:00) >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] SPM12 for segmentation and (inverse) >>>> normalization >>>> >>>> Dear Sarang and Jan-Mathijs, >>>> >>>> Thanks a lot. I am now able (after updating FT, which now includes >>>> SPM12 in /external), to use SPM12 for segmentation of my template and my >>>> subject MRI, by using cfg.spmversion = 'spm12'. 12 is definitely is a big >>>> improvement over 8 when it comes to brain-segmentation, which now does not >>>> require individual treatments anymore. It also outputs more compartments >>>> which gives me a little bit more to work with when dealing with scans that >>>> have bad delineation of the scalp for normalization. >>>> >>>> Pleas note that defaults seems to differ - some FT functions default to >>>> spm8, others to spm12. >>>> >>>> In fact, FT still reverts to spm8 in ft_volumenormalise when called in >>>> ft_prepare_sourcemodel, even when calling the latter with cfg.spmversion = >>>> 'spm12'. In other words the cfg.spmversion is not passed along. >>>> >>>> Best wishes and thanks again! >>>> Stephen >>>> >>>> >>>> >>>> On 21 September 2017 at 09:09, Schoffelen, J.M. (Jan Mathijs) < >>>> jan.schoffelen at donders.ru.nl> wrote: >>>> >>>>> Hi Stephen, >>>>> >>>>> Please note that FT now has full support for SPM12, both using the >>>>> old-style segmentation, and the new one (the latter yielding 6 tissue >>>>> types). >>>>> >>>>> Best, >>>>> Jan-Mathijs >>>>> >>>>> On 20 Sep 2017, at 17:03, Stephen Whitmarsh < >>>>> stephen.whitmarsh at gmail.com> wrote: >>>>> >>>>> Dear all, >>>>> >>>>> I having some problems in normalizing MRIs for my study. Some have >>>>> improper segmentation for which changing individual brain/scalp thresholds >>>>> works in many cases but not all, e.g. when the scalp 'bleeds' into some >>>>> noise outside of the head. Also, changing parameters in spm8 for >>>>> normalization, such as number of iterations (directly in in spm_normalize, >>>>> since FT does not pass these parameters) improves the transformation. >>>>> >>>>> However, some scans I cannot deal with, either because they have noise >>>>> from outsides of the head 'bleed' onto the scalp, thereby preventing >>>>> optimal scalp-segmentation and thereby normalization. Others have an >>>>> inappropriate contrast MRI sequence. >>>>> >>>>> Some fMRI researchers advised me to use SPM12, because of its improved >>>>> preprocessing procedures. However, it does not seem supported in FT yet. >>>>> Does anyone have experience with this, and can perhaps share how they >>>>> extracted the transformation matrix from the resulting nifti's? >>>>> >>>>> Thanks, >>>>> Stephen >>>>> _______________________________________________ >>>>> 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 hamedtaheri at yahoo.com Fri Sep 22 13:53:44 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Fri, 22 Sep 2017 11:53:44 +0000 (UTC) Subject: [FieldTrip] Artifact Rejection Problem References: <258456736.7597235.1506081224221.ref@mail.yahoo.com> Message-ID: <258456736.7597235.1506081224221@mail.yahoo.com> Hello Dear Fieldtrip users, I have an EEG signal which I want to do artifact rejection on it.I've recorded the EEG during watching a video clip. My signal is 100 seconds and I've selected 50 seconds.I can find EOG artifact but I can't reject it. Would you please let me know how can I do it. cfg  = []; cfg.dataset   = 'myfile.eeg';  %BrainVision Recoreder EEG cfg.trialdef.triallength   = inf; cfg.trialdef.ntrials         = inf; cfg   = ft_definetrial(cfg); trl     = cfg.trl; data_org = ft_preprocessing(cfg); %Select 30sec of data cfg.latency        = 'all'; cfg.latency     = [0 30]; %start point and end point cfg.avgovertime = 'no'; cfg.nanmean     = 'no'; data_s = ft_selectdata(cfg, data_org); [cfg, artifact] = ft_artifact_eog(cfg,data_s);clean_data = ft_rejectartifact(cfg,data_s); -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Fri Sep 22 14:12:11 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 22 Sep 2017 14:12:11 +0200 Subject: [FieldTrip] Warnings on CentOS break code? Message-ID: Hi there, Since upgrading to the latest FT version, some warnings throw an error because FT cannot determine it's in a CentOS distro. At least, that's what I think it is? Am I missing something? Best, Stephen cfg = []; cfg.artfctdef = artdef_MEG{ipart}; cfg.artfctdef.reject = 'partial'; cfg.artfctdef.minaccepttim = 3; data{ipart} = ft_rejectartifact(cfg,data{ipart}); results in: Error using ft_platform_supports (line 134) unsupported value for first argument: html Error in ft_notification (line 376) if ft_platform_supports('html') Error in ft_warning (line 63) ft_notification(varargin{:}); Error in getdimord>warning_dimord_could_not_be_determined (line 621) ft_warning('%s\n\n%s', msg,content); Error in getdimord (line 572) warning_dimord_could_not_be_determined(field,data); Error in ft_selectdata (line 201) dimord{i} = getdimord(varargin{1}, datfield{i}); Error in WANDER_common_filter_DICS (line 85) hdr = ft_selectdata(cfg,hdr); 134 error('unsupported value for first argument: %s', what); -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Fri Sep 22 19:06:53 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Fri, 22 Sep 2017 17:06:53 +0000 (UTC) Subject: [FieldTrip] Artifact Removing Problem References: <28989140.7825054.1506100013966.ref@mail.yahoo.com> Message-ID: <28989140.7825054.1506100013966@mail.yahoo.com> Hi all I've tried to remove EOG, jump and muscle artifact from my EEG.I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. ( No filter, remove) . I want to filter my signal no remove some part of mt signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG.Could you please help me what is my wrong? Best Regards,Hamed -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamedtaheri at yahoo.com Sun Sep 24 17:37:43 2017 From: hamedtaheri at yahoo.com (Hamed Taheri) Date: Sun, 24 Sep 2017 15:37:43 +0000 (UTC) Subject: [FieldTrip] Artifact Rejection Problem References: <383387083.4716793.1506267463295.ref@mail.yahoo.com> Message-ID: <383387083.4716793.1506267463295@mail.yahoo.com> Hi all I've tried to remove EOG, jump and muscle artifact from my EEG.I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. I want to filter my signal no remove some part of my signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG.Could you please help me what is my wrong? cfg.artfctdef.eog.artifact = artifact_EOG; cfg.artfctdef.jump.artifact = artifact_jump; cfg.artfctdef.muscle.artifact = artifact_muscle; cfg.artfctdef.reject = 'complet' ; data_no_artifacts = ft_rejectartifact(cfg,data_int); Best Regards,Hamed -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon Sep 25 03:23:35 2017 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 25 Sep 2017 11:23:35 +1000 Subject: [FieldTrip] Question regarding clusterplot Message-ID: Dear list, I am trying to plot significant clusters from the cluster based permutation test on the ERPs. I want to plot the p values on a binary fashion (p<.05). I just don't want to highlight the electrodes, but I want to interpolate the p values and plot topography (just like ERP topography, but in abinary fashion). I was wondering whether there is a way to do it? Thanks, Arti -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Sep 25 06:29:05 2017 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 25 Sep 2017 06:29:05 +0200 Subject: [FieldTrip] Question regarding clusterplot In-Reply-To: References: Message-ID: Hi Arti, you could specify cfg.parameter = ‘mask’; instead of ‘avg’ which is the default. best tzvetan > Am 25.09.2017 um 03:23 schrieb Arti Abhishek : > > Dear list, > > I am trying to plot significant clusters from the cluster based permutation test on the ERPs. I want to plot the p values on a binary fashion (p<.05). I just don't want to highlight the electrodes, but I want to interpolate the p values and plot topography (just like ERP topography, but in abinary fashion). I was wondering whether there is a way to do it? > > Thanks, > Arti > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From simeon.wong at sickkids.ca Mon Sep 25 16:45:04 2017 From: simeon.wong at sickkids.ca (Simeon Wong) Date: Mon, 25 Sep 2017 14:45:04 +0000 Subject: [FieldTrip] Artifact Rejection Problem In-Reply-To: <383387083.4716793.1506267463295@mail.yahoo.com> References: <383387083.4716793.1506267463295.ref@mail.yahoo.com>, <383387083.4716793.1506267463295@mail.yahoo.com> Message-ID: Hi Hamed, I believe ft_rejectartefact does not offer an option to simply remove any artefact. Removing artefacts is actually a non-trivial process that you can approach from several different ways. Try using ft_componentanalysis to apply ICA to remove eye blinks and some eye movement. I'm not too sure about muscle artefact in EEG but perhaps setting a bandpass filter from 1-30 Hz may help attenuate most of it. You probably don't need to worry about jump artifacts since that typically applies only to MEG. Regards, Simeon Wong ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Hamed Taheri Sent: September 24, 2017 11:37:43 AM To: FieldTrip Discussion List Subject: [FieldTrip] Artifact Rejection Problem Hi all I've tried to remove EOG, jump and muscle artifact from my EEG. I can find the artifact but when I use ft_rejectartifact, it removes some parts of EEG that contaminated by artifacts. I want to filter my signal no remove some part of my signal. When I use artifact removing in EEGLab or BrainStorm just artifact removed no the contaminated part of EEG. Could you please help me what is my wrong? cfg.artfctdef.eog.artifact = artifact_EOG; cfg.artfctdef.jump.artifact = artifact_jump; cfg.artfctdef.muscle.artifact = artifact_muscle; cfg.artfctdef.reject = 'complet' ; data_no_artifacts = ft_rejectartifact(cfg,data_int); Best Regards, Hamed ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. From bqrosen at ucsd.edu Mon Sep 25 22:05:39 2017 From: bqrosen at ucsd.edu (Burke Rosen) Date: Mon, 25 Sep 2017 13:05:39 -0700 Subject: [FieldTrip] ft_combineplanar 'svd' method Message-ID: Hello, What is the principle behind the ‘svd’ and ‘absvd’ methods for ft_combineplanar? And/or is there a citation which introduces these methods? Thank you, Burke Rosen From michak at is.umk.pl Mon Sep 25 23:44:00 2017 From: michak at is.umk.pl (=?UTF-8?Q?Micha=C5=82_Komorowski?=) Date: Mon, 25 Sep 2017 23:44:00 +0200 Subject: [FieldTrip] AAL Surface plot - weird black spots In-Reply-To: References: Message-ID: Dear Fieldtrippers, I found the solution and it is simple. Just make sure that you have in your config follwing lines: cfg.projmethod = 'project' cfg.projvec = [0 5] Have a nice plots ! Michał Komorowski, MSc Nicolaus Copernicus University in Toruń Faculty of Physics, Astronomy and Informatics Department of Informatics 2017-07-31 14:15 GMT+02:00 Michał Komorowski : > Dear Fieldtrippers, > > I am trying to reproduce brain surface pictures from this paper (Fig.5) : > http://journals.plos.org/plosbiology/article?id=10. > 1371/journal.pbio.1002498 > > I wonder why I get weid black spots in surface plot (e.g. occipital area). > What should I do to get those nice picures from link above? > What I am doing wrong (code below)? > > Code for generating erroneous pictures (see attachment): > > mrifile = [FieldtripPath 'template/anatomy/single_subj_ > T1.nii'] > > mri = ft_read_mri(mrifile) > mri.coordsys = 'mni'; % to prevent manual fixing of coordsys > > atlaspath = [FieldtripPath 'template/atlas/aal/ROI_MNI_V4.nii']; > atlas = ft_read_atlas(atlaspath) > atlas.anatomy = mri.anatomy; > > cfg = []; > cfg.method = 'surface'; > cfg.projmethod = 'project'; > cfg.camlight = 'yes'; > %cfg.surffile = [FieldtripPath 'template/anatomy/surface_pial_left.mat']; > % uncomment to project half brain > cfg.locationcoordinates = 'voxel'; > cfg.cmap = jet(116); > cfg.cmap = [[0,0,0]; cfg.cmap] > cfg.funcolormap = cfg.cmap; > cfg.funparameter = 'tissue'; > cfg.atlas = atlaspath; > ft_sourceplot(cfg, atlas) > > > % check fit anatomy to atlas > cfg = []; > cfg.method = 'ortho'; > cfg.locationcoordinates = 'voxel'; > cfg.cmap = jet(116); > cfg.cmap = [[0,0,0]; cfg.cmap] % color map > cfg.funcolormap = cfg.cmap; > cfg.funparameter = 'tissue'; > ft_sourceplot(cfg, atlas) > > Best wishes. > > Michał Komorowski > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nirofir2 at gmail.com Tue Sep 26 15:12:30 2017 From: nirofir2 at gmail.com (Nir Ofir) Date: Tue, 26 Sep 2017 16:12:30 +0300 Subject: [FieldTrip] Variable Number of Tapers in 'mtmfft' Frequency Analysis Message-ID: Hi Fieldtrip users, ft_freqanalysis (FT version 20170404) does not allow using a variable number of tapers in 'mtmfft' mode (lines 462-465 display a warning and keep only the first element of cfg.tapsmofrq), but it seems like ft_specest_mtmfft does have an implementation of a variable number of tapers (lines 286-348). It also seems like mtm_specest_mtmconvol, which allows variable number of tapers, calls ft_specest_mtmfft. So 2 questions: 1. Is the variable number of tapers option used in mtmfft in some other way? 2. What is the reason for not allowing a variable number of tapers in mtmfft generally? Thanks! Nir Ofir -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog.louisa at gmail.com Wed Sep 27 22:01:53 2017 From: bog.louisa at gmail.com (Louisa Bogaerts) Date: Wed, 27 Sep 2017 23:01:53 +0300 Subject: [FieldTrip] reading in and preprocessing gtec_mat data Message-ID: Hello everyone, In the lab or Dr. Landau we recently started using a *g.tech EEG setup* and *Simulink* record the data. We used the newest version of Fieldtrip to try analyze the data. Simulink outputs the data as a .mat file (an example here: https://www.dropbox.com/s/6xgio9w81qx94bq/example.mat?dl=0), and according to the fieldtrip documentation this data format should now be supported: e.g., https://github.com/fieldtrip/fieldtrip/blob/master/fileio/ft_read_data.m, lines 274-276: if any(strcmp(dataformat, {'bci2000_dat', 'eyelink_asc', 'gtec_mat', 'gtec_hdf5', 'mega_neurone'})) However, it seems that multiple Fieldtrip functions are “looking” for a header file that is not found. - When reading in the data with ft_read_data() we get the following error messages (whereas simply loading them with load() works fine): Error using ft_notification (line 340) unsupported header format "matlab" Error in ft_error (line 39) ft_notification(varargin{:}); Error in ft_read_header (line 2325) ft_error('unsupported header format "%s"', headerformat); Error in ft_read_data (line 200) hdr = ft_read_header(filename, 'headerformat', headerformat, 'chanindx', chanindx, 'checkmaxfilter', checkmaxfilter); - The same error messages show when using ft_preprocessing(). Does anyone have experience reading in and preprocessing gtech_mat data and can he/she help us understand how to save the header info so that fieldtrip can read it and recognise the data as gtec_mat? Any help will be very much appreciated. Louisa, Omri & Flor -------------- next part -------------- An HTML attachment was scrubbed... URL: From isac.sehlstedt at psy.gu.se Fri Sep 29 12:19:51 2017 From: isac.sehlstedt at psy.gu.se (Isac Sehlstedt) Date: Fri, 29 Sep 2017 10:19:51 +0000 Subject: [FieldTrip] Follow up question: Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: Dear fieldtripers, This is a kind reminder of a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (follow dropbox-link below) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see ft_componentanalysis-result1.tiff, or ft_componentanalysis-result2.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see matlab_pca_results.tiff) . Why am I not getting that in ft? Is it possible to get that using ft? Pictures are found using this link: https://www.dropbox.com/sh/k6ax6bvjb5yi13l/AADvwBzGduIXlCLaPBS4_ELya?dl=0 Very Best, Isac ————————————————— The code ————————————————— clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Sep 29 12:36:30 2017 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 29 Sep 2017 10:36:30 +0000 Subject: [FieldTrip] Follow up question: Computing pca variables (i.e. Latent, and coefficient variables) after ft_componentanalysis In-Reply-To: References: Message-ID: <97B82971-ABD0-49F2-81C4-235AE4D09162@donders.ru.nl> perhaps you may want to check the ‘avg’ field. JM On 29 Sep 2017, at 12:19, Isac Sehlstedt > wrote: Dear fieldtripers, This is a kind reminder of a follow-up question to a previous question with the same mail-topic. I have included my code below to show what I am doing (in case I have made errors) and print screens (follow dropbox-link below) of the variables I get after the ft_componentanalysis that I get. Sadly, I cannot see any variable named comp.trial (see ft_componentanalysis-result1.tiff, or ft_componentanalysis-result2.tiff). Also, when running the PCA in matlab, I get a coefficient array that has as many entries as there are time-points in my trials (see matlab_pca_results.tiff) . Why am I not getting that in ft? Is it possible to get that using ft? Pictures are found using this link: https://www.dropbox.com/sh/k6ax6bvjb5yi13l/AADvwBzGduIXlCLaPBS4_ELya?dl=0 Very Best, Isac ————————————————— The code ————————————————— clear all; close all; %% Load load('averages_for_ft.mat') %% define layout cfg = []; cfg.elec=PreOdd_ft{1, 1}.elec; cfg.rotate=90; %rotation around the z-axis in degrees (default = [], which means automatic) layout = ft_prepare_layout(cfg) %% Make the computations % Dummy varibles Cond1 = []; Cond2 = []; theDiff = []; theDiff_ft = {}; %% Start loop for i=1:size(Cond1_ft,2) %Get the basic condtitions curr_Cond2 = Cond2_ft{i}.avg; curr_Cond1 = Cond1_ft{i}.avg; %Get the basic condtitions cfg = []; curr_Cond2_ft = ft_timelockanalysis(cfg, Cond2_ft{i}); curr_Cond1_ft = ft_timelockanalysis(cfg, Cond1_ft{i}); % Then take the difference of the averages using ft_math cfg = []; cfg.operation = 'subtract'; cfg.parameter = 'avg'; curr_difference = ft_math(cfg,curr_Cond1_ft,curr_Cond2_ft); curr_difference_avg = curr_difference.avg; % Creating a struct with the subjectwise differences between conditions theDiff_ft{i} = curr_difference % constructing concatenated averaged sets for the PCA. Cond2 = [Cond2 curr_Cond2]; Cond1 = [Cond1 curr_Cond1]; theDiff = [theDiff curr_difference_avg]; end %% Create dummy subjects in order to run the PCA over subjects dummy_Cond2 = Cond2_ft{1}; dummy_Cond2.avg = Cond2; dummy_Cond2.time = 1:1:size(Cond2,2); dummy_Cond1 = Cond1_ft{1}; dummy_Cond1.avg = Cond1; dummy_Cond1.time = 1:1:size(Cond1,2); dummy_theDiff = Cond1_ft{1}; dummy_theDiff.avg = theDiff; dummy_theDiff.time = 1:1:size(theDiff,2); %% Run the PCA cfg = []; cfg.method = 'pca'; cfg.layout = layout; Cond1_comp = ft_componentanalysis(cfg, dummy_Cond1); Cond2_comp = ft_componentanalysis(cfg, dummy_Cond2); theDiff_comp = ft_componentanalysis(cfg, dummy_theDiff); %% Revert back to subject level cfgCond2 = []; cfgCond2.unmixing = Cond2_comp.unmixing; cfgCond2.topolabel = Cond2_comp.topolabel; cfgCond1 = []; cfgCond1.unmixing = Cond1_comp.unmixing; cfgCond1.topolabel = Cond1_comp.topolabel; cfgtheDiff = []; cfgtheDiff.unmixing = theDiff_comp.unmixing; cfgtheDiff.topolabel = theDiff_comp.topolabel; for i=1:size(Cond1_ft,2) Cond1_rs{i} = ft_componentanalysis(cfgCond1, Cond1_ft{i}); Cond2_rs{i} = ft_componentanalysis(cfgCond2, Cond2_ft{i}); theDiff_rs{i}= ft_componentanalysis(cfgtheDiff, theDiff_ft{i} ); end _______________________________________________ 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 stephen.whitmarsh at gmail.com Fri Sep 29 12:42:41 2017 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 29 Sep 2017 12:42:41 +0200 Subject: [FieldTrip] reading in and preprocessing gtec_mat data In-Reply-To: References: Message-ID: Hi Louisa et al, It seems that you are actually not trying to read data in the Gtec data format, but that of simulink (which was saved as a mat file, as a matlab file). So, you should be able to just read your mat file and then put your data in a fieldtrip data structure. See: http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat Cheers, Stephen On 27 September 2017 at 22:01, Louisa Bogaerts wrote: > Hello everyone, > > > > In the lab or Dr. Landau we recently started using a *g.tech EEG setup* > and *Simulink* record the data. We used the newest version of Fieldtrip > to try analyze the data. > > > > Simulink outputs the data as a .mat file (an example here: > https://www.dropbox.com/s/6xgio9w81qx94bq/example.mat?dl=0), and > according to the fieldtrip documentation this data format should now be > supported: e.g., https://github.com/fieldtrip/f > ieldtrip/blob/master/fileio/ft_read_data.m, lines 274-276: > > if any(strcmp(dataformat, {'bci2000_dat', 'eyelink_asc', 'gtec_mat', > > 'gtec_hdf5', 'mega_neurone'})) > > > > However, it seems that multiple Fieldtrip functions are “looking” for a > header file that is not found. > > - When reading in the data with ft_read_data() we get the following > error messages (whereas simply loading them with load() works fine): > > Error using ft_notification (line 340) > > unsupported header format "matlab" > > > > Error in ft_error (line 39) > > ft_notification(varargin{:}); > > > > Error in ft_read_header (line 2325) > > ft_error('unsupported header format "%s"', headerformat); > > > > Error in ft_read_data (line 200) > > hdr = ft_read_header(filename, 'headerformat', headerformat, 'chanindx', > > chanindx, 'checkmaxfilter', checkmaxfilter); > > > > - The same error messages show when using ft_preprocessing(). > > > > Does anyone have experience reading in and preprocessing gtech_mat data > and can he/she help us understand how to save the header info so that > fieldtrip can read it and recognise the data as gtec_mat? > > > > Any help will be very much appreciated. > > > > Louisa, Omri & Flor > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: