From R.Zimmermann at UKE.Uni-Hamburg.de Mon Dec 2 14:33:25 2013 From: R.Zimmermann at UKE.Uni-Hamburg.de (Dr. Zimmermann) Date: Mon, 2 Dec 2013 14:33:25 +0100 Subject: [FieldTrip] Format for storing MRI data (DICOM import for CTF MEG) In-Reply-To: References: <5298908D.2000005@donders.ru.nl> Message-ID: <529C8C25.1000300@UKE.Uni-Hamburg.de> Hi, we're operating a CTF MEG, our MRI data is provided in DICOM format. The FieldTrip doc about conversion of DICOM data into CTF format: http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format has already found its way to us. Currently, we we're still using the '...old and difficult way' since import and setting of fiducials is done by people (=> MRI-operator) other than the later users (=> MRI-user) of the mri data. To keep this task sharing, each converted MRI should be saved to a file by a MRI-operator. Later this file could be opened by the MRI-user. On the one hand the saved file should contain all of the MRI content (data, hdr with transformation matrices etc.), on the other hand I wouldn't like to add software prerequisites (as spm or freesurfer) for the storage or later reading process. Obviously I can take the (still provided) original CTF routine: writeCTFMRI.m (This would mean to regress most of the importing process). Is there a way to store the MRI data in CTF format without using the function provided by CTF? Regards, Roger -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- A non-text attachment was scrubbed... Name: R_Zimmermann.vcf Type: text/x-vcard Size: 427 bytes Desc: not available URL: From thomas.wunderle at esi-frankfurt.de Mon Dec 2 14:41:35 2013 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Mon, 2 Dec 2013 13:41:35 +0000 Subject: [FieldTrip] ft_connectivity_csd2transfer Message-ID: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> Hi, a small bug has slipped in during the last update of the function " ft_connectivity_csd2transfer" The "f" in the function definition is missing, so the function is recognized as a script "unction [output] = ft_connectivity_csd2transfer(freq, varargin)" Best, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel:   +49 69 96769 519 Fax:   +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries From jan.schoffelen at donders.ru.nl Mon Dec 2 15:41:54 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 2 Dec 2013 15:41:54 +0100 Subject: [FieldTrip] ft_connectivity_csd2transfer In-Reply-To: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> References: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <4E8B9A63-3813-490C-94B2-55BDD52AF96B@donders.ru.nl> Hi Thomas, My bad, apologies and thanks for noticing and letting us know. I fixed it. Best, JM On Dec 2, 2013, at 2:41 PM, Wunderle, Thomas wrote: > Hi, > a small bug has slipped in during the last update of the function " ft_connectivity_csd2transfer" > > The "f" in the function definition is missing, so the function is recognized as a script > > "unction [output] = ft_connectivity_csd2transfer(freq, varargin)" > > Best, > Thomas > > ----- > Dr. Thomas Wunderle > Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 519 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Geschäftsführer: Prof. Dr. Pascal Fries > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Dec 2 20:15:38 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 2 Dec 2013 14:15:38 -0500 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Thank you Arjen, Actually, I am testing the FieldTrip motion regression on MEG data specifically collected with a current phantom and known motion. I can treat the data as ERP data and average over 1 sec trials if needed. Following your advise on reduction of the regressors number (on 120 trials of 1 sec long) I was able to avoid the "out of memory" issue. Though I run into the different set of problems now that I need help to understand: ______________________________________________ ??? Error using ==> mxSerialize Error during serialization of (null) Error in ==> ft_postamble_provenance at 91 cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); Error in ==> ft_postamble at 55 evalin('caller', ['ft_postamble_' cmd]); Error in ==> ft_timelockanalysis at 370 ft_postamble provenance timelock Error in ==> ft_regressconfound at 313 dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging _________________________________________________________ Here is the code I run to regress the head motion: %% addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 ft_defaults cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; cfg.trialdef.triallength=1; cfg.trialdef.ntrials=120; cfg.continuous = 'yes'; cfg = ft_definetrial(cfg); cfg.channel = {'MEG'}; cfg.demean = 'yes'; data = ft_preprocessing(cfg); %% cfg = []; cfg.keeptrials = 'yes'; timelock = ft_timelockanalysis(cfg, data); %% cfg = []; cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; cfg.trialdef.triallength=1; cfg.trialdef.ntrials=120; cfg.continuous = 'yes'; cfg = ft_definetrial(cfg); %% cfg.channel = {'HLC0011','HLC0012','HLC0013', ... 'HLC0021','HLC0022','HLC0023', ... 'HLC0031','HLC0032','HLC0033'}; headpos = ft_preprocessing(cfg); ntrials = length(headpos.sampleinfo) for t = 1:ntrials coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; end cc = circumcenter(coil1, coil2, coil3); cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; %% confound = [cc_dem ... ones(size(cc_dem,1),1)]; %% cfg = []; cfg.confound = confound; cfg.reject = [1:6]; regr = ft_regressconfound(cfg, timelock); %% _________________________________________________________________ Sorry for the lengthy letter and thanks for the help! Inna On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) wrote: > Hi Inna, > > Are you using the same design matrix as on the wiki page? That one covers > the primary head translations and rotations, but also their > derivatives. You could try using the primary measures only (3 > translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant > regressors). It is also mentionworthy that there should be a balance > between the number of regressors and the number of observations > (i.e. trials). I believe on the respective wiki page on head movement > regression it states that the ratio is recommended to be not larger > than 1:10 (regressors:trials), accompanied with a reference. Accordingly, > I'd suggest to use those 7 regressors, and your data (120s resting state) > split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These > specifications might hopefully also allow working around your memory issue. > > Second, it may be worth mentioning what you would like to do with the data > post-movement-regression. Namely, the movement compensation will remove > contributions from head movement to the signal. But this requires that > signal to behave consistently over trials, which does not seem the case > with the signal in your resting study? That is, with an ERP study, the > signal fluctuations appear consistent over trials, with amplitudes being > modulated by head movement (i.e. sensor-source distance, see our neuroimage > paper - 2013) in a predictable fashion. So if you're planning on doing > frequency analysis, or maybe connectivity analysis, after head movement > compensation, I'd recommend reversing that order. The rule of thumb is to > use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise > unexplained variance (over trials) due to head movement, benefitting your > statistical assessments. > > Hope these suggestions may help you with further analyses. I'm > not familiar with anyone implementing this method to resting state > analyses, but maybe someone else has some first-hand experience here. > Furthermore, too late for your current dataset, but for a next one I'd > recommend using the online head position monitoring/respositioning tool > that we have developed for CTF systems (a neuromag version is approaching > the final stage). This tool is routinely used in our lab to monitor > and reduce head movment throughout recording (after which > ft_regressconfound is being used to deal with the trial-by-trial crumbles). > > Yours, > Arjen > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Tue Dec 3 19:04:36 2013 From: octavian.lie at gmail.com (Octavian Lie) Date: Tue, 3 Dec 2013 12:04:36 -0600 Subject: [FieldTrip] openmeeg matlab path Message-ID: Dear All, I installed openmeeg on my ubuntu 12.04 64 bit via github, tested it and works well from the terminal; I usually initiate the job from the terminal with: cd openmeeg/data/< subject> #!/usr/bin/env bash ... However matlab cannot see path, I get this matlab error when calling via fieldtrip Error using ft_hastoolbox (line 445) the OPENMEEG toolbox is not installed, see http://gforge.inria.fr/projects/openmeeg and http://gforge.inria.fr/frs/?group_id=435 Error in ft_headmodel_openmeeg (line 35) ft_hastoolbox('openmeeg', 1); ... How can I make matlab see path? I have read that one has to add these export PATH=$PATH:/opt/openmeeg/bin export DYLD_LIBRARY_PATH=/opt/openmeeg/lib:$LD_LIBRARY_PATH Where have these to be added, in the startup.m, terminal, or linux script? Thank you, Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Tue Dec 3 21:15:26 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Tue, 3 Dec 2013 21:15:26 +0100 Subject: [FieldTrip] openmeeg matlab path In-Reply-To: References: Message-ID: Dear Octavian, try something like this in the matlab prompt setenv('PATH', '/opt/openmeeg/bin') setenv('LD_LIBRARY_PATH', '/opt/openmeeg/lib') on linux and on mac: setenv('PATH', '/opt/openmeeg/bin') setenv('DYLD_LIBRARY_PATH', '/opt/openmeeg/lib') to test your install run: system('om_assemble') you should see something like: >> system('om_assemble') om_assemble version 2.2 compiled at Dec 3 2013 20:41:48 Not enough arguments Please try "om_assemble -h" or "om_assemble --help " ans = 0 Hope this helps, Alex On Tue, Dec 3, 2013 at 7:04 PM, Octavian Lie wrote: > Dear All, > > I installed openmeeg on my ubuntu 12.04 64 bit via github, tested it and > works well from the terminal; I usually initiate the job from the terminal > with: > > cd openmeeg/data/< subject> > #!/usr/bin/env bash > ... > > However matlab cannot see path, I get this matlab error when calling via > fieldtrip > > Error using ft_hastoolbox (line 445) > the OPENMEEG toolbox is not installed, see > http://gforge.inria.fr/projects/openmeeg and > http://gforge.inria.fr/frs/?group_id=435 > > Error in ft_headmodel_openmeeg (line 35) > ft_hastoolbox('openmeeg', 1); > ... > > How can I make matlab see path? I have read that one has to add these > > export PATH=$PATH:/opt/openmeeg/bin > export DYLD_LIBRARY_PATH=/opt/openmeeg/lib:$LD_LIBRARY_PATH > > Where have these to be added, in the startup.m, terminal, or linux script? > > Thank you, > > Octavian > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From octavian.lie at gmail.com Wed Dec 4 04:40:54 2013 From: octavian.lie at gmail.com (Octavian Lie) Date: Tue, 3 Dec 2013 21:40:54 -0600 Subject: [FieldTrip] openmeeg matlab path In-Reply-To: References: Message-ID: Thank you, Alexandre. In the end, it was not the openmeeg path which was the only issue, it was the absence of fieldtrip wrappers such as om_save_tri.m in the spm external fieldtrip distribution, so it turns out that both fieldtrip and openmeeg have to be installed and on path for forward model calculation using spm GUI option openmeeg. That was not clear at the outset. Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean-baptiste.versini at etu.univ-lyon1.fr Wed Dec 4 11:38:52 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Wed, 4 Dec 2013 10:38:52 +0000 Subject: [FieldTrip] Reorder labels Message-ID: <5271B6068CD8D94DB82254228237928801790806@mbx2010-02.univ-lyon1.fr> Dear all, When I delete channels and then use ft_channelrepair to reconstruct the missing channel, it changes the order of the label (reconstructed channel are added at the end of the list). I know it doesn't matter when I use fieldtrip functions but it does matter when I use my function. I wanted to know if there was an easy way in fieldtrip to reorder all the channel by an alphalphabetical order since I assume it does something like this when we process data with different channel order. Regards, JB -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Thu Dec 5 15:06:20 2013 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 05 Dec 2013 15:06:20 +0100 Subject: [FieldTrip] beamforming: one/two sources and subject specific ROI In-Reply-To: <52A0871E.6090204@gmail.com> References: <52A0871E.6090204@gmail.com> Message-ID: <52A0885C.5030706@gmail.com> Dear FT community, I have (nice!) source-reconstruction results for my data (attached) and now I've got a list of things I'd like to do next but I've got some specific questions left. 1) ft_sourcestatistics detects /one /cluster (p = .002). It'd be nice if I could say there are two different "sources" for my effect, one temporo-parietal and one frontal. But I believe that from a source reconstruction perspective, I cannot claim that. Could anyone confirm that for me? 2) Based on the stats, I'd like to define my ROI and go back to individual subjects to look at the single-trial data within this detected source. (Ultimately, I'd like to correlate power within that source with reaction times). Joern had some suggestions about how to select the ROI "I had the feeling that especially this latter approach (base ROI on GA +/- 3 cm, smooth individual subject data, select most sensitive voxel)" http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006733.html Has anyone done something similar (or different)? Did it work out well? The problem I think I'll face is that my source isn't very focal (half of the left hemisphere!), so I'd be very happy to hear your thoughts on whether this analysis is even feasible... Thanks a lot, Vitoria -- ** Please consider the environment - do you really need to print? ** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_ex.jpg Type: image/jpeg Size: 22840 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Dec 5 17:00:40 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 05 Dec 2013 17:00:40 +0100 Subject: [FieldTrip] beamforming: one/two sources and subject specific ROI In-Reply-To: <52A0885C.5030706@gmail.com> References: <52A0871E.6090204@gmail.com> <52A0885C.5030706@gmail.com> Message-ID: <52A0A328.7050704@donders.ru.nl> Hi Vitoria, I also got two other remarks that might help you. On the one hand, you could play around with the regularization of the source reconstruction (lambda), that might help to get more focal sources. On the other hand, you can also play around with your clusteralpha, if you decrease that you could get spatially more defined clusters. Oh and, don't necessarily trust the surface plots - they display a projection onto the brain surface, thus deeper brain activity will appear of neocortical origin. Of course, it looks nice for a paper :) But to make precise regional specific claims, an ortho plot might be better. Regarding your questions, for 1) I would agree, for 2), well you cited my mail, so that's the two ways I'd try :) Best, Jörn Vitoria Piai wrote: > Dear FT community, > > I have (nice!) source-reconstruction results for my data (attached) > and now I've got a list of things I'd like to do next but I've got > some specific questions left. > > 1) ft_sourcestatistics detects /one /cluster (p = .002). It'd be nice > if I could say there are two different "sources" for my effect, one > temporo-parietal and one frontal. But I believe that from a source > reconstruction perspective, I cannot claim that. Could anyone confirm > that for me? > > 2) Based on the stats, I'd like to define my ROI and go back to > individual subjects to look at the single-trial data within this > detected source. (Ultimately, I'd like to correlate power within that > source with reaction times). > Joern had some suggestions about how to select the ROI "I had the feeling that especially this latter approach (base ROI on GA +/- 3 cm, smooth individual subject data, select most sensitive voxel)" > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006733.html > Has anyone done something similar (or different)? Did it work out well? > The problem I think I'll face is that my source isn't very focal (half of the left hemisphere!), so I'd be very happy to hear your thoughts on whether this analysis is even feasible... > > Thanks a lot, > Vitoria > > -- > ** Please consider the environment - do you really need to print? ** > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From ayobimpe2004 at hotmail.com Thu Dec 5 20:32:49 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 5 Dec 2013 20:32:49 +0100 Subject: [FieldTrip] Source Analysis Message-ID: hello, 1. I used ASA head model to projected electrode on it to calculated the lead field and perform source analysis. I ma having problem with the projection of source on MRI after source interpolation. The source couldn't align with the MRI image. The first picture is for the source (before interpolation) and the second is after interpolation. I have tried several methods like volumeresclice but no good result. Please help me! 2. I want to do source analysis in frequency band (like alpha, beta etc) with frequency analysed data (ouput of ft_frequencyanalysis). But in the source analysis, I can only select one frequency (not band). Please I how can I play with it to get the frequency range of interest? Best regards, Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig2.png Type: image/png Size: 22122 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig1.png Type: image/png Size: 95973 bytes Desc: not available URL: From russgport at gmail.com Thu Dec 5 23:36:56 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 5 Dec 2013 17:36:56 -0500 Subject: [FieldTrip] questions itc/plf calculation via hilbert transformations Message-ID: Hi fellow fieldtippers, I have a question that brought around by an answer I previously received. For data analyzed with ft_freqanalysis and using the 'wavelet' option I can computer ITC/PLF via, tmpdat = freq.fourierspctrm; tmpdat = tmpdat./abs(tmpdat); ; % this will normalize each trial for its amplitude; itc = abs(mean(tmpdat)); % this will give the itc thank you again Jan-Mathijs for this insight I am now trying to calculate ITC via hilbert transformation, putting my VE data through ft_preproc_hilbert. Can I just use the cfg.option = 'imag', to get the imaginary component of the analytic signal, since this is what i use with wavelets (i.e. what the tmpda =tmpdat./abs(tmpdat) achieves). Then I would just repeat the last line itc = abs(mean(tmpdat)). I only hesitate because on several of the mailing list emails people have suggested doing cfg.option = 'angle' (which computes the imaginary component (tmpdat./abs(tmpdat) then uses the angle function (angle()). Have I been calculating ITC wrong for my wavelets? Or should i just the the cfg.option = 'imag' and mimik my wavelet based ITC. Thanks Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Dec 6 07:18:47 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 6 Dec 2013 07:18:47 +0100 Subject: [FieldTrip] questions itc/plf calculation via hilbert transformations In-Reply-To: References: Message-ID: Hi Russ, The imaginary part of a complex number (i.e. the 'b' in 'a+b*i') is very different from the phase (i.e. the 'p' in 'A*exp(i*p)'). When computing ITC, the expression z = z / abs(z) sets the amplitude (A) to 1, while preserving the phase. This is not the same as taking the imaginary par. To be able to later compute the ITC, I would actually just use cfg.hilbert = 'complex', and then do the exact same computations as with your wavelet approach. Using cfg.hilbert = 'angle' gives you the angle (in radians) directly, so a real number. This is more difficult (and slow) to work with than using the normalized complex representation. Hope this helps, Best, Eelke On Dec 5, 2013 11:39 PM, "Russell G Port" wrote: > Hi fellow fieldtippers, > > I have a question that brought around by an answer I previously received. > For data analyzed with ft_freqanalysis and using the 'wavelet' option I > can computer ITC/PLF via, > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); ; % this will normalize each trial for its > amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > > thank you again Jan-Mathijs for this insight > > I am now trying to calculate ITC via hilbert transformation, putting my VE > data through > > ft_preproc_hilbert. Can I just use the cfg.option = 'imag', to get the > imaginary component of > > the analytic signal, since this is what i use with wavelets (i.e. what the > > tmpda =tmpdat./abs(tmpdat) achieves). Then I would just repeat the last > line itc = > > abs(mean(tmpdat)). I only hesitate because on several of the mailing list > emails people have > > suggested doing cfg.option = 'angle' (which computes the imaginary > component (tmpdat./abs(tmpdat) then uses the angle function (angle()). > Have I been calculating ITC wrong for my wavelets? Or should i just the the > cfg.option = 'imag' and mimik my wavelet based ITC. > > Thanks > > Russ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Dec 6 16:07:24 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 6 Dec 2013 16:07:24 +0100 Subject: [FieldTrip] Source Analysis In-Reply-To: References: Message-ID: Hi Azeez, For your question (1), I think it would be helpful if you give a bit more information on what you are doing. If the source reconstruction is not aligned to your MRI, probably some ingredient for the source analysis was also misaligned. Could you see whether your source model, volume conduction model, and sensor definition are all in alignment? (See here http://fieldtrip.fcdonders.nl/faq/how_can_i_check_whether_the_grid_that_i_have_is_aligned_to_the_segmented_volume_and_to_the_sensor_gradiometer ) Regarding (2): typically I would use cfg.taper = 'dpss' (the default) and then choose a combination of cfg.foi and cfg.tapsmofrq that yield the frequency band of interest. E.g. cfg.foi = 20 and cfg.tapsmofrq = 8 gives you a frequency band ranging from 12 to 28 Hz. Best, Eelke On 5 December 2013 20:32, Azeez Adebimpe wrote: > > hello, > > 1. I used ASA head model to projected electrode on it to calculated the > lead field and perform source analysis. I ma having problem with the > projection of source on MRI after source interpolation. The source couldn't > align with the MRI image. The first picture is for the source (before > interpolation) and the second is after interpolation. I have tried several > methods like volumeresclice but no good result. Please help me! > > > 2. I want to do source analysis in frequency band (like alpha, beta etc) > with frequency analysed data (ouput of ft_frequencyanalysis). But in the > source analysis, I can only select one frequency (not band). Please I how > can I play with it to get the frequency range of interest? > > Best regards, > Azeez Adebimpe > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ayobimpe2004 at hotmail.com Fri Dec 6 16:21:52 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Fri, 6 Dec 2013 16:21:52 +0100 Subject: [FieldTrip] Source Analysis In-Reply-To: References: Message-ID: Thank you Eelke,I got the second part very well.I ensured that the sensor aligned very well on the head model before calculating there source analysis. I don't have the MRI for the subjects but want to use any of the template MRI to view the result of source analysis. I made use of T1,mii in spm8 but couldn't get it as it was done in online tutorial. I don't have MRI for the patients but used head model from ASA software.I will be glad for more info. Azeez > Date: Fri, 6 Dec 2013 16:07:24 +0100 > From: eelke.spaak at donders.ru.nl > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Source Analysis > > Hi Azeez, > > For your question (1), I think it would be helpful if you give a bit > more information on what you are doing. If the source reconstruction > is not aligned to your MRI, probably some ingredient for the source > analysis was also misaligned. Could you see whether your source model, > volume conduction model, and sensor definition are all in alignment? > (See here http://fieldtrip.fcdonders.nl/faq/how_can_i_check_whether_the_grid_that_i_have_is_aligned_to_the_segmented_volume_and_to_the_sensor_gradiometer > ) > > Regarding (2): typically I would use cfg.taper = 'dpss' (the default) > and then choose a combination of cfg.foi and cfg.tapsmofrq that yield > the frequency band of interest. E.g. cfg.foi = 20 and cfg.tapsmofrq = > 8 gives you a frequency band ranging from 12 to 28 Hz. > > Best, > Eelke > > On 5 December 2013 20:32, Azeez Adebimpe wrote: > > > > hello, > > > > 1. I used ASA head model to projected electrode on it to calculated the > > lead field and perform source analysis. I ma having problem with the > > projection of source on MRI after source interpolation. The source couldn't > > align with the MRI image. The first picture is for the source (before > > interpolation) and the second is after interpolation. I have tried several > > methods like volumeresclice but no good result. Please help me! > > > > > > 2. I want to do source analysis in frequency band (like alpha, beta etc) > > with frequency analysed data (ouput of ft_frequencyanalysis). But in the > > source analysis, I can only select one frequency (not band). Please I how > > can I play with it to get the frequency range of interest? > > > > Best regards, > > Azeez Adebimpe > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Sun Dec 8 20:46:55 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Sun, 8 Dec 2013 20:46:55 +0100 Subject: [FieldTrip] fit volume segment and sensors Message-ID: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> Dear Fieldtrippers I 'm trying to perform source analysis on MEG data. I use an AtB system (usually it is described as 'itab' in fieldtrip) First I have preprocessed my data and I have calculated the cross spectral density matrix Then I have constructed the forward model mri = ft_read_mri('Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; [segmentedmri] = ft_volumesegment(cfg, mri); and segmented the brain surface: cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); With the command ft_read_sens I have also read the sensors positions. Before going on I have checked the results plotting the volume and the sensors using the commands vol = ft_convert_units(vol,'cm'); sens = ft_read_sens(rawdataname); figure ft_plot_sens(sens, 'style', '*b'); hold on ft_plot_vol(vol); and I have noticed that the result is wrong because the volume soesn't fit the sensors as shown in the attachment Moreover, following some topics in the mailing list I have used ft_determine_coordsys(mri) ft_determine_coordsys(vol) ft_determine_coordsys(sens) and I have found that the coordinate systems are diffeerent. As far as I understand I should use the ctf coordinate system to perform the source analysis. But even if I try to specify this coordinate system it did not work. Any suggestion to solve this problem? Kind regards ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3401689815 tel +39 0818675361 fax +39 0818675128 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -------------- next part -------------- A non-text attachment was scrubbed... Name: brain&sensors.png Type: image/png Size: 22007 bytes Desc: not available URL: From a.todorovic at fcdonders.ru.nl Sun Dec 8 22:44:03 2013 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Sun, 8 Dec 2013 22:44:03 +0100 (CET) Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Dear 'trippers, I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. This is how I normally do it: cfg = []; cfg.planarmethod = 'sincos'; cfg.channel = {'MEG'}; cfg.trials = 'all'; cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) data_planar = ft_megplanar(cfg,data); Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? Cheers, Ana From ayobimpe2004 at hotmail.com Sun Dec 8 22:44:42 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 8 Dec 2013 22:44:42 +0100 Subject: [FieldTrip] TOPOPLOTER Message-ID: Dear all, Please I am using the topopotER but I ma getting the below error message: ??? Index exceeds matrix dimensions. Error in ==> ft_plot_topo at 182 mask{i}(end+1,:) = mask{i}(1,:); % force them to be closed Error in ==> topoplot_common at 709 ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ==> ft_topoplotER at 169cfg = topoplot_common(cfg, varargin{:});Please help of what am missing here.Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Dec 9 09:16:11 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 9 Dec 2013 09:16:11 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: Hi Ana, Are you by any chance doing ICA followed by ft_rejectcomponent at some point before ft_megplanar? After rejecting a component, grad.chanpos and grad.chanori will contain only NaNs (as of some months ago indeed), as the channel positions are ill-defined at that point (i.e. each 'data'-channel is in fact a weighted mixture of the original, physical, MEG channels). Since ft_megplanar needs the channel positions, it can no longer operate on data after ft_rejectcomponent. However, there is an easy workaround: the original channel positions should quite nicely approximate the positions after ft_rejectcomponent. So, what I do is simply store the original data.grad somewhere, and then make sure to stick in the data just before ft_megplanar. Note that the reason why ft_rejectcomponent updates the grad is that creating an accurate forward model (for source reconstruction) requires accurate sensor information. Therefore it fills grad.chanpos with NaNs, while updating grad.coilpos etc. to reflect the new projection. So you should *not* use the original grad for source analysis after ft_rejectcomponent, in that case just use the updated one with the NaNs inside. Best, Eelke On 8 December 2013 22:44, Todorovic, A. wrote: > Dear 'trippers, > > I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. > > This is how I normally do it: > > cfg = []; > cfg.planarmethod = 'sincos'; > cfg.channel = {'MEG'}; > cfg.trials = 'all'; > cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) > data_planar = ft_megplanar(cfg,data); > > > Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? > > > Cheers, > Ana > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Dec 9 09:19:04 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 9 Dec 2013 09:19:04 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: PS: Note that a bug is assigned to me to facilitate ft_megplanar after reprojection without artificially restoring the grad (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2332), so this should be fixed at some point. On 9 December 2013 09:16, Eelke Spaak wrote: > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. wrote: >> Dear 'trippers, >> >> I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. >> >> This is how I normally do it: >> >> cfg = []; >> cfg.planarmethod = 'sincos'; >> cfg.channel = {'MEG'}; >> cfg.trials = 'all'; >> cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) >> data_planar = ft_megplanar(cfg,data); >> >> >> Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? >> >> >> Cheers, >> Ana >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Mon Dec 9 10:36:08 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Mon, 9 Dec 2013 11:36:08 +0200 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand Message-ID: Hi, I want to save my multichannel EEG recordings after an experiment to process them offline with fieldtrip. I'm using Python to develop this system so I need some pointers to a Python package to save my data in a format that FT will understand. EDF, GDF can be read by FT but I couldn't find a writer library for those formats for Python. Will plain .mat files work? Thanks. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From jm.horschig at donders.ru.nl Mon Dec 9 11:30:30 2013 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 09 Dec 2013 11:30:30 +0100 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand In-Reply-To: References: Message-ID: <52A59BC6.5060408@donders.ru.nl> Dear Ozan, plain mat-files will do, but you will have to write your own wrapper: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import I don't know any Python toolboxes, so I cannot help with that (and that is because I don't know Python) Best, Jörn Ozan Çağlayan wrote: > Hi, > > I want to save my multichannel EEG recordings after an experiment to > process them offline with fieldtrip. I'm using Python to develop this > system so I need some pointers to a Python package to save my data in > a format that FT will understand. EDF, GDF can be read by FT but I > couldn't find a writer library for those formats for Python. Will > plain .mat files work? > > Thanks. > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 9 11:36:14 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 09 Dec 2013 11:36:14 +0100 Subject: [FieldTrip] TOPOPLOTER In-Reply-To: References: Message-ID: <52A59D1E.1000409@donders.ru.nl> Dear Azeez, at the moment it is hard to know why the error appears, there could be several reasons. Could you please provide some more information on what you are doing? Something along these lines: http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#example_message Best, Jörn Azeez Adebimpe wrote: > Dear all, > > Please I am using the topopotER but I ma getting the below error message: > > /??? Index exceeds matrix dimensions./ > / > / > /Error in ==> ft_plot_topo at 182/ > / mask{i}(end+1,:) = mask{i}(1,:); % force them to > be closed/ > / > / > /Error in ==> topoplot_common at 709/ > /ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,.../ > / > / > /Error in ==> ft_topoplotER at 169/ > /cfg = topoplot_common(cfg, varargin{:});/ > Please help of what am missing here. > Azeez Adebimpe > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 9 11:54:14 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 09 Dec 2013 11:54:14 +0100 Subject: [FieldTrip] fit volume segment and sensors In-Reply-To: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> References: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> Message-ID: <52A5A156.3070408@donders.ru.nl> Dear Sara, the procedure described on the FT-page is tailored towards data gathered from CTF data just because we happen to have a CTF-system here. Since you have itab-data, the coordinate system of your sensors (gradiometers) is not in ctf-space. Some more information on the different coordinate systems can be found here: http://fieldtrip.fcdonders.nl/faq/how_are_the_different_head_and_mri_coordinate_systems_defined?s[]=coordinate&s[]=system#details_of_the_chieti_itab_coordinate_system Your first step needs to be to coregister the gradiometer information with the MRI. Afaik, ft_volumerealign will then also take care of the coordinate system then (or, more precisely, return the appropriate transformation). See also here http://fieldtrip.fcdonders.nl/faq/how_to_coregister_an_anatomical_mri_with_the_gradiometer_or_electrode_positions?s[]=coordinate&s[]=system If I remember correctly, this will not change the coordinate system of the gradiometers, but adjust the transformation matrix of the MRI instead. You do not need to be in CTF-space, you just need to make sure that all your data are in the same coordinate-system. Once you got that, it should work. For example, for EEG source reconstruction you can stay in MNI-space all the time. Dealing with these transformation between coordinate systems is some nasty job, so take care you do it correctly and e.g. not get confused by neurological and radiological convention And note that there is also ft_convert_coordsys for transformation, but I am not sure whether that works for gradiometers, yet. I think this all just works for volumes. I hope this works for you. Best, Jörn s.rombetto at cib.na.cnr.it wrote: > Dear Fieldtrippers > > I 'm trying to perform source analysis on MEG data. > I use an AtB system (usually it is described as 'itab' in fieldtrip) > > First I have preprocessed my data and I have calculated the cross > spectral density matrix > > Then I have constructed the forward model > > mri = ft_read_mri('Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > [segmentedmri] = ft_volumesegment(cfg, mri); > > and segmented the brain surface: > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > With the command ft_read_sens I have also read the sensors positions. > > Before going on I have checked the results plotting the volume and the > sensors using the commands > vol = ft_convert_units(vol,'cm'); > sens = ft_read_sens(rawdataname); > figure > ft_plot_sens(sens, 'style', '*b'); > hold on > ft_plot_vol(vol); > > and I have noticed that the result is wrong because the volume soesn't > fit the sensors as shown in the attachment > Moreover, following some topics in the mailing list I have used > > ft_determine_coordsys(mri) > ft_determine_coordsys(vol) > ft_determine_coordsys(sens) > > and I have found that the coordinate systems are diffeerent. > > As far as I understand I should use the ctf coordinate system to > perform the source analysis. But even if I try to specify this > coordinate system it did not work. > Any suggestion to solve this problem? > > Kind regards > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From christoph.herrmann at uni-oldenburg.de Mon Dec 9 14:18:55 2013 From: christoph.herrmann at uni-oldenburg.de (Christoph Herrmann) Date: Mon, 09 Dec 2013 14:18:55 +0100 Subject: [FieldTrip] Job offer (PhD student position) Message-ID: <52A5C33F.9080307@uni-oldenburg.de> Dear EEGLAB users, I am offering a position as a PhD student in my lab (see attachment). I would be happy if you could bring this job advertisement to the attention of students who might be suited candidates. The task of the PhD student will be to record EEG while participants receive transcranial alternating current stimulation (tACS). The project aims at investiagting which stimulation protocols are capable of modulating human EEG and perception. The project will be carried out in collaboration with the University Clinic in Hamburg Eppendorf (Andreas Engel) where similar experiments will be conducted in ferrets as well as with Münster University Clinic (Carsten Wolters) where a finite element model of tACS will be used to predict the pattern of current flow inside the brain. Best wishes, Christoph Herrmann -- Prof. Dr. Christoph Herrmann Departement of Psychology European Medical School Carl von Ossietzky University Ammerländer Heerstr. 114-118 26111 Oldenburg, Germany Tel: +49 441 798 4936 Fax: +49 441 798 3865 Office: A7/019 Web: http://www.uni-oldenburg.de/allgemeine-psychologie -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD in EEG-tACS.pdf Type: application/pdf Size: 114350 bytes Desc: not available URL: From a.todorovic at fcdonders.ru.nl Mon Dec 9 14:29:46 2013 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Mon, 9 Dec 2013 14:29:46 +0100 (CET) Subject: [FieldTrip] fieldtrip Digest, Vol 37, Issue 8 In-Reply-To: Message-ID: <1088480008.912147.1386595786285.JavaMail.root@monoceros.zimbra.ru.nl> Hi Eelke, Thanks for your quick reply! ICA is indeed what I normally do (including saving the original gradiometer definitions), but the NaNs appear even if I skip ICA and just preprocess and then do ft_megplanar directly after. However I am now starting to think that these NaNs are a normal consequence of doing a planar gradient transformation and that I was wrong to assume that this is what it causing my problem further down the pipeline. I dug up some old TFRs and saw that their grad.chanori structures also consist of NaNs. My apologies for not checking this previously. And the problem that I have is that the channel labels disappear after ft_freqdescriptives and that the powspctrm field is empty (or if I use a variant of ft_freqdescriptives which is newer than the one I normally use, an error with reshape occurs). The original TFRs prior to ft_freqdescriptives look OK though. But I will dig further to see what could be causing it - in most cases it's something I did. Cheers, Ana > > Message: 3 > Date: Mon, 9 Dec 2013 09:16:11 +0100 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] gradiometer definitions after ft_megplanar > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. > wrote: > > Dear 'trippers, > > > > I am attempting to do a TFR on planar gradient data. I first > > preprocess, then do ft_megplanar, then ft_freqanalysis, followed by > > ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori > > field consists only of NaNs. I see that some changes were made a few > > months ago on how gradiometers are described, so I am wondering > > whether there are some changes I should now make to the cfg > > structure when doing the planar gradient transformation. > > > > This is how I normally do it: > > > > cfg = []; > > cfg.planarmethod = 'sincos'; > > cfg.channel = {'MEG'}; > > cfg.trials = 'all'; > > cfg.neighbours = neighbours; % > > neighbours=ft_prepare_neighbours(cfg,data) > > data_planar = ft_megplanar(cfg,data); > > > > > > Alternatively, is there some workaround I could now implement to fix > > my already calculated TFR structures? > > > > > > Cheers, > > Ana > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 4 > Date: Mon, 9 Dec 2013 09:19:04 +0100 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] gradiometer definitions after ft_megplanar > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > PS: Note that a bug is assigned to me to facilitate ft_megplanar after > reprojection without artificially restoring the grad > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2332), so this should be > fixed at some point. > From a.stolk8 at gmail.com Mon Dec 9 15:48:35 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 9 Dec 2013 15:48:35 +0100 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Inna, Testing ft_regressconfound with some fake data, everything seems to be fine here: timelock = []; timelock.label = {'1' '2'}; timelock.time = 1:5; timelock.dimord = 'rpt_chan_time'; timelock.trial = randn(20,2,5); timelock.avg = randn(2,5); cfg = []; cfg.confound = randn(20,3); cfg.reject = [1:3]; timelock_out = ft_regressconfound(cfg, timelock); Does this example code work for you? I could not detect any mistake in your lines of code. What does your 'timelock' structure look like? Are there any real values in the data? (don't think this is causing it, but please update to newest Ft version just to be sure) Yours, Arjen 2013/12/2 McGowin, Inna > Thank you Arjen, > Actually, I am testing the FieldTrip motion regression on MEG data > specifically collected with a current phantom and known motion. I can treat > the data as ERP data and average over 1 sec trials if needed. > Following your advise on reduction of the regressors number (on 120 trials > of 1 sec long) I was able to avoid the "out of memory" issue. Though I run > into the different set of problems now that I need help to understand: > ______________________________________________ > ??? Error using ==> mxSerialize > Error during serialization of (null) > > Error in ==> ft_postamble_provenance at 91 > cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); > > Error in ==> ft_postamble at 55 > evalin('caller', ['ft_postamble_' cmd]); > > Error in ==> ft_timelockanalysis at 370 > ft_postamble provenance timelock > > Error in ==> ft_regressconfound at 313 > dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging > _________________________________________________________ > > Here is the code I run to regress the head motion: > %% > addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 > ft_defaults > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > cfg.trialdef.triallength=1; > cfg.trialdef.ntrials=120; > cfg.continuous = 'yes'; > cfg = ft_definetrial(cfg); > cfg.channel = {'MEG'}; > cfg.demean = 'yes'; > data = ft_preprocessing(cfg); > > %% > cfg = []; > cfg.keeptrials = 'yes'; > timelock = ft_timelockanalysis(cfg, data); > > %% > cfg = []; > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > cfg.trialdef.triallength=1; > cfg.trialdef.ntrials=120; > cfg.continuous = 'yes'; > cfg = ft_definetrial(cfg); > > %% > cfg.channel = {'HLC0011','HLC0012','HLC0013', ... > 'HLC0021','HLC0022','HLC0023', ... > 'HLC0031','HLC0032','HLC0033'}; > headpos = ft_preprocessing(cfg); > > ntrials = length(headpos.sampleinfo) > for t = 1:ntrials > coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); > mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; > coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); > mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; > coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); > mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; > end > > cc = circumcenter(coil1, coil2, coil3); > cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; > > %% > confound = [cc_dem ... > ones(size(cc_dem,1),1)]; > > %% > cfg = []; > cfg.confound = confound; > cfg.reject = [1:6]; > regr = ft_regressconfound(cfg, timelock); > %% > > _________________________________________________________________ > Sorry for the lengthy letter and thanks for the help! > > Inna > > > > > > On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Hi Inna, >> >> Are you using the same design matrix as on the wiki page? That one covers >> the primary head translations and rotations, but also their >> derivatives. You could try using the primary measures only (3 >> translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant >> regressors). It is also mentionworthy that there should be a balance >> between the number of regressors and the number of observations >> (i.e. trials). I believe on the respective wiki page on head movement >> regression it states that the ratio is recommended to be not larger >> than 1:10 (regressors:trials), accompanied with a reference. Accordingly, >> I'd suggest to use those 7 regressors, and your data (120s resting state) >> split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These >> specifications might hopefully also allow working around your memory issue. >> >> Second, it may be worth mentioning what you would like to do with the >> data post-movement-regression. Namely, the movement compensation will >> remove contributions from head movement to the signal. But this requires >> that signal to behave consistently over trials, which does not seem the >> case with the signal in your resting study? That is, with an ERP study, the >> signal fluctuations appear consistent over trials, with amplitudes being >> modulated by head movement (i.e. sensor-source distance, see our neuroimage >> paper - 2013) in a predictable fashion. So if you're planning on doing >> frequency analysis, or maybe connectivity analysis, after head movement >> compensation, I'd recommend reversing that order. The rule of thumb is to >> use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise >> unexplained variance (over trials) due to head movement, benefitting your >> statistical assessments. >> >> Hope these suggestions may help you with further analyses. I'm >> not familiar with anyone implementing this method to resting state >> analyses, but maybe someone else has some first-hand experience here. >> Furthermore, too late for your current dataset, but for a next one I'd >> recommend using the online head position monitoring/respositioning tool >> that we have developed for CTF systems (a neuromag version is approaching >> the final stage). This tool is routinely used in our lab to monitor >> and reduce head movment throughout recording (after which >> ft_regressconfound is being used to deal with the trial-by-trial crumbles). >> >> Yours, >> Arjen >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Mon Dec 9 17:49:06 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Mon, 9 Dec 2013 11:49:06 -0500 Subject: [FieldTrip] Sample Data Message-ID: Hey guys, I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I was wondering if anyone could point me in the direction of some sample data, preferably in Brainvision format. I was unable to retrieve any from websites such as eegdatabase.kiv. Thank you -Norman -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrolland at ucsd.edu Mon Dec 9 18:31:24 2013 From: mrolland at ucsd.edu (Matthieu Rolland) Date: Mon, 09 Dec 2013 09:31:24 -0800 Subject: [FieldTrip] Filtering before epoching Message-ID: <52A5FE6C.4030002@ucsd.edu> Hi everybody, Is it possible to filter data prior to epoching? And more generally is it possible to epoch data that has already been preprocessed? I have tried without success many variations of this: 1. Preprocessing step on continuous data with filtering. /cfg=[];// //cfg.dataset = 'raw_data.fif';// //cfg.bpfilter = 'yes';// //cfg.bpfreq = [a b];// //data = ft_preprocessing(cfg);/ 2. Define trial. /cfg =// ft_definetrial(cfg);/ 3. Preprocessing step for epoching data on filtered data. /final_data = ft_preprocessing(cfg,data);/ Thank you for your help. Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Dec 9 19:04:20 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 9 Dec 2013 13:04:20 -0500 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Thanks you Your code works fine. Here is the Matlab output for this code: *the input is timelock data with 2 channels and 5 timebinsremoving confound 1 2 3 keeping confound normalizing the confounds, except the constant estimating the regression weights and removing the confounds updating descriptives the input is timelock data with 2 channels and 5 timebinsWarning: the data does not contain a trial definition > In utilities\private\warning_once at 158 In utilities\private\fixsampleinfo at 66 In ft_datatype_raw at 154 In ft_checkdata at 298 In ft_timelockanalysis at 105 In ft_regressconfound at 313Warning: reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuousrecording > In utilities\private\warning_once at 158 In utilities\private\fixsampleinfo at 79 In ft_datatype_raw at 154 In ft_checkdata at 298 In ft_timelockanalysis at 105 In ft_regressconfound at 313averaging trialsaveraging trial 20 of 20the call to "ft_timelockanalysis" took 1 secondsthe call to "ft_regressconfound" took 4 seconds* The data I am trying to correct for the motion is real. It was collected with a current phantom generating the signal by a dipole. The data is continuous but can be broken into trials of 1 sec (the dipole generates 7 Hz sinusoidal signal continuously). The phantom was mechanically moved during the scan for a precisely known amount (e.g. 1 cm down). The data was recorded by CTF 275-sensor MEG unit with the continuous head coils localization. I was able to apply the SSS motion correction algorithm successfully to this data set. If there is a way I could share this data set. Thanks, Inna Inna McGowin On Mon, Dec 9, 2013 at 9:48 AM, Arjen Stolk wrote: > Hi Inna, > > Testing ft_regressconfound with some fake data, everything seems to be > fine here: > > timelock = []; > timelock.label = {'1' '2'}; > timelock.time = 1:5; > timelock.dimord = 'rpt_chan_time'; > timelock.trial = randn(20,2,5); > timelock.avg = randn(2,5); > > cfg = []; > cfg.confound = randn(20,3); > cfg.reject = [1:3]; > timelock_out = ft_regressconfound(cfg, timelock); > > Does this example code work for you? I could not detect any mistake in > your lines of code. What does your 'timelock' structure look like? Are > there any real values in the data? (don't think this is causing it, but > please update to newest Ft version just to be sure) > > Yours, > Arjen > > > 2013/12/2 McGowin, Inna > > Thank you Arjen, >> Actually, I am testing the FieldTrip motion regression on MEG data >> specifically collected with a current phantom and known motion. I can treat >> the data as ERP data and average over 1 sec trials if needed. >> Following your advise on reduction of the regressors number (on 120 >> trials of 1 sec long) I was able to avoid the "out of memory" issue. Though >> I run into the different set of problems now that I need help to understand: >> ______________________________________________ >> ??? Error using ==> mxSerialize >> Error during serialization of (null) >> >> Error in ==> ft_postamble_provenance at 91 >> cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); >> >> Error in ==> ft_postamble at 55 >> evalin('caller', ['ft_postamble_' cmd]); >> >> Error in ==> ft_timelockanalysis at 370 >> ft_postamble provenance timelock >> >> Error in ==> ft_regressconfound at 313 >> dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging >> _________________________________________________________ >> >> Here is the code I run to regress the head motion: >> %% >> addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 >> ft_defaults >> cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; >> cfg.trialdef.triallength=1; >> cfg.trialdef.ntrials=120; >> cfg.continuous = 'yes'; >> cfg = ft_definetrial(cfg); >> cfg.channel = {'MEG'}; >> cfg.demean = 'yes'; >> data = ft_preprocessing(cfg); >> >> %% >> cfg = []; >> cfg.keeptrials = 'yes'; >> timelock = ft_timelockanalysis(cfg, data); >> >> %% >> cfg = []; >> cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; >> cfg.trialdef.triallength=1; >> cfg.trialdef.ntrials=120; >> cfg.continuous = 'yes'; >> cfg = ft_definetrial(cfg); >> >> %% >> cfg.channel = {'HLC0011','HLC0012','HLC0013', ... >> 'HLC0021','HLC0022','HLC0023', ... >> 'HLC0031','HLC0032','HLC0033'}; >> headpos = ft_preprocessing(cfg); >> >> ntrials = length(headpos.sampleinfo) >> for t = 1:ntrials >> coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); >> mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; >> coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); >> mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; >> coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); >> mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; >> end >> >> cc = circumcenter(coil1, coil2, coil3); >> cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; >> >> %% >> confound = [cc_dem ... >> ones(size(cc_dem,1),1)]; >> >> %% >> cfg = []; >> cfg.confound = confound; >> cfg.reject = [1:6]; >> regr = ft_regressconfound(cfg, timelock); >> %% >> >> _________________________________________________________________ >> Sorry for the lengthy letter and thanks for the help! >> >> Inna >> >> >> >> >> >> On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Hi Inna, >>> >>> Are you using the same design matrix as on the wiki page? That one >>> covers the primary head translations and rotations, but also their >>> derivatives. You could try using the primary measures only (3 >>> translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant >>> regressors). It is also mentionworthy that there should be a balance >>> between the number of regressors and the number of observations >>> (i.e. trials). I believe on the respective wiki page on head movement >>> regression it states that the ratio is recommended to be not larger >>> than 1:10 (regressors:trials), accompanied with a reference. Accordingly, >>> I'd suggest to use those 7 regressors, and your data (120s resting state) >>> split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These >>> specifications might hopefully also allow working around your memory issue. >>> >>> Second, it may be worth mentioning what you would like to do with the >>> data post-movement-regression. Namely, the movement compensation will >>> remove contributions from head movement to the signal. But this requires >>> that signal to behave consistently over trials, which does not seem the >>> case with the signal in your resting study? That is, with an ERP study, the >>> signal fluctuations appear consistent over trials, with amplitudes being >>> modulated by head movement (i.e. sensor-source distance, see our neuroimage >>> paper - 2013) in a predictable fashion. So if you're planning on doing >>> frequency analysis, or maybe connectivity analysis, after head movement >>> compensation, I'd recommend reversing that order. The rule of thumb is to >>> use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise >>> unexplained variance (over trials) due to head movement, benefitting your >>> statistical assessments. >>> >>> Hope these suggestions may help you with further analyses. I'm >>> not familiar with anyone implementing this method to resting state >>> analyses, but maybe someone else has some first-hand experience here. >>> Furthermore, too late for your current dataset, but for a next one I'd >>> recommend using the online head position monitoring/respositioning tool >>> that we have developed for CTF systems (a neuromag version is approaching >>> the final stage). This tool is routinely used in our lab to monitor >>> and reduce head movment throughout recording (after which >>> ft_regressconfound is being used to deal with the trial-by-trial crumbles). >>> >>> Yours, >>> Arjen >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Dec 9 19:59:36 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 9 Dec 2013 13:59:36 -0500 Subject: [FieldTrip] ft_senstype Message-ID: There seems to be a bug in ft_senstype. Even if my data.label has names without spaces, it always returns 'neuromag306', instead of 'neuromag306alt'. Because of that line 103 and 104 in ft_combineplanar returns empty matrices. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Dec 9 20:09:37 2013 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Mon, 9 Dec 2013 20:09:37 +0100 (CET) Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: Message-ID: <729996541.4260388.1386616177029.JavaMail.root@sculptor.zimbra.ru.nl> Dear Inna, The output you get is as one would expect. Could you try and spot any principal differences between the timelock structure you have and the one we just simulated? Alternatively, could you send me a reduced/exchangeable timelock structure with say, about 3 trials, for me to replicate your error (<15mb?, by direct email to a.stolk8 at gmail.com)? Yours Arjen ----- Oorspronkelijk bericht ----- > Van: "Inna McGowin" > Aan: "FieldTrip discussion list" > Verzonden: Maandag 9 december 2013 19:04:20 > Onderwerp: Re: [FieldTrip] Fwd: head motion regression with > ft_regressconfound on a continuous MEG data > Thanks you > Your code works fine. Here is the Matlab output for this code: > the input is timelock data with 2 channels and 5 timebins > removing confound 1 2 3 > keeping confound > normalizing the confounds, except the constant > estimating the regression weights and removing the confounds > updating descriptives > the input is timelock data with 2 channels and 5 timebins > Warning: the data does not contain a trial definition > > In utilities\private\warning_once at 158 > In utilities\private\fixsampleinfo at 66 > In ft_datatype_raw at 154 > In ft_checkdata at 298 > In ft_timelockanalysis at 105 > In ft_regressconfound at 313 > Warning: reconstructing sampleinfo by assuming that the trials are > consecutive segments of a continuous > recording > > In utilities\private\warning_once at 158 > In utilities\private\fixsampleinfo at 79 > In ft_datatype_raw at 154 > In ft_checkdata at 298 > In ft_timelockanalysis at 105 > In ft_regressconfound at 313 > averaging trials > averaging trial 20 of 20 > the call to "ft_timelockanalysis" took 1 seconds > the call to "ft_regressconfound" took 4 seconds > The data I am trying to correct for the motion is real. It was > collected with a current phantom generating the signal by a dipole. > The data is continuous but can be broken into trials of 1 sec (the > dipole generates 7 Hz sinusoidal signal continuously). The phantom was > mechanically moved during the scan for a precisely known amount (e.g. > 1 cm down). The data was recorded by CTF 275-sensor MEG unit with the > continuous head coils localization. I was able to apply the SSS motion > correction algorithm successfully to this data set. If there is a way > I could share this data set. > Thanks, > Inna > Inna McGowin > On Mon, Dec 9, 2013 at 9:48 AM, Arjen Stolk < a.stolk8 at gmail.com > > wrote: > > Hi Inna, > > Testing ft_regressconfound with some fake data, everything seems to > > be > > fine here: > > timelock = []; > > timelock.label = {'1' '2'}; > > timelock.time = 1:5; > > timelock.dimord = 'rpt_chan_time'; > > timelock.trial = randn(20,2,5); > > timelock.avg = randn(2,5); > > cfg = []; > > cfg.confound = randn(20,3); > > cfg.reject = [1:3]; > > timelock_out = ft_regressconfound(cfg, timelock); > > Does this example code work for you? I could not detect any mistake > > in > > your lines of code. What does your 'timelock' structure look like? > > Are > > there any real values in the data? (don't think this is causing it, > > but please update to newest Ft version just to be sure) > > Yours, > > Arjen > > 2013/12/2 McGowin, Inna < mcgoiv0 at wfu.edu > > > > Thank you Arjen, > > > Actually, I am testing the FieldTrip motion regression on MEG data > > > specifically collected with a current phantom and known motion. I > > > can > > > treat the data as ERP data and average over 1 sec trials if > > > needed. > > > Following your advise on reduction of the regressors number (on > > > 120 > > > trials of 1 sec long) I was able to avoid the "out of memory" > > > issue. > > > Though I run into the different set of problems now that I need > > > help > > > to understand: > > > ______________________________________________ > > > ??? Error using ==> mxSerialize > > > Error during serialization of (null) > > > Error in ==> ft_postamble_provenance at 91 > > > cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); > > > Error in ==> ft_postamble at 55 > > > evalin('caller', ['ft_postamble_' cmd]); > > > Error in ==> ft_timelockanalysis at 370 > > > ft_postamble provenance timelock > > > Error in ==> ft_regressconfound at 313 > > > dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging > > > _________________________________________________________ > > > Here is the code I run to regress the head motion: > > > %% > > > addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 > > > ft_defaults > > > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > > > cfg.trialdef.triallength=1; > > > cfg.trialdef.ntrials=120; > > > cfg.continuous = 'yes'; > > > cfg = ft_definetrial(cfg); > > > cfg.channel = {'MEG'}; > > > cfg.demean = 'yes'; > > > data = ft_preprocessing(cfg); > > > %% > > > cfg = []; > > > cfg.keeptrials = 'yes'; > > > timelock = ft_timelockanalysis(cfg, data); > > > %% > > > cfg = []; > > > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > > > cfg.trialdef.triallength=1; > > > cfg.trialdef.ntrials=120; > > > cfg.continuous = 'yes'; > > > cfg = ft_definetrial(cfg); > > > %% > > > cfg.channel = {'HLC0011','HLC0012','HLC0013', ... > > > 'HLC0021','HLC0022','HLC0023', ... > > > 'HLC0031','HLC0032','HLC0033'}; > > > headpos = ft_preprocessing(cfg); > > > ntrials = length(headpos.sampleinfo) > > > for t = 1:ntrials > > > coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); > > > mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; > > > coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); > > > mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; > > > coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); > > > mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; > > > end > > > cc = circumcenter(coil1, coil2, coil3); > > > cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; > > > %% > > > confound = [cc_dem ... > > > ones(size(cc_dem,1),1)]; > > > %% > > > cfg = []; > > > cfg.confound = confound; > > > cfg.reject = [1:6]; > > > regr = ft_regressconfound(cfg, timelock); > > > %% > > > _________________________________________________________________ > > > Sorry for the lengthy letter and thanks for the help! > > > Inna > > > On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < > > > a.stolk at fcdonders.ru.nl > wrote: > > > > Hi Inna, > > > > Are you using the same design matrix as on the wiki page? That > > > > one > > > > covers the primary head translations and rotations, but also > > > > their > > > > derivatives. You could try using the primary measures only (3 > > > > translastions, and 3 rotations of the circumcenter, totaling 6 + > > > > 1 > > > > constant regressors). It is also mentionworthy that there should > > > > be > > > > a > > > > balance between the number of regressors and the number of > > > > observations (i.e. trials). I believe on the respective wiki > > > > page > > > > on > > > > head movement regression it states that the ratio is recommended > > > > to > > > > be > > > > not larger than 1:10 (regressors:trials), accompanied with a > > > > reference. Accordingly, I'd suggest to use those 7 regressors, > > > > and > > > > your data (120s resting state) split in segments of 1 or 2 > > > > seconds, > > > > totaling 60 or 120 trials. These specifications might hopefully > > > > also > > > > allow working around your memory issue. > > > > Second, it may be worth mentioning what you would like to do > > > > with > > > > the > > > > data post-movement-regression. Namely, the movement compensation > > > > will > > > > remove contributions from head movement to the signal. But this > > > > requires that signal to behave consistently over trials, which > > > > does > > > > not seem the case with the signal in your resting study? That > > > > is, > > > > with > > > > an ERP study, the signal fluctuations appear consistent over > > > > trials, > > > > with amplitudes being modulated by head movement (i.e. > > > > sensor-source > > > > distance, see our neuroimage paper - 2013) in a predictable > > > > fashion. > > > > So if you're planning on doing frequency analysis, or maybe > > > > connectivity analysis, after head movement compensation, I'd > > > > recommend > > > > reversing that order. The rule of thumb is to use > > > > ft_regressconfound > > > > just prior to ft_xxxstatistics, removing otherwise unexplained > > > > variance (over trials) due to head movement, benefitting your > > > > statistical assessments. > > > > Hope these suggestions may help you with further analyses. I'm > > > > not > > > > familiar with anyone implementing this method to resting state > > > > analyses, but maybe someone else has some first-hand experience > > > > here. > > > > Furthermore, too late for your current dataset, but for a next > > > > one > > > > I'd > > > > recommend using the online head position > > > > monitoring/respositioning > > > > tool that we have developed for CTF systems (a neuromag version > > > > is > > > > approaching the final stage). This tool is routinely used in our > > > > lab > > > > to monitor and reduce head movment throughout recording (after > > > > which > > > > ft_regressconfound is being used to deal with the trial-by-trial > > > > crumbles). > > > > Yours, > > > > Arjen > > > > _______________________________________________ > > > > fieldtrip mailing list > > > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From faranak.farzan at gmail.com Mon Dec 9 20:45:51 2013 From: faranak.farzan at gmail.com (Faranak Farzan) Date: Mon, 9 Dec 2013 14:45:51 -0500 Subject: [FieldTrip] 3D Cluster Based Correction Message-ID: Dear Fieldtripers, In response to message 1 bellow, We have a new question: We are correcting for multiple comparisons using cluster-based algorithms suggested by Maris and Oostenveld. Can we retrieve the cluster "LABELS" from the 3D matrix of ChanXTimXFreq (shuffled for subjects). For instance as an output of this Fieldtrip function statcondfieldtrip.m Thank you! Faranak Message: 1 Date: Fri, 29 Nov 2013 15:14:26 +0400 From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Question regarding cluster-based permutation test Message-ID: Content-Type: text/plain; charset="utf-8" Hello Faranak, If you're doing a within-subjects design, then testing channels*time*freq on grand average data should be possible; see http://fieldtrip .fcdonders.nl/tutorial/cluster_permutation_freq#within_subjects_experiments . Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Dec 10 08:57:34 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 10 Dec 2013 08:57:34 +0100 Subject: [FieldTrip] Filtering before epoching In-Reply-To: <52A5FE6C.4030002@ucsd.edu> References: <52A5FE6C.4030002@ucsd.edu> Message-ID: <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> Hi Matt, Yes, it's possible. The only thing you should change in your approach is step 3: use ft_redefinetrial, rather than ft_preprocessing So: 1. Preprocessing step on continuous data with filtering. cfg=[]; cfg.dataset = 'raw_data.fif'; cfg.bpfilter = 'yes'; cfg.bpfreq = [a b]; data = ft_preprocessing(cfg); 2. Define trial. cfg = []; cfg.dataset = 'blabla'; cfg.trialdef.xxx etc some settings here. cfg = ft_definetrial(cfg); trl = cfg.trl; 3. Preprocessing step for epoching data on filtered data. cfg = []; cfg.trl = trl; final_data = ft_redefinetrial(cfg,data); Best, JM On Dec 9, 2013, at 6:31 PM, Matthieu Rolland wrote: > Hi everybody, > > Is it possible to filter data prior to epoching? And more generally is it possible to epoch data that has already been preprocessed? > > I have tried without success many variations of this: > > 1. Preprocessing step on continuous data with filtering. > cfg=[]; > cfg.dataset = 'raw_data.fif'; > cfg.bpfilter = 'yes'; > cfg.bpfreq = [a b]; > data = ft_preprocessing(cfg); > > 2. Define trial. > cfg = ft_definetrial(cfg); > > 3. Preprocessing step for epoching data on filtered data. > final_data = ft_preprocessing(cfg,data); > > > Thank you for your help. > Matt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 10:09:11 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 11:09:11 +0200 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand In-Reply-To: <52A59BC6.5060408@donders.ru.nl> References: <52A59BC6.5060408@donders.ru.nl> Message-ID: On Mon, Dec 9, 2013 at 12:30 PM, "Jörn M. Horschig" wrote: > Dear Ozan, > > plain mat-files will do, but you will have to write your own wrapper: > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import > > I don't know any Python toolboxes, so I cannot help with that (and that is > because I don't know Python) Hi, I think I managed out doing this but there are some points I like to discuss. My EEG stream is made of 14 channels. Sampling rate is 128. I don't have separate trials but a single continuous recording. So if I understand correctly I have to create the data structure like this: data.fsample = 128 data.labels = cell array of channel labels data.trial = {[14xNsamples]} (Single element cell array containing the whole EEG data) data.sampleinfo = [1 Nsamples] data.time = {linspace(0, Nsamples/fsample, Nsamples)} ?? What should the data.time be? Is it the whole recording duration divided by Nsamples? Thanks. From jean-baptiste.versini at etu.univ-lyon1.fr Tue Dec 10 11:43:06 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Tue, 10 Dec 2013 10:43:06 +0000 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl>, Message-ID: <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Hello, data.trial is a <1 x NTrial cell> and each cell in it is a data.time is a <1 x NTrial cell> and each cell in it is a <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial sampled at 5Hz. ________________________________________ De : fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] de la part de Ozan Çağlayan [ozancag at gmail.com] Date d'envoi : mardi 10 décembre 2013 10:09 À : FieldTrip discussion list Objet : Re: [FieldTrip] Best way of saving data in format that fieldtrip will understand On Mon, Dec 9, 2013 at 12:30 PM, "Jörn M. Horschig" wrote: > Dear Ozan, > > plain mat-files will do, but you will have to write your own wrapper: > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import > > I don't know any Python toolboxes, so I cannot help with that (and that is > because I don't know Python) Hi, I think I managed out doing this but there are some points I like to discuss. My EEG stream is made of 14 channels. Sampling rate is 128. I don't have separate trials but a single continuous recording. So if I understand correctly I have to create the data structure like this: data.fsample = 128 data.labels = cell array of channel labels data.trial = {[14xNsamples]} (Single element cell array containing the whole EEG data) data.sampleinfo = [1 Nsamples] data.time = {linspace(0, Nsamples/fsample, Nsamples)} ?? What should the data.time be? Is it the whole recording duration divided by Nsamples? Thanks. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Tue Dec 10 13:48:37 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 14:48:37 +0200 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: On Tue, Dec 10, 2013 at 12:43 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Hello, > > data.trial is a <1 x NTrial cell> and each cell in it is a > data.time is a <1 x NTrial cell> and each cell in it is a <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial sampled at 5Hz. 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? Am I wrong? -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From r.oostenveld at donders.ru.nl Tue Dec 10 14:23:39 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:23:39 +0100 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: <5439AD52-5050-4B5D-87D8-CDCD15F98799@donders.ru.nl> Hi Ozan On 10 Dec 2013, at 13:48, Ozan Çağlayan wrote: > > 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? > Am I wrong? No, at 5 Hz sampling frequency the distance between subsequent samples is 1/5 Hz = 0.2 seconds. So depending on whether you include the edges of the time interval or not, a time interval from 0 to 1 could be represented as 0.0 0.2 0.4. 0.6 0.8 1.0 % including both edges 0.2 0.4. 0.6 0.8 1.0 % including only the rightmost edge 0.0 0.2 0.4. 0.6 0.8 % including only the leftmost edge 0.2 0.4. 0.6 0.8 % not including the edges of the interval In the case of a continuous recording of Nsamples at Fsample I would consider the best representation data.trial{1} = randn(Nchans, Nsamples); data.time{1} = ((1:nSamples)-1)/Fsample; % the first sample is at time=0, the last sample is at (nSamples-1)/Fsample data.label = arrayfun(@num2str, 1:Nchans, 'UniformOutput', false) See also http://fieldtrip.fcdonders.nl/faq/how_can_i_process_continuous_data_without_triggers, http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat and http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_one_dataformat_into_an_other You might want to check out http://martinos.org/mne/mne-python.html and http://code.google.com/p/pyeeg/ for python code related to EEG data. best regards, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Tue Dec 10 14:26:27 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:26:27 +0100 Subject: [FieldTrip] ft_senstype In-Reply-To: References: Message-ID: Hi Raghavan thanks for reporting. I have added it to our bug tracker on http://bugzilla.fcdonders.nl/show_bug.cgi?id=2418. If you want, you can register on bugzilla with your email and automatically get informed when the bug gets resolved. See also http://fieldtrip.fcdonders.nl/bugzilla best regards Robert On 9 Dec 2013, at 19:59, Raghavan Gopalakrishnan wrote: > There seems to be a bug in ft_senstype. > Even if my data.label has names without spaces, it always returns 'neuromag306', instead of 'neuromag306alt'. Because of that line 103 and 104 in ft_combineplanar returns empty matrices. > > Thanks, > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Tue Dec 10 14:32:37 2013 From: stan.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Tue, 10 Dec 2013 14:32:37 +0100 (CET) Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: <04c601cef5ac$4a4c2f90$dee48eb0$@vanpelt@fcdonders.ru.nl> Yes, you are wrong. [ 0. , 0.25, 0.5 , 0.75, 1. ] would mean 4 Hz sampling (steps of 0.25 => 1/0.25=4) 5Hz sampling implies time steps of 0.2s (=1/5) Best, Stan Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen tel: 024-3616288 -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ozan Çaglayan Sent: dinsdag 10 december 2013 13:49 To: FieldTrip discussion list Subject: Re: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand On Tue, Dec 10, 2013 at 12:43 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Hello, > > data.trial is a <1 x NTrial cell> and each cell in it is a NSample double> data.time is a <1 x NTrial cell> and each cell in it is a > <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial > sampled at 5Hz. 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? Am I wrong? -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Tue Dec 10 14:35:54 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:35:54 +0100 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Hi Norman Welcome in the FieldTrip community. A lot of the FieldTrip tutorials are based on example data and my colleague Nietssche is just working on collecting a list of tutorial data sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you can find a (temporary) excel sheet listing all datasets. The plan is to move that to a FAQ, i.e. "which example dataset is used in which tutorial?" For example the http://fieldtrip.fcdonders.nl/tutorial/continuous tutorial is based on an example BrainVision EEG dataset. Also http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. best regards, Robert On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: > Hey guys, > I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I was wondering if anyone could point me in the direction of some sample data, preferably in Brainvision format. I was unable to retrieve any from websites such as eegdatabase.kiv. Thank you > -Norman > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 15:33:19 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 16:33:19 +0200 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: <52a71808.c846cd0a.157e.ffff8a29SMTPIN_ADDED_BROKEN@mx.google.com> References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> <52a71808.c846cd0a.157e.ffff8a29SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: On Tue, Dec 10, 2013 at 3:32 PM, Stan van Pelt wrote: > Yes, you are wrong. > > [ 0. , 0.25, 0.5 , 0.75, 1. ] would mean 4 Hz sampling (steps of 0.25 > => 1/0.25=4) > > 5Hz sampling implies time steps of 0.2s (=1/5) Thank you for the clear explanations and the pointers Robert and Stan! -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From t.schneider at uke.uni-hamburg.de Tue Dec 10 15:39:55 2013 From: t.schneider at uke.uni-hamburg.de (Till Schneider) Date: Tue, 10 Dec 2013 15:39:55 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <52A727BB.50603@uke.uni-hamburg.de> Hi Eelke, just to get this issue straight. The correct way for creating an accurate forward model for MEG data after ICA artifact correction is to use the grad structure given by ft_rejectcomponent, right? And the corrected grad stucture is only provided when the third input argument (i.e. the original data) is passed to ft_rejectcomponent? (e.g. data_clean = ft_rejectcomponent(cfg, comp, data_original), where comp is the result of ft_componentanalysis). Or is it sufficient to pass two input arguments (cfg and comp) to ft_rejectcomponent? Best, Till -- Till Schneider, PhD Cognitive and Clinical Neurophysiology Group Dept. of Neurophysiology and Pathophysiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg Germany phone +49-40-7410-53188 fax +49-40-7410-57126 www.uke.de/neurophysiologie Am 09.12.13 09:16, schrieb Eelke Spaak: > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. wrote: >> Dear 'trippers, >> >> I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. >> >> This is how I normally do it: >> >> cfg = []; >> cfg.planarmethod = 'sincos'; >> cfg.channel = {'MEG'}; >> cfg.trials = 'all'; >> cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) >> data_planar = ft_megplanar(cfg,data); >> >> >> Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? >> >> >> Cheers, >> Ana >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From normanbenbrahim at gmail.com Tue Dec 10 15:42:40 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 09:42:40 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Thank you Robert, this is very helpful On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Norman > > Welcome in the FieldTrip community. > > A lot of the FieldTrip tutorials are based on example data and my > colleague Nietssche is just working on collecting a list of tutorial data > sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you can > find a (temporary) excel sheet listing all datasets. The plan is to move > that to a FAQ, i.e. "which example dataset is used in which tutorial?" > > For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also > http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. > > best regards, > Robert > > > On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: > > Hey guys, > I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I > was wondering if anyone could point me in the direction of some sample > data, preferably in Brainvision format. I was unable to retrieve any from > websites such as eegdatabase.kiv. Thank you > -Norman > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrolland at ucsd.edu Tue Dec 10 16:01:38 2013 From: mrolland at ucsd.edu (Matthieu Rolland) Date: Tue, 10 Dec 2013 07:01:38 -0800 Subject: [FieldTrip] Filtering before epoching In-Reply-To: <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> References: <52A5FE6C.4030002@ucsd.edu> <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> Message-ID: <52A72CD2.3080802@ucsd.edu> Thank you! On 12/09/13 23:57, jan-mathijs schoffelen wrote: > Hi Matt, > > Yes, it's possible. The only thing you should change in your approach > is step 3: use ft_redefinetrial, rather than ft_preprocessing > > So: > > 1. Preprocessing step on continuous data with filtering. > /cfg=[];// > //cfg.dataset = 'raw_data.fif';// > //cfg.bpfilter = 'yes';// > //cfg.bpfreq = [a b];// > //data = ft_preprocessing(cfg);/ > > 2. Define trial. > / > / > /cfg = [];/ > /cfg.dataset = 'blabla';/ > /cfg.trialdef.xxx etc some settings here./ > /cfg =//ft_definetrial(cfg);/ > trl = cfg.trl; > > 3. Preprocessing step for epoching data on filtered data. > / > / > /cfg = [];/ > /cfg.trl = trl;/ > /final_data = ft_redefinetrial(cfg,data);/ > > > Best, > JM > > On Dec 9, 2013, at 6:31 PM, Matthieu Rolland wrote: > >> Hi everybody, >> >> Is it possible to filter data prior to epoching? And more generally >> is it possible to epoch data that has already been preprocessed? >> >> I have tried without success many variations of this: >> >> 1. Preprocessing step on continuous data with filtering. >> /cfg=[];// >> //cfg.dataset = 'raw_data.fif';// >> //cfg.bpfilter = 'yes';// >> //cfg.bpfreq = [a b];// >> //data = ft_preprocessing(cfg);/ >> >> 2. Define trial. >> /cfg =// ft_definetrial(cfg);/ >> >> 3. Preprocessing step for epoching data on filtered data. >> /final_data = ft_preprocessing(cfg,data);/ >> >> >> Thank you for your help. >> Matt >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Tue Dec 10 16:08:01 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 10:08:01 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Robert: I'm trying to download the files but it always gets interrupted for some reason. I've tried it 6 times now on 2 different internet connections On Tue, Dec 10, 2013 at 9:42 AM, Norman Benbrahim wrote: > Thank you Robert, this is very helpful > > > On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Norman >> >> Welcome in the FieldTrip community. >> >> A lot of the FieldTrip tutorials are based on example data and my >> colleague Nietssche is just working on collecting a list of tutorial data >> sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you >> can find a (temporary) excel sheet listing all datasets. The plan is to >> move that to a FAQ, i.e. "which example dataset is used in which tutorial?" >> >> For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also >> http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. >> >> best regards, >> Robert >> >> >> On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: >> >> Hey guys, >> I'm a new Grad Student, going to be using Fieldtrip a lot in the future. >> I was wondering if anyone could point me in the direction of some sample >> data, preferably in Brainvision format. I was unable to retrieve any from >> websites such as eegdatabase.kiv. Thank you >> -Norman >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Tue Dec 10 16:11:49 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 10:11:49 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Nevermind it's working now On Tue, Dec 10, 2013 at 10:08 AM, Norman Benbrahim < normanbenbrahim at gmail.com> wrote: > Robert: I'm trying to download the files but it always gets interrupted > for some reason. I've tried it 6 times now on 2 different internet > connections > > > On Tue, Dec 10, 2013 at 9:42 AM, Norman Benbrahim < > normanbenbrahim at gmail.com> wrote: > >> Thank you Robert, this is very helpful >> >> >> On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < >> r.oostenveld at donders.ru.nl> wrote: >> >>> Hi Norman >>> >>> Welcome in the FieldTrip community. >>> >>> A lot of the FieldTrip tutorials are based on example data and my >>> colleague Nietssche is just working on collecting a list of tutorial data >>> sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you >>> can find a (temporary) excel sheet listing all datasets. The plan is to >>> move that to a FAQ, i.e. "which example dataset is used in which tutorial?" >>> >>> For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also >>> http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. >>> >>> best regards, >>> Robert >>> >>> >>> On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: >>> >>> Hey guys, >>> I'm a new Grad Student, going to be using Fieldtrip a lot in the future. >>> I was wondering if anyone could point me in the direction of some sample >>> data, preferably in Brainvision format. I was unable to retrieve any from >>> websites such as eegdatabase.kiv. Thank you >>> -Norman >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 17:40:49 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 18:40:49 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis Message-ID: Hi, I was struggling with the problem below for an hour and digging through the code I found out that I was setting cfg.fsample = 128 instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad which was causing a type mismatch in the below line. I think either in the docs it should be told that the fsample needs to be a double or FT should cast it to double transparently. Or can this be caused by Matlab 2013a as told by the warnings :) >> [freqs] = ft_freqanalysis(cfg, data) Warning: You are using MATLAB 2013a. FieldTrip is currently not supported on 2013a (8.1) or newer. Using your current MATLAB version can lead to unexpected behaviour, which might not be easily noticable. Continuing is not advised. > In ft_defaults at 64 In ft_freqanalysis at 191 the input is raw data with 14 channels and 1 trials Error using .* Integers can only be combined with integers of the same class, or scalar doubles. Error in ft_freqanalysis (line 423) fboi = round(cfg.foi .* cfg.pad) + 1; ********* Here cfg.pad is an int32 with 10 in it and cfg.foi = []. >> [] .* double(10) ans = [] >> [] .* int32(10) Error using .* Integers can only be combined with integers of the same class, or scalar doubles. and pad is set as: padding = max(trllength); cfg.pad = padding/data.fsample; // trllength == 1280, fsample == 128 in my case. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From ozancag at gmail.com Tue Dec 10 17:41:35 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 18:41:35 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: On Tue, Dec 10, 2013 at 6:40 PM, Ozan Çağlayan wrote: > Hi, > > I was struggling with the problem below for an hour and digging > through the code I found out that I was setting cfg.fsample = 128 > instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad > which was causing a type mismatch in the below line. not cfg.fsample of course, data.fsample.. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From nheugel89 at gmail.com Tue Dec 10 18:23:55 2013 From: nheugel89 at gmail.com (Nicholas Heugel) Date: Tue, 10 Dec 2013 11:23:55 -0600 Subject: [FieldTrip] Error after MNE Message-ID: I a trying to go through the tutorial for the - Source reconstruction of event-related fields using minimum-norm estimate I am able to run everything up to the MNE with no problem, and it seems like the MNE portion works. But when I run the command bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); and then plot it to visualize the source space. I get the error Reference to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; I have looked on this site and online and can't find an explanation of what is wrong or how to fix the problem. Any help would be appreciated. I am using an Anatomical MRI scan for the head model analysis, the skull is present and I manually am Identifying the fiducials. Also, a few steps earlier it had me check the white matter segmentation done by Freesurfer and that worked fine and what I get closely resembles the tutorial. So I think the problem is somewhere in the MNE I am just not sure where. Any help would be appreciated. Thank you for your time. Nicholas -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Dec 11 09:04:35 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 11 Dec 2013 09:04:35 +0100 Subject: [FieldTrip] Error after MNE In-Reply-To: References: Message-ID: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> Hi Nicholas, It seems that the fif files lacks some information that FieldTrip assumes to be present. I would say that this can only be caused by the fact that the version of mne_make_source_space you used does not write the triangle area information into the fif file. Could you go to bugzilla.fcdonders.nl, create yourself an account, and file the issue as a bug? Please then also upload the fif-file you mentioned. I'll have a look at it and make the ft_read_headshape function more robust. In the mean time you could comment out line 421. Best, Jan-Mathijs On Dec 10, 2013, at 6:23 PM, Nicholas Heugel wrote: > I a trying to go through the tutorial for the > Source reconstruction of event-related fields using minimum-norm estimate > > I am able to run everything up to the MNE with no problem, and it seems like the MNE portion works. But when I run the command bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > and then plot it to visualize the source space. I get the error Reference to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; > I have looked on this site and online and can't find an explanation of what is wrong or how to fix the problem. Any help would be appreciated. I am using an Anatomical MRI scan for the head model analysis, the skull is present and I manually am Identifying the fiducials. Also, a few steps earlier it had me check the white matter segmentation done by Freesurfer and that worked fine and what I get closely resembles the tutorial. So I think the problem is somewhere in the MNE I am just not sure where. Any help would be appreciated. Thank you for your time. > Nicholas > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Dec 11 10:41:17 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 11 Dec 2013 10:41:17 +0100 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: Hi Ozan, It is unclear to me why cfg.pad would be an integer, see what happens when I execute the following (in either Matlab 2012a or 2013a): >> class(32) ans = double Maybe you have some Matlab setting enabled causing it to store numbers that appear to be integer as an int32? On a sidenote, please note that, as the warning indicates, not all changes with 2013a are expected to result in errors, they might actually just lead to unexpected (i.e. wrong) results, without you necessarily noticing. Therefore, it would really be better to stick to an older version until the code has been properly updated. We are working on making fieldtrip work with 2013a, you can see the progress here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2095 Best, Eelke On 10 December 2013 17:41, Ozan Çağlayan wrote: > On Tue, Dec 10, 2013 at 6:40 PM, Ozan Çağlayan wrote: >> Hi, >> >> I was struggling with the problem below for an hour and digging >> through the code I found out that I was setting cfg.fsample = 128 >> instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad >> which was causing a type mismatch in the below line. > > not cfg.fsample of course, data.fsample.. > > > -- > Ozan Çağlayan > Research Assistant > Galatasaray University - Computer Engineering Dept. > http://www.ozancaglayan.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Wed Dec 11 11:11:58 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Wed, 11 Dec 2013 12:11:58 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: On Wed, Dec 11, 2013 at 11:41 AM, Eelke Spaak wrote: > Hi Ozan, > > It is unclear to me why cfg.pad would be an integer, see what happens > when I execute the following (in either Matlab 2012a or 2013a): > >>> class(32) > ans = > double This is double on my system too but since I save the .mat file from Python, I was setting fsample to 128 which was exported by Python as int, which I think can be expected. Setting it to 128.0 fixes the problem but maybe this can be ensured in FieldTrip code pathway by casting the fsample to double. Anyways not a big deal until I found the cause behind this :) -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From daniele.marinazzo at ugent.be Wed Dec 11 13:09:03 2013 From: daniele.marinazzo at ugent.be (Daniele Marinazzo) Date: Wed, 11 Dec 2013 13:09:03 +0100 Subject: [FieldTrip] Course: Practical data analysis and modeling in cognitive and clinical neuroscience, April 14-18, Gent, Beligum Message-ID: Hi all The Multidisciplinary Research Partnership in Neuroscience, part of the Institute for Neuroscience at Ghent University, with the support of the INCF program for Teaching and Training , is organizing an international 5-day training course, focusing on *data analysis in cognitive and clinical neuroscience*. The participants will be able to design and implement pipelines for effective and reproducible experiments. The course will be held at the Faculty of Psychology and Pedagogical Sciences of the university of Ghent, from april 14 to April 18, 2014. There will be two theoretical talks in the morning, describing the state fo the art of specific steps of neuroimaging based reseach, and application-oriented short lectures followed by hands on sessions in the afternoon; some of them parallel for the focus on EEG or fMRI. Target audience The course is open to PhD students and young postdoctoral researchers who use neuroimaging data for their experiments in psychology and clinical neuroscience. Ideally the candidates are in the stage of having already acquired part of their dataset, or they are about to design their own experiment. Applicants are encouraged to present their dataset in the application (format, subjects, conditions,etc), and to bring a sample of it to the School, where they will have the chance to analyze it under the guidance of the lecturers. More info and registration on the school website http://www.da.ugent.be/school2014 -- Daniele Marinazzo -- Department of Data Analysis Faculty of Psychology and Pedagogical Sciences, Gent University Henri Dunantlaan 1, B-9000 Gent, Belgium +32 (0) 9 264 6375 http://users.ugent.be/~dmarinaz/ * * *School: Data analysis in experimental and clinical neuroscience, Gent, April 14-18 2014* *Frontiers Research Topic: Information based methods for neuroimaging data analysis * http://helpdesk.ugent.be/e-maildisclaimer.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Wed Dec 11 18:35:59 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 11 Dec 2013 12:35:59 -0500 Subject: [FieldTrip] frequency analysis Message-ID: I have a few questions regarding frequency analysis using wavelets. 1. Is it possible to z-score the TF spectrograms? Is so how and where should I specify the baseline? 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make sure all sensors from multi subject are matched. However, why is this not performed before grand averaging time-frequency data since the powspctrm is specific to each channel? 3. Is combineplanar a necessary step before any grand averaging i.e. ERF or TFR? I am using neuromag data, so can I perform grand averaging and statistics without combineplanar? 4. Fieldtrip only reads neuromag FIF files that has been processed through maxfilter. There are times when there is a need not to use maxfilter, is there a work around? Thanks very much. Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfegen at gmail.com Wed Dec 11 19:13:40 2013 From: dfegen at gmail.com (Drew Fegen) Date: Wed, 11 Dec 2013 13:13:40 -0500 Subject: [FieldTrip] ft_freqanalysis() on entire continuous data followed by ft_redefinetrial() error - incorrect data format? Message-ID: Hello, Trying to do time-frequency analysis on some intracranial EEG data and I would like to apply the time-frequency analysis to the entire continuous data to avoid any boundary effects and padding issues. However, after I run the time-frequency analysis on the entire continuous data and then try to define trials I get errors due to the input data being in the incorrect format. The data are .edf files that were being imported incorrectly and being parsed into short segments, thus I have been using "cfg.continuous='yes' " in ft_preprocessing() and then using ft_redefinetrial() to subsequently define trials. So I read the data in like this: cfg=[]; cfg.reref='yes'; cfg.dataset = 'data.edf'; cfg.headerfile = 'data.edf'; cfg.dataformat = 'edf'; cfg.headerformat = 'edf'; cfg.continuous = 'yes'; cfg.demean='yes'; data = ft_preprocessing(cfg); and the data looks like: >> data data = hdr: [1x1 struct] label: {101x1 cell} time: {[1x535040 double]} trial: {[101x535040 double]} fsample: 512 sampleinfo: [1 535040] cfg: [1x1 struct] Then my time-frequency analysis looks like this: cfg = []; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 1:2:30; cfg.toi = -0.5:0.05:1.5; cfg.channel = 'all'; TFRwave = ft_freqanalysis(cfg, data); and the output looks like this: >> TFRwave TFRwave = label: {101x1 cell} dimord: 'chan_freq_time' freq: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29] time: [1x41 double] powspctrm: [101x15x41 double] cumtapcnt: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] cfg: [1x1 struct] then I define trials like this (which works fine in other processing streams I have): [TFRwave_byTrial] = ft_redefinetrial(cfg, TFRwave) gives this error: the input is freq data with 101 channels, 15 frequencybins and 41 timebins ??? Error using ==> ft_checkdata>freq2raw at 1669 this only works for dimord='rpt_chan_freq_time' Error in ==> ft_checkdata at 317 data = freq2raw(data); Error in ==> ft_redefinetrial at 104 data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); So it seems like ft_redefinetrial() does not like the data in the format "chan_freq_time" and instead wants the format "rpt_chan_freq_time". I tried changing the output format of the time-frequency analysis by changing the "cfg.output" option to 'powandcsc' and 'fourier', and I also tried converting the time-frequency data using "freqnew=ft_checkdata(data,'cmbrepresentation','full');" and "freqnew=ft_checkdata(data,'cmbrepresentation','sparsewithpow');" but could not get the data in a format that could be used by ft_redefinetrial(). Maybe I missed something in the documentation or mailing list? Does anyone have any thoughts or ideas? Thanks! David -------------- next part -------------- An HTML attachment was scrubbed... URL: From nheugel89 at gmail.com Thu Dec 12 02:42:29 2013 From: nheugel89 at gmail.com (Nicholas Heugel) Date: Wed, 11 Dec 2013 19:42:29 -0600 Subject: [FieldTrip] Error after MNE In-Reply-To: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> References: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> Message-ID: I did as you asked. I put it in the core category with the error as the title On Wed, Dec 11, 2013 at 2:04 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Nicholas, > > It seems that the fif files lacks some information that FieldTrip assumes > to be present. I would say that this can only be caused by the fact that > the version of mne_make_source_space you used does not write the triangle > area information into the fif file. Could you go to bugzilla.fcdonders.nl, > create yourself an account, and file the issue as a bug? Please then also > upload the fif-file you mentioned. I'll have a look at it and make the > ft_read_headshape function more robust. In the mean time you could comment > out line 421. > > Best, > Jan-Mathijs > > > > On Dec 10, 2013, at 6:23 PM, Nicholas Heugel wrote: > > I a trying to go through the tutorial for the > > - Source reconstruction of event-related fields using minimum-norm > estimate > > I am able to run everything up to the MNE with no problem, and it > seems like the MNE portion works. But when I run the command bnd = > ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > and then plot it to visualize the source space. I get the error Reference > to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) > shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; > I have looked on this site and online and can't find an explanation > of what is wrong or how to fix the problem. Any help would be appreciated. > I am using an Anatomical MRI scan for the head model analysis, the skull > is present and I manually am Identifying the fiducials. Also, a few > steps earlier it had me check the white matter segmentation done by > Freesurfer and that worked fine and what I get closely resembles the > tutorial. So I think the problem is somewhere in the MNE I am just not > sure where. Any help would be appreciated. Thank you for your time. > > Nicholas > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luckyluke1979 at yahoo.com.ar Thu Dec 12 09:19:46 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Thu, 12 Dec 2013 00:19:46 -0800 (PST) Subject: [FieldTrip] Time-Frequency Plot Granger Causality Message-ID: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Hi, Following the tutorial on connectivity analysis I am trying to implement Granger Causality on simulated signals. I can reproduce all the results that appear in the tutorial in my dataset but I cannot obtain a graph of Wavelet-based granger causality with the format: -x axis: time -y axis: frequency This  graph should allow me to compare in a single figure how channel 1 granger causes channel 2 at a range of frequencies as a function of time (like in Fig 3 of Dhamala et al, 2008). My problem is that I cannot figure out how to produce this graph with the tutorial functions as they seem to automatically compute Granger Spectra for the whole epoch. In the tutorial demo the structure 'freq' has dimord: 'rpttap_chan_freq', and the structure 'granger' has dimord: 'chan_chan_freq'. What I am looking for is a function that returns a structure with the granger spectra computed with dimord of 'chan_chan_freq_time' 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then '[output] = ft_connectivity_csd2transfer(freq);' with all types of parameters but I could not reach to a solution. Is there a way of building a time-frequency granger spectra within fieldtrip? 2- Alternatively to 1, I thought that I could compute non-parametric Granger Spectra for different time windows inside each epoch and then concatenate the results. Before doing this I would like to be sure that I am not missing a way of doing it that it's already implemented in fieldtrip (I have just started using Fieldtrip a short time ago) Thanks a lot Cheers   Lisandro Kaunitz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Dec 12 09:28:09 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 12 Dec 2013 09:28:09 +0100 Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Message-ID: <47E648A2-F681-409F-9A08-0F44B62939F2@donders.ru.nl> Dear Luckyluke, In principle what you want should be possible, but it is not well tested. Rather I would suggest to go for solution 2, i.e. re-epoch your data and compile a time-frequency map by hand. If you want to try it anyway, the key would be to use cfg.method = 'mtmconvol', rather than 'mtmfft' when computing the spectral representation of your data. Best, Jan-Mathijs On Dec 12, 2013, at 9:19 AM, Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to implement Granger Causality on simulated signals. I can reproduce all the results that appear in the tutorial in my dataset but I cannot obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This graph should allow me to compare in a single figure how channel 1 granger causes channel 2 at a range of frequencies as a function of time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with the tutorial functions as they seem to automatically compute Granger Spectra for the whole epoch. In the tutorial demo the structure 'freq' has dimord: 'rpttap_chan_freq', and the structure 'granger' has dimord: 'chan_chan_freq'. What I am looking for is a function that returns a structure with the granger spectra computed with dimord of 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then '[output] = ft_connectivity_csd2transfer(freq);' with all types of parameters but I could not reach to a solution. Is there a way of building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric Granger Spectra for different time windows inside each epoch and then concatenate the results. Before doing this I would like to be sure that I am not missing a way of doing it that it's already implemented in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > > Lisandro Kaunitz > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Dec 12 09:33:11 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:33:11 +0100 Subject: [FieldTrip] frequency analysis In-Reply-To: References: Message-ID: <52A974C7.3080104@donders.ru.nl> Dear Raghavan, 1) Sure is it possible, z-scoring is nothing else then subtracting the mean and dividing by the standard deviation. The time-period from which you obtain the mean and standard deviation depend on what you want and how you define it. 2) Usually we do not use megrealign at all and assume that subjects are approximately similarly seated in the helmet for computing the grandaverage. MEG sensor-level analysis is not suited very well for making spatial inferences anyway, I would advise to go to source space for such a thing. 3) For neuromag data, you already have planar gradiometers, so you do not need megplanar and combineplanar. We, on the other hand, only have axial gradiometers with our CTF system, thus we need a planar transformation to get a planar representation. 4) I cannot help with this one, sorry. Best, Jörn Raghavan Gopalakrishnan wrote: > I have a few questions regarding frequency analysis using wavelets. > > 1. Is it possible to z-score the TF spectrograms? Is so how and where > should I specify the baseline? > 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make > sure all sensors from multi subject are matched. However, why is this > not performed before grand averaging time-frequency data since the > powspctrm is specific to each channel? > 3. Is combineplanar a necessary step before any grand averaging i.e. > ERF or TFR? I am using neuromag data, so can I perform grand averaging > and statistics without combineplanar? > 4. Fieldtrip only reads neuromag FIF files that has been processed > through maxfilter. There are times when there is a need not to use > maxfilter, is there a work around? > > Thanks very much. > Raghavan > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Thu Dec 12 09:33:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:33:50 +0100 Subject: [FieldTrip] ft_freqanalysis() on entire continuous data followed by ft_redefinetrial() error - incorrect data format? In-Reply-To: References: Message-ID: <52A974EE.8030601@donders.ru.nl> Hi David, try specifying cfg.keeptrials = 'yes' before computing the power spectrum. Best, Jörn Drew Fegen wrote: > Hello, > > Trying to do time-frequency analysis on some intracranial EEG data and > I would like to apply the time-frequency analysis to the entire > continuous data to avoid any boundary effects and padding issues. > However, after I run the time-frequency analysis on the entire > continuous data and then try to define trials I get errors due to the > input data being in the incorrect format. > > The data are .edf files that were being imported incorrectly and being > parsed into short segments, thus I have been using > "cfg.continuous='yes' " in ft_preprocessing() and then using > ft_redefinetrial() to subsequently define trials. > > So I read the data in like this: > > cfg=[]; > cfg.reref='yes'; > cfg.dataset = 'data.edf'; > cfg.headerfile = 'data.edf'; > cfg.dataformat = 'edf'; > cfg.headerformat = 'edf'; > cfg.continuous = 'yes'; > cfg.demean='yes'; > data = ft_preprocessing(cfg); > > > and the data looks like: > > >> data > > data = > > hdr: [1x1 struct] > label: {101x1 cell} > time: {[1x535040 double]} > trial: {[101x535040 double]} > fsample: 512 > sampleinfo: [1 535040] > cfg: [1x1 struct] > > > Then my time-frequency analysis looks like this: > > cfg = []; > cfg.method = 'wavelet'; > cfg.width = 7; > cfg.output = 'pow'; > cfg.foi = 1:2:30; > cfg.toi = -0.5:0.05:1.5; > cfg.channel = 'all'; > TFRwave = ft_freqanalysis(cfg, data); > > > and the output looks like this: > > >> TFRwave > > TFRwave = > > label: {101x1 cell} > dimord: 'chan_freq_time' > freq: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29] > time: [1x41 double] > powspctrm: [101x15x41 double] > cumtapcnt: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] > cfg: [1x1 struct] > > > then I define trials like this (which works fine in other processing > streams I have): > > [TFRwave_byTrial] = ft_redefinetrial(cfg, TFRwave) > > > gives this error: > > the input is freq data with 101 channels, 15 frequencybins and 41 timebins > ??? Error using ==> ft_checkdata>freq2raw at 1669 > this only works for dimord='rpt_chan_freq_time' > > Error in ==> ft_checkdata at 317 > data = freq2raw(data); > > Error in ==> ft_redefinetrial at 104 > data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); > > > So it seems like ft_redefinetrial() does not like the data in the > format "chan_freq_time" and instead wants the format > "rpt_chan_freq_time". I tried changing the output format of the > time-frequency analysis by changing the "cfg.output" option to > 'powandcsc' and 'fourier', and I also tried converting the > time-frequency data using > "freqnew=ft_checkdata(data,'cmbrepresentation','full');" and > "freqnew=ft_checkdata(data,'cmbrepresentation','sparsewithpow');" but > could not get the data in a format that could be used by > ft_redefinetrial(). > > Maybe I missed something in the documentation or mailing list? Does > anyone have any thoughts or ideas? > > Thanks! > David > > > > > > > > > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Thu Dec 12 09:39:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:39:50 +0100 Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Message-ID: <52A97656.9020506@donders.ru.nl> Hi Lisandro, actually, for me it works by just computing a time-frequency representation and shoving that into ft_connectivityanalysis. Is there an error if you try that? I literally do cfg = []; cfg.channelcmb = ...; cfg.method = 'granger'; granger = ft_connectivityanalysis(cfg, freq); With freq obtained by cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foi = 1:32; cfg.t_ftimwin = 0.5.*ones(size(4./cfg.foi'), 1); cfg.toi = -1:0.05:1; freq = ft_freqanalysis(cfg, data); Otherwise, solution 2 is something that definitely works and what I also did first, and it worked fine. There should be nothing wrong imho, as JM also pointed out. Best, Jörn Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to > implement Granger Causality on simulated signals. I can reproduce all > the results that appear in the tutorial in my dataset but I cannot > obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This graph should allow me to compare in a single figure how channel > 1 granger causes channel 2 at a range of frequencies as a function of > time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with > the tutorial functions as they seem to automatically compute Granger > Spectra for the whole epoch. In the tutorial demo the structure 'freq' > has dimord: 'rpttap_chan_freq', and the structure 'granger' has > dimord: 'chan_chan_freq'. What I am looking for is a function that > returns a structure with the granger spectra computed with dimord of > 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then > '[output] = ft_connectivity_csd2transfer(freq);' with all types of > parameters but I could not reach to a solution. Is there a way of > building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric > Granger Spectra for different time windows inside each epoch and then > concatenate the results. Before doing this I would like to be sure > that I am not missing a way of doing it that it's already implemented > in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > Lisandro Kaunitz > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Thu Dec 12 09:45:19 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 12 Dec 2013 09:45:19 +0100 Subject: [FieldTrip] Low-pass filter before resampling? Message-ID: Hi all, A quick question: in your experience, is it necessary (or advisable) to explicitly apply a low-pass filter (using e.g. ft_preprocessing) before calling ft_resampledata? I previously assumed ft_resampledata (or the low-level implementation, pchip) was taking care of this, but looking in the code I cannot find evidence for or against my assumption. Thanks, Eelke From eelke.spaak at donders.ru.nl Thu Dec 12 09:48:15 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 12 Dec 2013 09:48:15 +0100 Subject: [FieldTrip] Low-pass filter before resampling? In-Reply-To: References: Message-ID: Oops, I was looking in the wrong part of the code for ft_resampledata (usetime = 1, while I should have been looking at usefsample = 1). There, it is clear that Matlab's resample() is being used, which tells me in the documentation "resample applies an anti-aliasing (lowpass) FIR filter to x during the resampling process. It designs the filter using firls with a Kaiser window." So, it is definitely not needed. Sorry for filling up your inboxes :) Eelke On 12 December 2013 09:45, Eelke Spaak wrote: > Hi all, > > A quick question: in your experience, is it necessary (or advisable) > to explicitly apply a low-pass filter (using e.g. ft_preprocessing) > before calling ft_resampledata? I previously assumed ft_resampledata > (or the low-level implementation, pchip) was taking care of this, but > looking in the code I cannot find evidence for or against my > assumption. > > Thanks, > Eelke From thomas.wunderle at esi-frankfurt.de Thu Dec 12 10:46:49 2013 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Thu, 12 Dec 2013 09:46:49 +0000 Subject: [FieldTrip] Low-pass filter before resampling? In-Reply-To: References: Message-ID: <27E5CAD9145EEC41BB9B34C01716A1983049F31C@UM-EXCDAG-A01.um.gwdg.de> Hi all, I was also thinking about resampling data recently. The reason is that I saw (as Eelke mentioned) that the Matlab "resample" function applies a Kaiser window function to lowpass filter the data before (down/resampling). Now, I was not sure if this can create a problem for directed connectivity analysis (like Granger connectivity), because you apply a non-causal kernel which "contaminates" a given moment in time with the future. I'm not an expert enough to see through if this is a problem for methods like Granger which rely on predicting a signal given the data in the past. If so, one should be careful in using non-causal filters e.g. for resampling. At the moment I'm using the Matlab function "resample" with the option "0" ( like: y = resample(data,D,N,0) ), which does then nearest neighbor interpolation. What's your opinions about that topic? Best, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel:   +49 69 96769 519 Fax:   +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries -----Ursprüngliche Nachricht----- Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Eelke Spaak Gesendet: Donnerstag, 12. Dezember 2013 09:48 An: Email discussion list for the FieldTrip project Betreff: Re: [FieldTrip] Low-pass filter before resampling? Oops, I was looking in the wrong part of the code for ft_resampledata (usetime = 1, while I should have been looking at usefsample = 1). There, it is clear that Matlab's resample() is being used, which tells me in the documentation "resample applies an anti-aliasing (lowpass) FIR filter to x during the resampling process. It designs the filter using firls with a Kaiser window." So, it is definitely not needed. Sorry for filling up your inboxes :) Eelke On 12 December 2013 09:45, Eelke Spaak wrote: > Hi all, > > A quick question: in your experience, is it necessary (or advisable) > to explicitly apply a low-pass filter (using e.g. ft_preprocessing) > before calling ft_resampledata? I previously assumed ft_resampledata > (or the low-level implementation, pchip) was taking care of this, but > looking in the code I cannot find evidence for or against my > assumption. > > Thanks, > Eelke _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From luckyluke1979 at yahoo.com.ar Thu Dec 12 12:27:55 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Thu, 12 Dec 2013 03:27:55 -0800 (PST) Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <52A97656.9020506@donders.ru.nl> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> <52A97656.9020506@donders.ru.nl> Message-ID: <1386847675.60465.YahooMailNeo@web140306.mail.bf1.yahoo.com> Thanks a lot for the fast responses. I'll try both methods and test whether there are differences in the results Cheers   Lisandro Kaunitz El día jueves, 12 de diciembre de 2013 19:39, Jörn M. Horschig escribió: Hi Lisandro, actually, for me it works by just computing a time-frequency representation and shoving that into ft_connectivityanalysis. Is there an error if you try that? I literally do     cfg = [];     cfg.channelcmb = ...;     cfg.method    = 'granger';     granger    = ft_connectivityanalysis(cfg, freq); With freq obtained by       cfg          = [];       cfg.method    = 'mtmconvol';       cfg.output    = 'fourier';       cfg.taper    = 'hanning';       cfg.foi      = 1:32;       cfg.t_ftimwin = 0.5.*ones(size(4./cfg.foi'), 1);       cfg.toi      = -1:0.05:1;       freq          = ft_freqanalysis(cfg, data); Otherwise, solution 2 is something that definitely works and what I also did first, and it worked fine. There should be nothing wrong imho, as JM also pointed out. Best, Jörn Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to > implement Granger Causality on simulated signals. I can reproduce all > the results that appear in the tutorial in my dataset but I cannot > obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This  graph should allow me to compare in a single figure how channel > 1 granger causes channel 2 at a range of frequencies as a function of > time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with > the tutorial functions as they seem to automatically compute Granger > Spectra for the whole epoch. In the tutorial demo the structure 'freq' > has dimord: 'rpttap_chan_freq', and the structure 'granger' has > dimord: 'chan_chan_freq'. What I am looking for is a function that > returns a structure with the granger spectra computed with dimord of > 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then > '[output] = ft_connectivity_csd2transfer(freq);' with all types of > parameters but I could not reach to a solution. Is there a way of > building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric > Granger Spectra for different time windows inside each epoch and then > concatenate the results. Before doing this I would like to be sure > that I am not missing a way of doing it that it's already implemented > in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > Lisandro Kaunitz > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel:    +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Thu Dec 12 13:22:26 2013 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Thu, 12 Dec 2013 12:22:26 +0000 Subject: [FieldTrip] Offline use of Fieldtrip for TMSi file formats (.poly5, .s00) Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094E7A08@PEXMB001B.vu.local> Hi all, I used the TMSi software to acquire EEG and EMG data and so my files have the poly5 format. I'm trying to read my poly5 files into matlab using fieldtrip so it immediately get's the format desired for further analyses using fieldtrip, but it doesn't work and online I only find information on how to use fieldtrip together with TMSi realtime and not in offline data analyses. Does anybody know how to do this or where I can find how to do this? Thanks in advance, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From emanuelvandenbroeke at hotmail.com Thu Dec 12 13:34:04 2013 From: emanuelvandenbroeke at hotmail.com (emanuel vandenbroeke) Date: Thu, 12 Dec 2013 13:34:04 +0100 Subject: [FieldTrip] Normality Message-ID: Hi, Maybe someone can help me with a question.I collected data of 16 subjects in a repeated measures design with 2 within subject factors (time (3 levels) and arm (2 levels)). I measured several dependent variables.Before applying a RM ANOVA to my data i first inspected each dependent variable (with its levels) regarding the assumption of normality. Some variables look positively skewed and some look negatively skewed. These deviations of normality can be corrected with a reflection first and then log transformation in the case of a negative skew distribution and the positive skew distributions can be corrected by a log transform alone. Some people say that the RM ANOVA is robust for mild violations of normality but I can not find any papers confirming this.Now my question, should I apply these transformations to my data or not? And secondly, if I apply a transformation to one variable (for example the negatively skewed variables) should I also use this transform for the other variables or can I differentiate and decide the appropriate transform for each dependent variable? Many thanks, Best,Emanuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From santiago.torres at mail.mcgill.ca Fri Dec 13 18:06:54 2013 From: santiago.torres at mail.mcgill.ca (Santiago Torres, Mr) Date: Fri, 13 Dec 2013 17:06:54 +0000 Subject: [FieldTrip] ft_spikedensity Message-ID: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> Hello All, I am trying to run the spike analysis script ft_spikedensity and have the following problem: When defining the begSample variable in line 234 of the code: begSample = nearest(timeAxis, cfg.latency(1)) Error using nearest Too many input arguments. the code is set such that it inputs two variables to the function nearest, which only allows for one variable as input. This should always give an error independent of the variables that are given to nearest. I tried to do a temporary fix by eliminating the second input which seems unnecessary (given that further code uses the values in the timeAxis matrix only) or by making a matrix using cfg.latency(1) as the final value of nearest(timeAxis). Neither of this options work as they give a bigger sampleSel than timeAxis (sampleSel(sampleSel>length(timeAxis)) = []). However, I do not want to mess with something that may have other implications further down, and I assume the second variable (cf.latency(1)) is there for a reason. Can someone help explain how to go around this problem or why it may not be working? timeAxis is a 1*n double matrix with increasing positive time values starting at 0. cfg.latency(1) is 0. I am using a 32-bit matlab version R2012a. Thanks, Santiago Torres -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Fri Dec 13 19:06:41 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Fri, 13 Dec 2013 19:06:41 +0100 Subject: [FieldTrip] Leadfield and source contain NaN Message-ID: Dear All, I calculated leadfield with 64 electrodes but majority of part of leadfield.leadfield consist of NaN and some with values and I ensured the electrode is projected on the head (but some not touching the head directly but at the right position). Please help me with what I am missing please. Whenever I used the leadfield to calculate source, it also contain NaN. Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From luckyluke1979 at yahoo.com.ar Mon Dec 16 08:21:17 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Sun, 15 Dec 2013 23:21:17 -0800 (PST) Subject: [FieldTrip] Estimating Single-trial Granger Causality Message-ID: <1387178477.14427.YahooMailNeo@web140303.mail.bf1.yahoo.com> Hi, I am trying to compute grangerspectra for simulated single trials. Whenver I run granger causality on a single trial with 2 or more channels I got the following warning: Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In connectivity/private/sfactorization_wilson at 81   In ft_connectivity_csd2transfer at 180   In ft_connectivityanalysis at 400   In example_maillingList at 51 This warning disappears if I use the same number of trials and channels / signals in my dataset (i.e, 2 trials with 2 channels, 3 trials for  3 channels, etc). Is it possible to obtain granger spectra for single trials with Fieldtrip? I would like to average the spectra across single trials to run statistics and compare across conditions later on. This is the code I am using in my simulation, if the value of cfg.ntrials is changed to 2 (both times is is declared), then the warning disappears: nTrials = 5; for tr = 1 : nTrials             %% Simulate data         cfg             = [];     cfg.ntrials     = 1;     cfg.triallength = 2; % in secs     cfg.nsignal     = 2;     cfg.fsample     = 200;     cfg.method      = 'ar';     cfg.bpfilter    = 'no'; % (or 'no')     cfg.bpfreq      = [0 300]; % (default: [15 25])         cfg.params(:,:,1) = [ 0.8  0 ;                           0.9  0.9];         cfg.params(:,:,2) = [-0.5    0;                           0.9   -0.8];         cfg.noisecov      = [ 0.3  0; 0 0.2];         data            = ft_connectivitysimulation(cfg);            %% Non-parametric computation of the cross-spectral density matrix         cfg                 = [];     cfg.ntrials         = 1;     cfg.triallength     = 2; % in secs     cfg.nsignal         = 2;     cfg.method          = 'mtmconvol';     cfg.output          = 'fourier';     cfg.taper           = 'hanning';     cfg.foi             = 2:2:100;     cfg.t_ftimwin       = 0.05 .* ones(size(4./cfg.foi', 1), 1);     cfg.toi             = 0:0.05:2;         freq                = ft_freqanalysis(cfg, data);             %% GRANGER CAUSALITY         cfg           = [];     cfg.method    = 'granger';     granger       = ft_connectivityanalysis(cfg, freq);         sp_chan1_chan2(:,:,tr) = squeeze(granger.grangerspctrm(1,2, :, :)); %#ok     sp_chan2_chan1(:,:,tr) = squeeze(granger.grangerspctrm(2,1, :, :)); %#ok     end Thanks a lot Cheers   Lisandro Kaunitz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Dec 16 09:22:16 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 09:22:16 +0100 Subject: [FieldTrip] Leadfield and source contain NaN In-Reply-To: References: Message-ID: <52AEB838.10702@donders.ru.nl> Dear Azeez, some gridpoints might fall outside the head, thus no source activity is computed and the respective value is set to nan. In your grid or leadfield-structure you got the fields .inside and .outside. You can use these as indices to find the respective values of sourceactivity only inside (or outside) the brain. You can use the indices in analog to this example: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#computing_the_sourcemodel (see the call to ft_plot_mesh) Best, Jörn On 12/13/2013 7:06 PM, Azeez Adebimpe wrote: > Dear All, > > I calculated leadfield with 64 electrodes but majority of part of > leadfield.leadfield consist of NaN and some with values and I ensured > the electrode is projected on the head (but some not touching the head > directly but at the right position). Please help me with what I am > missing please. Whenever I used the leadfield to calculate source, it > also contain NaN. > > > > Azeez Adebimpe > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 16 09:25:35 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 09:25:35 +0100 Subject: [FieldTrip] ft_spikedensity In-Reply-To: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> References: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> Message-ID: <52AEB8FF.4050404@donders.ru.nl> Dear Santiago, maybe you forgot to call ft_defaults prior to doing anything with Fieldtrip? Fieldtrip has an own nearest function, which needs *at least* two input arguments. Calling ft_defaults should add the necessary paths so that Matlab knows which nearest function to use. You can also easily verify this by calling which nearest in the command window. If this refers to a Fieldtrip function, you are fine. However, from what you describe, the path is not set correctly and this will refer to some function outside Fieldtrip. Best, Jörn On 12/13/2013 6:06 PM, Santiago Torres, Mr wrote: > Hello All, > I am trying to run the spike analysis script ft_spikedensity and have > the following problem: > When defining the begSample variable in line 234 of the code: > > begSample = nearest(timeAxis, cfg.latency(1)) > Error using nearest > Too many input arguments. > > the code is set such that it inputs two variables to the function > nearest, which only allows for one variable as input. This should > always give an error independent of the variables that are given to > nearest. I tried to do a temporary fix by eliminating the second input > which seems unnecessary (given that further code uses the values in > the timeAxis matrix only) or by making a matrix using cfg.latency(1) > as the final value of nearest(timeAxis). Neither of this options work > as they give a bigger sampleSel than timeAxis > (sampleSel(sampleSel>length(timeAxis)) = []). However, I do not want > to mess with something that may have other implications further down, > and I assume the second variable (cf.latency(1)) is there for a > reason. Can someone help explain how to go around this problem or why > it may not be working? > > timeAxis is a 1*n double matrix with increasing positive time values > starting at 0. cfg.latency(1) is 0. I am using a 32-bit matlab version > R2012a. > > Thanks, > Santiago Torres > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jean-baptiste.versini at etu.univ-lyon1.fr Mon Dec 16 12:29:22 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Mon, 16 Dec 2013 11:29:22 +0000 Subject: [FieldTrip] Single trial baseline correction Message-ID: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> Dear fieldtrip users, I wanted to know if there is a way in fieldtrip to average trials after doing the baseline correction, as it is suggested in this article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ Regards, Versini JB -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Dec 16 14:17:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 14:17:50 +0100 Subject: [FieldTrip] Single trial baseline correction In-Reply-To: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> References: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> Message-ID: <52AEFD7E.3050606@donders.ru.nl> Dear Jean-Baptiste, of course there is, but it depends on the representation of your data. There is ft_timelockbaseline and ft_freqbaseline, both do a baseline per trial if the representation allows so. For ft_timelockbaseline, you can explicitly specify cfg.parameter = 'trials', and for ft_freqbaseline baselining per trial is the default if there are multiple observations in your data. Best, Jörn On 12/16/2013 12:29 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Dear fieldtrip users, > > I wanted to know if there is a way in fieldtrip to average trials > *after *doing the baseline correction, as it is suggested in this > article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ > > Regards, > Versini JB > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From gopalar.ccf at gmail.com Mon Dec 16 18:35:28 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 16 Dec 2013 12:35:28 -0500 Subject: [FieldTrip] dbs artifact Message-ID: Is there some experience around in fieldtrip community on ways to deal with dbs artifact in MEG data? Are there plans of including such artifact rejection routines in FT? Thanks very much. Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Mon Dec 16 19:38:29 2013 From: alik.widge at gmail.com (Alik Widge) Date: Mon, 16 Dec 2013 13:38:29 -0500 Subject: [FieldTrip] dbs artifact In-Reply-To: References: Message-ID: I can't tell you about MEG, but here's a method for EEG: http://dx.doi.org/10.1016/j.clinph.2010.02.156 We are playing around right now with questions of source localization and whether it might be possible to clearly localize the DBS to its subcortical source. Ask me in three months. If you have any capacity to request things of your subjects' neurologists, there are some papers in the literature suggesting that artifact is weaker in a bipolar configuration compared to monopolar. Again, EEG only. Here at Martinos the only recommendation I've heard about DBS+MEG is "doesn't work well". I don't know of anyone who's really studied the problem. Alik Widge alik.widge at gmail.com (206) 866-5435 On Mon, Dec 16, 2013 at 12:35 PM, Raghavan Gopalakrishnan < gopalar.ccf at gmail.com> wrote: > Is there some experience around in fieldtrip community on ways to deal > with dbs artifact in MEG data? Are there plans of including such artifact > rejection routines in FT? > > Thanks very much. > Raghavan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Mon Dec 16 19:58:57 2013 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Mon, 16 Dec 2013 19:58:57 +0100 Subject: [FieldTrip] dbs artifact In-Reply-To: References: Message-ID: In MEG, there are two methods which deal with suppression of DBS artifacts. The tSSS method is used for Elekta Neuromag MEG system for removing DBS artifacts. I came to know that the authors also made a software called MaxFilter for the same manufacturer. http://www.sciencedirect.com/science/article/pii/S0531513107001422 The other method is called Spectral Signal Space separation where authors claim to have better performance than tSSS. http://www.sciencedirect.com/science/article/pii/S105381191100139X I have tried 4 methods in removing the artifacts in EEG including the one Alik mentions and this performed poorly. Feel free to contact me if you need anything more. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Mon, Dec 16, 2013 at 7:38 PM, Alik Widge wrote: > I can't tell you about MEG, but here's a method for EEG: > http://dx.doi.org/10.1016/j.clinph.2010.02.156 > > We are playing around right now with questions of source localization and > whether it might be possible to clearly localize the DBS to its subcortical > source. Ask me in three months. > > If you have any capacity to request things of your subjects' neurologists, > there are some papers in the literature suggesting that artifact is weaker > in a bipolar configuration compared to monopolar. Again, EEG only. Here at > Martinos the only recommendation I've heard about DBS+MEG is "doesn't work > well". I don't know of anyone who's really studied the problem. > > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Mon, Dec 16, 2013 at 12:35 PM, Raghavan Gopalakrishnan < > gopalar.ccf at gmail.com> wrote: > >> Is there some experience around in fieldtrip community on ways to deal >> with dbs artifact in MEG data? Are there plans of including such artifact >> rejection routines in FT? >> >> Thanks very much. >> Raghavan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From merhart at ucsd.edu Tue Dec 17 01:41:02 2013 From: merhart at ucsd.edu (Matt Erhart) Date: Mon, 16 Dec 2013 16:41:02 -0800 Subject: [FieldTrip] Epoching continuous time frequency data Message-ID: I would like to run freqanalysis on my continuous data and then redefine trials with a cfg.trl, but ft_redefinetrial is turning my continuous time frequency data into something other than timefreq data. Is ft_redefinetrial even designed to epoch continuous freqdata? Is there a working code snippet around that shows exactly how to efficiently run freqanalysis on continuous data and then epoch it? % this cfg seems to produce reasonable results per some imagesc plotting: cfg.method = 'hilbert' cfg.foi = [2:4:56]; cfg.toi = data_ds.time; %every time point works cfg.filttype = 'fir'; % fir seems better than firls, butter has unit circle error cfg.keeptrials = 'yes'; cfg.output = 'pow'; TFRwave = ft_freqanalysis(cfg, data_ds); % continuous data to tf [cfg.trl, cfg.event] = txt2trl(cfg); %cfg.trl epochs non-freq data just fine TFRwave_trials = ft_redefinetrial(cfg,TFRwave); % warns that no trial def. provided but doesn't error ft_singleplotTFR(cfg, TFRwave_trials); % says TFRwave_trials is not freqdata -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean-baptiste.versini at etu.univ-lyon1.fr Tue Dec 17 09:40:04 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Tue, 17 Dec 2013 08:40:04 +0000 Subject: [FieldTrip] RE : Single trial baseline correction In-Reply-To: <52AEFD7E.3050606@donders.ru.nl> References: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr>, <52AEFD7E.3050606@donders.ru.nl> Message-ID: <5271B6068CD8D94DB822542282379288017A895A@mbx2010-02.univ-lyon1.fr> Hello, Thanks, that's exactly what I was looking for. Best, Jean-Baptiste ________________________________________ De : fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] de la part de "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Date d'envoi : lundi 16 décembre 2013 14:17 À : FieldTrip discussion list Objet : Re: [FieldTrip] Single trial baseline correction Dear Jean-Baptiste, of course there is, but it depends on the representation of your data. There is ft_timelockbaseline and ft_freqbaseline, both do a baseline per trial if the representation allows so. For ft_timelockbaseline, you can explicitly specify cfg.parameter = 'trials', and for ft_freqbaseline baselining per trial is the default if there are multiple observations in your data. Best, Jörn On 12/16/2013 12:29 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Dear fieldtrip users, > > I wanted to know if there is a way in fieldtrip to average trials > *after *doing the baseline correction, as it is suggested in this > article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ > > Regards, > Versini JB > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From i.e.j.de.vries at student.vu.nl Wed Dec 18 07:35:55 2013 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 18 Dec 2013 06:35:55 +0000 Subject: [FieldTrip] EEG cap layout Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094E8B74@PEXMB001B.vu.local> Hi all, I used the TMSi EEG cap with 64 electrodes, but this exact layout doesn't seem to be present in the fieldtrip layout database. The layout named: "quickcap64.mat" comes closest to the caps I used, but isn't the exact same one. Did anybody make their own specific layout for fieldtrip? cheers Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 09:48:40 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 08:48:40 +0000 Subject: [FieldTrip] ft_topoplotCC question Message-ID: Hi all, *Explanation* So I have a matrix with the dimensions: SUBJECT X CONNECTIVITY X CHANa X CHANb X FREQ size: 63 X 12 X 128 X 128 X 6 meaning: - Subject 1:30 patients, 31:63 controls - Connectivity different kinds of connectivity measures (dtf, coherence, ...) - CHANa, CHANb: channels from biosemi128 layout - Freq: connectivity measures at different frequencies (2Hz, 5.5Hz, 10.5Hz, ...) *Current way of doing it* I want to plot the grand average (patient-control comparison) into one figure. What I am doing now is: 1) Looking for significant values: ttest2 for all patient and all controls nested in 4 for-loops. Sweeping trough connectivity, frequency, first channel and second channel. Where 1st and 2d channel can't be equal) 2) Taking the grand average of patient and controls, multiplying with H0 reject/accept binary matrix resulting in zero connectivity strengths for non significant values and saving the connectivity matrix in 2 structures CONN_PAT and CONN_CON 3) Manually updating the rest of the CONN_PAT and CONN_CON fields (such as frequencies of interest) and eventually using it as an input for ft_topoplotCC. (one figure for every connectivity measure) *Questions:* 1) It appears that ft_topoplotCC doesn't really look at the data field (eg cohspctrm) of CONN_PAT or CONN_CON, not declaring width of lines or opacity results in plotting all the connection lines, Am I doing something wrong? 2) If using the data field (eg plvspctrm) for controlling the opacity, shouldn't I first normalize the data? Eg: (data-average)/std(data) or /max(data) ? 3) How can I plot all the frequencies in different colors? I tried to use the hold on; hold off; command in a for loop for all frequencies but it does plot new figures. 4) Is there a way for plotting patients and controls in 1 figure? CONN_PAT - CONN_CON isn't a good way a one can get negative values. Any ideas for plotting all this information in a matrix are more then welcome! Bests, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Wed Dec 18 10:34:18 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Wed, 18 Dec 2013 10:34:18 +0100 Subject: [FieldTrip] EEG cap layout In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094E8B74@PEXMB001B.vu.local>, Message-ID: Hi Ingmar, Try this tutorial; http://fieldtrip.fcdonders.nl/tutorial/layoutthat is what I used to create mine. Azeez Adebimpe From: i.e.j.de.vries at student.vu.nl To: fieldtrip at science.ru.nl Date: Wed, 18 Dec 2013 06:35:55 +0000 Subject: [FieldTrip] EEG cap layout Hi all, I used the TMSi EEG cap with 64 electrodes, but this exact layout doesn't seem to be present in the fieldtrip layout database. The layout named: "quickcap64.mat" comes closest to the caps I used, but isn't the exact same one. Did anybody make their own specific layout for fieldtrip? cheers Ingmar _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Wed Dec 18 14:39:16 2013 From: narayan.ps at tut.fi (Narayan Puthanmadam Subramaniyam) Date: Wed, 18 Dec 2013 15:39:16 +0200 Subject: [FieldTrip] question on TF analysis Message-ID: <000301cefbf6$8ba424c0$a2ec6e40$@tut.fi> Dear FT experts I have ERP data ranging from -200 ms to 1198 ms at sampling frequency of 500 Hz (Totally 700 samples). I would like to use wavelets to analyze TF between 1 to 30 Hz. I have never used wavelets so I did some reading on them and figured out that for analyzing high frequency wavelet cycles of 5 or more is good. However, my analysis is confined to relatively low frequency bands (1-4, 4-8, 8-13 and 13-30). How should I make the choice for number of cycles so that I can have clear picture of what is happening at these bands ? Plus my epoch has only 700 time points, so I assume having few cycles will increase the window length at low frequency and thus I loose time info ? Best regards Narayan -------------- next part -------------- An HTML attachment was scrubbed... URL: From joscha.schmiedt at esi-frankfurt.de Wed Dec 18 16:06:58 2013 From: joscha.schmiedt at esi-frankfurt.de (Schmiedt, Joscha) Date: Wed, 18 Dec 2013 15:06:58 +0000 Subject: [FieldTrip] Wavelet bandwidth on tutorial website Message-ID: <26F2DFC0-6ABF-4029-A569-4F2FD7643DEC@esi-frankfurt.de> Hi, The fieldtrip tutorial website on TFRs with wavelets (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis#morlet_wavelets) states that "at a given frequency F is equal to F/width*2 (so, at 30 Hz and a width of 7, the spectral bandwidth is 30/7*2 = 8.6 Hz) while the wavelet duration is equal to width/F/pi (in this case, 7/30/pi = 0.074s = 74ms)”. According to the help of ft_freqanalysis and the code of ft_specest_wavelet the spectral bandwidth (standard deviation in frequency domain) is F/width. Is the website outdated? Best, Joscha From michielb at tcd.ie Wed Dec 18 16:15:41 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:15:41 +0000 Subject: [FieldTrip] charpath, distance matrix Message-ID: Hi all, I want to calculate the characteristic path length with ft_networkanalysis but it needs a distance matrix. What is the quickest way to calculate this? Or should I calculate it myself as a distance of 1 to go to a neighbouring electrode and do this for all my biosemi128 electrodes? Thanks, Bests, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Dec 18 16:31:45 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 18 Dec 2013 16:31:45 +0100 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: References: Message-ID: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> Bart, You probably could use ft_networkanalysis in two steps. First with cfg.method='distance', then with cfg.method = 'charpath'. Best, JM On Dec 18, 2013, at 4:15 PM, Bart Michiels wrote: > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 16:51:29 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:51:29 +0000 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: References: Message-ID: edit: Nevermind, have to use the ft_networkanalysis with cfg.parameter = distance first. On 18 December 2013 15:15, Bart Michiels wrote: > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis > but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring > electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 16:52:18 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:52:18 +0000 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> References: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> Message-ID: Thanks Jan-Mathijs, didn't see your e-mail :) On 18 December 2013 15:31, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Bart, > You probably could use ft_networkanalysis in two steps. First with > cfg.method='distance', then with cfg.method = 'charpath'. > Best, > JM > > On Dec 18, 2013, at 4:15 PM, Bart Michiels wrote: > > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis > but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring > electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Dec 19 15:38:34 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 19 Dec 2013 15:38:34 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem Message-ID: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> Dear all, I have a problem of which I can't really find the source. When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. Does anyone have an idea at which point this problem might occur? Thanks a lot. Julian P.S.: Below are the basic steps I use: %% 2.1. Build individual BEM-Model % First Realign Volume. Set Nas LPA, RPA, and positive z-values cfg=[]; cfg.method='interactive'; cfg.coordsys = 'ctf'; mri_r = ft_volumerealign(cfg,mri); cfg=[]; mri_rs = ft_volumereslice(cfg,mri_r); %% Segment the individual volume cfg=[]; cfg.output={'brain' 'scalp' 'skull'}; cfg.brainsmooth = 5; cfg.scalpsmooth = 5; cfg.brainthreshold = .5; cfg.scalpthreshold = .1; mri_s = ft_volumesegment(cfg,mri_rs); %% Create Headmodel cfg=[]; cfg.interactive = 'no'; cfg.numvertices = 1000; bnd_s = ft_prepare_mesh(cfg,mri_s); cfg=[]; cfg.method='dipoli'; % cfg.conductivity=[0.3300 0.0041 0.3300]; vol_s = ft_prepare_headmodel(cfg,bnd_s); cfg = []; cfg.mri = mri_s; grid = ft_prepare_sourcemodel(cfg); grid.inside = find(grid.brain==1)'; grid.outside = find(grid.brain==0)'; grid.pos = grid.pos*10; % Set right dimensions %% Align Electrodes cfg=[]; cfg.method='interactive'; cfg.elec=elec_128; cfg.headshape=vol_s.bnd(1); elec_new=ft_electroderealign(cfg); %% 4. Make the Leadfield. elec_new.type='eeg'; cfg=[]; cfg.channel = 1:126; cfg.elec=elec_new; cfg.vol=vol_s; cfg.grid=grid; lf = ft_prepare_leadfield(cfg); %% BEAMFORMER cfg=[]; cfg.channel=1:126; cfg.method='lcmv'; %Time-Domain-Beamformer cfg.grid=lf; cfg.vol=vol_s; cfg.elec=elec_new; cfg.reducerank = 3; cfg.keepfilter='yes'; beamfilter = ft_sourceanalysis(cfg, dat4beam); %% Keep the cfg, just add the filter. cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above lcmv_bl = ft_sourceanalysis(cfg, bl_dat); lcmv_act = ft_sourceanalysis(cfg, act_dat); ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EEG_Vol_Alignment.pdf Type: application/pdf Size: 539791 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1_standard_brain.png Type: image/png Size: 187540 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Thu Dec 19 16:35:47 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 19 Dec 2013 16:35:47 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> Message-ID: <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? best, Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 19/12/2013, a las 15:38, Julian Keil escribió: > Dear all, > > I have a problem of which I can't really find the source. > > When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). > > However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. > > The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. > > I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. > > Does anyone have an idea at which point this problem might occur? > > Thanks a lot. > > Julian > > > > P.S.: Below are the basic steps I use: > > %% 2.1. Build individual BEM-Model > % First Realign Volume. Set Nas LPA, RPA, and positive z-values > > cfg=[]; > cfg.method='interactive'; > cfg.coordsys = 'ctf'; > > mri_r = ft_volumerealign(cfg,mri); > > cfg=[]; > > mri_rs = ft_volumereslice(cfg,mri_r); > > %% Segment the individual volume > cfg=[]; > cfg.output={'brain' 'scalp' 'skull'}; > cfg.brainsmooth = 5; > cfg.scalpsmooth = 5; > cfg.brainthreshold = .5; > cfg.scalpthreshold = .1; > mri_s = ft_volumesegment(cfg,mri_rs); > > %% Create Headmodel > cfg=[]; > cfg.interactive = 'no'; > cfg.numvertices = 1000; > > bnd_s = ft_prepare_mesh(cfg,mri_s); > > cfg=[]; > cfg.method='dipoli'; % > cfg.conductivity=[0.3300 0.0041 0.3300]; > > vol_s = ft_prepare_headmodel(cfg,bnd_s); > > cfg = []; > cfg.mri = mri_s; > grid = ft_prepare_sourcemodel(cfg); > > grid.inside = find(grid.brain==1)'; > grid.outside = find(grid.brain==0)'; > grid.pos = grid.pos*10; % Set right dimensions > > %% Align Electrodes > cfg=[]; > cfg.method='interactive'; > cfg.elec=elec_128; > cfg.headshape=vol_s.bnd(1); > > elec_new=ft_electroderealign(cfg); > > %% 4. Make the Leadfield. > elec_new.type='eeg'; > > cfg=[]; > cfg.channel = 1:126; > cfg.elec=elec_new; > cfg.vol=vol_s; > cfg.grid=grid; > > lf = ft_prepare_leadfield(cfg); > > %% BEAMFORMER > > cfg=[]; > cfg.channel=1:126; > cfg.method='lcmv'; %Time-Domain-Beamformer > cfg.grid=lf; > cfg.vol=vol_s; > cfg.elec=elec_new; > cfg.reducerank = 3; > cfg.keepfilter='yes'; > > beamfilter = ft_sourceanalysis(cfg, dat4beam); > > %% Keep the cfg, just add the filter. > > cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above > > lcmv_bl = ft_sourceanalysis(cfg, bl_dat); > lcmv_act = ft_sourceanalysis(cfg, act_dat); > > > > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Dec 19 17:08:47 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 19 Dec 2013 17:08:47 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> Message-ID: <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> Hi Stephan, thanks for your quick reply. If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? Thanks a lot once more. Julian Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: > > hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? > > best, > > Stephan > > ________________________________________________________ > Stephan Moratti, PhD > > see also: http://web.me.com/smoratti/ > > Universidad Complutense de Madrid > Facultad de Psicología > Departamento de Psicología Básica I > Campus de Somosaguas > 28223 Pozuelo de Alarcón (Madrid) > Spain > > and > > Center for Biomedical Technology > Laboratory for Cognitive and Computational Neuroscience > Parque Científico y Tecnológico de la Universidad Politecnica de Madrid > Campus Montegancedo > 28223 Pozuelo de Alarcón (Madrid) > Spain > > > email: smoratti at psi.ucm.es > Tel.: +34 679219982 > > El 19/12/2013, a las 15:38, Julian Keil escribió: > >> Dear all, >> >> I have a problem of which I can't really find the source. >> >> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >> >> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >> >> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >> >> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >> >> Does anyone have an idea at which point this problem might occur? >> >> Thanks a lot. >> >> Julian >> >> >> >> P.S.: Below are the basic steps I use: >> >> %% 2.1. Build individual BEM-Model >> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >> >> cfg=[]; >> cfg.method='interactive'; >> cfg.coordsys = 'ctf'; >> >> mri_r = ft_volumerealign(cfg,mri); >> >> cfg=[]; >> >> mri_rs = ft_volumereslice(cfg,mri_r); >> >> %% Segment the individual volume >> cfg=[]; >> cfg.output={'brain' 'scalp' 'skull'}; >> cfg.brainsmooth = 5; >> cfg.scalpsmooth = 5; >> cfg.brainthreshold = .5; >> cfg.scalpthreshold = .1; >> mri_s = ft_volumesegment(cfg,mri_rs); >> >> %% Create Headmodel >> cfg=[]; >> cfg.interactive = 'no'; >> cfg.numvertices = 1000; >> >> bnd_s = ft_prepare_mesh(cfg,mri_s); >> >> cfg=[]; >> cfg.method='dipoli'; % >> cfg.conductivity=[0.3300 0.0041 0.3300]; >> >> vol_s = ft_prepare_headmodel(cfg,bnd_s); >> >> cfg = []; >> cfg.mri = mri_s; >> grid = ft_prepare_sourcemodel(cfg); >> >> grid.inside = find(grid.brain==1)'; >> grid.outside = find(grid.brain==0)'; >> grid.pos = grid.pos*10; % Set right dimensions >> >> %% Align Electrodes >> cfg=[]; >> cfg.method='interactive'; >> cfg.elec=elec_128; >> cfg.headshape=vol_s.bnd(1); >> >> elec_new=ft_electroderealign(cfg); >> >> %% 4. Make the Leadfield. >> elec_new.type='eeg'; >> >> cfg=[]; >> cfg.channel = 1:126; >> cfg.elec=elec_new; >> cfg.vol=vol_s; >> cfg.grid=grid; >> >> lf = ft_prepare_leadfield(cfg); >> >> %% BEAMFORMER >> >> cfg=[]; >> cfg.channel=1:126; >> cfg.method='lcmv'; %Time-Domain-Beamformer >> cfg.grid=lf; >> cfg.vol=vol_s; >> cfg.elec=elec_new; >> cfg.reducerank = 3; >> cfg.keepfilter='yes'; >> >> beamfilter = ft_sourceanalysis(cfg, dat4beam); >> >> %% Keep the cfg, just add the filter. >> >> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >> >> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >> lcmv_act = ft_sourceanalysis(cfg, act_dat); >> >> >> >> ******************** >> Dr. Julian Keil >> >> AG Multisensorische Integration >> Psychiatrische Universitätsklinik >> der Charité im St. Hedwig-Krankenhaus >> Große Hamburger Straße 5-11, Raum E 307 >> 10115 Berlin >> >> Telefon: +49-30-2311-1879 >> Fax: +49-30-2311-2209 >> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Thu Dec 19 17:18:50 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 19 Dec 2013 16:18:50 +0000 Subject: [FieldTrip] frequency analysis In-Reply-To: <52A974C7.3080104@donders.ru.nl> References: <52A974C7.3080104@donders.ru.nl> Message-ID: Dear Raghavan, For your 3rd question, I would add to Jorn's answer that you can, but not are required to, use combineplanar of your planar gradiometer pairs if you want one answer (of ERF or TFR) per channel location rather than 2, prior to grandaveraging. For statistics, be sure to use the correct neighbours template file: neuromag306planar_neighb.mat if you have not combined, and neuromag306cmb_neighb.mat if you have combined. Best, Johanna 2013/12/12 "Jörn M. Horschig" > Dear Raghavan, > > 1) Sure is it possible, z-scoring is nothing else then subtracting the > mean and dividing by the standard deviation. The time-period from which you > obtain the mean and standard deviation depend on what you want and how you > define it. > > 2) Usually we do not use megrealign at all and assume that subjects are > approximately similarly seated in the helmet for computing the > grandaverage. MEG sensor-level analysis is not suited very well for making > spatial inferences anyway, I would advise to go to source space for such a > thing. > > 3) For neuromag data, you already have planar gradiometers, so you do not > need megplanar and combineplanar. We, on the other hand, only have axial > gradiometers with our CTF system, thus we need a planar transformation to > get a planar representation. > > 4) I cannot help with this one, sorry. > > Best, > Jörn > > Raghavan Gopalakrishnan wrote: > >> I have a few questions regarding frequency analysis using wavelets. >> >> 1. Is it possible to z-score the TF spectrograms? Is so how and where >> should I specify the baseline? >> 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make >> sure all sensors from multi subject are matched. However, why is this not >> performed before grand averaging time-frequency data since the powspctrm is >> specific to each channel? >> 3. Is combineplanar a necessary step before any grand averaging i.e. ERF >> or TFR? I am using neuromag data, so can I perform grand averaging and >> statistics without combineplanar? >> 4. Fieldtrip only reads neuromag FIF files that has been processed >> through maxfilter. There are times when there is a need not to use >> maxfilter, is there a work around? >> >> Thanks very much. >> Raghavan >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Thu Dec 19 20:44:35 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 19 Dec 2013 20:44:35 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> Message-ID: <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> I thought of changing the dat4beam.elec to newelec. Does this help? Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 19/12/2013, a las 17:08, Julian Keil escribió: > Hi Stephan, > > thanks for your quick reply. > > If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. > > If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. > > Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? > > Thanks a lot once more. > > Julian > > Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: > >> >> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? >> >> best, >> >> Stephan >> >> ________________________________________________________ >> Stephan Moratti, PhD >> >> see also: http://web.me.com/smoratti/ >> >> Universidad Complutense de Madrid >> Facultad de Psicología >> Departamento de Psicología Básica I >> Campus de Somosaguas >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> and >> >> Center for Biomedical Technology >> Laboratory for Cognitive and Computational Neuroscience >> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >> Campus Montegancedo >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> >> email: smoratti at psi.ucm.es >> Tel.: +34 679219982 >> >> El 19/12/2013, a las 15:38, Julian Keil escribió: >> >>> Dear all, >>> >>> I have a problem of which I can't really find the source. >>> >>> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >>> >>> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >>> >>> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >>> >>> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >>> >>> Does anyone have an idea at which point this problem might occur? >>> >>> Thanks a lot. >>> >>> Julian >>> >>> >>> >>> P.S.: Below are the basic steps I use: >>> >>> %% 2.1. Build individual BEM-Model >>> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >>> >>> cfg=[]; >>> cfg.method='interactive'; >>> cfg.coordsys = 'ctf'; >>> >>> mri_r = ft_volumerealign(cfg,mri); >>> >>> cfg=[]; >>> >>> mri_rs = ft_volumereslice(cfg,mri_r); >>> >>> %% Segment the individual volume >>> cfg=[]; >>> cfg.output={'brain' 'scalp' 'skull'}; >>> cfg.brainsmooth = 5; >>> cfg.scalpsmooth = 5; >>> cfg.brainthreshold = .5; >>> cfg.scalpthreshold = .1; >>> mri_s = ft_volumesegment(cfg,mri_rs); >>> >>> %% Create Headmodel >>> cfg=[]; >>> cfg.interactive = 'no'; >>> cfg.numvertices = 1000; >>> >>> bnd_s = ft_prepare_mesh(cfg,mri_s); >>> >>> cfg=[]; >>> cfg.method='dipoli'; % >>> cfg.conductivity=[0.3300 0.0041 0.3300]; >>> >>> vol_s = ft_prepare_headmodel(cfg,bnd_s); >>> >>> cfg = []; >>> cfg.mri = mri_s; >>> grid = ft_prepare_sourcemodel(cfg); >>> >>> grid.inside = find(grid.brain==1)'; >>> grid.outside = find(grid.brain==0)'; >>> grid.pos = grid.pos*10; % Set right dimensions >>> >>> %% Align Electrodes >>> cfg=[]; >>> cfg.method='interactive'; >>> cfg.elec=elec_128; >>> cfg.headshape=vol_s.bnd(1); >>> >>> elec_new=ft_electroderealign(cfg); >>> >>> %% 4. Make the Leadfield. >>> elec_new.type='eeg'; >>> >>> cfg=[]; >>> cfg.channel = 1:126; >>> cfg.elec=elec_new; >>> cfg.vol=vol_s; >>> cfg.grid=grid; >>> >>> lf = ft_prepare_leadfield(cfg); >>> >>> %% BEAMFORMER >>> >>> cfg=[]; >>> cfg.channel=1:126; >>> cfg.method='lcmv'; %Time-Domain-Beamformer >>> cfg.grid=lf; >>> cfg.vol=vol_s; >>> cfg.elec=elec_new; >>> cfg.reducerank = 3; >>> cfg.keepfilter='yes'; >>> >>> beamfilter = ft_sourceanalysis(cfg, dat4beam); >>> >>> %% Keep the cfg, just add the filter. >>> >>> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >>> >>> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >>> lcmv_act = ft_sourceanalysis(cfg, act_dat); >>> >>> >>> >>> ******************** >>> Dr. Julian Keil >>> >>> AG Multisensorische Integration >>> Psychiatrische Universitätsklinik >>> der Charité im St. Hedwig-Krankenhaus >>> Große Hamburger Straße 5-11, Raum E 307 >>> 10115 Berlin >>> >>> Telefon: +49-30-2311-1879 >>> Fax: +49-30-2311-2209 >>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Fri Dec 20 09:01:13 2013 From: michielb at tcd.ie (Bart Michiels) Date: Fri, 20 Dec 2013 08:01:13 +0000 Subject: [FieldTrip] connectivity analysis In-Reply-To: <19A3518D-5E2A-452B-BA89-918B8FD18BC5@donders.ru.nl> References: <19A3518D-5E2A-452B-BA89-918B8FD18BC5@donders.ru.nl> Message-ID: Good morning Jan-Mathijs, Some weeks ago you've sent me the following answer to my question on doing some connectivity and network analysis on some frequency data separated in frequency bins. I totally agree with you that electrode level analysis is a bad way for doing the connectivity analysis, but I have to use electrode level data (for the moment). I also listened to your advance and only averaged the connectivity measures between subjects for the grand average comparison. For the ft_freqanalysis I used the smoothing box and the foi in such a way it would overlap my frequency band of interest, but why can't one just average frequency data for a range of frequencies? And why wouldn't you do it across trials? For the trials I just used cfg.keeptrials = 'yes' and used it as an input for ft_connectivityanalysis where the dimension trials is lost. So I presume averaging over trials is done in the right way within the ft_connectivityanalysis function? Bests, Bart On 12 November 2013 10:57, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Bart, > > If you 7 frequency bins within each frequency bin are considered to belong > to the same frequency band, I'd suggest to use the multitaper approach to > estimate the spectral parameters per frequency band, using just a single > frequency bin to represent the whole band of interest. So, rather than for > example estimating from 15 until 21 Hz in steps of 1 Hz, you can also > estimate only at 18, using cfg.tapsmofrq = 3 in ft_freqanalysis. I suggest > to have a look at the documentation on the FT-wiki that is concerned with > frequency analysis. I would certainly not average the spectral > representation prior to computing the coherence, neither across the > individual frequency bins, and even more certainly not across trials. > > Regarding statistics, I don't want to discourage you, but I don't think it > makes sense to attempt doing statistics at the channel level to begin with, > due to the effects of volume conduction. Also, in any group comparison (but > also when doing a comparison across conditions), if there is any between > groups in terms of SNR (e.g. more or less alpha power across groups) you > are bound to find a statistically significant difference in estimated > connectivity as well. It remains to be motivated in such a case, that the > change in estimated connectivity actually reflects a change in true > connectivity. > > If you want to do statistics irrespective of these caveats, you may want > to look into FieldTrip's implementation of the non-parametric permutation > testing framework. There is ample documentation about this on our wiki as > well. > > Best wishes, > > Jan-Mathijs > > > > On Oct 30, 2013, at 1:22 PM, Bart Michiels wrote: > > Hi, > > I have 30 patients and 30 controls and I'm investigating their coherence > (EEG, 128 electrodes). Every patient has ~30 trials resting state eyes open > consisting of 7 frequency bins with 7 frequencies in each bin. My goal is > to show connectivity differences between different brain regions in the > control and patient group (doing electrode-level analysis now, source-level > analysis is next step). > > - Is it more appropriate to keep the averaging step as the latest step > (ie. calculate all coherence for all the different subjects, for all > trials, for all different frequencies in frequency bins) or is it better to > do the averaging asap (ie. average all frequencies in 1 frequency bin at > the time-frequency analysis step, average all trials at the > ft_freqdescriptives step, ...) > > - Is there any better way to do some statistics on the 128x128x7x7 (128 > electrodes, 7 frequency bins, 7 frequencies in each bin) besides using the > ttest2() matlab function? > > Any tips & tricks are more then welcome! > > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Fri Dec 20 10:07:42 2013 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 20 Dec 2013 10:07:42 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> Message-ID: Hi Stephan, Ah, I forgot that the electrode definition is added to the EEG-structure. Unfortunately, neither removing this nor setting all .elec-fields to the aligned elec_new helps. Happy end-of-the-year wishes, Julian Am 19.12.2013 um 20:44 schrieb smoratti at psi.ucm.es: > > I thought of changing the dat4beam.elec to newelec. Does this help? > > Stephan > > ________________________________________________________ > Stephan Moratti, PhD > > see also: http://web.me.com/smoratti/ > > Universidad Complutense de Madrid > Facultad de Psicología > Departamento de Psicología Básica I > Campus de Somosaguas > 28223 Pozuelo de Alarcón (Madrid) > Spain > > and > > Center for Biomedical Technology > Laboratory for Cognitive and Computational Neuroscience > Parque Científico y Tecnológico de la Universidad Politecnica de Madrid > Campus Montegancedo > 28223 Pozuelo de Alarcón (Madrid) > Spain > > > email: smoratti at psi.ucm.es > Tel.: +34 679219982 > > El 19/12/2013, a las 17:08, Julian Keil escribió: > >> Hi Stephan, >> >> thanks for your quick reply. >> >> If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. >> >> If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. >> >> Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? >> >> Thanks a lot once more. >> >> Julian >> >> Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: >> >>> >>> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? >>> >>> best, >>> >>> Stephan >>> >>> ________________________________________________________ >>> Stephan Moratti, PhD >>> >>> see also: http://web.me.com/smoratti/ >>> >>> Universidad Complutense de Madrid >>> Facultad de Psicología >>> Departamento de Psicología Básica I >>> Campus de Somosaguas >>> 28223 Pozuelo de Alarcón (Madrid) >>> Spain >>> >>> and >>> >>> Center for Biomedical Technology >>> Laboratory for Cognitive and Computational Neuroscience >>> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >>> Campus Montegancedo >>> 28223 Pozuelo de Alarcón (Madrid) >>> Spain >>> >>> >>> email: smoratti at psi.ucm.es >>> Tel.: +34 679219982 >>> >>> El 19/12/2013, a las 15:38, Julian Keil escribió: >>> >>>> Dear all, >>>> >>>> I have a problem of which I can't really find the source. >>>> >>>> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >>>> >>>> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >>>> >>>> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >>>> >>>> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >>>> >>>> Does anyone have an idea at which point this problem might occur? >>>> >>>> Thanks a lot. >>>> >>>> Julian >>>> >>>> >>>> >>>> P.S.: Below are the basic steps I use: >>>> >>>> %% 2.1. Build individual BEM-Model >>>> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >>>> >>>> cfg=[]; >>>> cfg.method='interactive'; >>>> cfg.coordsys = 'ctf'; >>>> >>>> mri_r = ft_volumerealign(cfg,mri); >>>> >>>> cfg=[]; >>>> >>>> mri_rs = ft_volumereslice(cfg,mri_r); >>>> >>>> %% Segment the individual volume >>>> cfg=[]; >>>> cfg.output={'brain' 'scalp' 'skull'}; >>>> cfg.brainsmooth = 5; >>>> cfg.scalpsmooth = 5; >>>> cfg.brainthreshold = .5; >>>> cfg.scalpthreshold = .1; >>>> mri_s = ft_volumesegment(cfg,mri_rs); >>>> >>>> %% Create Headmodel >>>> cfg=[]; >>>> cfg.interactive = 'no'; >>>> cfg.numvertices = 1000; >>>> >>>> bnd_s = ft_prepare_mesh(cfg,mri_s); >>>> >>>> cfg=[]; >>>> cfg.method='dipoli'; % >>>> cfg.conductivity=[0.3300 0.0041 0.3300]; >>>> >>>> vol_s = ft_prepare_headmodel(cfg,bnd_s); >>>> >>>> cfg = []; >>>> cfg.mri = mri_s; >>>> grid = ft_prepare_sourcemodel(cfg); >>>> >>>> grid.inside = find(grid.brain==1)'; >>>> grid.outside = find(grid.brain==0)'; >>>> grid.pos = grid.pos*10; % Set right dimensions >>>> >>>> %% Align Electrodes >>>> cfg=[]; >>>> cfg.method='interactive'; >>>> cfg.elec=elec_128; >>>> cfg.headshape=vol_s.bnd(1); >>>> >>>> elec_new=ft_electroderealign(cfg); >>>> >>>> %% 4. Make the Leadfield. >>>> elec_new.type='eeg'; >>>> >>>> cfg=[]; >>>> cfg.channel = 1:126; >>>> cfg.elec=elec_new; >>>> cfg.vol=vol_s; >>>> cfg.grid=grid; >>>> >>>> lf = ft_prepare_leadfield(cfg); >>>> >>>> %% BEAMFORMER >>>> >>>> cfg=[]; >>>> cfg.channel=1:126; >>>> cfg.method='lcmv'; %Time-Domain-Beamformer >>>> cfg.grid=lf; >>>> cfg.vol=vol_s; >>>> cfg.elec=elec_new; >>>> cfg.reducerank = 3; >>>> cfg.keepfilter='yes'; >>>> >>>> beamfilter = ft_sourceanalysis(cfg, dat4beam); >>>> >>>> %% Keep the cfg, just add the filter. >>>> >>>> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >>>> >>>> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >>>> lcmv_act = ft_sourceanalysis(cfg, act_dat); >>>> >>>> >>>> >>>> ******************** >>>> Dr. Julian Keil >>>> >>>> AG Multisensorische Integration >>>> Psychiatrische Universitätsklinik >>>> der Charité im St. Hedwig-Krankenhaus >>>> Große Hamburger Straße 5-11, Raum E 307 >>>> 10115 Berlin >>>> >>>> Telefon: +49-30-2311-1879 >>>> Fax: +49-30-2311-2209 >>>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From R.Oostenveld at donders.ru.nl Fri Dec 20 14:38:37 2013 From: R.Oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 20 Dec 2013 14:38:37 +0100 Subject: [FieldTrip] Job posting: 9 PhD positions in the Dutch Research Consortium 'Language in Interaction' References: <1517293618.4361293.1387545450952.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <5A236B39-57EC-4178-9F97-4106E05B1428@donders.ru.nl> Begin forwarded message: > From: "Lorenz, C.M." > Date: 20 December 2013 14:17:30 CET > To: R.Oostenveld at donders.ru.nl > Subject: Job posting: 9 PhD positions in the Dutch Research Consortium 'Language in Interaction' > > Nine PhD Positions in the Dutch Research Consortium 'Language in Interaction' > > We are looking for highly motivated PhD candidates to enrich a unique consortium of researchers that aims to unravel the neurocognitive mechanisms of language at multiple levels. The goal is to understand both the universality and the variability of the human language faculty from genes to behaviour. > > The Netherlands has an outstanding track record in the language sciences. This research consortium sponsored by a large grant from the Netherlands Organization for Scientific research (NWO) brings together many of the excellent research groups in the Netherlands with a research programme on the foundations of language. The research team consists of 43 Principal Investigators. In addition to the excellence in the domain of language and related relevant fields of cognition, our consortium provides state-of-the-art research facilities and a research team with ample experience in the complex research methods that will be invoked to address the scientific questions at the highest level of methodological sophistication. These include methods from genetics, neuroimaging, computational modelling, and patient-related research. This consortium realizes both quality and critical mass for studying human language at a scale not easily found anywhere else. > > Currently, the consortium advertises nine PhD positions for a period of 4 years. These positions provide the opportunity for conducting world-class research as a member of an interdisciplinary team. > > Closing date for application: February 2, 2014 > > Click here for more information on the PhD positions and how to apply. > > (url = http://www.ru.nl/vacatures/details/details_vacature_0?recid=529314) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mje.mads at gmail.com Fri Dec 20 23:43:02 2013 From: mje.mads at gmail.com (Mads Jensen) Date: Fri, 20 Dec 2013 23:43:02 +0100 Subject: [FieldTrip] permutation test on extracted sources? Message-ID: <52B4C7F6.6060609@gmail.com> Hi all, I have some data that are extracted time series from a source reconstruction. I would like to use the statistical apparatus of Fieldtrip to do permutation tests on these data. Is is possible to create a "virtual" channel and do a permutation test on that, and what about multiple "virtual" channels at the same time? best wishes, mads From n.lam at fcdonders.ru.nl Sat Dec 21 09:53:47 2013 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Sat, 21 Dec 2013 09:53:47 +0100 (CET) Subject: [FieldTrip] permutation test on extracted sources? In-Reply-To: <52B4C7F6.6060609@gmail.com> Message-ID: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> Hi Mads, FieldTrip has a virtual sensor tutorial. http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors?s[]=beamformer&s[]=extended I'm not too familiar with it, but I do know that it uses a time-series source reconstruction (LCMV Beamformer) which is probably similar to what you've done. Further down the tutorial they do a source analysis with ft_sourceanalysis which the output I think you can use to do statistics (ft_sourcestatistics). I'm sure some other FT members can add to the details. Hope this helps. Best, Nietzsche ----- Original Message ----- > From: "Mads Jensen" > To: fieldtrip at science.ru.nl > Sent: Friday, 20 December, 2013 11:43:02 PM > Subject: [FieldTrip] permutation test on extracted sources? > Hi all, > > I have some data that are extracted time series from a source > reconstruction. I would like to use the statistical apparatus of > Fieldtrip to do permutation tests on these data. > > Is is possible to create a "virtual" channel and do a permutation test > on that, and what about multiple "virtual" channels at the same time? > > > best wishes, > mads > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From mje.mads at gmail.com Fri Dec 27 10:46:06 2013 From: mje.mads at gmail.com (Mads Jensen) Date: Fri, 27 Dec 2013 10:46:06 +0100 Subject: [FieldTrip] permutation test on extracted sources? In-Reply-To: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> References: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <52BD4C5E.8020106@gmail.com> Hi Liam, Thanks I had missed that tutorial, very useful. best, mads On 12/21/2013 09:53 AM, Lam, Nietzsche wrote: > Hi Mads, > > FieldTrip has a virtual sensor tutorial. > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors?s[]=beamformer&s[]=extended > > I'm not too familiar with it, but I do know that it uses a time-series source reconstruction (LCMV Beamformer) which is probably similar to what you've done. Further down the tutorial they do a source analysis with ft_sourceanalysis which the output I think you can use to do statistics (ft_sourcestatistics). I'm sure some other FT members can add to the details. > > Hope this helps. > > Best, > Nietzsche > > ----- Original Message ----- >> From: "Mads Jensen" >> To: fieldtrip at science.ru.nl >> Sent: Friday, 20 December, 2013 11:43:02 PM >> Subject: [FieldTrip] permutation test on extracted sources? >> Hi all, >> >> I have some data that are extracted time series from a source >> reconstruction. I would like to use the statistical apparatus of >> Fieldtrip to do permutation tests on these data. >> >> Is is possible to create a "virtual" channel and do a permutation test >> on that, and what about multiple "virtual" channels at the same time? >> >> >> best wishes, >> mads >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From R.Zimmermann at UKE.Uni-Hamburg.de Mon Dec 2 14:33:25 2013 From: R.Zimmermann at UKE.Uni-Hamburg.de (Dr. Zimmermann) Date: Mon, 2 Dec 2013 14:33:25 +0100 Subject: [FieldTrip] Format for storing MRI data (DICOM import for CTF MEG) In-Reply-To: References: <5298908D.2000005@donders.ru.nl> Message-ID: <529C8C25.1000300@UKE.Uni-Hamburg.de> Hi, we're operating a CTF MEG, our MRI data is provided in DICOM format. The FieldTrip doc about conversion of DICOM data into CTF format: http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format has already found its way to us. Currently, we we're still using the '...old and difficult way' since import and setting of fiducials is done by people (=> MRI-operator) other than the later users (=> MRI-user) of the mri data. To keep this task sharing, each converted MRI should be saved to a file by a MRI-operator. Later this file could be opened by the MRI-user. On the one hand the saved file should contain all of the MRI content (data, hdr with transformation matrices etc.), on the other hand I wouldn't like to add software prerequisites (as spm or freesurfer) for the storage or later reading process. Obviously I can take the (still provided) original CTF routine: writeCTFMRI.m (This would mean to regress most of the importing process). Is there a way to store the MRI data in CTF format without using the function provided by CTF? Regards, Roger -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- A non-text attachment was scrubbed... Name: R_Zimmermann.vcf Type: text/x-vcard Size: 427 bytes Desc: not available URL: From thomas.wunderle at esi-frankfurt.de Mon Dec 2 14:41:35 2013 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Mon, 2 Dec 2013 13:41:35 +0000 Subject: [FieldTrip] ft_connectivity_csd2transfer Message-ID: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> Hi, a small bug has slipped in during the last update of the function " ft_connectivity_csd2transfer" The "f" in the function definition is missing, so the function is recognized as a script "unction [output] = ft_connectivity_csd2transfer(freq, varargin)" Best, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel:   +49 69 96769 519 Fax:   +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries From jan.schoffelen at donders.ru.nl Mon Dec 2 15:41:54 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 2 Dec 2013 15:41:54 +0100 Subject: [FieldTrip] ft_connectivity_csd2transfer In-Reply-To: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> References: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <4E8B9A63-3813-490C-94B2-55BDD52AF96B@donders.ru.nl> Hi Thomas, My bad, apologies and thanks for noticing and letting us know. I fixed it. Best, JM On Dec 2, 2013, at 2:41 PM, Wunderle, Thomas wrote: > Hi, > a small bug has slipped in during the last update of the function " ft_connectivity_csd2transfer" > > The "f" in the function definition is missing, so the function is recognized as a script > > "unction [output] = ft_connectivity_csd2transfer(freq, varargin)" > > Best, > Thomas > > ----- > Dr. Thomas Wunderle > Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 519 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Geschäftsführer: Prof. Dr. Pascal Fries > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Dec 2 20:15:38 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 2 Dec 2013 14:15:38 -0500 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Thank you Arjen, Actually, I am testing the FieldTrip motion regression on MEG data specifically collected with a current phantom and known motion. I can treat the data as ERP data and average over 1 sec trials if needed. Following your advise on reduction of the regressors number (on 120 trials of 1 sec long) I was able to avoid the "out of memory" issue. Though I run into the different set of problems now that I need help to understand: ______________________________________________ ??? Error using ==> mxSerialize Error during serialization of (null) Error in ==> ft_postamble_provenance at 91 cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); Error in ==> ft_postamble at 55 evalin('caller', ['ft_postamble_' cmd]); Error in ==> ft_timelockanalysis at 370 ft_postamble provenance timelock Error in ==> ft_regressconfound at 313 dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging _________________________________________________________ Here is the code I run to regress the head motion: %% addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 ft_defaults cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; cfg.trialdef.triallength=1; cfg.trialdef.ntrials=120; cfg.continuous = 'yes'; cfg = ft_definetrial(cfg); cfg.channel = {'MEG'}; cfg.demean = 'yes'; data = ft_preprocessing(cfg); %% cfg = []; cfg.keeptrials = 'yes'; timelock = ft_timelockanalysis(cfg, data); %% cfg = []; cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; cfg.trialdef.triallength=1; cfg.trialdef.ntrials=120; cfg.continuous = 'yes'; cfg = ft_definetrial(cfg); %% cfg.channel = {'HLC0011','HLC0012','HLC0013', ... 'HLC0021','HLC0022','HLC0023', ... 'HLC0031','HLC0032','HLC0033'}; headpos = ft_preprocessing(cfg); ntrials = length(headpos.sampleinfo) for t = 1:ntrials coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; end cc = circumcenter(coil1, coil2, coil3); cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; %% confound = [cc_dem ... ones(size(cc_dem,1),1)]; %% cfg = []; cfg.confound = confound; cfg.reject = [1:6]; regr = ft_regressconfound(cfg, timelock); %% _________________________________________________________________ Sorry for the lengthy letter and thanks for the help! Inna On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) wrote: > Hi Inna, > > Are you using the same design matrix as on the wiki page? That one covers > the primary head translations and rotations, but also their > derivatives. You could try using the primary measures only (3 > translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant > regressors). It is also mentionworthy that there should be a balance > between the number of regressors and the number of observations > (i.e. trials). I believe on the respective wiki page on head movement > regression it states that the ratio is recommended to be not larger > than 1:10 (regressors:trials), accompanied with a reference. Accordingly, > I'd suggest to use those 7 regressors, and your data (120s resting state) > split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These > specifications might hopefully also allow working around your memory issue. > > Second, it may be worth mentioning what you would like to do with the data > post-movement-regression. Namely, the movement compensation will remove > contributions from head movement to the signal. But this requires that > signal to behave consistently over trials, which does not seem the case > with the signal in your resting study? That is, with an ERP study, the > signal fluctuations appear consistent over trials, with amplitudes being > modulated by head movement (i.e. sensor-source distance, see our neuroimage > paper - 2013) in a predictable fashion. So if you're planning on doing > frequency analysis, or maybe connectivity analysis, after head movement > compensation, I'd recommend reversing that order. The rule of thumb is to > use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise > unexplained variance (over trials) due to head movement, benefitting your > statistical assessments. > > Hope these suggestions may help you with further analyses. I'm > not familiar with anyone implementing this method to resting state > analyses, but maybe someone else has some first-hand experience here. > Furthermore, too late for your current dataset, but for a next one I'd > recommend using the online head position monitoring/respositioning tool > that we have developed for CTF systems (a neuromag version is approaching > the final stage). This tool is routinely used in our lab to monitor > and reduce head movment throughout recording (after which > ft_regressconfound is being used to deal with the trial-by-trial crumbles). > > Yours, > Arjen > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Tue Dec 3 19:04:36 2013 From: octavian.lie at gmail.com (Octavian Lie) Date: Tue, 3 Dec 2013 12:04:36 -0600 Subject: [FieldTrip] openmeeg matlab path Message-ID: Dear All, I installed openmeeg on my ubuntu 12.04 64 bit via github, tested it and works well from the terminal; I usually initiate the job from the terminal with: cd openmeeg/data/< subject> #!/usr/bin/env bash ... However matlab cannot see path, I get this matlab error when calling via fieldtrip Error using ft_hastoolbox (line 445) the OPENMEEG toolbox is not installed, see http://gforge.inria.fr/projects/openmeeg and http://gforge.inria.fr/frs/?group_id=435 Error in ft_headmodel_openmeeg (line 35) ft_hastoolbox('openmeeg', 1); ... How can I make matlab see path? I have read that one has to add these export PATH=$PATH:/opt/openmeeg/bin export DYLD_LIBRARY_PATH=/opt/openmeeg/lib:$LD_LIBRARY_PATH Where have these to be added, in the startup.m, terminal, or linux script? Thank you, Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Tue Dec 3 21:15:26 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Tue, 3 Dec 2013 21:15:26 +0100 Subject: [FieldTrip] openmeeg matlab path In-Reply-To: References: Message-ID: Dear Octavian, try something like this in the matlab prompt setenv('PATH', '/opt/openmeeg/bin') setenv('LD_LIBRARY_PATH', '/opt/openmeeg/lib') on linux and on mac: setenv('PATH', '/opt/openmeeg/bin') setenv('DYLD_LIBRARY_PATH', '/opt/openmeeg/lib') to test your install run: system('om_assemble') you should see something like: >> system('om_assemble') om_assemble version 2.2 compiled at Dec 3 2013 20:41:48 Not enough arguments Please try "om_assemble -h" or "om_assemble --help " ans = 0 Hope this helps, Alex On Tue, Dec 3, 2013 at 7:04 PM, Octavian Lie wrote: > Dear All, > > I installed openmeeg on my ubuntu 12.04 64 bit via github, tested it and > works well from the terminal; I usually initiate the job from the terminal > with: > > cd openmeeg/data/< subject> > #!/usr/bin/env bash > ... > > However matlab cannot see path, I get this matlab error when calling via > fieldtrip > > Error using ft_hastoolbox (line 445) > the OPENMEEG toolbox is not installed, see > http://gforge.inria.fr/projects/openmeeg and > http://gforge.inria.fr/frs/?group_id=435 > > Error in ft_headmodel_openmeeg (line 35) > ft_hastoolbox('openmeeg', 1); > ... > > How can I make matlab see path? I have read that one has to add these > > export PATH=$PATH:/opt/openmeeg/bin > export DYLD_LIBRARY_PATH=/opt/openmeeg/lib:$LD_LIBRARY_PATH > > Where have these to be added, in the startup.m, terminal, or linux script? > > Thank you, > > Octavian > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From octavian.lie at gmail.com Wed Dec 4 04:40:54 2013 From: octavian.lie at gmail.com (Octavian Lie) Date: Tue, 3 Dec 2013 21:40:54 -0600 Subject: [FieldTrip] openmeeg matlab path In-Reply-To: References: Message-ID: Thank you, Alexandre. In the end, it was not the openmeeg path which was the only issue, it was the absence of fieldtrip wrappers such as om_save_tri.m in the spm external fieldtrip distribution, so it turns out that both fieldtrip and openmeeg have to be installed and on path for forward model calculation using spm GUI option openmeeg. That was not clear at the outset. Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean-baptiste.versini at etu.univ-lyon1.fr Wed Dec 4 11:38:52 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Wed, 4 Dec 2013 10:38:52 +0000 Subject: [FieldTrip] Reorder labels Message-ID: <5271B6068CD8D94DB82254228237928801790806@mbx2010-02.univ-lyon1.fr> Dear all, When I delete channels and then use ft_channelrepair to reconstruct the missing channel, it changes the order of the label (reconstructed channel are added at the end of the list). I know it doesn't matter when I use fieldtrip functions but it does matter when I use my function. I wanted to know if there was an easy way in fieldtrip to reorder all the channel by an alphalphabetical order since I assume it does something like this when we process data with different channel order. Regards, JB -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Thu Dec 5 15:06:20 2013 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 05 Dec 2013 15:06:20 +0100 Subject: [FieldTrip] beamforming: one/two sources and subject specific ROI In-Reply-To: <52A0871E.6090204@gmail.com> References: <52A0871E.6090204@gmail.com> Message-ID: <52A0885C.5030706@gmail.com> Dear FT community, I have (nice!) source-reconstruction results for my data (attached) and now I've got a list of things I'd like to do next but I've got some specific questions left. 1) ft_sourcestatistics detects /one /cluster (p = .002). It'd be nice if I could say there are two different "sources" for my effect, one temporo-parietal and one frontal. But I believe that from a source reconstruction perspective, I cannot claim that. Could anyone confirm that for me? 2) Based on the stats, I'd like to define my ROI and go back to individual subjects to look at the single-trial data within this detected source. (Ultimately, I'd like to correlate power within that source with reaction times). Joern had some suggestions about how to select the ROI "I had the feeling that especially this latter approach (base ROI on GA +/- 3 cm, smooth individual subject data, select most sensitive voxel)" http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006733.html Has anyone done something similar (or different)? Did it work out well? The problem I think I'll face is that my source isn't very focal (half of the left hemisphere!), so I'd be very happy to hear your thoughts on whether this analysis is even feasible... Thanks a lot, Vitoria -- ** Please consider the environment - do you really need to print? ** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_ex.jpg Type: image/jpeg Size: 22840 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Dec 5 17:00:40 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 05 Dec 2013 17:00:40 +0100 Subject: [FieldTrip] beamforming: one/two sources and subject specific ROI In-Reply-To: <52A0885C.5030706@gmail.com> References: <52A0871E.6090204@gmail.com> <52A0885C.5030706@gmail.com> Message-ID: <52A0A328.7050704@donders.ru.nl> Hi Vitoria, I also got two other remarks that might help you. On the one hand, you could play around with the regularization of the source reconstruction (lambda), that might help to get more focal sources. On the other hand, you can also play around with your clusteralpha, if you decrease that you could get spatially more defined clusters. Oh and, don't necessarily trust the surface plots - they display a projection onto the brain surface, thus deeper brain activity will appear of neocortical origin. Of course, it looks nice for a paper :) But to make precise regional specific claims, an ortho plot might be better. Regarding your questions, for 1) I would agree, for 2), well you cited my mail, so that's the two ways I'd try :) Best, Jörn Vitoria Piai wrote: > Dear FT community, > > I have (nice!) source-reconstruction results for my data (attached) > and now I've got a list of things I'd like to do next but I've got > some specific questions left. > > 1) ft_sourcestatistics detects /one /cluster (p = .002). It'd be nice > if I could say there are two different "sources" for my effect, one > temporo-parietal and one frontal. But I believe that from a source > reconstruction perspective, I cannot claim that. Could anyone confirm > that for me? > > 2) Based on the stats, I'd like to define my ROI and go back to > individual subjects to look at the single-trial data within this > detected source. (Ultimately, I'd like to correlate power within that > source with reaction times). > Joern had some suggestions about how to select the ROI "I had the feeling that especially this latter approach (base ROI on GA +/- 3 cm, smooth individual subject data, select most sensitive voxel)" > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006733.html > Has anyone done something similar (or different)? Did it work out well? > The problem I think I'll face is that my source isn't very focal (half of the left hemisphere!), so I'd be very happy to hear your thoughts on whether this analysis is even feasible... > > Thanks a lot, > Vitoria > > -- > ** Please consider the environment - do you really need to print? ** > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From ayobimpe2004 at hotmail.com Thu Dec 5 20:32:49 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 5 Dec 2013 20:32:49 +0100 Subject: [FieldTrip] Source Analysis Message-ID: hello, 1. I used ASA head model to projected electrode on it to calculated the lead field and perform source analysis. I ma having problem with the projection of source on MRI after source interpolation. The source couldn't align with the MRI image. The first picture is for the source (before interpolation) and the second is after interpolation. I have tried several methods like volumeresclice but no good result. Please help me! 2. I want to do source analysis in frequency band (like alpha, beta etc) with frequency analysed data (ouput of ft_frequencyanalysis). But in the source analysis, I can only select one frequency (not band). Please I how can I play with it to get the frequency range of interest? Best regards, Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig2.png Type: image/png Size: 22122 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig1.png Type: image/png Size: 95973 bytes Desc: not available URL: From russgport at gmail.com Thu Dec 5 23:36:56 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 5 Dec 2013 17:36:56 -0500 Subject: [FieldTrip] questions itc/plf calculation via hilbert transformations Message-ID: Hi fellow fieldtippers, I have a question that brought around by an answer I previously received. For data analyzed with ft_freqanalysis and using the 'wavelet' option I can computer ITC/PLF via, tmpdat = freq.fourierspctrm; tmpdat = tmpdat./abs(tmpdat); ; % this will normalize each trial for its amplitude; itc = abs(mean(tmpdat)); % this will give the itc thank you again Jan-Mathijs for this insight I am now trying to calculate ITC via hilbert transformation, putting my VE data through ft_preproc_hilbert. Can I just use the cfg.option = 'imag', to get the imaginary component of the analytic signal, since this is what i use with wavelets (i.e. what the tmpda =tmpdat./abs(tmpdat) achieves). Then I would just repeat the last line itc = abs(mean(tmpdat)). I only hesitate because on several of the mailing list emails people have suggested doing cfg.option = 'angle' (which computes the imaginary component (tmpdat./abs(tmpdat) then uses the angle function (angle()). Have I been calculating ITC wrong for my wavelets? Or should i just the the cfg.option = 'imag' and mimik my wavelet based ITC. Thanks Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Dec 6 07:18:47 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 6 Dec 2013 07:18:47 +0100 Subject: [FieldTrip] questions itc/plf calculation via hilbert transformations In-Reply-To: References: Message-ID: Hi Russ, The imaginary part of a complex number (i.e. the 'b' in 'a+b*i') is very different from the phase (i.e. the 'p' in 'A*exp(i*p)'). When computing ITC, the expression z = z / abs(z) sets the amplitude (A) to 1, while preserving the phase. This is not the same as taking the imaginary par. To be able to later compute the ITC, I would actually just use cfg.hilbert = 'complex', and then do the exact same computations as with your wavelet approach. Using cfg.hilbert = 'angle' gives you the angle (in radians) directly, so a real number. This is more difficult (and slow) to work with than using the normalized complex representation. Hope this helps, Best, Eelke On Dec 5, 2013 11:39 PM, "Russell G Port" wrote: > Hi fellow fieldtippers, > > I have a question that brought around by an answer I previously received. > For data analyzed with ft_freqanalysis and using the 'wavelet' option I > can computer ITC/PLF via, > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); ; % this will normalize each trial for its > amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > > thank you again Jan-Mathijs for this insight > > I am now trying to calculate ITC via hilbert transformation, putting my VE > data through > > ft_preproc_hilbert. Can I just use the cfg.option = 'imag', to get the > imaginary component of > > the analytic signal, since this is what i use with wavelets (i.e. what the > > tmpda =tmpdat./abs(tmpdat) achieves). Then I would just repeat the last > line itc = > > abs(mean(tmpdat)). I only hesitate because on several of the mailing list > emails people have > > suggested doing cfg.option = 'angle' (which computes the imaginary > component (tmpdat./abs(tmpdat) then uses the angle function (angle()). > Have I been calculating ITC wrong for my wavelets? Or should i just the the > cfg.option = 'imag' and mimik my wavelet based ITC. > > Thanks > > Russ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Dec 6 16:07:24 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 6 Dec 2013 16:07:24 +0100 Subject: [FieldTrip] Source Analysis In-Reply-To: References: Message-ID: Hi Azeez, For your question (1), I think it would be helpful if you give a bit more information on what you are doing. If the source reconstruction is not aligned to your MRI, probably some ingredient for the source analysis was also misaligned. Could you see whether your source model, volume conduction model, and sensor definition are all in alignment? (See here http://fieldtrip.fcdonders.nl/faq/how_can_i_check_whether_the_grid_that_i_have_is_aligned_to_the_segmented_volume_and_to_the_sensor_gradiometer ) Regarding (2): typically I would use cfg.taper = 'dpss' (the default) and then choose a combination of cfg.foi and cfg.tapsmofrq that yield the frequency band of interest. E.g. cfg.foi = 20 and cfg.tapsmofrq = 8 gives you a frequency band ranging from 12 to 28 Hz. Best, Eelke On 5 December 2013 20:32, Azeez Adebimpe wrote: > > hello, > > 1. I used ASA head model to projected electrode on it to calculated the > lead field and perform source analysis. I ma having problem with the > projection of source on MRI after source interpolation. The source couldn't > align with the MRI image. The first picture is for the source (before > interpolation) and the second is after interpolation. I have tried several > methods like volumeresclice but no good result. Please help me! > > > 2. I want to do source analysis in frequency band (like alpha, beta etc) > with frequency analysed data (ouput of ft_frequencyanalysis). But in the > source analysis, I can only select one frequency (not band). Please I how > can I play with it to get the frequency range of interest? > > Best regards, > Azeez Adebimpe > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ayobimpe2004 at hotmail.com Fri Dec 6 16:21:52 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Fri, 6 Dec 2013 16:21:52 +0100 Subject: [FieldTrip] Source Analysis In-Reply-To: References: Message-ID: Thank you Eelke,I got the second part very well.I ensured that the sensor aligned very well on the head model before calculating there source analysis. I don't have the MRI for the subjects but want to use any of the template MRI to view the result of source analysis. I made use of T1,mii in spm8 but couldn't get it as it was done in online tutorial. I don't have MRI for the patients but used head model from ASA software.I will be glad for more info. Azeez > Date: Fri, 6 Dec 2013 16:07:24 +0100 > From: eelke.spaak at donders.ru.nl > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Source Analysis > > Hi Azeez, > > For your question (1), I think it would be helpful if you give a bit > more information on what you are doing. If the source reconstruction > is not aligned to your MRI, probably some ingredient for the source > analysis was also misaligned. Could you see whether your source model, > volume conduction model, and sensor definition are all in alignment? > (See here http://fieldtrip.fcdonders.nl/faq/how_can_i_check_whether_the_grid_that_i_have_is_aligned_to_the_segmented_volume_and_to_the_sensor_gradiometer > ) > > Regarding (2): typically I would use cfg.taper = 'dpss' (the default) > and then choose a combination of cfg.foi and cfg.tapsmofrq that yield > the frequency band of interest. E.g. cfg.foi = 20 and cfg.tapsmofrq = > 8 gives you a frequency band ranging from 12 to 28 Hz. > > Best, > Eelke > > On 5 December 2013 20:32, Azeez Adebimpe wrote: > > > > hello, > > > > 1. I used ASA head model to projected electrode on it to calculated the > > lead field and perform source analysis. I ma having problem with the > > projection of source on MRI after source interpolation. The source couldn't > > align with the MRI image. The first picture is for the source (before > > interpolation) and the second is after interpolation. I have tried several > > methods like volumeresclice but no good result. Please help me! > > > > > > 2. I want to do source analysis in frequency band (like alpha, beta etc) > > with frequency analysed data (ouput of ft_frequencyanalysis). But in the > > source analysis, I can only select one frequency (not band). Please I how > > can I play with it to get the frequency range of interest? > > > > Best regards, > > Azeez Adebimpe > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Sun Dec 8 20:46:55 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Sun, 8 Dec 2013 20:46:55 +0100 Subject: [FieldTrip] fit volume segment and sensors Message-ID: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> Dear Fieldtrippers I 'm trying to perform source analysis on MEG data. I use an AtB system (usually it is described as 'itab' in fieldtrip) First I have preprocessed my data and I have calculated the cross spectral density matrix Then I have constructed the forward model mri = ft_read_mri('Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; [segmentedmri] = ft_volumesegment(cfg, mri); and segmented the brain surface: cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); With the command ft_read_sens I have also read the sensors positions. Before going on I have checked the results plotting the volume and the sensors using the commands vol = ft_convert_units(vol,'cm'); sens = ft_read_sens(rawdataname); figure ft_plot_sens(sens, 'style', '*b'); hold on ft_plot_vol(vol); and I have noticed that the result is wrong because the volume soesn't fit the sensors as shown in the attachment Moreover, following some topics in the mailing list I have used ft_determine_coordsys(mri) ft_determine_coordsys(vol) ft_determine_coordsys(sens) and I have found that the coordinate systems are diffeerent. As far as I understand I should use the ctf coordinate system to perform the source analysis. But even if I try to specify this coordinate system it did not work. Any suggestion to solve this problem? Kind regards ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3401689815 tel +39 0818675361 fax +39 0818675128 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -------------- next part -------------- A non-text attachment was scrubbed... Name: brain&sensors.png Type: image/png Size: 22007 bytes Desc: not available URL: From a.todorovic at fcdonders.ru.nl Sun Dec 8 22:44:03 2013 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Sun, 8 Dec 2013 22:44:03 +0100 (CET) Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Dear 'trippers, I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. This is how I normally do it: cfg = []; cfg.planarmethod = 'sincos'; cfg.channel = {'MEG'}; cfg.trials = 'all'; cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) data_planar = ft_megplanar(cfg,data); Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? Cheers, Ana From ayobimpe2004 at hotmail.com Sun Dec 8 22:44:42 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 8 Dec 2013 22:44:42 +0100 Subject: [FieldTrip] TOPOPLOTER Message-ID: Dear all, Please I am using the topopotER but I ma getting the below error message: ??? Index exceeds matrix dimensions. Error in ==> ft_plot_topo at 182 mask{i}(end+1,:) = mask{i}(1,:); % force them to be closed Error in ==> topoplot_common at 709 ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ==> ft_topoplotER at 169cfg = topoplot_common(cfg, varargin{:});Please help of what am missing here.Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Dec 9 09:16:11 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 9 Dec 2013 09:16:11 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: Hi Ana, Are you by any chance doing ICA followed by ft_rejectcomponent at some point before ft_megplanar? After rejecting a component, grad.chanpos and grad.chanori will contain only NaNs (as of some months ago indeed), as the channel positions are ill-defined at that point (i.e. each 'data'-channel is in fact a weighted mixture of the original, physical, MEG channels). Since ft_megplanar needs the channel positions, it can no longer operate on data after ft_rejectcomponent. However, there is an easy workaround: the original channel positions should quite nicely approximate the positions after ft_rejectcomponent. So, what I do is simply store the original data.grad somewhere, and then make sure to stick in the data just before ft_megplanar. Note that the reason why ft_rejectcomponent updates the grad is that creating an accurate forward model (for source reconstruction) requires accurate sensor information. Therefore it fills grad.chanpos with NaNs, while updating grad.coilpos etc. to reflect the new projection. So you should *not* use the original grad for source analysis after ft_rejectcomponent, in that case just use the updated one with the NaNs inside. Best, Eelke On 8 December 2013 22:44, Todorovic, A. wrote: > Dear 'trippers, > > I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. > > This is how I normally do it: > > cfg = []; > cfg.planarmethod = 'sincos'; > cfg.channel = {'MEG'}; > cfg.trials = 'all'; > cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) > data_planar = ft_megplanar(cfg,data); > > > Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? > > > Cheers, > Ana > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Dec 9 09:19:04 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 9 Dec 2013 09:19:04 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: PS: Note that a bug is assigned to me to facilitate ft_megplanar after reprojection without artificially restoring the grad (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2332), so this should be fixed at some point. On 9 December 2013 09:16, Eelke Spaak wrote: > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. wrote: >> Dear 'trippers, >> >> I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. >> >> This is how I normally do it: >> >> cfg = []; >> cfg.planarmethod = 'sincos'; >> cfg.channel = {'MEG'}; >> cfg.trials = 'all'; >> cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) >> data_planar = ft_megplanar(cfg,data); >> >> >> Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? >> >> >> Cheers, >> Ana >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Mon Dec 9 10:36:08 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Mon, 9 Dec 2013 11:36:08 +0200 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand Message-ID: Hi, I want to save my multichannel EEG recordings after an experiment to process them offline with fieldtrip. I'm using Python to develop this system so I need some pointers to a Python package to save my data in a format that FT will understand. EDF, GDF can be read by FT but I couldn't find a writer library for those formats for Python. Will plain .mat files work? Thanks. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From jm.horschig at donders.ru.nl Mon Dec 9 11:30:30 2013 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 09 Dec 2013 11:30:30 +0100 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand In-Reply-To: References: Message-ID: <52A59BC6.5060408@donders.ru.nl> Dear Ozan, plain mat-files will do, but you will have to write your own wrapper: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import I don't know any Python toolboxes, so I cannot help with that (and that is because I don't know Python) Best, Jörn Ozan Çağlayan wrote: > Hi, > > I want to save my multichannel EEG recordings after an experiment to > process them offline with fieldtrip. I'm using Python to develop this > system so I need some pointers to a Python package to save my data in > a format that FT will understand. EDF, GDF can be read by FT but I > couldn't find a writer library for those formats for Python. Will > plain .mat files work? > > Thanks. > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 9 11:36:14 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 09 Dec 2013 11:36:14 +0100 Subject: [FieldTrip] TOPOPLOTER In-Reply-To: References: Message-ID: <52A59D1E.1000409@donders.ru.nl> Dear Azeez, at the moment it is hard to know why the error appears, there could be several reasons. Could you please provide some more information on what you are doing? Something along these lines: http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#example_message Best, Jörn Azeez Adebimpe wrote: > Dear all, > > Please I am using the topopotER but I ma getting the below error message: > > /??? Index exceeds matrix dimensions./ > / > / > /Error in ==> ft_plot_topo at 182/ > / mask{i}(end+1,:) = mask{i}(1,:); % force them to > be closed/ > / > / > /Error in ==> topoplot_common at 709/ > /ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,.../ > / > / > /Error in ==> ft_topoplotER at 169/ > /cfg = topoplot_common(cfg, varargin{:});/ > Please help of what am missing here. > Azeez Adebimpe > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 9 11:54:14 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 09 Dec 2013 11:54:14 +0100 Subject: [FieldTrip] fit volume segment and sensors In-Reply-To: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> References: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> Message-ID: <52A5A156.3070408@donders.ru.nl> Dear Sara, the procedure described on the FT-page is tailored towards data gathered from CTF data just because we happen to have a CTF-system here. Since you have itab-data, the coordinate system of your sensors (gradiometers) is not in ctf-space. Some more information on the different coordinate systems can be found here: http://fieldtrip.fcdonders.nl/faq/how_are_the_different_head_and_mri_coordinate_systems_defined?s[]=coordinate&s[]=system#details_of_the_chieti_itab_coordinate_system Your first step needs to be to coregister the gradiometer information with the MRI. Afaik, ft_volumerealign will then also take care of the coordinate system then (or, more precisely, return the appropriate transformation). See also here http://fieldtrip.fcdonders.nl/faq/how_to_coregister_an_anatomical_mri_with_the_gradiometer_or_electrode_positions?s[]=coordinate&s[]=system If I remember correctly, this will not change the coordinate system of the gradiometers, but adjust the transformation matrix of the MRI instead. You do not need to be in CTF-space, you just need to make sure that all your data are in the same coordinate-system. Once you got that, it should work. For example, for EEG source reconstruction you can stay in MNI-space all the time. Dealing with these transformation between coordinate systems is some nasty job, so take care you do it correctly and e.g. not get confused by neurological and radiological convention And note that there is also ft_convert_coordsys for transformation, but I am not sure whether that works for gradiometers, yet. I think this all just works for volumes. I hope this works for you. Best, Jörn s.rombetto at cib.na.cnr.it wrote: > Dear Fieldtrippers > > I 'm trying to perform source analysis on MEG data. > I use an AtB system (usually it is described as 'itab' in fieldtrip) > > First I have preprocessed my data and I have calculated the cross > spectral density matrix > > Then I have constructed the forward model > > mri = ft_read_mri('Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > [segmentedmri] = ft_volumesegment(cfg, mri); > > and segmented the brain surface: > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > With the command ft_read_sens I have also read the sensors positions. > > Before going on I have checked the results plotting the volume and the > sensors using the commands > vol = ft_convert_units(vol,'cm'); > sens = ft_read_sens(rawdataname); > figure > ft_plot_sens(sens, 'style', '*b'); > hold on > ft_plot_vol(vol); > > and I have noticed that the result is wrong because the volume soesn't > fit the sensors as shown in the attachment > Moreover, following some topics in the mailing list I have used > > ft_determine_coordsys(mri) > ft_determine_coordsys(vol) > ft_determine_coordsys(sens) > > and I have found that the coordinate systems are diffeerent. > > As far as I understand I should use the ctf coordinate system to > perform the source analysis. But even if I try to specify this > coordinate system it did not work. > Any suggestion to solve this problem? > > Kind regards > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From christoph.herrmann at uni-oldenburg.de Mon Dec 9 14:18:55 2013 From: christoph.herrmann at uni-oldenburg.de (Christoph Herrmann) Date: Mon, 09 Dec 2013 14:18:55 +0100 Subject: [FieldTrip] Job offer (PhD student position) Message-ID: <52A5C33F.9080307@uni-oldenburg.de> Dear EEGLAB users, I am offering a position as a PhD student in my lab (see attachment). I would be happy if you could bring this job advertisement to the attention of students who might be suited candidates. The task of the PhD student will be to record EEG while participants receive transcranial alternating current stimulation (tACS). The project aims at investiagting which stimulation protocols are capable of modulating human EEG and perception. The project will be carried out in collaboration with the University Clinic in Hamburg Eppendorf (Andreas Engel) where similar experiments will be conducted in ferrets as well as with Münster University Clinic (Carsten Wolters) where a finite element model of tACS will be used to predict the pattern of current flow inside the brain. Best wishes, Christoph Herrmann -- Prof. Dr. Christoph Herrmann Departement of Psychology European Medical School Carl von Ossietzky University Ammerländer Heerstr. 114-118 26111 Oldenburg, Germany Tel: +49 441 798 4936 Fax: +49 441 798 3865 Office: A7/019 Web: http://www.uni-oldenburg.de/allgemeine-psychologie -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD in EEG-tACS.pdf Type: application/pdf Size: 114350 bytes Desc: not available URL: From a.todorovic at fcdonders.ru.nl Mon Dec 9 14:29:46 2013 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Mon, 9 Dec 2013 14:29:46 +0100 (CET) Subject: [FieldTrip] fieldtrip Digest, Vol 37, Issue 8 In-Reply-To: Message-ID: <1088480008.912147.1386595786285.JavaMail.root@monoceros.zimbra.ru.nl> Hi Eelke, Thanks for your quick reply! ICA is indeed what I normally do (including saving the original gradiometer definitions), but the NaNs appear even if I skip ICA and just preprocess and then do ft_megplanar directly after. However I am now starting to think that these NaNs are a normal consequence of doing a planar gradient transformation and that I was wrong to assume that this is what it causing my problem further down the pipeline. I dug up some old TFRs and saw that their grad.chanori structures also consist of NaNs. My apologies for not checking this previously. And the problem that I have is that the channel labels disappear after ft_freqdescriptives and that the powspctrm field is empty (or if I use a variant of ft_freqdescriptives which is newer than the one I normally use, an error with reshape occurs). The original TFRs prior to ft_freqdescriptives look OK though. But I will dig further to see what could be causing it - in most cases it's something I did. Cheers, Ana > > Message: 3 > Date: Mon, 9 Dec 2013 09:16:11 +0100 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] gradiometer definitions after ft_megplanar > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. > wrote: > > Dear 'trippers, > > > > I am attempting to do a TFR on planar gradient data. I first > > preprocess, then do ft_megplanar, then ft_freqanalysis, followed by > > ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori > > field consists only of NaNs. I see that some changes were made a few > > months ago on how gradiometers are described, so I am wondering > > whether there are some changes I should now make to the cfg > > structure when doing the planar gradient transformation. > > > > This is how I normally do it: > > > > cfg = []; > > cfg.planarmethod = 'sincos'; > > cfg.channel = {'MEG'}; > > cfg.trials = 'all'; > > cfg.neighbours = neighbours; % > > neighbours=ft_prepare_neighbours(cfg,data) > > data_planar = ft_megplanar(cfg,data); > > > > > > Alternatively, is there some workaround I could now implement to fix > > my already calculated TFR structures? > > > > > > Cheers, > > Ana > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 4 > Date: Mon, 9 Dec 2013 09:19:04 +0100 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] gradiometer definitions after ft_megplanar > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > PS: Note that a bug is assigned to me to facilitate ft_megplanar after > reprojection without artificially restoring the grad > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2332), so this should be > fixed at some point. > From a.stolk8 at gmail.com Mon Dec 9 15:48:35 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 9 Dec 2013 15:48:35 +0100 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Inna, Testing ft_regressconfound with some fake data, everything seems to be fine here: timelock = []; timelock.label = {'1' '2'}; timelock.time = 1:5; timelock.dimord = 'rpt_chan_time'; timelock.trial = randn(20,2,5); timelock.avg = randn(2,5); cfg = []; cfg.confound = randn(20,3); cfg.reject = [1:3]; timelock_out = ft_regressconfound(cfg, timelock); Does this example code work for you? I could not detect any mistake in your lines of code. What does your 'timelock' structure look like? Are there any real values in the data? (don't think this is causing it, but please update to newest Ft version just to be sure) Yours, Arjen 2013/12/2 McGowin, Inna > Thank you Arjen, > Actually, I am testing the FieldTrip motion regression on MEG data > specifically collected with a current phantom and known motion. I can treat > the data as ERP data and average over 1 sec trials if needed. > Following your advise on reduction of the regressors number (on 120 trials > of 1 sec long) I was able to avoid the "out of memory" issue. Though I run > into the different set of problems now that I need help to understand: > ______________________________________________ > ??? Error using ==> mxSerialize > Error during serialization of (null) > > Error in ==> ft_postamble_provenance at 91 > cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); > > Error in ==> ft_postamble at 55 > evalin('caller', ['ft_postamble_' cmd]); > > Error in ==> ft_timelockanalysis at 370 > ft_postamble provenance timelock > > Error in ==> ft_regressconfound at 313 > dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging > _________________________________________________________ > > Here is the code I run to regress the head motion: > %% > addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 > ft_defaults > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > cfg.trialdef.triallength=1; > cfg.trialdef.ntrials=120; > cfg.continuous = 'yes'; > cfg = ft_definetrial(cfg); > cfg.channel = {'MEG'}; > cfg.demean = 'yes'; > data = ft_preprocessing(cfg); > > %% > cfg = []; > cfg.keeptrials = 'yes'; > timelock = ft_timelockanalysis(cfg, data); > > %% > cfg = []; > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > cfg.trialdef.triallength=1; > cfg.trialdef.ntrials=120; > cfg.continuous = 'yes'; > cfg = ft_definetrial(cfg); > > %% > cfg.channel = {'HLC0011','HLC0012','HLC0013', ... > 'HLC0021','HLC0022','HLC0023', ... > 'HLC0031','HLC0032','HLC0033'}; > headpos = ft_preprocessing(cfg); > > ntrials = length(headpos.sampleinfo) > for t = 1:ntrials > coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); > mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; > coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); > mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; > coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); > mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; > end > > cc = circumcenter(coil1, coil2, coil3); > cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; > > %% > confound = [cc_dem ... > ones(size(cc_dem,1),1)]; > > %% > cfg = []; > cfg.confound = confound; > cfg.reject = [1:6]; > regr = ft_regressconfound(cfg, timelock); > %% > > _________________________________________________________________ > Sorry for the lengthy letter and thanks for the help! > > Inna > > > > > > On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Hi Inna, >> >> Are you using the same design matrix as on the wiki page? That one covers >> the primary head translations and rotations, but also their >> derivatives. You could try using the primary measures only (3 >> translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant >> regressors). It is also mentionworthy that there should be a balance >> between the number of regressors and the number of observations >> (i.e. trials). I believe on the respective wiki page on head movement >> regression it states that the ratio is recommended to be not larger >> than 1:10 (regressors:trials), accompanied with a reference. Accordingly, >> I'd suggest to use those 7 regressors, and your data (120s resting state) >> split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These >> specifications might hopefully also allow working around your memory issue. >> >> Second, it may be worth mentioning what you would like to do with the >> data post-movement-regression. Namely, the movement compensation will >> remove contributions from head movement to the signal. But this requires >> that signal to behave consistently over trials, which does not seem the >> case with the signal in your resting study? That is, with an ERP study, the >> signal fluctuations appear consistent over trials, with amplitudes being >> modulated by head movement (i.e. sensor-source distance, see our neuroimage >> paper - 2013) in a predictable fashion. So if you're planning on doing >> frequency analysis, or maybe connectivity analysis, after head movement >> compensation, I'd recommend reversing that order. The rule of thumb is to >> use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise >> unexplained variance (over trials) due to head movement, benefitting your >> statistical assessments. >> >> Hope these suggestions may help you with further analyses. I'm >> not familiar with anyone implementing this method to resting state >> analyses, but maybe someone else has some first-hand experience here. >> Furthermore, too late for your current dataset, but for a next one I'd >> recommend using the online head position monitoring/respositioning tool >> that we have developed for CTF systems (a neuromag version is approaching >> the final stage). This tool is routinely used in our lab to monitor >> and reduce head movment throughout recording (after which >> ft_regressconfound is being used to deal with the trial-by-trial crumbles). >> >> Yours, >> Arjen >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Mon Dec 9 17:49:06 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Mon, 9 Dec 2013 11:49:06 -0500 Subject: [FieldTrip] Sample Data Message-ID: Hey guys, I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I was wondering if anyone could point me in the direction of some sample data, preferably in Brainvision format. I was unable to retrieve any from websites such as eegdatabase.kiv. Thank you -Norman -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrolland at ucsd.edu Mon Dec 9 18:31:24 2013 From: mrolland at ucsd.edu (Matthieu Rolland) Date: Mon, 09 Dec 2013 09:31:24 -0800 Subject: [FieldTrip] Filtering before epoching Message-ID: <52A5FE6C.4030002@ucsd.edu> Hi everybody, Is it possible to filter data prior to epoching? And more generally is it possible to epoch data that has already been preprocessed? I have tried without success many variations of this: 1. Preprocessing step on continuous data with filtering. /cfg=[];// //cfg.dataset = 'raw_data.fif';// //cfg.bpfilter = 'yes';// //cfg.bpfreq = [a b];// //data = ft_preprocessing(cfg);/ 2. Define trial. /cfg =// ft_definetrial(cfg);/ 3. Preprocessing step for epoching data on filtered data. /final_data = ft_preprocessing(cfg,data);/ Thank you for your help. Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Dec 9 19:04:20 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 9 Dec 2013 13:04:20 -0500 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Thanks you Your code works fine. Here is the Matlab output for this code: *the input is timelock data with 2 channels and 5 timebinsremoving confound 1 2 3 keeping confound normalizing the confounds, except the constant estimating the regression weights and removing the confounds updating descriptives the input is timelock data with 2 channels and 5 timebinsWarning: the data does not contain a trial definition > In utilities\private\warning_once at 158 In utilities\private\fixsampleinfo at 66 In ft_datatype_raw at 154 In ft_checkdata at 298 In ft_timelockanalysis at 105 In ft_regressconfound at 313Warning: reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuousrecording > In utilities\private\warning_once at 158 In utilities\private\fixsampleinfo at 79 In ft_datatype_raw at 154 In ft_checkdata at 298 In ft_timelockanalysis at 105 In ft_regressconfound at 313averaging trialsaveraging trial 20 of 20the call to "ft_timelockanalysis" took 1 secondsthe call to "ft_regressconfound" took 4 seconds* The data I am trying to correct for the motion is real. It was collected with a current phantom generating the signal by a dipole. The data is continuous but can be broken into trials of 1 sec (the dipole generates 7 Hz sinusoidal signal continuously). The phantom was mechanically moved during the scan for a precisely known amount (e.g. 1 cm down). The data was recorded by CTF 275-sensor MEG unit with the continuous head coils localization. I was able to apply the SSS motion correction algorithm successfully to this data set. If there is a way I could share this data set. Thanks, Inna Inna McGowin On Mon, Dec 9, 2013 at 9:48 AM, Arjen Stolk wrote: > Hi Inna, > > Testing ft_regressconfound with some fake data, everything seems to be > fine here: > > timelock = []; > timelock.label = {'1' '2'}; > timelock.time = 1:5; > timelock.dimord = 'rpt_chan_time'; > timelock.trial = randn(20,2,5); > timelock.avg = randn(2,5); > > cfg = []; > cfg.confound = randn(20,3); > cfg.reject = [1:3]; > timelock_out = ft_regressconfound(cfg, timelock); > > Does this example code work for you? I could not detect any mistake in > your lines of code. What does your 'timelock' structure look like? Are > there any real values in the data? (don't think this is causing it, but > please update to newest Ft version just to be sure) > > Yours, > Arjen > > > 2013/12/2 McGowin, Inna > > Thank you Arjen, >> Actually, I am testing the FieldTrip motion regression on MEG data >> specifically collected with a current phantom and known motion. I can treat >> the data as ERP data and average over 1 sec trials if needed. >> Following your advise on reduction of the regressors number (on 120 >> trials of 1 sec long) I was able to avoid the "out of memory" issue. Though >> I run into the different set of problems now that I need help to understand: >> ______________________________________________ >> ??? Error using ==> mxSerialize >> Error during serialization of (null) >> >> Error in ==> ft_postamble_provenance at 91 >> cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); >> >> Error in ==> ft_postamble at 55 >> evalin('caller', ['ft_postamble_' cmd]); >> >> Error in ==> ft_timelockanalysis at 370 >> ft_postamble provenance timelock >> >> Error in ==> ft_regressconfound at 313 >> dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging >> _________________________________________________________ >> >> Here is the code I run to regress the head motion: >> %% >> addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 >> ft_defaults >> cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; >> cfg.trialdef.triallength=1; >> cfg.trialdef.ntrials=120; >> cfg.continuous = 'yes'; >> cfg = ft_definetrial(cfg); >> cfg.channel = {'MEG'}; >> cfg.demean = 'yes'; >> data = ft_preprocessing(cfg); >> >> %% >> cfg = []; >> cfg.keeptrials = 'yes'; >> timelock = ft_timelockanalysis(cfg, data); >> >> %% >> cfg = []; >> cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; >> cfg.trialdef.triallength=1; >> cfg.trialdef.ntrials=120; >> cfg.continuous = 'yes'; >> cfg = ft_definetrial(cfg); >> >> %% >> cfg.channel = {'HLC0011','HLC0012','HLC0013', ... >> 'HLC0021','HLC0022','HLC0023', ... >> 'HLC0031','HLC0032','HLC0033'}; >> headpos = ft_preprocessing(cfg); >> >> ntrials = length(headpos.sampleinfo) >> for t = 1:ntrials >> coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); >> mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; >> coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); >> mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; >> coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); >> mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; >> end >> >> cc = circumcenter(coil1, coil2, coil3); >> cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; >> >> %% >> confound = [cc_dem ... >> ones(size(cc_dem,1),1)]; >> >> %% >> cfg = []; >> cfg.confound = confound; >> cfg.reject = [1:6]; >> regr = ft_regressconfound(cfg, timelock); >> %% >> >> _________________________________________________________________ >> Sorry for the lengthy letter and thanks for the help! >> >> Inna >> >> >> >> >> >> On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Hi Inna, >>> >>> Are you using the same design matrix as on the wiki page? That one >>> covers the primary head translations and rotations, but also their >>> derivatives. You could try using the primary measures only (3 >>> translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant >>> regressors). It is also mentionworthy that there should be a balance >>> between the number of regressors and the number of observations >>> (i.e. trials). I believe on the respective wiki page on head movement >>> regression it states that the ratio is recommended to be not larger >>> than 1:10 (regressors:trials), accompanied with a reference. Accordingly, >>> I'd suggest to use those 7 regressors, and your data (120s resting state) >>> split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These >>> specifications might hopefully also allow working around your memory issue. >>> >>> Second, it may be worth mentioning what you would like to do with the >>> data post-movement-regression. Namely, the movement compensation will >>> remove contributions from head movement to the signal. But this requires >>> that signal to behave consistently over trials, which does not seem the >>> case with the signal in your resting study? That is, with an ERP study, the >>> signal fluctuations appear consistent over trials, with amplitudes being >>> modulated by head movement (i.e. sensor-source distance, see our neuroimage >>> paper - 2013) in a predictable fashion. So if you're planning on doing >>> frequency analysis, or maybe connectivity analysis, after head movement >>> compensation, I'd recommend reversing that order. The rule of thumb is to >>> use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise >>> unexplained variance (over trials) due to head movement, benefitting your >>> statistical assessments. >>> >>> Hope these suggestions may help you with further analyses. I'm >>> not familiar with anyone implementing this method to resting state >>> analyses, but maybe someone else has some first-hand experience here. >>> Furthermore, too late for your current dataset, but for a next one I'd >>> recommend using the online head position monitoring/respositioning tool >>> that we have developed for CTF systems (a neuromag version is approaching >>> the final stage). This tool is routinely used in our lab to monitor >>> and reduce head movment throughout recording (after which >>> ft_regressconfound is being used to deal with the trial-by-trial crumbles). >>> >>> Yours, >>> Arjen >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Dec 9 19:59:36 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 9 Dec 2013 13:59:36 -0500 Subject: [FieldTrip] ft_senstype Message-ID: There seems to be a bug in ft_senstype. Even if my data.label has names without spaces, it always returns 'neuromag306', instead of 'neuromag306alt'. Because of that line 103 and 104 in ft_combineplanar returns empty matrices. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Dec 9 20:09:37 2013 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Mon, 9 Dec 2013 20:09:37 +0100 (CET) Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: Message-ID: <729996541.4260388.1386616177029.JavaMail.root@sculptor.zimbra.ru.nl> Dear Inna, The output you get is as one would expect. Could you try and spot any principal differences between the timelock structure you have and the one we just simulated? Alternatively, could you send me a reduced/exchangeable timelock structure with say, about 3 trials, for me to replicate your error (<15mb?, by direct email to a.stolk8 at gmail.com)? Yours Arjen ----- Oorspronkelijk bericht ----- > Van: "Inna McGowin" > Aan: "FieldTrip discussion list" > Verzonden: Maandag 9 december 2013 19:04:20 > Onderwerp: Re: [FieldTrip] Fwd: head motion regression with > ft_regressconfound on a continuous MEG data > Thanks you > Your code works fine. Here is the Matlab output for this code: > the input is timelock data with 2 channels and 5 timebins > removing confound 1 2 3 > keeping confound > normalizing the confounds, except the constant > estimating the regression weights and removing the confounds > updating descriptives > the input is timelock data with 2 channels and 5 timebins > Warning: the data does not contain a trial definition > > In utilities\private\warning_once at 158 > In utilities\private\fixsampleinfo at 66 > In ft_datatype_raw at 154 > In ft_checkdata at 298 > In ft_timelockanalysis at 105 > In ft_regressconfound at 313 > Warning: reconstructing sampleinfo by assuming that the trials are > consecutive segments of a continuous > recording > > In utilities\private\warning_once at 158 > In utilities\private\fixsampleinfo at 79 > In ft_datatype_raw at 154 > In ft_checkdata at 298 > In ft_timelockanalysis at 105 > In ft_regressconfound at 313 > averaging trials > averaging trial 20 of 20 > the call to "ft_timelockanalysis" took 1 seconds > the call to "ft_regressconfound" took 4 seconds > The data I am trying to correct for the motion is real. It was > collected with a current phantom generating the signal by a dipole. > The data is continuous but can be broken into trials of 1 sec (the > dipole generates 7 Hz sinusoidal signal continuously). The phantom was > mechanically moved during the scan for a precisely known amount (e.g. > 1 cm down). The data was recorded by CTF 275-sensor MEG unit with the > continuous head coils localization. I was able to apply the SSS motion > correction algorithm successfully to this data set. If there is a way > I could share this data set. > Thanks, > Inna > Inna McGowin > On Mon, Dec 9, 2013 at 9:48 AM, Arjen Stolk < a.stolk8 at gmail.com > > wrote: > > Hi Inna, > > Testing ft_regressconfound with some fake data, everything seems to > > be > > fine here: > > timelock = []; > > timelock.label = {'1' '2'}; > > timelock.time = 1:5; > > timelock.dimord = 'rpt_chan_time'; > > timelock.trial = randn(20,2,5); > > timelock.avg = randn(2,5); > > cfg = []; > > cfg.confound = randn(20,3); > > cfg.reject = [1:3]; > > timelock_out = ft_regressconfound(cfg, timelock); > > Does this example code work for you? I could not detect any mistake > > in > > your lines of code. What does your 'timelock' structure look like? > > Are > > there any real values in the data? (don't think this is causing it, > > but please update to newest Ft version just to be sure) > > Yours, > > Arjen > > 2013/12/2 McGowin, Inna < mcgoiv0 at wfu.edu > > > > Thank you Arjen, > > > Actually, I am testing the FieldTrip motion regression on MEG data > > > specifically collected with a current phantom and known motion. I > > > can > > > treat the data as ERP data and average over 1 sec trials if > > > needed. > > > Following your advise on reduction of the regressors number (on > > > 120 > > > trials of 1 sec long) I was able to avoid the "out of memory" > > > issue. > > > Though I run into the different set of problems now that I need > > > help > > > to understand: > > > ______________________________________________ > > > ??? Error using ==> mxSerialize > > > Error during serialization of (null) > > > Error in ==> ft_postamble_provenance at 91 > > > cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); > > > Error in ==> ft_postamble at 55 > > > evalin('caller', ['ft_postamble_' cmd]); > > > Error in ==> ft_timelockanalysis at 370 > > > ft_postamble provenance timelock > > > Error in ==> ft_regressconfound at 313 > > > dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging > > > _________________________________________________________ > > > Here is the code I run to regress the head motion: > > > %% > > > addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 > > > ft_defaults > > > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > > > cfg.trialdef.triallength=1; > > > cfg.trialdef.ntrials=120; > > > cfg.continuous = 'yes'; > > > cfg = ft_definetrial(cfg); > > > cfg.channel = {'MEG'}; > > > cfg.demean = 'yes'; > > > data = ft_preprocessing(cfg); > > > %% > > > cfg = []; > > > cfg.keeptrials = 'yes'; > > > timelock = ft_timelockanalysis(cfg, data); > > > %% > > > cfg = []; > > > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > > > cfg.trialdef.triallength=1; > > > cfg.trialdef.ntrials=120; > > > cfg.continuous = 'yes'; > > > cfg = ft_definetrial(cfg); > > > %% > > > cfg.channel = {'HLC0011','HLC0012','HLC0013', ... > > > 'HLC0021','HLC0022','HLC0023', ... > > > 'HLC0031','HLC0032','HLC0033'}; > > > headpos = ft_preprocessing(cfg); > > > ntrials = length(headpos.sampleinfo) > > > for t = 1:ntrials > > > coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); > > > mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; > > > coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); > > > mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; > > > coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); > > > mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; > > > end > > > cc = circumcenter(coil1, coil2, coil3); > > > cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; > > > %% > > > confound = [cc_dem ... > > > ones(size(cc_dem,1),1)]; > > > %% > > > cfg = []; > > > cfg.confound = confound; > > > cfg.reject = [1:6]; > > > regr = ft_regressconfound(cfg, timelock); > > > %% > > > _________________________________________________________________ > > > Sorry for the lengthy letter and thanks for the help! > > > Inna > > > On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < > > > a.stolk at fcdonders.ru.nl > wrote: > > > > Hi Inna, > > > > Are you using the same design matrix as on the wiki page? That > > > > one > > > > covers the primary head translations and rotations, but also > > > > their > > > > derivatives. You could try using the primary measures only (3 > > > > translastions, and 3 rotations of the circumcenter, totaling 6 + > > > > 1 > > > > constant regressors). It is also mentionworthy that there should > > > > be > > > > a > > > > balance between the number of regressors and the number of > > > > observations (i.e. trials). I believe on the respective wiki > > > > page > > > > on > > > > head movement regression it states that the ratio is recommended > > > > to > > > > be > > > > not larger than 1:10 (regressors:trials), accompanied with a > > > > reference. Accordingly, I'd suggest to use those 7 regressors, > > > > and > > > > your data (120s resting state) split in segments of 1 or 2 > > > > seconds, > > > > totaling 60 or 120 trials. These specifications might hopefully > > > > also > > > > allow working around your memory issue. > > > > Second, it may be worth mentioning what you would like to do > > > > with > > > > the > > > > data post-movement-regression. Namely, the movement compensation > > > > will > > > > remove contributions from head movement to the signal. But this > > > > requires that signal to behave consistently over trials, which > > > > does > > > > not seem the case with the signal in your resting study? That > > > > is, > > > > with > > > > an ERP study, the signal fluctuations appear consistent over > > > > trials, > > > > with amplitudes being modulated by head movement (i.e. > > > > sensor-source > > > > distance, see our neuroimage paper - 2013) in a predictable > > > > fashion. > > > > So if you're planning on doing frequency analysis, or maybe > > > > connectivity analysis, after head movement compensation, I'd > > > > recommend > > > > reversing that order. The rule of thumb is to use > > > > ft_regressconfound > > > > just prior to ft_xxxstatistics, removing otherwise unexplained > > > > variance (over trials) due to head movement, benefitting your > > > > statistical assessments. > > > > Hope these suggestions may help you with further analyses. I'm > > > > not > > > > familiar with anyone implementing this method to resting state > > > > analyses, but maybe someone else has some first-hand experience > > > > here. > > > > Furthermore, too late for your current dataset, but for a next > > > > one > > > > I'd > > > > recommend using the online head position > > > > monitoring/respositioning > > > > tool that we have developed for CTF systems (a neuromag version > > > > is > > > > approaching the final stage). This tool is routinely used in our > > > > lab > > > > to monitor and reduce head movment throughout recording (after > > > > which > > > > ft_regressconfound is being used to deal with the trial-by-trial > > > > crumbles). > > > > Yours, > > > > Arjen > > > > _______________________________________________ > > > > fieldtrip mailing list > > > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From faranak.farzan at gmail.com Mon Dec 9 20:45:51 2013 From: faranak.farzan at gmail.com (Faranak Farzan) Date: Mon, 9 Dec 2013 14:45:51 -0500 Subject: [FieldTrip] 3D Cluster Based Correction Message-ID: Dear Fieldtripers, In response to message 1 bellow, We have a new question: We are correcting for multiple comparisons using cluster-based algorithms suggested by Maris and Oostenveld. Can we retrieve the cluster "LABELS" from the 3D matrix of ChanXTimXFreq (shuffled for subjects). For instance as an output of this Fieldtrip function statcondfieldtrip.m Thank you! Faranak Message: 1 Date: Fri, 29 Nov 2013 15:14:26 +0400 From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Question regarding cluster-based permutation test Message-ID: Content-Type: text/plain; charset="utf-8" Hello Faranak, If you're doing a within-subjects design, then testing channels*time*freq on grand average data should be possible; see http://fieldtrip .fcdonders.nl/tutorial/cluster_permutation_freq#within_subjects_experiments . Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Dec 10 08:57:34 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 10 Dec 2013 08:57:34 +0100 Subject: [FieldTrip] Filtering before epoching In-Reply-To: <52A5FE6C.4030002@ucsd.edu> References: <52A5FE6C.4030002@ucsd.edu> Message-ID: <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> Hi Matt, Yes, it's possible. The only thing you should change in your approach is step 3: use ft_redefinetrial, rather than ft_preprocessing So: 1. Preprocessing step on continuous data with filtering. cfg=[]; cfg.dataset = 'raw_data.fif'; cfg.bpfilter = 'yes'; cfg.bpfreq = [a b]; data = ft_preprocessing(cfg); 2. Define trial. cfg = []; cfg.dataset = 'blabla'; cfg.trialdef.xxx etc some settings here. cfg = ft_definetrial(cfg); trl = cfg.trl; 3. Preprocessing step for epoching data on filtered data. cfg = []; cfg.trl = trl; final_data = ft_redefinetrial(cfg,data); Best, JM On Dec 9, 2013, at 6:31 PM, Matthieu Rolland wrote: > Hi everybody, > > Is it possible to filter data prior to epoching? And more generally is it possible to epoch data that has already been preprocessed? > > I have tried without success many variations of this: > > 1. Preprocessing step on continuous data with filtering. > cfg=[]; > cfg.dataset = 'raw_data.fif'; > cfg.bpfilter = 'yes'; > cfg.bpfreq = [a b]; > data = ft_preprocessing(cfg); > > 2. Define trial. > cfg = ft_definetrial(cfg); > > 3. Preprocessing step for epoching data on filtered data. > final_data = ft_preprocessing(cfg,data); > > > Thank you for your help. > Matt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 10:09:11 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 11:09:11 +0200 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand In-Reply-To: <52A59BC6.5060408@donders.ru.nl> References: <52A59BC6.5060408@donders.ru.nl> Message-ID: On Mon, Dec 9, 2013 at 12:30 PM, "Jörn M. Horschig" wrote: > Dear Ozan, > > plain mat-files will do, but you will have to write your own wrapper: > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import > > I don't know any Python toolboxes, so I cannot help with that (and that is > because I don't know Python) Hi, I think I managed out doing this but there are some points I like to discuss. My EEG stream is made of 14 channels. Sampling rate is 128. I don't have separate trials but a single continuous recording. So if I understand correctly I have to create the data structure like this: data.fsample = 128 data.labels = cell array of channel labels data.trial = {[14xNsamples]} (Single element cell array containing the whole EEG data) data.sampleinfo = [1 Nsamples] data.time = {linspace(0, Nsamples/fsample, Nsamples)} ?? What should the data.time be? Is it the whole recording duration divided by Nsamples? Thanks. From jean-baptiste.versini at etu.univ-lyon1.fr Tue Dec 10 11:43:06 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Tue, 10 Dec 2013 10:43:06 +0000 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl>, Message-ID: <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Hello, data.trial is a <1 x NTrial cell> and each cell in it is a data.time is a <1 x NTrial cell> and each cell in it is a <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial sampled at 5Hz. ________________________________________ De : fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] de la part de Ozan Çağlayan [ozancag at gmail.com] Date d'envoi : mardi 10 décembre 2013 10:09 À : FieldTrip discussion list Objet : Re: [FieldTrip] Best way of saving data in format that fieldtrip will understand On Mon, Dec 9, 2013 at 12:30 PM, "Jörn M. Horschig" wrote: > Dear Ozan, > > plain mat-files will do, but you will have to write your own wrapper: > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import > > I don't know any Python toolboxes, so I cannot help with that (and that is > because I don't know Python) Hi, I think I managed out doing this but there are some points I like to discuss. My EEG stream is made of 14 channels. Sampling rate is 128. I don't have separate trials but a single continuous recording. So if I understand correctly I have to create the data structure like this: data.fsample = 128 data.labels = cell array of channel labels data.trial = {[14xNsamples]} (Single element cell array containing the whole EEG data) data.sampleinfo = [1 Nsamples] data.time = {linspace(0, Nsamples/fsample, Nsamples)} ?? What should the data.time be? Is it the whole recording duration divided by Nsamples? Thanks. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Tue Dec 10 13:48:37 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 14:48:37 +0200 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: On Tue, Dec 10, 2013 at 12:43 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Hello, > > data.trial is a <1 x NTrial cell> and each cell in it is a > data.time is a <1 x NTrial cell> and each cell in it is a <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial sampled at 5Hz. 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? Am I wrong? -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From r.oostenveld at donders.ru.nl Tue Dec 10 14:23:39 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:23:39 +0100 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: <5439AD52-5050-4B5D-87D8-CDCD15F98799@donders.ru.nl> Hi Ozan On 10 Dec 2013, at 13:48, Ozan Çağlayan wrote: > > 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? > Am I wrong? No, at 5 Hz sampling frequency the distance between subsequent samples is 1/5 Hz = 0.2 seconds. So depending on whether you include the edges of the time interval or not, a time interval from 0 to 1 could be represented as 0.0 0.2 0.4. 0.6 0.8 1.0 % including both edges 0.2 0.4. 0.6 0.8 1.0 % including only the rightmost edge 0.0 0.2 0.4. 0.6 0.8 % including only the leftmost edge 0.2 0.4. 0.6 0.8 % not including the edges of the interval In the case of a continuous recording of Nsamples at Fsample I would consider the best representation data.trial{1} = randn(Nchans, Nsamples); data.time{1} = ((1:nSamples)-1)/Fsample; % the first sample is at time=0, the last sample is at (nSamples-1)/Fsample data.label = arrayfun(@num2str, 1:Nchans, 'UniformOutput', false) See also http://fieldtrip.fcdonders.nl/faq/how_can_i_process_continuous_data_without_triggers, http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat and http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_one_dataformat_into_an_other You might want to check out http://martinos.org/mne/mne-python.html and http://code.google.com/p/pyeeg/ for python code related to EEG data. best regards, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Tue Dec 10 14:26:27 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:26:27 +0100 Subject: [FieldTrip] ft_senstype In-Reply-To: References: Message-ID: Hi Raghavan thanks for reporting. I have added it to our bug tracker on http://bugzilla.fcdonders.nl/show_bug.cgi?id=2418. If you want, you can register on bugzilla with your email and automatically get informed when the bug gets resolved. See also http://fieldtrip.fcdonders.nl/bugzilla best regards Robert On 9 Dec 2013, at 19:59, Raghavan Gopalakrishnan wrote: > There seems to be a bug in ft_senstype. > Even if my data.label has names without spaces, it always returns 'neuromag306', instead of 'neuromag306alt'. Because of that line 103 and 104 in ft_combineplanar returns empty matrices. > > Thanks, > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Tue Dec 10 14:32:37 2013 From: stan.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Tue, 10 Dec 2013 14:32:37 +0100 (CET) Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: <04c601cef5ac$4a4c2f90$dee48eb0$@vanpelt@fcdonders.ru.nl> Yes, you are wrong. [ 0. , 0.25, 0.5 , 0.75, 1. ] would mean 4 Hz sampling (steps of 0.25 => 1/0.25=4) 5Hz sampling implies time steps of 0.2s (=1/5) Best, Stan Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen tel: 024-3616288 -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ozan Çaglayan Sent: dinsdag 10 december 2013 13:49 To: FieldTrip discussion list Subject: Re: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand On Tue, Dec 10, 2013 at 12:43 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Hello, > > data.trial is a <1 x NTrial cell> and each cell in it is a NSample double> data.time is a <1 x NTrial cell> and each cell in it is a > <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial > sampled at 5Hz. 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? Am I wrong? -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Tue Dec 10 14:35:54 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:35:54 +0100 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Hi Norman Welcome in the FieldTrip community. A lot of the FieldTrip tutorials are based on example data and my colleague Nietssche is just working on collecting a list of tutorial data sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you can find a (temporary) excel sheet listing all datasets. The plan is to move that to a FAQ, i.e. "which example dataset is used in which tutorial?" For example the http://fieldtrip.fcdonders.nl/tutorial/continuous tutorial is based on an example BrainVision EEG dataset. Also http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. best regards, Robert On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: > Hey guys, > I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I was wondering if anyone could point me in the direction of some sample data, preferably in Brainvision format. I was unable to retrieve any from websites such as eegdatabase.kiv. Thank you > -Norman > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 15:33:19 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 16:33:19 +0200 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: <52a71808.c846cd0a.157e.ffff8a29SMTPIN_ADDED_BROKEN@mx.google.com> References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> <52a71808.c846cd0a.157e.ffff8a29SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: On Tue, Dec 10, 2013 at 3:32 PM, Stan van Pelt wrote: > Yes, you are wrong. > > [ 0. , 0.25, 0.5 , 0.75, 1. ] would mean 4 Hz sampling (steps of 0.25 > => 1/0.25=4) > > 5Hz sampling implies time steps of 0.2s (=1/5) Thank you for the clear explanations and the pointers Robert and Stan! -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From t.schneider at uke.uni-hamburg.de Tue Dec 10 15:39:55 2013 From: t.schneider at uke.uni-hamburg.de (Till Schneider) Date: Tue, 10 Dec 2013 15:39:55 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <52A727BB.50603@uke.uni-hamburg.de> Hi Eelke, just to get this issue straight. The correct way for creating an accurate forward model for MEG data after ICA artifact correction is to use the grad structure given by ft_rejectcomponent, right? And the corrected grad stucture is only provided when the third input argument (i.e. the original data) is passed to ft_rejectcomponent? (e.g. data_clean = ft_rejectcomponent(cfg, comp, data_original), where comp is the result of ft_componentanalysis). Or is it sufficient to pass two input arguments (cfg and comp) to ft_rejectcomponent? Best, Till -- Till Schneider, PhD Cognitive and Clinical Neurophysiology Group Dept. of Neurophysiology and Pathophysiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg Germany phone +49-40-7410-53188 fax +49-40-7410-57126 www.uke.de/neurophysiologie Am 09.12.13 09:16, schrieb Eelke Spaak: > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. wrote: >> Dear 'trippers, >> >> I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. >> >> This is how I normally do it: >> >> cfg = []; >> cfg.planarmethod = 'sincos'; >> cfg.channel = {'MEG'}; >> cfg.trials = 'all'; >> cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) >> data_planar = ft_megplanar(cfg,data); >> >> >> Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? >> >> >> Cheers, >> Ana >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From normanbenbrahim at gmail.com Tue Dec 10 15:42:40 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 09:42:40 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Thank you Robert, this is very helpful On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Norman > > Welcome in the FieldTrip community. > > A lot of the FieldTrip tutorials are based on example data and my > colleague Nietssche is just working on collecting a list of tutorial data > sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you can > find a (temporary) excel sheet listing all datasets. The plan is to move > that to a FAQ, i.e. "which example dataset is used in which tutorial?" > > For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also > http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. > > best regards, > Robert > > > On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: > > Hey guys, > I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I > was wondering if anyone could point me in the direction of some sample > data, preferably in Brainvision format. I was unable to retrieve any from > websites such as eegdatabase.kiv. Thank you > -Norman > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrolland at ucsd.edu Tue Dec 10 16:01:38 2013 From: mrolland at ucsd.edu (Matthieu Rolland) Date: Tue, 10 Dec 2013 07:01:38 -0800 Subject: [FieldTrip] Filtering before epoching In-Reply-To: <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> References: <52A5FE6C.4030002@ucsd.edu> <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> Message-ID: <52A72CD2.3080802@ucsd.edu> Thank you! On 12/09/13 23:57, jan-mathijs schoffelen wrote: > Hi Matt, > > Yes, it's possible. The only thing you should change in your approach > is step 3: use ft_redefinetrial, rather than ft_preprocessing > > So: > > 1. Preprocessing step on continuous data with filtering. > /cfg=[];// > //cfg.dataset = 'raw_data.fif';// > //cfg.bpfilter = 'yes';// > //cfg.bpfreq = [a b];// > //data = ft_preprocessing(cfg);/ > > 2. Define trial. > / > / > /cfg = [];/ > /cfg.dataset = 'blabla';/ > /cfg.trialdef.xxx etc some settings here./ > /cfg =//ft_definetrial(cfg);/ > trl = cfg.trl; > > 3. Preprocessing step for epoching data on filtered data. > / > / > /cfg = [];/ > /cfg.trl = trl;/ > /final_data = ft_redefinetrial(cfg,data);/ > > > Best, > JM > > On Dec 9, 2013, at 6:31 PM, Matthieu Rolland wrote: > >> Hi everybody, >> >> Is it possible to filter data prior to epoching? And more generally >> is it possible to epoch data that has already been preprocessed? >> >> I have tried without success many variations of this: >> >> 1. Preprocessing step on continuous data with filtering. >> /cfg=[];// >> //cfg.dataset = 'raw_data.fif';// >> //cfg.bpfilter = 'yes';// >> //cfg.bpfreq = [a b];// >> //data = ft_preprocessing(cfg);/ >> >> 2. Define trial. >> /cfg =// ft_definetrial(cfg);/ >> >> 3. Preprocessing step for epoching data on filtered data. >> /final_data = ft_preprocessing(cfg,data);/ >> >> >> Thank you for your help. >> Matt >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Tue Dec 10 16:08:01 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 10:08:01 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Robert: I'm trying to download the files but it always gets interrupted for some reason. I've tried it 6 times now on 2 different internet connections On Tue, Dec 10, 2013 at 9:42 AM, Norman Benbrahim wrote: > Thank you Robert, this is very helpful > > > On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Norman >> >> Welcome in the FieldTrip community. >> >> A lot of the FieldTrip tutorials are based on example data and my >> colleague Nietssche is just working on collecting a list of tutorial data >> sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you >> can find a (temporary) excel sheet listing all datasets. The plan is to >> move that to a FAQ, i.e. "which example dataset is used in which tutorial?" >> >> For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also >> http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. >> >> best regards, >> Robert >> >> >> On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: >> >> Hey guys, >> I'm a new Grad Student, going to be using Fieldtrip a lot in the future. >> I was wondering if anyone could point me in the direction of some sample >> data, preferably in Brainvision format. I was unable to retrieve any from >> websites such as eegdatabase.kiv. Thank you >> -Norman >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Tue Dec 10 16:11:49 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 10:11:49 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Nevermind it's working now On Tue, Dec 10, 2013 at 10:08 AM, Norman Benbrahim < normanbenbrahim at gmail.com> wrote: > Robert: I'm trying to download the files but it always gets interrupted > for some reason. I've tried it 6 times now on 2 different internet > connections > > > On Tue, Dec 10, 2013 at 9:42 AM, Norman Benbrahim < > normanbenbrahim at gmail.com> wrote: > >> Thank you Robert, this is very helpful >> >> >> On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < >> r.oostenveld at donders.ru.nl> wrote: >> >>> Hi Norman >>> >>> Welcome in the FieldTrip community. >>> >>> A lot of the FieldTrip tutorials are based on example data and my >>> colleague Nietssche is just working on collecting a list of tutorial data >>> sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you >>> can find a (temporary) excel sheet listing all datasets. The plan is to >>> move that to a FAQ, i.e. "which example dataset is used in which tutorial?" >>> >>> For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also >>> http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. >>> >>> best regards, >>> Robert >>> >>> >>> On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: >>> >>> Hey guys, >>> I'm a new Grad Student, going to be using Fieldtrip a lot in the future. >>> I was wondering if anyone could point me in the direction of some sample >>> data, preferably in Brainvision format. I was unable to retrieve any from >>> websites such as eegdatabase.kiv. Thank you >>> -Norman >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 17:40:49 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 18:40:49 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis Message-ID: Hi, I was struggling with the problem below for an hour and digging through the code I found out that I was setting cfg.fsample = 128 instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad which was causing a type mismatch in the below line. I think either in the docs it should be told that the fsample needs to be a double or FT should cast it to double transparently. Or can this be caused by Matlab 2013a as told by the warnings :) >> [freqs] = ft_freqanalysis(cfg, data) Warning: You are using MATLAB 2013a. FieldTrip is currently not supported on 2013a (8.1) or newer. Using your current MATLAB version can lead to unexpected behaviour, which might not be easily noticable. Continuing is not advised. > In ft_defaults at 64 In ft_freqanalysis at 191 the input is raw data with 14 channels and 1 trials Error using .* Integers can only be combined with integers of the same class, or scalar doubles. Error in ft_freqanalysis (line 423) fboi = round(cfg.foi .* cfg.pad) + 1; ********* Here cfg.pad is an int32 with 10 in it and cfg.foi = []. >> [] .* double(10) ans = [] >> [] .* int32(10) Error using .* Integers can only be combined with integers of the same class, or scalar doubles. and pad is set as: padding = max(trllength); cfg.pad = padding/data.fsample; // trllength == 1280, fsample == 128 in my case. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From ozancag at gmail.com Tue Dec 10 17:41:35 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 18:41:35 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: On Tue, Dec 10, 2013 at 6:40 PM, Ozan Çağlayan wrote: > Hi, > > I was struggling with the problem below for an hour and digging > through the code I found out that I was setting cfg.fsample = 128 > instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad > which was causing a type mismatch in the below line. not cfg.fsample of course, data.fsample.. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From nheugel89 at gmail.com Tue Dec 10 18:23:55 2013 From: nheugel89 at gmail.com (Nicholas Heugel) Date: Tue, 10 Dec 2013 11:23:55 -0600 Subject: [FieldTrip] Error after MNE Message-ID: I a trying to go through the tutorial for the - Source reconstruction of event-related fields using minimum-norm estimate I am able to run everything up to the MNE with no problem, and it seems like the MNE portion works. But when I run the command bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); and then plot it to visualize the source space. I get the error Reference to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; I have looked on this site and online and can't find an explanation of what is wrong or how to fix the problem. Any help would be appreciated. I am using an Anatomical MRI scan for the head model analysis, the skull is present and I manually am Identifying the fiducials. Also, a few steps earlier it had me check the white matter segmentation done by Freesurfer and that worked fine and what I get closely resembles the tutorial. So I think the problem is somewhere in the MNE I am just not sure where. Any help would be appreciated. Thank you for your time. Nicholas -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Dec 11 09:04:35 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 11 Dec 2013 09:04:35 +0100 Subject: [FieldTrip] Error after MNE In-Reply-To: References: Message-ID: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> Hi Nicholas, It seems that the fif files lacks some information that FieldTrip assumes to be present. I would say that this can only be caused by the fact that the version of mne_make_source_space you used does not write the triangle area information into the fif file. Could you go to bugzilla.fcdonders.nl, create yourself an account, and file the issue as a bug? Please then also upload the fif-file you mentioned. I'll have a look at it and make the ft_read_headshape function more robust. In the mean time you could comment out line 421. Best, Jan-Mathijs On Dec 10, 2013, at 6:23 PM, Nicholas Heugel wrote: > I a trying to go through the tutorial for the > Source reconstruction of event-related fields using minimum-norm estimate > > I am able to run everything up to the MNE with no problem, and it seems like the MNE portion works. But when I run the command bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > and then plot it to visualize the source space. I get the error Reference to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; > I have looked on this site and online and can't find an explanation of what is wrong or how to fix the problem. Any help would be appreciated. I am using an Anatomical MRI scan for the head model analysis, the skull is present and I manually am Identifying the fiducials. Also, a few steps earlier it had me check the white matter segmentation done by Freesurfer and that worked fine and what I get closely resembles the tutorial. So I think the problem is somewhere in the MNE I am just not sure where. Any help would be appreciated. Thank you for your time. > Nicholas > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Dec 11 10:41:17 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 11 Dec 2013 10:41:17 +0100 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: Hi Ozan, It is unclear to me why cfg.pad would be an integer, see what happens when I execute the following (in either Matlab 2012a or 2013a): >> class(32) ans = double Maybe you have some Matlab setting enabled causing it to store numbers that appear to be integer as an int32? On a sidenote, please note that, as the warning indicates, not all changes with 2013a are expected to result in errors, they might actually just lead to unexpected (i.e. wrong) results, without you necessarily noticing. Therefore, it would really be better to stick to an older version until the code has been properly updated. We are working on making fieldtrip work with 2013a, you can see the progress here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2095 Best, Eelke On 10 December 2013 17:41, Ozan Çağlayan wrote: > On Tue, Dec 10, 2013 at 6:40 PM, Ozan Çağlayan wrote: >> Hi, >> >> I was struggling with the problem below for an hour and digging >> through the code I found out that I was setting cfg.fsample = 128 >> instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad >> which was causing a type mismatch in the below line. > > not cfg.fsample of course, data.fsample.. > > > -- > Ozan Çağlayan > Research Assistant > Galatasaray University - Computer Engineering Dept. > http://www.ozancaglayan.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Wed Dec 11 11:11:58 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Wed, 11 Dec 2013 12:11:58 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: On Wed, Dec 11, 2013 at 11:41 AM, Eelke Spaak wrote: > Hi Ozan, > > It is unclear to me why cfg.pad would be an integer, see what happens > when I execute the following (in either Matlab 2012a or 2013a): > >>> class(32) > ans = > double This is double on my system too but since I save the .mat file from Python, I was setting fsample to 128 which was exported by Python as int, which I think can be expected. Setting it to 128.0 fixes the problem but maybe this can be ensured in FieldTrip code pathway by casting the fsample to double. Anyways not a big deal until I found the cause behind this :) -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From daniele.marinazzo at ugent.be Wed Dec 11 13:09:03 2013 From: daniele.marinazzo at ugent.be (Daniele Marinazzo) Date: Wed, 11 Dec 2013 13:09:03 +0100 Subject: [FieldTrip] Course: Practical data analysis and modeling in cognitive and clinical neuroscience, April 14-18, Gent, Beligum Message-ID: Hi all The Multidisciplinary Research Partnership in Neuroscience, part of the Institute for Neuroscience at Ghent University, with the support of the INCF program for Teaching and Training , is organizing an international 5-day training course, focusing on *data analysis in cognitive and clinical neuroscience*. The participants will be able to design and implement pipelines for effective and reproducible experiments. The course will be held at the Faculty of Psychology and Pedagogical Sciences of the university of Ghent, from april 14 to April 18, 2014. There will be two theoretical talks in the morning, describing the state fo the art of specific steps of neuroimaging based reseach, and application-oriented short lectures followed by hands on sessions in the afternoon; some of them parallel for the focus on EEG or fMRI. Target audience The course is open to PhD students and young postdoctoral researchers who use neuroimaging data for their experiments in psychology and clinical neuroscience. Ideally the candidates are in the stage of having already acquired part of their dataset, or they are about to design their own experiment. Applicants are encouraged to present their dataset in the application (format, subjects, conditions,etc), and to bring a sample of it to the School, where they will have the chance to analyze it under the guidance of the lecturers. More info and registration on the school website http://www.da.ugent.be/school2014 -- Daniele Marinazzo -- Department of Data Analysis Faculty of Psychology and Pedagogical Sciences, Gent University Henri Dunantlaan 1, B-9000 Gent, Belgium +32 (0) 9 264 6375 http://users.ugent.be/~dmarinaz/ * * *School: Data analysis in experimental and clinical neuroscience, Gent, April 14-18 2014* *Frontiers Research Topic: Information based methods for neuroimaging data analysis * http://helpdesk.ugent.be/e-maildisclaimer.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Wed Dec 11 18:35:59 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 11 Dec 2013 12:35:59 -0500 Subject: [FieldTrip] frequency analysis Message-ID: I have a few questions regarding frequency analysis using wavelets. 1. Is it possible to z-score the TF spectrograms? Is so how and where should I specify the baseline? 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make sure all sensors from multi subject are matched. However, why is this not performed before grand averaging time-frequency data since the powspctrm is specific to each channel? 3. Is combineplanar a necessary step before any grand averaging i.e. ERF or TFR? I am using neuromag data, so can I perform grand averaging and statistics without combineplanar? 4. Fieldtrip only reads neuromag FIF files that has been processed through maxfilter. There are times when there is a need not to use maxfilter, is there a work around? Thanks very much. Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfegen at gmail.com Wed Dec 11 19:13:40 2013 From: dfegen at gmail.com (Drew Fegen) Date: Wed, 11 Dec 2013 13:13:40 -0500 Subject: [FieldTrip] ft_freqanalysis() on entire continuous data followed by ft_redefinetrial() error - incorrect data format? Message-ID: Hello, Trying to do time-frequency analysis on some intracranial EEG data and I would like to apply the time-frequency analysis to the entire continuous data to avoid any boundary effects and padding issues. However, after I run the time-frequency analysis on the entire continuous data and then try to define trials I get errors due to the input data being in the incorrect format. The data are .edf files that were being imported incorrectly and being parsed into short segments, thus I have been using "cfg.continuous='yes' " in ft_preprocessing() and then using ft_redefinetrial() to subsequently define trials. So I read the data in like this: cfg=[]; cfg.reref='yes'; cfg.dataset = 'data.edf'; cfg.headerfile = 'data.edf'; cfg.dataformat = 'edf'; cfg.headerformat = 'edf'; cfg.continuous = 'yes'; cfg.demean='yes'; data = ft_preprocessing(cfg); and the data looks like: >> data data = hdr: [1x1 struct] label: {101x1 cell} time: {[1x535040 double]} trial: {[101x535040 double]} fsample: 512 sampleinfo: [1 535040] cfg: [1x1 struct] Then my time-frequency analysis looks like this: cfg = []; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 1:2:30; cfg.toi = -0.5:0.05:1.5; cfg.channel = 'all'; TFRwave = ft_freqanalysis(cfg, data); and the output looks like this: >> TFRwave TFRwave = label: {101x1 cell} dimord: 'chan_freq_time' freq: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29] time: [1x41 double] powspctrm: [101x15x41 double] cumtapcnt: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] cfg: [1x1 struct] then I define trials like this (which works fine in other processing streams I have): [TFRwave_byTrial] = ft_redefinetrial(cfg, TFRwave) gives this error: the input is freq data with 101 channels, 15 frequencybins and 41 timebins ??? Error using ==> ft_checkdata>freq2raw at 1669 this only works for dimord='rpt_chan_freq_time' Error in ==> ft_checkdata at 317 data = freq2raw(data); Error in ==> ft_redefinetrial at 104 data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); So it seems like ft_redefinetrial() does not like the data in the format "chan_freq_time" and instead wants the format "rpt_chan_freq_time". I tried changing the output format of the time-frequency analysis by changing the "cfg.output" option to 'powandcsc' and 'fourier', and I also tried converting the time-frequency data using "freqnew=ft_checkdata(data,'cmbrepresentation','full');" and "freqnew=ft_checkdata(data,'cmbrepresentation','sparsewithpow');" but could not get the data in a format that could be used by ft_redefinetrial(). Maybe I missed something in the documentation or mailing list? Does anyone have any thoughts or ideas? Thanks! David -------------- next part -------------- An HTML attachment was scrubbed... URL: From nheugel89 at gmail.com Thu Dec 12 02:42:29 2013 From: nheugel89 at gmail.com (Nicholas Heugel) Date: Wed, 11 Dec 2013 19:42:29 -0600 Subject: [FieldTrip] Error after MNE In-Reply-To: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> References: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> Message-ID: I did as you asked. I put it in the core category with the error as the title On Wed, Dec 11, 2013 at 2:04 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Nicholas, > > It seems that the fif files lacks some information that FieldTrip assumes > to be present. I would say that this can only be caused by the fact that > the version of mne_make_source_space you used does not write the triangle > area information into the fif file. Could you go to bugzilla.fcdonders.nl, > create yourself an account, and file the issue as a bug? Please then also > upload the fif-file you mentioned. I'll have a look at it and make the > ft_read_headshape function more robust. In the mean time you could comment > out line 421. > > Best, > Jan-Mathijs > > > > On Dec 10, 2013, at 6:23 PM, Nicholas Heugel wrote: > > I a trying to go through the tutorial for the > > - Source reconstruction of event-related fields using minimum-norm > estimate > > I am able to run everything up to the MNE with no problem, and it > seems like the MNE portion works. But when I run the command bnd = > ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > and then plot it to visualize the source space. I get the error Reference > to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) > shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; > I have looked on this site and online and can't find an explanation > of what is wrong or how to fix the problem. Any help would be appreciated. > I am using an Anatomical MRI scan for the head model analysis, the skull > is present and I manually am Identifying the fiducials. Also, a few > steps earlier it had me check the white matter segmentation done by > Freesurfer and that worked fine and what I get closely resembles the > tutorial. So I think the problem is somewhere in the MNE I am just not > sure where. Any help would be appreciated. Thank you for your time. > > Nicholas > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luckyluke1979 at yahoo.com.ar Thu Dec 12 09:19:46 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Thu, 12 Dec 2013 00:19:46 -0800 (PST) Subject: [FieldTrip] Time-Frequency Plot Granger Causality Message-ID: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Hi, Following the tutorial on connectivity analysis I am trying to implement Granger Causality on simulated signals. I can reproduce all the results that appear in the tutorial in my dataset but I cannot obtain a graph of Wavelet-based granger causality with the format: -x axis: time -y axis: frequency This  graph should allow me to compare in a single figure how channel 1 granger causes channel 2 at a range of frequencies as a function of time (like in Fig 3 of Dhamala et al, 2008). My problem is that I cannot figure out how to produce this graph with the tutorial functions as they seem to automatically compute Granger Spectra for the whole epoch. In the tutorial demo the structure 'freq' has dimord: 'rpttap_chan_freq', and the structure 'granger' has dimord: 'chan_chan_freq'. What I am looking for is a function that returns a structure with the granger spectra computed with dimord of 'chan_chan_freq_time' 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then '[output] = ft_connectivity_csd2transfer(freq);' with all types of parameters but I could not reach to a solution. Is there a way of building a time-frequency granger spectra within fieldtrip? 2- Alternatively to 1, I thought that I could compute non-parametric Granger Spectra for different time windows inside each epoch and then concatenate the results. Before doing this I would like to be sure that I am not missing a way of doing it that it's already implemented in fieldtrip (I have just started using Fieldtrip a short time ago) Thanks a lot Cheers   Lisandro Kaunitz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Dec 12 09:28:09 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 12 Dec 2013 09:28:09 +0100 Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Message-ID: <47E648A2-F681-409F-9A08-0F44B62939F2@donders.ru.nl> Dear Luckyluke, In principle what you want should be possible, but it is not well tested. Rather I would suggest to go for solution 2, i.e. re-epoch your data and compile a time-frequency map by hand. If you want to try it anyway, the key would be to use cfg.method = 'mtmconvol', rather than 'mtmfft' when computing the spectral representation of your data. Best, Jan-Mathijs On Dec 12, 2013, at 9:19 AM, Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to implement Granger Causality on simulated signals. I can reproduce all the results that appear in the tutorial in my dataset but I cannot obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This graph should allow me to compare in a single figure how channel 1 granger causes channel 2 at a range of frequencies as a function of time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with the tutorial functions as they seem to automatically compute Granger Spectra for the whole epoch. In the tutorial demo the structure 'freq' has dimord: 'rpttap_chan_freq', and the structure 'granger' has dimord: 'chan_chan_freq'. What I am looking for is a function that returns a structure with the granger spectra computed with dimord of 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then '[output] = ft_connectivity_csd2transfer(freq);' with all types of parameters but I could not reach to a solution. Is there a way of building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric Granger Spectra for different time windows inside each epoch and then concatenate the results. Before doing this I would like to be sure that I am not missing a way of doing it that it's already implemented in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > > Lisandro Kaunitz > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Dec 12 09:33:11 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:33:11 +0100 Subject: [FieldTrip] frequency analysis In-Reply-To: References: Message-ID: <52A974C7.3080104@donders.ru.nl> Dear Raghavan, 1) Sure is it possible, z-scoring is nothing else then subtracting the mean and dividing by the standard deviation. The time-period from which you obtain the mean and standard deviation depend on what you want and how you define it. 2) Usually we do not use megrealign at all and assume that subjects are approximately similarly seated in the helmet for computing the grandaverage. MEG sensor-level analysis is not suited very well for making spatial inferences anyway, I would advise to go to source space for such a thing. 3) For neuromag data, you already have planar gradiometers, so you do not need megplanar and combineplanar. We, on the other hand, only have axial gradiometers with our CTF system, thus we need a planar transformation to get a planar representation. 4) I cannot help with this one, sorry. Best, Jörn Raghavan Gopalakrishnan wrote: > I have a few questions regarding frequency analysis using wavelets. > > 1. Is it possible to z-score the TF spectrograms? Is so how and where > should I specify the baseline? > 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make > sure all sensors from multi subject are matched. However, why is this > not performed before grand averaging time-frequency data since the > powspctrm is specific to each channel? > 3. Is combineplanar a necessary step before any grand averaging i.e. > ERF or TFR? I am using neuromag data, so can I perform grand averaging > and statistics without combineplanar? > 4. Fieldtrip only reads neuromag FIF files that has been processed > through maxfilter. There are times when there is a need not to use > maxfilter, is there a work around? > > Thanks very much. > Raghavan > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Thu Dec 12 09:33:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:33:50 +0100 Subject: [FieldTrip] ft_freqanalysis() on entire continuous data followed by ft_redefinetrial() error - incorrect data format? In-Reply-To: References: Message-ID: <52A974EE.8030601@donders.ru.nl> Hi David, try specifying cfg.keeptrials = 'yes' before computing the power spectrum. Best, Jörn Drew Fegen wrote: > Hello, > > Trying to do time-frequency analysis on some intracranial EEG data and > I would like to apply the time-frequency analysis to the entire > continuous data to avoid any boundary effects and padding issues. > However, after I run the time-frequency analysis on the entire > continuous data and then try to define trials I get errors due to the > input data being in the incorrect format. > > The data are .edf files that were being imported incorrectly and being > parsed into short segments, thus I have been using > "cfg.continuous='yes' " in ft_preprocessing() and then using > ft_redefinetrial() to subsequently define trials. > > So I read the data in like this: > > cfg=[]; > cfg.reref='yes'; > cfg.dataset = 'data.edf'; > cfg.headerfile = 'data.edf'; > cfg.dataformat = 'edf'; > cfg.headerformat = 'edf'; > cfg.continuous = 'yes'; > cfg.demean='yes'; > data = ft_preprocessing(cfg); > > > and the data looks like: > > >> data > > data = > > hdr: [1x1 struct] > label: {101x1 cell} > time: {[1x535040 double]} > trial: {[101x535040 double]} > fsample: 512 > sampleinfo: [1 535040] > cfg: [1x1 struct] > > > Then my time-frequency analysis looks like this: > > cfg = []; > cfg.method = 'wavelet'; > cfg.width = 7; > cfg.output = 'pow'; > cfg.foi = 1:2:30; > cfg.toi = -0.5:0.05:1.5; > cfg.channel = 'all'; > TFRwave = ft_freqanalysis(cfg, data); > > > and the output looks like this: > > >> TFRwave > > TFRwave = > > label: {101x1 cell} > dimord: 'chan_freq_time' > freq: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29] > time: [1x41 double] > powspctrm: [101x15x41 double] > cumtapcnt: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] > cfg: [1x1 struct] > > > then I define trials like this (which works fine in other processing > streams I have): > > [TFRwave_byTrial] = ft_redefinetrial(cfg, TFRwave) > > > gives this error: > > the input is freq data with 101 channels, 15 frequencybins and 41 timebins > ??? Error using ==> ft_checkdata>freq2raw at 1669 > this only works for dimord='rpt_chan_freq_time' > > Error in ==> ft_checkdata at 317 > data = freq2raw(data); > > Error in ==> ft_redefinetrial at 104 > data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); > > > So it seems like ft_redefinetrial() does not like the data in the > format "chan_freq_time" and instead wants the format > "rpt_chan_freq_time". I tried changing the output format of the > time-frequency analysis by changing the "cfg.output" option to > 'powandcsc' and 'fourier', and I also tried converting the > time-frequency data using > "freqnew=ft_checkdata(data,'cmbrepresentation','full');" and > "freqnew=ft_checkdata(data,'cmbrepresentation','sparsewithpow');" but > could not get the data in a format that could be used by > ft_redefinetrial(). > > Maybe I missed something in the documentation or mailing list? Does > anyone have any thoughts or ideas? > > Thanks! > David > > > > > > > > > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Thu Dec 12 09:39:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:39:50 +0100 Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Message-ID: <52A97656.9020506@donders.ru.nl> Hi Lisandro, actually, for me it works by just computing a time-frequency representation and shoving that into ft_connectivityanalysis. Is there an error if you try that? I literally do cfg = []; cfg.channelcmb = ...; cfg.method = 'granger'; granger = ft_connectivityanalysis(cfg, freq); With freq obtained by cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foi = 1:32; cfg.t_ftimwin = 0.5.*ones(size(4./cfg.foi'), 1); cfg.toi = -1:0.05:1; freq = ft_freqanalysis(cfg, data); Otherwise, solution 2 is something that definitely works and what I also did first, and it worked fine. There should be nothing wrong imho, as JM also pointed out. Best, Jörn Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to > implement Granger Causality on simulated signals. I can reproduce all > the results that appear in the tutorial in my dataset but I cannot > obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This graph should allow me to compare in a single figure how channel > 1 granger causes channel 2 at a range of frequencies as a function of > time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with > the tutorial functions as they seem to automatically compute Granger > Spectra for the whole epoch. In the tutorial demo the structure 'freq' > has dimord: 'rpttap_chan_freq', and the structure 'granger' has > dimord: 'chan_chan_freq'. What I am looking for is a function that > returns a structure with the granger spectra computed with dimord of > 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then > '[output] = ft_connectivity_csd2transfer(freq);' with all types of > parameters but I could not reach to a solution. Is there a way of > building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric > Granger Spectra for different time windows inside each epoch and then > concatenate the results. Before doing this I would like to be sure > that I am not missing a way of doing it that it's already implemented > in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > Lisandro Kaunitz > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Thu Dec 12 09:45:19 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 12 Dec 2013 09:45:19 +0100 Subject: [FieldTrip] Low-pass filter before resampling? Message-ID: Hi all, A quick question: in your experience, is it necessary (or advisable) to explicitly apply a low-pass filter (using e.g. ft_preprocessing) before calling ft_resampledata? I previously assumed ft_resampledata (or the low-level implementation, pchip) was taking care of this, but looking in the code I cannot find evidence for or against my assumption. Thanks, Eelke From eelke.spaak at donders.ru.nl Thu Dec 12 09:48:15 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 12 Dec 2013 09:48:15 +0100 Subject: [FieldTrip] Low-pass filter before resampling? In-Reply-To: References: Message-ID: Oops, I was looking in the wrong part of the code for ft_resampledata (usetime = 1, while I should have been looking at usefsample = 1). There, it is clear that Matlab's resample() is being used, which tells me in the documentation "resample applies an anti-aliasing (lowpass) FIR filter to x during the resampling process. It designs the filter using firls with a Kaiser window." So, it is definitely not needed. Sorry for filling up your inboxes :) Eelke On 12 December 2013 09:45, Eelke Spaak wrote: > Hi all, > > A quick question: in your experience, is it necessary (or advisable) > to explicitly apply a low-pass filter (using e.g. ft_preprocessing) > before calling ft_resampledata? I previously assumed ft_resampledata > (or the low-level implementation, pchip) was taking care of this, but > looking in the code I cannot find evidence for or against my > assumption. > > Thanks, > Eelke From thomas.wunderle at esi-frankfurt.de Thu Dec 12 10:46:49 2013 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Thu, 12 Dec 2013 09:46:49 +0000 Subject: [FieldTrip] Low-pass filter before resampling? In-Reply-To: References: Message-ID: <27E5CAD9145EEC41BB9B34C01716A1983049F31C@UM-EXCDAG-A01.um.gwdg.de> Hi all, I was also thinking about resampling data recently. The reason is that I saw (as Eelke mentioned) that the Matlab "resample" function applies a Kaiser window function to lowpass filter the data before (down/resampling). Now, I was not sure if this can create a problem for directed connectivity analysis (like Granger connectivity), because you apply a non-causal kernel which "contaminates" a given moment in time with the future. I'm not an expert enough to see through if this is a problem for methods like Granger which rely on predicting a signal given the data in the past. If so, one should be careful in using non-causal filters e.g. for resampling. At the moment I'm using the Matlab function "resample" with the option "0" ( like: y = resample(data,D,N,0) ), which does then nearest neighbor interpolation. What's your opinions about that topic? Best, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel:   +49 69 96769 519 Fax:   +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries -----Ursprüngliche Nachricht----- Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Eelke Spaak Gesendet: Donnerstag, 12. Dezember 2013 09:48 An: Email discussion list for the FieldTrip project Betreff: Re: [FieldTrip] Low-pass filter before resampling? Oops, I was looking in the wrong part of the code for ft_resampledata (usetime = 1, while I should have been looking at usefsample = 1). There, it is clear that Matlab's resample() is being used, which tells me in the documentation "resample applies an anti-aliasing (lowpass) FIR filter to x during the resampling process. It designs the filter using firls with a Kaiser window." So, it is definitely not needed. Sorry for filling up your inboxes :) Eelke On 12 December 2013 09:45, Eelke Spaak wrote: > Hi all, > > A quick question: in your experience, is it necessary (or advisable) > to explicitly apply a low-pass filter (using e.g. ft_preprocessing) > before calling ft_resampledata? I previously assumed ft_resampledata > (or the low-level implementation, pchip) was taking care of this, but > looking in the code I cannot find evidence for or against my > assumption. > > Thanks, > Eelke _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From luckyluke1979 at yahoo.com.ar Thu Dec 12 12:27:55 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Thu, 12 Dec 2013 03:27:55 -0800 (PST) Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <52A97656.9020506@donders.ru.nl> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> <52A97656.9020506@donders.ru.nl> Message-ID: <1386847675.60465.YahooMailNeo@web140306.mail.bf1.yahoo.com> Thanks a lot for the fast responses. I'll try both methods and test whether there are differences in the results Cheers   Lisandro Kaunitz El día jueves, 12 de diciembre de 2013 19:39, Jörn M. Horschig escribió: Hi Lisandro, actually, for me it works by just computing a time-frequency representation and shoving that into ft_connectivityanalysis. Is there an error if you try that? I literally do     cfg = [];     cfg.channelcmb = ...;     cfg.method    = 'granger';     granger    = ft_connectivityanalysis(cfg, freq); With freq obtained by       cfg          = [];       cfg.method    = 'mtmconvol';       cfg.output    = 'fourier';       cfg.taper    = 'hanning';       cfg.foi      = 1:32;       cfg.t_ftimwin = 0.5.*ones(size(4./cfg.foi'), 1);       cfg.toi      = -1:0.05:1;       freq          = ft_freqanalysis(cfg, data); Otherwise, solution 2 is something that definitely works and what I also did first, and it worked fine. There should be nothing wrong imho, as JM also pointed out. Best, Jörn Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to > implement Granger Causality on simulated signals. I can reproduce all > the results that appear in the tutorial in my dataset but I cannot > obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This  graph should allow me to compare in a single figure how channel > 1 granger causes channel 2 at a range of frequencies as a function of > time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with > the tutorial functions as they seem to automatically compute Granger > Spectra for the whole epoch. In the tutorial demo the structure 'freq' > has dimord: 'rpttap_chan_freq', and the structure 'granger' has > dimord: 'chan_chan_freq'. What I am looking for is a function that > returns a structure with the granger spectra computed with dimord of > 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then > '[output] = ft_connectivity_csd2transfer(freq);' with all types of > parameters but I could not reach to a solution. Is there a way of > building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric > Granger Spectra for different time windows inside each epoch and then > concatenate the results. Before doing this I would like to be sure > that I am not missing a way of doing it that it's already implemented > in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > Lisandro Kaunitz > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel:    +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Thu Dec 12 13:22:26 2013 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Thu, 12 Dec 2013 12:22:26 +0000 Subject: [FieldTrip] Offline use of Fieldtrip for TMSi file formats (.poly5, .s00) Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094E7A08@PEXMB001B.vu.local> Hi all, I used the TMSi software to acquire EEG and EMG data and so my files have the poly5 format. I'm trying to read my poly5 files into matlab using fieldtrip so it immediately get's the format desired for further analyses using fieldtrip, but it doesn't work and online I only find information on how to use fieldtrip together with TMSi realtime and not in offline data analyses. Does anybody know how to do this or where I can find how to do this? Thanks in advance, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From emanuelvandenbroeke at hotmail.com Thu Dec 12 13:34:04 2013 From: emanuelvandenbroeke at hotmail.com (emanuel vandenbroeke) Date: Thu, 12 Dec 2013 13:34:04 +0100 Subject: [FieldTrip] Normality Message-ID: Hi, Maybe someone can help me with a question.I collected data of 16 subjects in a repeated measures design with 2 within subject factors (time (3 levels) and arm (2 levels)). I measured several dependent variables.Before applying a RM ANOVA to my data i first inspected each dependent variable (with its levels) regarding the assumption of normality. Some variables look positively skewed and some look negatively skewed. These deviations of normality can be corrected with a reflection first and then log transformation in the case of a negative skew distribution and the positive skew distributions can be corrected by a log transform alone. Some people say that the RM ANOVA is robust for mild violations of normality but I can not find any papers confirming this.Now my question, should I apply these transformations to my data or not? And secondly, if I apply a transformation to one variable (for example the negatively skewed variables) should I also use this transform for the other variables or can I differentiate and decide the appropriate transform for each dependent variable? Many thanks, Best,Emanuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From santiago.torres at mail.mcgill.ca Fri Dec 13 18:06:54 2013 From: santiago.torres at mail.mcgill.ca (Santiago Torres, Mr) Date: Fri, 13 Dec 2013 17:06:54 +0000 Subject: [FieldTrip] ft_spikedensity Message-ID: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> Hello All, I am trying to run the spike analysis script ft_spikedensity and have the following problem: When defining the begSample variable in line 234 of the code: begSample = nearest(timeAxis, cfg.latency(1)) Error using nearest Too many input arguments. the code is set such that it inputs two variables to the function nearest, which only allows for one variable as input. This should always give an error independent of the variables that are given to nearest. I tried to do a temporary fix by eliminating the second input which seems unnecessary (given that further code uses the values in the timeAxis matrix only) or by making a matrix using cfg.latency(1) as the final value of nearest(timeAxis). Neither of this options work as they give a bigger sampleSel than timeAxis (sampleSel(sampleSel>length(timeAxis)) = []). However, I do not want to mess with something that may have other implications further down, and I assume the second variable (cf.latency(1)) is there for a reason. Can someone help explain how to go around this problem or why it may not be working? timeAxis is a 1*n double matrix with increasing positive time values starting at 0. cfg.latency(1) is 0. I am using a 32-bit matlab version R2012a. Thanks, Santiago Torres -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Fri Dec 13 19:06:41 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Fri, 13 Dec 2013 19:06:41 +0100 Subject: [FieldTrip] Leadfield and source contain NaN Message-ID: Dear All, I calculated leadfield with 64 electrodes but majority of part of leadfield.leadfield consist of NaN and some with values and I ensured the electrode is projected on the head (but some not touching the head directly but at the right position). Please help me with what I am missing please. Whenever I used the leadfield to calculate source, it also contain NaN. Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From luckyluke1979 at yahoo.com.ar Mon Dec 16 08:21:17 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Sun, 15 Dec 2013 23:21:17 -0800 (PST) Subject: [FieldTrip] Estimating Single-trial Granger Causality Message-ID: <1387178477.14427.YahooMailNeo@web140303.mail.bf1.yahoo.com> Hi, I am trying to compute grangerspectra for simulated single trials. Whenver I run granger causality on a single trial with 2 or more channels I got the following warning: Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In connectivity/private/sfactorization_wilson at 81   In ft_connectivity_csd2transfer at 180   In ft_connectivityanalysis at 400   In example_maillingList at 51 This warning disappears if I use the same number of trials and channels / signals in my dataset (i.e, 2 trials with 2 channels, 3 trials for  3 channels, etc). Is it possible to obtain granger spectra for single trials with Fieldtrip? I would like to average the spectra across single trials to run statistics and compare across conditions later on. This is the code I am using in my simulation, if the value of cfg.ntrials is changed to 2 (both times is is declared), then the warning disappears: nTrials = 5; for tr = 1 : nTrials             %% Simulate data         cfg             = [];     cfg.ntrials     = 1;     cfg.triallength = 2; % in secs     cfg.nsignal     = 2;     cfg.fsample     = 200;     cfg.method      = 'ar';     cfg.bpfilter    = 'no'; % (or 'no')     cfg.bpfreq      = [0 300]; % (default: [15 25])         cfg.params(:,:,1) = [ 0.8  0 ;                           0.9  0.9];         cfg.params(:,:,2) = [-0.5    0;                           0.9   -0.8];         cfg.noisecov      = [ 0.3  0; 0 0.2];         data            = ft_connectivitysimulation(cfg);            %% Non-parametric computation of the cross-spectral density matrix         cfg                 = [];     cfg.ntrials         = 1;     cfg.triallength     = 2; % in secs     cfg.nsignal         = 2;     cfg.method          = 'mtmconvol';     cfg.output          = 'fourier';     cfg.taper           = 'hanning';     cfg.foi             = 2:2:100;     cfg.t_ftimwin       = 0.05 .* ones(size(4./cfg.foi', 1), 1);     cfg.toi             = 0:0.05:2;         freq                = ft_freqanalysis(cfg, data);             %% GRANGER CAUSALITY         cfg           = [];     cfg.method    = 'granger';     granger       = ft_connectivityanalysis(cfg, freq);         sp_chan1_chan2(:,:,tr) = squeeze(granger.grangerspctrm(1,2, :, :)); %#ok     sp_chan2_chan1(:,:,tr) = squeeze(granger.grangerspctrm(2,1, :, :)); %#ok     end Thanks a lot Cheers   Lisandro Kaunitz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Dec 16 09:22:16 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 09:22:16 +0100 Subject: [FieldTrip] Leadfield and source contain NaN In-Reply-To: References: Message-ID: <52AEB838.10702@donders.ru.nl> Dear Azeez, some gridpoints might fall outside the head, thus no source activity is computed and the respective value is set to nan. In your grid or leadfield-structure you got the fields .inside and .outside. You can use these as indices to find the respective values of sourceactivity only inside (or outside) the brain. You can use the indices in analog to this example: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#computing_the_sourcemodel (see the call to ft_plot_mesh) Best, Jörn On 12/13/2013 7:06 PM, Azeez Adebimpe wrote: > Dear All, > > I calculated leadfield with 64 electrodes but majority of part of > leadfield.leadfield consist of NaN and some with values and I ensured > the electrode is projected on the head (but some not touching the head > directly but at the right position). Please help me with what I am > missing please. Whenever I used the leadfield to calculate source, it > also contain NaN. > > > > Azeez Adebimpe > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 16 09:25:35 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 09:25:35 +0100 Subject: [FieldTrip] ft_spikedensity In-Reply-To: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> References: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> Message-ID: <52AEB8FF.4050404@donders.ru.nl> Dear Santiago, maybe you forgot to call ft_defaults prior to doing anything with Fieldtrip? Fieldtrip has an own nearest function, which needs *at least* two input arguments. Calling ft_defaults should add the necessary paths so that Matlab knows which nearest function to use. You can also easily verify this by calling which nearest in the command window. If this refers to a Fieldtrip function, you are fine. However, from what you describe, the path is not set correctly and this will refer to some function outside Fieldtrip. Best, Jörn On 12/13/2013 6:06 PM, Santiago Torres, Mr wrote: > Hello All, > I am trying to run the spike analysis script ft_spikedensity and have > the following problem: > When defining the begSample variable in line 234 of the code: > > begSample = nearest(timeAxis, cfg.latency(1)) > Error using nearest > Too many input arguments. > > the code is set such that it inputs two variables to the function > nearest, which only allows for one variable as input. This should > always give an error independent of the variables that are given to > nearest. I tried to do a temporary fix by eliminating the second input > which seems unnecessary (given that further code uses the values in > the timeAxis matrix only) or by making a matrix using cfg.latency(1) > as the final value of nearest(timeAxis). Neither of this options work > as they give a bigger sampleSel than timeAxis > (sampleSel(sampleSel>length(timeAxis)) = []). However, I do not want > to mess with something that may have other implications further down, > and I assume the second variable (cf.latency(1)) is there for a > reason. Can someone help explain how to go around this problem or why > it may not be working? > > timeAxis is a 1*n double matrix with increasing positive time values > starting at 0. cfg.latency(1) is 0. I am using a 32-bit matlab version > R2012a. > > Thanks, > Santiago Torres > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jean-baptiste.versini at etu.univ-lyon1.fr Mon Dec 16 12:29:22 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Mon, 16 Dec 2013 11:29:22 +0000 Subject: [FieldTrip] Single trial baseline correction Message-ID: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> Dear fieldtrip users, I wanted to know if there is a way in fieldtrip to average trials after doing the baseline correction, as it is suggested in this article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ Regards, Versini JB -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Dec 16 14:17:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 14:17:50 +0100 Subject: [FieldTrip] Single trial baseline correction In-Reply-To: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> References: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> Message-ID: <52AEFD7E.3050606@donders.ru.nl> Dear Jean-Baptiste, of course there is, but it depends on the representation of your data. There is ft_timelockbaseline and ft_freqbaseline, both do a baseline per trial if the representation allows so. For ft_timelockbaseline, you can explicitly specify cfg.parameter = 'trials', and for ft_freqbaseline baselining per trial is the default if there are multiple observations in your data. Best, Jörn On 12/16/2013 12:29 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Dear fieldtrip users, > > I wanted to know if there is a way in fieldtrip to average trials > *after *doing the baseline correction, as it is suggested in this > article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ > > Regards, > Versini JB > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From gopalar.ccf at gmail.com Mon Dec 16 18:35:28 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 16 Dec 2013 12:35:28 -0500 Subject: [FieldTrip] dbs artifact Message-ID: Is there some experience around in fieldtrip community on ways to deal with dbs artifact in MEG data? Are there plans of including such artifact rejection routines in FT? Thanks very much. Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Mon Dec 16 19:38:29 2013 From: alik.widge at gmail.com (Alik Widge) Date: Mon, 16 Dec 2013 13:38:29 -0500 Subject: [FieldTrip] dbs artifact In-Reply-To: References: Message-ID: I can't tell you about MEG, but here's a method for EEG: http://dx.doi.org/10.1016/j.clinph.2010.02.156 We are playing around right now with questions of source localization and whether it might be possible to clearly localize the DBS to its subcortical source. Ask me in three months. If you have any capacity to request things of your subjects' neurologists, there are some papers in the literature suggesting that artifact is weaker in a bipolar configuration compared to monopolar. Again, EEG only. Here at Martinos the only recommendation I've heard about DBS+MEG is "doesn't work well". I don't know of anyone who's really studied the problem. Alik Widge alik.widge at gmail.com (206) 866-5435 On Mon, Dec 16, 2013 at 12:35 PM, Raghavan Gopalakrishnan < gopalar.ccf at gmail.com> wrote: > Is there some experience around in fieldtrip community on ways to deal > with dbs artifact in MEG data? Are there plans of including such artifact > rejection routines in FT? > > Thanks very much. > Raghavan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Mon Dec 16 19:58:57 2013 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Mon, 16 Dec 2013 19:58:57 +0100 Subject: [FieldTrip] dbs artifact In-Reply-To: References: Message-ID: In MEG, there are two methods which deal with suppression of DBS artifacts. The tSSS method is used for Elekta Neuromag MEG system for removing DBS artifacts. I came to know that the authors also made a software called MaxFilter for the same manufacturer. http://www.sciencedirect.com/science/article/pii/S0531513107001422 The other method is called Spectral Signal Space separation where authors claim to have better performance than tSSS. http://www.sciencedirect.com/science/article/pii/S105381191100139X I have tried 4 methods in removing the artifacts in EEG including the one Alik mentions and this performed poorly. Feel free to contact me if you need anything more. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Mon, Dec 16, 2013 at 7:38 PM, Alik Widge wrote: > I can't tell you about MEG, but here's a method for EEG: > http://dx.doi.org/10.1016/j.clinph.2010.02.156 > > We are playing around right now with questions of source localization and > whether it might be possible to clearly localize the DBS to its subcortical > source. Ask me in three months. > > If you have any capacity to request things of your subjects' neurologists, > there are some papers in the literature suggesting that artifact is weaker > in a bipolar configuration compared to monopolar. Again, EEG only. Here at > Martinos the only recommendation I've heard about DBS+MEG is "doesn't work > well". I don't know of anyone who's really studied the problem. > > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Mon, Dec 16, 2013 at 12:35 PM, Raghavan Gopalakrishnan < > gopalar.ccf at gmail.com> wrote: > >> Is there some experience around in fieldtrip community on ways to deal >> with dbs artifact in MEG data? Are there plans of including such artifact >> rejection routines in FT? >> >> Thanks very much. >> Raghavan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From merhart at ucsd.edu Tue Dec 17 01:41:02 2013 From: merhart at ucsd.edu (Matt Erhart) Date: Mon, 16 Dec 2013 16:41:02 -0800 Subject: [FieldTrip] Epoching continuous time frequency data Message-ID: I would like to run freqanalysis on my continuous data and then redefine trials with a cfg.trl, but ft_redefinetrial is turning my continuous time frequency data into something other than timefreq data. Is ft_redefinetrial even designed to epoch continuous freqdata? Is there a working code snippet around that shows exactly how to efficiently run freqanalysis on continuous data and then epoch it? % this cfg seems to produce reasonable results per some imagesc plotting: cfg.method = 'hilbert' cfg.foi = [2:4:56]; cfg.toi = data_ds.time; %every time point works cfg.filttype = 'fir'; % fir seems better than firls, butter has unit circle error cfg.keeptrials = 'yes'; cfg.output = 'pow'; TFRwave = ft_freqanalysis(cfg, data_ds); % continuous data to tf [cfg.trl, cfg.event] = txt2trl(cfg); %cfg.trl epochs non-freq data just fine TFRwave_trials = ft_redefinetrial(cfg,TFRwave); % warns that no trial def. provided but doesn't error ft_singleplotTFR(cfg, TFRwave_trials); % says TFRwave_trials is not freqdata -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean-baptiste.versini at etu.univ-lyon1.fr Tue Dec 17 09:40:04 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Tue, 17 Dec 2013 08:40:04 +0000 Subject: [FieldTrip] RE : Single trial baseline correction In-Reply-To: <52AEFD7E.3050606@donders.ru.nl> References: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr>, <52AEFD7E.3050606@donders.ru.nl> Message-ID: <5271B6068CD8D94DB822542282379288017A895A@mbx2010-02.univ-lyon1.fr> Hello, Thanks, that's exactly what I was looking for. Best, Jean-Baptiste ________________________________________ De : fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] de la part de "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Date d'envoi : lundi 16 décembre 2013 14:17 À : FieldTrip discussion list Objet : Re: [FieldTrip] Single trial baseline correction Dear Jean-Baptiste, of course there is, but it depends on the representation of your data. There is ft_timelockbaseline and ft_freqbaseline, both do a baseline per trial if the representation allows so. For ft_timelockbaseline, you can explicitly specify cfg.parameter = 'trials', and for ft_freqbaseline baselining per trial is the default if there are multiple observations in your data. Best, Jörn On 12/16/2013 12:29 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Dear fieldtrip users, > > I wanted to know if there is a way in fieldtrip to average trials > *after *doing the baseline correction, as it is suggested in this > article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ > > Regards, > Versini JB > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From i.e.j.de.vries at student.vu.nl Wed Dec 18 07:35:55 2013 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 18 Dec 2013 06:35:55 +0000 Subject: [FieldTrip] EEG cap layout Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094E8B74@PEXMB001B.vu.local> Hi all, I used the TMSi EEG cap with 64 electrodes, but this exact layout doesn't seem to be present in the fieldtrip layout database. The layout named: "quickcap64.mat" comes closest to the caps I used, but isn't the exact same one. Did anybody make their own specific layout for fieldtrip? cheers Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 09:48:40 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 08:48:40 +0000 Subject: [FieldTrip] ft_topoplotCC question Message-ID: Hi all, *Explanation* So I have a matrix with the dimensions: SUBJECT X CONNECTIVITY X CHANa X CHANb X FREQ size: 63 X 12 X 128 X 128 X 6 meaning: - Subject 1:30 patients, 31:63 controls - Connectivity different kinds of connectivity measures (dtf, coherence, ...) - CHANa, CHANb: channels from biosemi128 layout - Freq: connectivity measures at different frequencies (2Hz, 5.5Hz, 10.5Hz, ...) *Current way of doing it* I want to plot the grand average (patient-control comparison) into one figure. What I am doing now is: 1) Looking for significant values: ttest2 for all patient and all controls nested in 4 for-loops. Sweeping trough connectivity, frequency, first channel and second channel. Where 1st and 2d channel can't be equal) 2) Taking the grand average of patient and controls, multiplying with H0 reject/accept binary matrix resulting in zero connectivity strengths for non significant values and saving the connectivity matrix in 2 structures CONN_PAT and CONN_CON 3) Manually updating the rest of the CONN_PAT and CONN_CON fields (such as frequencies of interest) and eventually using it as an input for ft_topoplotCC. (one figure for every connectivity measure) *Questions:* 1) It appears that ft_topoplotCC doesn't really look at the data field (eg cohspctrm) of CONN_PAT or CONN_CON, not declaring width of lines or opacity results in plotting all the connection lines, Am I doing something wrong? 2) If using the data field (eg plvspctrm) for controlling the opacity, shouldn't I first normalize the data? Eg: (data-average)/std(data) or /max(data) ? 3) How can I plot all the frequencies in different colors? I tried to use the hold on; hold off; command in a for loop for all frequencies but it does plot new figures. 4) Is there a way for plotting patients and controls in 1 figure? CONN_PAT - CONN_CON isn't a good way a one can get negative values. Any ideas for plotting all this information in a matrix are more then welcome! Bests, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Wed Dec 18 10:34:18 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Wed, 18 Dec 2013 10:34:18 +0100 Subject: [FieldTrip] EEG cap layout In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094E8B74@PEXMB001B.vu.local>, Message-ID: Hi Ingmar, Try this tutorial; http://fieldtrip.fcdonders.nl/tutorial/layoutthat is what I used to create mine. Azeez Adebimpe From: i.e.j.de.vries at student.vu.nl To: fieldtrip at science.ru.nl Date: Wed, 18 Dec 2013 06:35:55 +0000 Subject: [FieldTrip] EEG cap layout Hi all, I used the TMSi EEG cap with 64 electrodes, but this exact layout doesn't seem to be present in the fieldtrip layout database. The layout named: "quickcap64.mat" comes closest to the caps I used, but isn't the exact same one. Did anybody make their own specific layout for fieldtrip? cheers Ingmar _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Wed Dec 18 14:39:16 2013 From: narayan.ps at tut.fi (Narayan Puthanmadam Subramaniyam) Date: Wed, 18 Dec 2013 15:39:16 +0200 Subject: [FieldTrip] question on TF analysis Message-ID: <000301cefbf6$8ba424c0$a2ec6e40$@tut.fi> Dear FT experts I have ERP data ranging from -200 ms to 1198 ms at sampling frequency of 500 Hz (Totally 700 samples). I would like to use wavelets to analyze TF between 1 to 30 Hz. I have never used wavelets so I did some reading on them and figured out that for analyzing high frequency wavelet cycles of 5 or more is good. However, my analysis is confined to relatively low frequency bands (1-4, 4-8, 8-13 and 13-30). How should I make the choice for number of cycles so that I can have clear picture of what is happening at these bands ? Plus my epoch has only 700 time points, so I assume having few cycles will increase the window length at low frequency and thus I loose time info ? Best regards Narayan -------------- next part -------------- An HTML attachment was scrubbed... URL: From joscha.schmiedt at esi-frankfurt.de Wed Dec 18 16:06:58 2013 From: joscha.schmiedt at esi-frankfurt.de (Schmiedt, Joscha) Date: Wed, 18 Dec 2013 15:06:58 +0000 Subject: [FieldTrip] Wavelet bandwidth on tutorial website Message-ID: <26F2DFC0-6ABF-4029-A569-4F2FD7643DEC@esi-frankfurt.de> Hi, The fieldtrip tutorial website on TFRs with wavelets (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis#morlet_wavelets) states that "at a given frequency F is equal to F/width*2 (so, at 30 Hz and a width of 7, the spectral bandwidth is 30/7*2 = 8.6 Hz) while the wavelet duration is equal to width/F/pi (in this case, 7/30/pi = 0.074s = 74ms)”. According to the help of ft_freqanalysis and the code of ft_specest_wavelet the spectral bandwidth (standard deviation in frequency domain) is F/width. Is the website outdated? Best, Joscha From michielb at tcd.ie Wed Dec 18 16:15:41 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:15:41 +0000 Subject: [FieldTrip] charpath, distance matrix Message-ID: Hi all, I want to calculate the characteristic path length with ft_networkanalysis but it needs a distance matrix. What is the quickest way to calculate this? Or should I calculate it myself as a distance of 1 to go to a neighbouring electrode and do this for all my biosemi128 electrodes? Thanks, Bests, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Dec 18 16:31:45 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 18 Dec 2013 16:31:45 +0100 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: References: Message-ID: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> Bart, You probably could use ft_networkanalysis in two steps. First with cfg.method='distance', then with cfg.method = 'charpath'. Best, JM On Dec 18, 2013, at 4:15 PM, Bart Michiels wrote: > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 16:51:29 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:51:29 +0000 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: References: Message-ID: edit: Nevermind, have to use the ft_networkanalysis with cfg.parameter = distance first. On 18 December 2013 15:15, Bart Michiels wrote: > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis > but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring > electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 16:52:18 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:52:18 +0000 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> References: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> Message-ID: Thanks Jan-Mathijs, didn't see your e-mail :) On 18 December 2013 15:31, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Bart, > You probably could use ft_networkanalysis in two steps. First with > cfg.method='distance', then with cfg.method = 'charpath'. > Best, > JM > > On Dec 18, 2013, at 4:15 PM, Bart Michiels wrote: > > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis > but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring > electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Dec 19 15:38:34 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 19 Dec 2013 15:38:34 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem Message-ID: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> Dear all, I have a problem of which I can't really find the source. When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. Does anyone have an idea at which point this problem might occur? Thanks a lot. Julian P.S.: Below are the basic steps I use: %% 2.1. Build individual BEM-Model % First Realign Volume. Set Nas LPA, RPA, and positive z-values cfg=[]; cfg.method='interactive'; cfg.coordsys = 'ctf'; mri_r = ft_volumerealign(cfg,mri); cfg=[]; mri_rs = ft_volumereslice(cfg,mri_r); %% Segment the individual volume cfg=[]; cfg.output={'brain' 'scalp' 'skull'}; cfg.brainsmooth = 5; cfg.scalpsmooth = 5; cfg.brainthreshold = .5; cfg.scalpthreshold = .1; mri_s = ft_volumesegment(cfg,mri_rs); %% Create Headmodel cfg=[]; cfg.interactive = 'no'; cfg.numvertices = 1000; bnd_s = ft_prepare_mesh(cfg,mri_s); cfg=[]; cfg.method='dipoli'; % cfg.conductivity=[0.3300 0.0041 0.3300]; vol_s = ft_prepare_headmodel(cfg,bnd_s); cfg = []; cfg.mri = mri_s; grid = ft_prepare_sourcemodel(cfg); grid.inside = find(grid.brain==1)'; grid.outside = find(grid.brain==0)'; grid.pos = grid.pos*10; % Set right dimensions %% Align Electrodes cfg=[]; cfg.method='interactive'; cfg.elec=elec_128; cfg.headshape=vol_s.bnd(1); elec_new=ft_electroderealign(cfg); %% 4. Make the Leadfield. elec_new.type='eeg'; cfg=[]; cfg.channel = 1:126; cfg.elec=elec_new; cfg.vol=vol_s; cfg.grid=grid; lf = ft_prepare_leadfield(cfg); %% BEAMFORMER cfg=[]; cfg.channel=1:126; cfg.method='lcmv'; %Time-Domain-Beamformer cfg.grid=lf; cfg.vol=vol_s; cfg.elec=elec_new; cfg.reducerank = 3; cfg.keepfilter='yes'; beamfilter = ft_sourceanalysis(cfg, dat4beam); %% Keep the cfg, just add the filter. cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above lcmv_bl = ft_sourceanalysis(cfg, bl_dat); lcmv_act = ft_sourceanalysis(cfg, act_dat); ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EEG_Vol_Alignment.pdf Type: application/pdf Size: 539791 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1_standard_brain.png Type: image/png Size: 187540 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Thu Dec 19 16:35:47 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 19 Dec 2013 16:35:47 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> Message-ID: <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? best, Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 19/12/2013, a las 15:38, Julian Keil escribió: > Dear all, > > I have a problem of which I can't really find the source. > > When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). > > However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. > > The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. > > I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. > > Does anyone have an idea at which point this problem might occur? > > Thanks a lot. > > Julian > > > > P.S.: Below are the basic steps I use: > > %% 2.1. Build individual BEM-Model > % First Realign Volume. Set Nas LPA, RPA, and positive z-values > > cfg=[]; > cfg.method='interactive'; > cfg.coordsys = 'ctf'; > > mri_r = ft_volumerealign(cfg,mri); > > cfg=[]; > > mri_rs = ft_volumereslice(cfg,mri_r); > > %% Segment the individual volume > cfg=[]; > cfg.output={'brain' 'scalp' 'skull'}; > cfg.brainsmooth = 5; > cfg.scalpsmooth = 5; > cfg.brainthreshold = .5; > cfg.scalpthreshold = .1; > mri_s = ft_volumesegment(cfg,mri_rs); > > %% Create Headmodel > cfg=[]; > cfg.interactive = 'no'; > cfg.numvertices = 1000; > > bnd_s = ft_prepare_mesh(cfg,mri_s); > > cfg=[]; > cfg.method='dipoli'; % > cfg.conductivity=[0.3300 0.0041 0.3300]; > > vol_s = ft_prepare_headmodel(cfg,bnd_s); > > cfg = []; > cfg.mri = mri_s; > grid = ft_prepare_sourcemodel(cfg); > > grid.inside = find(grid.brain==1)'; > grid.outside = find(grid.brain==0)'; > grid.pos = grid.pos*10; % Set right dimensions > > %% Align Electrodes > cfg=[]; > cfg.method='interactive'; > cfg.elec=elec_128; > cfg.headshape=vol_s.bnd(1); > > elec_new=ft_electroderealign(cfg); > > %% 4. Make the Leadfield. > elec_new.type='eeg'; > > cfg=[]; > cfg.channel = 1:126; > cfg.elec=elec_new; > cfg.vol=vol_s; > cfg.grid=grid; > > lf = ft_prepare_leadfield(cfg); > > %% BEAMFORMER > > cfg=[]; > cfg.channel=1:126; > cfg.method='lcmv'; %Time-Domain-Beamformer > cfg.grid=lf; > cfg.vol=vol_s; > cfg.elec=elec_new; > cfg.reducerank = 3; > cfg.keepfilter='yes'; > > beamfilter = ft_sourceanalysis(cfg, dat4beam); > > %% Keep the cfg, just add the filter. > > cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above > > lcmv_bl = ft_sourceanalysis(cfg, bl_dat); > lcmv_act = ft_sourceanalysis(cfg, act_dat); > > > > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Dec 19 17:08:47 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 19 Dec 2013 17:08:47 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> Message-ID: <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> Hi Stephan, thanks for your quick reply. If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? Thanks a lot once more. Julian Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: > > hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? > > best, > > Stephan > > ________________________________________________________ > Stephan Moratti, PhD > > see also: http://web.me.com/smoratti/ > > Universidad Complutense de Madrid > Facultad de Psicología > Departamento de Psicología Básica I > Campus de Somosaguas > 28223 Pozuelo de Alarcón (Madrid) > Spain > > and > > Center for Biomedical Technology > Laboratory for Cognitive and Computational Neuroscience > Parque Científico y Tecnológico de la Universidad Politecnica de Madrid > Campus Montegancedo > 28223 Pozuelo de Alarcón (Madrid) > Spain > > > email: smoratti at psi.ucm.es > Tel.: +34 679219982 > > El 19/12/2013, a las 15:38, Julian Keil escribió: > >> Dear all, >> >> I have a problem of which I can't really find the source. >> >> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >> >> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >> >> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >> >> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >> >> Does anyone have an idea at which point this problem might occur? >> >> Thanks a lot. >> >> Julian >> >> >> >> P.S.: Below are the basic steps I use: >> >> %% 2.1. Build individual BEM-Model >> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >> >> cfg=[]; >> cfg.method='interactive'; >> cfg.coordsys = 'ctf'; >> >> mri_r = ft_volumerealign(cfg,mri); >> >> cfg=[]; >> >> mri_rs = ft_volumereslice(cfg,mri_r); >> >> %% Segment the individual volume >> cfg=[]; >> cfg.output={'brain' 'scalp' 'skull'}; >> cfg.brainsmooth = 5; >> cfg.scalpsmooth = 5; >> cfg.brainthreshold = .5; >> cfg.scalpthreshold = .1; >> mri_s = ft_volumesegment(cfg,mri_rs); >> >> %% Create Headmodel >> cfg=[]; >> cfg.interactive = 'no'; >> cfg.numvertices = 1000; >> >> bnd_s = ft_prepare_mesh(cfg,mri_s); >> >> cfg=[]; >> cfg.method='dipoli'; % >> cfg.conductivity=[0.3300 0.0041 0.3300]; >> >> vol_s = ft_prepare_headmodel(cfg,bnd_s); >> >> cfg = []; >> cfg.mri = mri_s; >> grid = ft_prepare_sourcemodel(cfg); >> >> grid.inside = find(grid.brain==1)'; >> grid.outside = find(grid.brain==0)'; >> grid.pos = grid.pos*10; % Set right dimensions >> >> %% Align Electrodes >> cfg=[]; >> cfg.method='interactive'; >> cfg.elec=elec_128; >> cfg.headshape=vol_s.bnd(1); >> >> elec_new=ft_electroderealign(cfg); >> >> %% 4. Make the Leadfield. >> elec_new.type='eeg'; >> >> cfg=[]; >> cfg.channel = 1:126; >> cfg.elec=elec_new; >> cfg.vol=vol_s; >> cfg.grid=grid; >> >> lf = ft_prepare_leadfield(cfg); >> >> %% BEAMFORMER >> >> cfg=[]; >> cfg.channel=1:126; >> cfg.method='lcmv'; %Time-Domain-Beamformer >> cfg.grid=lf; >> cfg.vol=vol_s; >> cfg.elec=elec_new; >> cfg.reducerank = 3; >> cfg.keepfilter='yes'; >> >> beamfilter = ft_sourceanalysis(cfg, dat4beam); >> >> %% Keep the cfg, just add the filter. >> >> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >> >> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >> lcmv_act = ft_sourceanalysis(cfg, act_dat); >> >> >> >> ******************** >> Dr. Julian Keil >> >> AG Multisensorische Integration >> Psychiatrische Universitätsklinik >> der Charité im St. Hedwig-Krankenhaus >> Große Hamburger Straße 5-11, Raum E 307 >> 10115 Berlin >> >> Telefon: +49-30-2311-1879 >> Fax: +49-30-2311-2209 >> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Thu Dec 19 17:18:50 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 19 Dec 2013 16:18:50 +0000 Subject: [FieldTrip] frequency analysis In-Reply-To: <52A974C7.3080104@donders.ru.nl> References: <52A974C7.3080104@donders.ru.nl> Message-ID: Dear Raghavan, For your 3rd question, I would add to Jorn's answer that you can, but not are required to, use combineplanar of your planar gradiometer pairs if you want one answer (of ERF or TFR) per channel location rather than 2, prior to grandaveraging. For statistics, be sure to use the correct neighbours template file: neuromag306planar_neighb.mat if you have not combined, and neuromag306cmb_neighb.mat if you have combined. Best, Johanna 2013/12/12 "Jörn M. Horschig" > Dear Raghavan, > > 1) Sure is it possible, z-scoring is nothing else then subtracting the > mean and dividing by the standard deviation. The time-period from which you > obtain the mean and standard deviation depend on what you want and how you > define it. > > 2) Usually we do not use megrealign at all and assume that subjects are > approximately similarly seated in the helmet for computing the > grandaverage. MEG sensor-level analysis is not suited very well for making > spatial inferences anyway, I would advise to go to source space for such a > thing. > > 3) For neuromag data, you already have planar gradiometers, so you do not > need megplanar and combineplanar. We, on the other hand, only have axial > gradiometers with our CTF system, thus we need a planar transformation to > get a planar representation. > > 4) I cannot help with this one, sorry. > > Best, > Jörn > > Raghavan Gopalakrishnan wrote: > >> I have a few questions regarding frequency analysis using wavelets. >> >> 1. Is it possible to z-score the TF spectrograms? Is so how and where >> should I specify the baseline? >> 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make >> sure all sensors from multi subject are matched. However, why is this not >> performed before grand averaging time-frequency data since the powspctrm is >> specific to each channel? >> 3. Is combineplanar a necessary step before any grand averaging i.e. ERF >> or TFR? I am using neuromag data, so can I perform grand averaging and >> statistics without combineplanar? >> 4. Fieldtrip only reads neuromag FIF files that has been processed >> through maxfilter. There are times when there is a need not to use >> maxfilter, is there a work around? >> >> Thanks very much. >> Raghavan >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Thu Dec 19 20:44:35 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 19 Dec 2013 20:44:35 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> Message-ID: <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> I thought of changing the dat4beam.elec to newelec. Does this help? Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 19/12/2013, a las 17:08, Julian Keil escribió: > Hi Stephan, > > thanks for your quick reply. > > If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. > > If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. > > Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? > > Thanks a lot once more. > > Julian > > Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: > >> >> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? >> >> best, >> >> Stephan >> >> ________________________________________________________ >> Stephan Moratti, PhD >> >> see also: http://web.me.com/smoratti/ >> >> Universidad Complutense de Madrid >> Facultad de Psicología >> Departamento de Psicología Básica I >> Campus de Somosaguas >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> and >> >> Center for Biomedical Technology >> Laboratory for Cognitive and Computational Neuroscience >> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >> Campus Montegancedo >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> >> email: smoratti at psi.ucm.es >> Tel.: +34 679219982 >> >> El 19/12/2013, a las 15:38, Julian Keil escribió: >> >>> Dear all, >>> >>> I have a problem of which I can't really find the source. >>> >>> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >>> >>> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >>> >>> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >>> >>> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >>> >>> Does anyone have an idea at which point this problem might occur? >>> >>> Thanks a lot. >>> >>> Julian >>> >>> >>> >>> P.S.: Below are the basic steps I use: >>> >>> %% 2.1. Build individual BEM-Model >>> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >>> >>> cfg=[]; >>> cfg.method='interactive'; >>> cfg.coordsys = 'ctf'; >>> >>> mri_r = ft_volumerealign(cfg,mri); >>> >>> cfg=[]; >>> >>> mri_rs = ft_volumereslice(cfg,mri_r); >>> >>> %% Segment the individual volume >>> cfg=[]; >>> cfg.output={'brain' 'scalp' 'skull'}; >>> cfg.brainsmooth = 5; >>> cfg.scalpsmooth = 5; >>> cfg.brainthreshold = .5; >>> cfg.scalpthreshold = .1; >>> mri_s = ft_volumesegment(cfg,mri_rs); >>> >>> %% Create Headmodel >>> cfg=[]; >>> cfg.interactive = 'no'; >>> cfg.numvertices = 1000; >>> >>> bnd_s = ft_prepare_mesh(cfg,mri_s); >>> >>> cfg=[]; >>> cfg.method='dipoli'; % >>> cfg.conductivity=[0.3300 0.0041 0.3300]; >>> >>> vol_s = ft_prepare_headmodel(cfg,bnd_s); >>> >>> cfg = []; >>> cfg.mri = mri_s; >>> grid = ft_prepare_sourcemodel(cfg); >>> >>> grid.inside = find(grid.brain==1)'; >>> grid.outside = find(grid.brain==0)'; >>> grid.pos = grid.pos*10; % Set right dimensions >>> >>> %% Align Electrodes >>> cfg=[]; >>> cfg.method='interactive'; >>> cfg.elec=elec_128; >>> cfg.headshape=vol_s.bnd(1); >>> >>> elec_new=ft_electroderealign(cfg); >>> >>> %% 4. Make the Leadfield. >>> elec_new.type='eeg'; >>> >>> cfg=[]; >>> cfg.channel = 1:126; >>> cfg.elec=elec_new; >>> cfg.vol=vol_s; >>> cfg.grid=grid; >>> >>> lf = ft_prepare_leadfield(cfg); >>> >>> %% BEAMFORMER >>> >>> cfg=[]; >>> cfg.channel=1:126; >>> cfg.method='lcmv'; %Time-Domain-Beamformer >>> cfg.grid=lf; >>> cfg.vol=vol_s; >>> cfg.elec=elec_new; >>> cfg.reducerank = 3; >>> cfg.keepfilter='yes'; >>> >>> beamfilter = ft_sourceanalysis(cfg, dat4beam); >>> >>> %% Keep the cfg, just add the filter. >>> >>> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >>> >>> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >>> lcmv_act = ft_sourceanalysis(cfg, act_dat); >>> >>> >>> >>> ******************** >>> Dr. Julian Keil >>> >>> AG Multisensorische Integration >>> Psychiatrische Universitätsklinik >>> der Charité im St. Hedwig-Krankenhaus >>> Große Hamburger Straße 5-11, Raum E 307 >>> 10115 Berlin >>> >>> Telefon: +49-30-2311-1879 >>> Fax: +49-30-2311-2209 >>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Fri Dec 20 09:01:13 2013 From: michielb at tcd.ie (Bart Michiels) Date: Fri, 20 Dec 2013 08:01:13 +0000 Subject: [FieldTrip] connectivity analysis In-Reply-To: <19A3518D-5E2A-452B-BA89-918B8FD18BC5@donders.ru.nl> References: <19A3518D-5E2A-452B-BA89-918B8FD18BC5@donders.ru.nl> Message-ID: Good morning Jan-Mathijs, Some weeks ago you've sent me the following answer to my question on doing some connectivity and network analysis on some frequency data separated in frequency bins. I totally agree with you that electrode level analysis is a bad way for doing the connectivity analysis, but I have to use electrode level data (for the moment). I also listened to your advance and only averaged the connectivity measures between subjects for the grand average comparison. For the ft_freqanalysis I used the smoothing box and the foi in such a way it would overlap my frequency band of interest, but why can't one just average frequency data for a range of frequencies? And why wouldn't you do it across trials? For the trials I just used cfg.keeptrials = 'yes' and used it as an input for ft_connectivityanalysis where the dimension trials is lost. So I presume averaging over trials is done in the right way within the ft_connectivityanalysis function? Bests, Bart On 12 November 2013 10:57, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Bart, > > If you 7 frequency bins within each frequency bin are considered to belong > to the same frequency band, I'd suggest to use the multitaper approach to > estimate the spectral parameters per frequency band, using just a single > frequency bin to represent the whole band of interest. So, rather than for > example estimating from 15 until 21 Hz in steps of 1 Hz, you can also > estimate only at 18, using cfg.tapsmofrq = 3 in ft_freqanalysis. I suggest > to have a look at the documentation on the FT-wiki that is concerned with > frequency analysis. I would certainly not average the spectral > representation prior to computing the coherence, neither across the > individual frequency bins, and even more certainly not across trials. > > Regarding statistics, I don't want to discourage you, but I don't think it > makes sense to attempt doing statistics at the channel level to begin with, > due to the effects of volume conduction. Also, in any group comparison (but > also when doing a comparison across conditions), if there is any between > groups in terms of SNR (e.g. more or less alpha power across groups) you > are bound to find a statistically significant difference in estimated > connectivity as well. It remains to be motivated in such a case, that the > change in estimated connectivity actually reflects a change in true > connectivity. > > If you want to do statistics irrespective of these caveats, you may want > to look into FieldTrip's implementation of the non-parametric permutation > testing framework. There is ample documentation about this on our wiki as > well. > > Best wishes, > > Jan-Mathijs > > > > On Oct 30, 2013, at 1:22 PM, Bart Michiels wrote: > > Hi, > > I have 30 patients and 30 controls and I'm investigating their coherence > (EEG, 128 electrodes). Every patient has ~30 trials resting state eyes open > consisting of 7 frequency bins with 7 frequencies in each bin. My goal is > to show connectivity differences between different brain regions in the > control and patient group (doing electrode-level analysis now, source-level > analysis is next step). > > - Is it more appropriate to keep the averaging step as the latest step > (ie. calculate all coherence for all the different subjects, for all > trials, for all different frequencies in frequency bins) or is it better to > do the averaging asap (ie. average all frequencies in 1 frequency bin at > the time-frequency analysis step, average all trials at the > ft_freqdescriptives step, ...) > > - Is there any better way to do some statistics on the 128x128x7x7 (128 > electrodes, 7 frequency bins, 7 frequencies in each bin) besides using the > ttest2() matlab function? > > Any tips & tricks are more then welcome! > > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Fri Dec 20 10:07:42 2013 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 20 Dec 2013 10:07:42 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> Message-ID: Hi Stephan, Ah, I forgot that the electrode definition is added to the EEG-structure. Unfortunately, neither removing this nor setting all .elec-fields to the aligned elec_new helps. Happy end-of-the-year wishes, Julian Am 19.12.2013 um 20:44 schrieb smoratti at psi.ucm.es: > > I thought of changing the dat4beam.elec to newelec. Does this help? > > Stephan > > ________________________________________________________ > Stephan Moratti, PhD > > see also: http://web.me.com/smoratti/ > > Universidad Complutense de Madrid > Facultad de Psicología > Departamento de Psicología Básica I > Campus de Somosaguas > 28223 Pozuelo de Alarcón (Madrid) > Spain > > and > > Center for Biomedical Technology > Laboratory for Cognitive and Computational Neuroscience > Parque Científico y Tecnológico de la Universidad Politecnica de Madrid > Campus Montegancedo > 28223 Pozuelo de Alarcón (Madrid) > Spain > > > email: smoratti at psi.ucm.es > Tel.: +34 679219982 > > El 19/12/2013, a las 17:08, Julian Keil escribió: > >> Hi Stephan, >> >> thanks for your quick reply. >> >> If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. >> >> If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. >> >> Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? >> >> Thanks a lot once more. >> >> Julian >> >> Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: >> >>> >>> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? >>> >>> best, >>> >>> Stephan >>> >>> ________________________________________________________ >>> Stephan Moratti, PhD >>> >>> see also: http://web.me.com/smoratti/ >>> >>> Universidad Complutense de Madrid >>> Facultad de Psicología >>> Departamento de Psicología Básica I >>> Campus de Somosaguas >>> 28223 Pozuelo de Alarcón (Madrid) >>> Spain >>> >>> and >>> >>> Center for Biomedical Technology >>> Laboratory for Cognitive and Computational Neuroscience >>> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >>> Campus Montegancedo >>> 28223 Pozuelo de Alarcón (Madrid) >>> Spain >>> >>> >>> email: smoratti at psi.ucm.es >>> Tel.: +34 679219982 >>> >>> El 19/12/2013, a las 15:38, Julian Keil escribió: >>> >>>> Dear all, >>>> >>>> I have a problem of which I can't really find the source. >>>> >>>> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >>>> >>>> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >>>> >>>> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >>>> >>>> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >>>> >>>> Does anyone have an idea at which point this problem might occur? >>>> >>>> Thanks a lot. >>>> >>>> Julian >>>> >>>> >>>> >>>> P.S.: Below are the basic steps I use: >>>> >>>> %% 2.1. Build individual BEM-Model >>>> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >>>> >>>> cfg=[]; >>>> cfg.method='interactive'; >>>> cfg.coordsys = 'ctf'; >>>> >>>> mri_r = ft_volumerealign(cfg,mri); >>>> >>>> cfg=[]; >>>> >>>> mri_rs = ft_volumereslice(cfg,mri_r); >>>> >>>> %% Segment the individual volume >>>> cfg=[]; >>>> cfg.output={'brain' 'scalp' 'skull'}; >>>> cfg.brainsmooth = 5; >>>> cfg.scalpsmooth = 5; >>>> cfg.brainthreshold = .5; >>>> cfg.scalpthreshold = .1; >>>> mri_s = ft_volumesegment(cfg,mri_rs); >>>> >>>> %% Create Headmodel >>>> cfg=[]; >>>> cfg.interactive = 'no'; >>>> cfg.numvertices = 1000; >>>> >>>> bnd_s = ft_prepare_mesh(cfg,mri_s); >>>> >>>> cfg=[]; >>>> cfg.method='dipoli'; % >>>> cfg.conductivity=[0.3300 0.0041 0.3300]; >>>> >>>> vol_s = ft_prepare_headmodel(cfg,bnd_s); >>>> >>>> cfg = []; >>>> cfg.mri = mri_s; >>>> grid = ft_prepare_sourcemodel(cfg); >>>> >>>> grid.inside = find(grid.brain==1)'; >>>> grid.outside = find(grid.brain==0)'; >>>> grid.pos = grid.pos*10; % Set right dimensions >>>> >>>> %% Align Electrodes >>>> cfg=[]; >>>> cfg.method='interactive'; >>>> cfg.elec=elec_128; >>>> cfg.headshape=vol_s.bnd(1); >>>> >>>> elec_new=ft_electroderealign(cfg); >>>> >>>> %% 4. Make the Leadfield. >>>> elec_new.type='eeg'; >>>> >>>> cfg=[]; >>>> cfg.channel = 1:126; >>>> cfg.elec=elec_new; >>>> cfg.vol=vol_s; >>>> cfg.grid=grid; >>>> >>>> lf = ft_prepare_leadfield(cfg); >>>> >>>> %% BEAMFORMER >>>> >>>> cfg=[]; >>>> cfg.channel=1:126; >>>> cfg.method='lcmv'; %Time-Domain-Beamformer >>>> cfg.grid=lf; >>>> cfg.vol=vol_s; >>>> cfg.elec=elec_new; >>>> cfg.reducerank = 3; >>>> cfg.keepfilter='yes'; >>>> >>>> beamfilter = ft_sourceanalysis(cfg, dat4beam); >>>> >>>> %% Keep the cfg, just add the filter. >>>> >>>> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >>>> >>>> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >>>> lcmv_act = ft_sourceanalysis(cfg, act_dat); >>>> >>>> >>>> >>>> ******************** >>>> Dr. Julian Keil >>>> >>>> AG Multisensorische Integration >>>> Psychiatrische Universitätsklinik >>>> der Charité im St. Hedwig-Krankenhaus >>>> Große Hamburger Straße 5-11, Raum E 307 >>>> 10115 Berlin >>>> >>>> Telefon: +49-30-2311-1879 >>>> Fax: +49-30-2311-2209 >>>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From R.Oostenveld at donders.ru.nl Fri Dec 20 14:38:37 2013 From: R.Oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 20 Dec 2013 14:38:37 +0100 Subject: [FieldTrip] Job posting: 9 PhD positions in the Dutch Research Consortium 'Language in Interaction' References: <1517293618.4361293.1387545450952.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <5A236B39-57EC-4178-9F97-4106E05B1428@donders.ru.nl> Begin forwarded message: > From: "Lorenz, C.M." > Date: 20 December 2013 14:17:30 CET > To: R.Oostenveld at donders.ru.nl > Subject: Job posting: 9 PhD positions in the Dutch Research Consortium 'Language in Interaction' > > Nine PhD Positions in the Dutch Research Consortium 'Language in Interaction' > > We are looking for highly motivated PhD candidates to enrich a unique consortium of researchers that aims to unravel the neurocognitive mechanisms of language at multiple levels. The goal is to understand both the universality and the variability of the human language faculty from genes to behaviour. > > The Netherlands has an outstanding track record in the language sciences. This research consortium sponsored by a large grant from the Netherlands Organization for Scientific research (NWO) brings together many of the excellent research groups in the Netherlands with a research programme on the foundations of language. The research team consists of 43 Principal Investigators. In addition to the excellence in the domain of language and related relevant fields of cognition, our consortium provides state-of-the-art research facilities and a research team with ample experience in the complex research methods that will be invoked to address the scientific questions at the highest level of methodological sophistication. These include methods from genetics, neuroimaging, computational modelling, and patient-related research. This consortium realizes both quality and critical mass for studying human language at a scale not easily found anywhere else. > > Currently, the consortium advertises nine PhD positions for a period of 4 years. These positions provide the opportunity for conducting world-class research as a member of an interdisciplinary team. > > Closing date for application: February 2, 2014 > > Click here for more information on the PhD positions and how to apply. > > (url = http://www.ru.nl/vacatures/details/details_vacature_0?recid=529314) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mje.mads at gmail.com Fri Dec 20 23:43:02 2013 From: mje.mads at gmail.com (Mads Jensen) Date: Fri, 20 Dec 2013 23:43:02 +0100 Subject: [FieldTrip] permutation test on extracted sources? Message-ID: <52B4C7F6.6060609@gmail.com> Hi all, I have some data that are extracted time series from a source reconstruction. I would like to use the statistical apparatus of Fieldtrip to do permutation tests on these data. Is is possible to create a "virtual" channel and do a permutation test on that, and what about multiple "virtual" channels at the same time? best wishes, mads From n.lam at fcdonders.ru.nl Sat Dec 21 09:53:47 2013 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Sat, 21 Dec 2013 09:53:47 +0100 (CET) Subject: [FieldTrip] permutation test on extracted sources? In-Reply-To: <52B4C7F6.6060609@gmail.com> Message-ID: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> Hi Mads, FieldTrip has a virtual sensor tutorial. http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors?s[]=beamformer&s[]=extended I'm not too familiar with it, but I do know that it uses a time-series source reconstruction (LCMV Beamformer) which is probably similar to what you've done. Further down the tutorial they do a source analysis with ft_sourceanalysis which the output I think you can use to do statistics (ft_sourcestatistics). I'm sure some other FT members can add to the details. Hope this helps. Best, Nietzsche ----- Original Message ----- > From: "Mads Jensen" > To: fieldtrip at science.ru.nl > Sent: Friday, 20 December, 2013 11:43:02 PM > Subject: [FieldTrip] permutation test on extracted sources? > Hi all, > > I have some data that are extracted time series from a source > reconstruction. I would like to use the statistical apparatus of > Fieldtrip to do permutation tests on these data. > > Is is possible to create a "virtual" channel and do a permutation test > on that, and what about multiple "virtual" channels at the same time? > > > best wishes, > mads > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From mje.mads at gmail.com Fri Dec 27 10:46:06 2013 From: mje.mads at gmail.com (Mads Jensen) Date: Fri, 27 Dec 2013 10:46:06 +0100 Subject: [FieldTrip] permutation test on extracted sources? In-Reply-To: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> References: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <52BD4C5E.8020106@gmail.com> Hi Liam, Thanks I had missed that tutorial, very useful. best, mads On 12/21/2013 09:53 AM, Lam, Nietzsche wrote: > Hi Mads, > > FieldTrip has a virtual sensor tutorial. > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors?s[]=beamformer&s[]=extended > > I'm not too familiar with it, but I do know that it uses a time-series source reconstruction (LCMV Beamformer) which is probably similar to what you've done. Further down the tutorial they do a source analysis with ft_sourceanalysis which the output I think you can use to do statistics (ft_sourcestatistics). I'm sure some other FT members can add to the details. > > Hope this helps. > > Best, > Nietzsche > > ----- Original Message ----- >> From: "Mads Jensen" >> To: fieldtrip at science.ru.nl >> Sent: Friday, 20 December, 2013 11:43:02 PM >> Subject: [FieldTrip] permutation test on extracted sources? >> Hi all, >> >> I have some data that are extracted time series from a source >> reconstruction. I would like to use the statistical apparatus of >> Fieldtrip to do permutation tests on these data. >> >> Is is possible to create a "virtual" channel and do a permutation test >> on that, and what about multiple "virtual" channels at the same time? >> >> >> best wishes, >> mads >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From R.Zimmermann at UKE.Uni-Hamburg.de Mon Dec 2 14:33:25 2013 From: R.Zimmermann at UKE.Uni-Hamburg.de (Dr. Zimmermann) Date: Mon, 2 Dec 2013 14:33:25 +0100 Subject: [FieldTrip] Format for storing MRI data (DICOM import for CTF MEG) In-Reply-To: References: <5298908D.2000005@donders.ru.nl> Message-ID: <529C8C25.1000300@UKE.Uni-Hamburg.de> Hi, we're operating a CTF MEG, our MRI data is provided in DICOM format. The FieldTrip doc about conversion of DICOM data into CTF format: http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format has already found its way to us. Currently, we we're still using the '...old and difficult way' since import and setting of fiducials is done by people (=> MRI-operator) other than the later users (=> MRI-user) of the mri data. To keep this task sharing, each converted MRI should be saved to a file by a MRI-operator. Later this file could be opened by the MRI-user. On the one hand the saved file should contain all of the MRI content (data, hdr with transformation matrices etc.), on the other hand I wouldn't like to add software prerequisites (as spm or freesurfer) for the storage or later reading process. Obviously I can take the (still provided) original CTF routine: writeCTFMRI.m (This would mean to regress most of the importing process). Is there a way to store the MRI data in CTF format without using the function provided by CTF? Regards, Roger -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- A non-text attachment was scrubbed... Name: R_Zimmermann.vcf Type: text/x-vcard Size: 427 bytes Desc: not available URL: From thomas.wunderle at esi-frankfurt.de Mon Dec 2 14:41:35 2013 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Mon, 2 Dec 2013 13:41:35 +0000 Subject: [FieldTrip] ft_connectivity_csd2transfer Message-ID: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> Hi, a small bug has slipped in during the last update of the function " ft_connectivity_csd2transfer" The "f" in the function definition is missing, so the function is recognized as a script "unction [output] = ft_connectivity_csd2transfer(freq, varargin)" Best, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel:   +49 69 96769 519 Fax:   +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries From jan.schoffelen at donders.ru.nl Mon Dec 2 15:41:54 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 2 Dec 2013 15:41:54 +0100 Subject: [FieldTrip] ft_connectivity_csd2transfer In-Reply-To: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> References: <27E5CAD9145EEC41BB9B34C01716A1983049CADE@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <4E8B9A63-3813-490C-94B2-55BDD52AF96B@donders.ru.nl> Hi Thomas, My bad, apologies and thanks for noticing and letting us know. I fixed it. Best, JM On Dec 2, 2013, at 2:41 PM, Wunderle, Thomas wrote: > Hi, > a small bug has slipped in during the last update of the function " ft_connectivity_csd2transfer" > > The "f" in the function definition is missing, so the function is recognized as a script > > "unction [output] = ft_connectivity_csd2transfer(freq, varargin)" > > Best, > Thomas > > ----- > Dr. Thomas Wunderle > Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 519 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Geschäftsführer: Prof. Dr. Pascal Fries > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Dec 2 20:15:38 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 2 Dec 2013 14:15:38 -0500 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Thank you Arjen, Actually, I am testing the FieldTrip motion regression on MEG data specifically collected with a current phantom and known motion. I can treat the data as ERP data and average over 1 sec trials if needed. Following your advise on reduction of the regressors number (on 120 trials of 1 sec long) I was able to avoid the "out of memory" issue. Though I run into the different set of problems now that I need help to understand: ______________________________________________ ??? Error using ==> mxSerialize Error during serialization of (null) Error in ==> ft_postamble_provenance at 91 cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); Error in ==> ft_postamble at 55 evalin('caller', ['ft_postamble_' cmd]); Error in ==> ft_timelockanalysis at 370 ft_postamble provenance timelock Error in ==> ft_regressconfound at 313 dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging _________________________________________________________ Here is the code I run to regress the head motion: %% addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 ft_defaults cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; cfg.trialdef.triallength=1; cfg.trialdef.ntrials=120; cfg.continuous = 'yes'; cfg = ft_definetrial(cfg); cfg.channel = {'MEG'}; cfg.demean = 'yes'; data = ft_preprocessing(cfg); %% cfg = []; cfg.keeptrials = 'yes'; timelock = ft_timelockanalysis(cfg, data); %% cfg = []; cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; cfg.trialdef.triallength=1; cfg.trialdef.ntrials=120; cfg.continuous = 'yes'; cfg = ft_definetrial(cfg); %% cfg.channel = {'HLC0011','HLC0012','HLC0013', ... 'HLC0021','HLC0022','HLC0023', ... 'HLC0031','HLC0032','HLC0033'}; headpos = ft_preprocessing(cfg); ntrials = length(headpos.sampleinfo) for t = 1:ntrials coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; end cc = circumcenter(coil1, coil2, coil3); cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; %% confound = [cc_dem ... ones(size(cc_dem,1),1)]; %% cfg = []; cfg.confound = confound; cfg.reject = [1:6]; regr = ft_regressconfound(cfg, timelock); %% _________________________________________________________________ Sorry for the lengthy letter and thanks for the help! Inna On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) wrote: > Hi Inna, > > Are you using the same design matrix as on the wiki page? That one covers > the primary head translations and rotations, but also their > derivatives. You could try using the primary measures only (3 > translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant > regressors). It is also mentionworthy that there should be a balance > between the number of regressors and the number of observations > (i.e. trials). I believe on the respective wiki page on head movement > regression it states that the ratio is recommended to be not larger > than 1:10 (regressors:trials), accompanied with a reference. Accordingly, > I'd suggest to use those 7 regressors, and your data (120s resting state) > split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These > specifications might hopefully also allow working around your memory issue. > > Second, it may be worth mentioning what you would like to do with the data > post-movement-regression. Namely, the movement compensation will remove > contributions from head movement to the signal. But this requires that > signal to behave consistently over trials, which does not seem the case > with the signal in your resting study? That is, with an ERP study, the > signal fluctuations appear consistent over trials, with amplitudes being > modulated by head movement (i.e. sensor-source distance, see our neuroimage > paper - 2013) in a predictable fashion. So if you're planning on doing > frequency analysis, or maybe connectivity analysis, after head movement > compensation, I'd recommend reversing that order. The rule of thumb is to > use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise > unexplained variance (over trials) due to head movement, benefitting your > statistical assessments. > > Hope these suggestions may help you with further analyses. I'm > not familiar with anyone implementing this method to resting state > analyses, but maybe someone else has some first-hand experience here. > Furthermore, too late for your current dataset, but for a next one I'd > recommend using the online head position monitoring/respositioning tool > that we have developed for CTF systems (a neuromag version is approaching > the final stage). This tool is routinely used in our lab to monitor > and reduce head movment throughout recording (after which > ft_regressconfound is being used to deal with the trial-by-trial crumbles). > > Yours, > Arjen > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Tue Dec 3 19:04:36 2013 From: octavian.lie at gmail.com (Octavian Lie) Date: Tue, 3 Dec 2013 12:04:36 -0600 Subject: [FieldTrip] openmeeg matlab path Message-ID: Dear All, I installed openmeeg on my ubuntu 12.04 64 bit via github, tested it and works well from the terminal; I usually initiate the job from the terminal with: cd openmeeg/data/< subject> #!/usr/bin/env bash ... However matlab cannot see path, I get this matlab error when calling via fieldtrip Error using ft_hastoolbox (line 445) the OPENMEEG toolbox is not installed, see http://gforge.inria.fr/projects/openmeeg and http://gforge.inria.fr/frs/?group_id=435 Error in ft_headmodel_openmeeg (line 35) ft_hastoolbox('openmeeg', 1); ... How can I make matlab see path? I have read that one has to add these export PATH=$PATH:/opt/openmeeg/bin export DYLD_LIBRARY_PATH=/opt/openmeeg/lib:$LD_LIBRARY_PATH Where have these to be added, in the startup.m, terminal, or linux script? Thank you, Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Tue Dec 3 21:15:26 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Tue, 3 Dec 2013 21:15:26 +0100 Subject: [FieldTrip] openmeeg matlab path In-Reply-To: References: Message-ID: Dear Octavian, try something like this in the matlab prompt setenv('PATH', '/opt/openmeeg/bin') setenv('LD_LIBRARY_PATH', '/opt/openmeeg/lib') on linux and on mac: setenv('PATH', '/opt/openmeeg/bin') setenv('DYLD_LIBRARY_PATH', '/opt/openmeeg/lib') to test your install run: system('om_assemble') you should see something like: >> system('om_assemble') om_assemble version 2.2 compiled at Dec 3 2013 20:41:48 Not enough arguments Please try "om_assemble -h" or "om_assemble --help " ans = 0 Hope this helps, Alex On Tue, Dec 3, 2013 at 7:04 PM, Octavian Lie wrote: > Dear All, > > I installed openmeeg on my ubuntu 12.04 64 bit via github, tested it and > works well from the terminal; I usually initiate the job from the terminal > with: > > cd openmeeg/data/< subject> > #!/usr/bin/env bash > ... > > However matlab cannot see path, I get this matlab error when calling via > fieldtrip > > Error using ft_hastoolbox (line 445) > the OPENMEEG toolbox is not installed, see > http://gforge.inria.fr/projects/openmeeg and > http://gforge.inria.fr/frs/?group_id=435 > > Error in ft_headmodel_openmeeg (line 35) > ft_hastoolbox('openmeeg', 1); > ... > > How can I make matlab see path? I have read that one has to add these > > export PATH=$PATH:/opt/openmeeg/bin > export DYLD_LIBRARY_PATH=/opt/openmeeg/lib:$LD_LIBRARY_PATH > > Where have these to be added, in the startup.m, terminal, or linux script? > > Thank you, > > Octavian > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From octavian.lie at gmail.com Wed Dec 4 04:40:54 2013 From: octavian.lie at gmail.com (Octavian Lie) Date: Tue, 3 Dec 2013 21:40:54 -0600 Subject: [FieldTrip] openmeeg matlab path In-Reply-To: References: Message-ID: Thank you, Alexandre. In the end, it was not the openmeeg path which was the only issue, it was the absence of fieldtrip wrappers such as om_save_tri.m in the spm external fieldtrip distribution, so it turns out that both fieldtrip and openmeeg have to be installed and on path for forward model calculation using spm GUI option openmeeg. That was not clear at the outset. Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean-baptiste.versini at etu.univ-lyon1.fr Wed Dec 4 11:38:52 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Wed, 4 Dec 2013 10:38:52 +0000 Subject: [FieldTrip] Reorder labels Message-ID: <5271B6068CD8D94DB82254228237928801790806@mbx2010-02.univ-lyon1.fr> Dear all, When I delete channels and then use ft_channelrepair to reconstruct the missing channel, it changes the order of the label (reconstructed channel are added at the end of the list). I know it doesn't matter when I use fieldtrip functions but it does matter when I use my function. I wanted to know if there was an easy way in fieldtrip to reorder all the channel by an alphalphabetical order since I assume it does something like this when we process data with different channel order. Regards, JB -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Thu Dec 5 15:06:20 2013 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 05 Dec 2013 15:06:20 +0100 Subject: [FieldTrip] beamforming: one/two sources and subject specific ROI In-Reply-To: <52A0871E.6090204@gmail.com> References: <52A0871E.6090204@gmail.com> Message-ID: <52A0885C.5030706@gmail.com> Dear FT community, I have (nice!) source-reconstruction results for my data (attached) and now I've got a list of things I'd like to do next but I've got some specific questions left. 1) ft_sourcestatistics detects /one /cluster (p = .002). It'd be nice if I could say there are two different "sources" for my effect, one temporo-parietal and one frontal. But I believe that from a source reconstruction perspective, I cannot claim that. Could anyone confirm that for me? 2) Based on the stats, I'd like to define my ROI and go back to individual subjects to look at the single-trial data within this detected source. (Ultimately, I'd like to correlate power within that source with reaction times). Joern had some suggestions about how to select the ROI "I had the feeling that especially this latter approach (base ROI on GA +/- 3 cm, smooth individual subject data, select most sensitive voxel)" http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006733.html Has anyone done something similar (or different)? Did it work out well? The problem I think I'll face is that my source isn't very focal (half of the left hemisphere!), so I'd be very happy to hear your thoughts on whether this analysis is even feasible... Thanks a lot, Vitoria -- ** Please consider the environment - do you really need to print? ** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_ex.jpg Type: image/jpeg Size: 22840 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Dec 5 17:00:40 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 05 Dec 2013 17:00:40 +0100 Subject: [FieldTrip] beamforming: one/two sources and subject specific ROI In-Reply-To: <52A0885C.5030706@gmail.com> References: <52A0871E.6090204@gmail.com> <52A0885C.5030706@gmail.com> Message-ID: <52A0A328.7050704@donders.ru.nl> Hi Vitoria, I also got two other remarks that might help you. On the one hand, you could play around with the regularization of the source reconstruction (lambda), that might help to get more focal sources. On the other hand, you can also play around with your clusteralpha, if you decrease that you could get spatially more defined clusters. Oh and, don't necessarily trust the surface plots - they display a projection onto the brain surface, thus deeper brain activity will appear of neocortical origin. Of course, it looks nice for a paper :) But to make precise regional specific claims, an ortho plot might be better. Regarding your questions, for 1) I would agree, for 2), well you cited my mail, so that's the two ways I'd try :) Best, Jörn Vitoria Piai wrote: > Dear FT community, > > I have (nice!) source-reconstruction results for my data (attached) > and now I've got a list of things I'd like to do next but I've got > some specific questions left. > > 1) ft_sourcestatistics detects /one /cluster (p = .002). It'd be nice > if I could say there are two different "sources" for my effect, one > temporo-parietal and one frontal. But I believe that from a source > reconstruction perspective, I cannot claim that. Could anyone confirm > that for me? > > 2) Based on the stats, I'd like to define my ROI and go back to > individual subjects to look at the single-trial data within this > detected source. (Ultimately, I'd like to correlate power within that > source with reaction times). > Joern had some suggestions about how to select the ROI "I had the feeling that especially this latter approach (base ROI on GA +/- 3 cm, smooth individual subject data, select most sensitive voxel)" > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006733.html > Has anyone done something similar (or different)? Did it work out well? > The problem I think I'll face is that my source isn't very focal (half of the left hemisphere!), so I'd be very happy to hear your thoughts on whether this analysis is even feasible... > > Thanks a lot, > Vitoria > > -- > ** Please consider the environment - do you really need to print? ** > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From ayobimpe2004 at hotmail.com Thu Dec 5 20:32:49 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 5 Dec 2013 20:32:49 +0100 Subject: [FieldTrip] Source Analysis Message-ID: hello, 1. I used ASA head model to projected electrode on it to calculated the lead field and perform source analysis. I ma having problem with the projection of source on MRI after source interpolation. The source couldn't align with the MRI image. The first picture is for the source (before interpolation) and the second is after interpolation. I have tried several methods like volumeresclice but no good result. Please help me! 2. I want to do source analysis in frequency band (like alpha, beta etc) with frequency analysed data (ouput of ft_frequencyanalysis). But in the source analysis, I can only select one frequency (not band). Please I how can I play with it to get the frequency range of interest? Best regards, Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig2.png Type: image/png Size: 22122 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig1.png Type: image/png Size: 95973 bytes Desc: not available URL: From russgport at gmail.com Thu Dec 5 23:36:56 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 5 Dec 2013 17:36:56 -0500 Subject: [FieldTrip] questions itc/plf calculation via hilbert transformations Message-ID: Hi fellow fieldtippers, I have a question that brought around by an answer I previously received. For data analyzed with ft_freqanalysis and using the 'wavelet' option I can computer ITC/PLF via, tmpdat = freq.fourierspctrm; tmpdat = tmpdat./abs(tmpdat); ; % this will normalize each trial for its amplitude; itc = abs(mean(tmpdat)); % this will give the itc thank you again Jan-Mathijs for this insight I am now trying to calculate ITC via hilbert transformation, putting my VE data through ft_preproc_hilbert. Can I just use the cfg.option = 'imag', to get the imaginary component of the analytic signal, since this is what i use with wavelets (i.e. what the tmpda =tmpdat./abs(tmpdat) achieves). Then I would just repeat the last line itc = abs(mean(tmpdat)). I only hesitate because on several of the mailing list emails people have suggested doing cfg.option = 'angle' (which computes the imaginary component (tmpdat./abs(tmpdat) then uses the angle function (angle()). Have I been calculating ITC wrong for my wavelets? Or should i just the the cfg.option = 'imag' and mimik my wavelet based ITC. Thanks Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Dec 6 07:18:47 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 6 Dec 2013 07:18:47 +0100 Subject: [FieldTrip] questions itc/plf calculation via hilbert transformations In-Reply-To: References: Message-ID: Hi Russ, The imaginary part of a complex number (i.e. the 'b' in 'a+b*i') is very different from the phase (i.e. the 'p' in 'A*exp(i*p)'). When computing ITC, the expression z = z / abs(z) sets the amplitude (A) to 1, while preserving the phase. This is not the same as taking the imaginary par. To be able to later compute the ITC, I would actually just use cfg.hilbert = 'complex', and then do the exact same computations as with your wavelet approach. Using cfg.hilbert = 'angle' gives you the angle (in radians) directly, so a real number. This is more difficult (and slow) to work with than using the normalized complex representation. Hope this helps, Best, Eelke On Dec 5, 2013 11:39 PM, "Russell G Port" wrote: > Hi fellow fieldtippers, > > I have a question that brought around by an answer I previously received. > For data analyzed with ft_freqanalysis and using the 'wavelet' option I > can computer ITC/PLF via, > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); ; % this will normalize each trial for its > amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > > thank you again Jan-Mathijs for this insight > > I am now trying to calculate ITC via hilbert transformation, putting my VE > data through > > ft_preproc_hilbert. Can I just use the cfg.option = 'imag', to get the > imaginary component of > > the analytic signal, since this is what i use with wavelets (i.e. what the > > tmpda =tmpdat./abs(tmpdat) achieves). Then I would just repeat the last > line itc = > > abs(mean(tmpdat)). I only hesitate because on several of the mailing list > emails people have > > suggested doing cfg.option = 'angle' (which computes the imaginary > component (tmpdat./abs(tmpdat) then uses the angle function (angle()). > Have I been calculating ITC wrong for my wavelets? Or should i just the the > cfg.option = 'imag' and mimik my wavelet based ITC. > > Thanks > > Russ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Dec 6 16:07:24 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 6 Dec 2013 16:07:24 +0100 Subject: [FieldTrip] Source Analysis In-Reply-To: References: Message-ID: Hi Azeez, For your question (1), I think it would be helpful if you give a bit more information on what you are doing. If the source reconstruction is not aligned to your MRI, probably some ingredient for the source analysis was also misaligned. Could you see whether your source model, volume conduction model, and sensor definition are all in alignment? (See here http://fieldtrip.fcdonders.nl/faq/how_can_i_check_whether_the_grid_that_i_have_is_aligned_to_the_segmented_volume_and_to_the_sensor_gradiometer ) Regarding (2): typically I would use cfg.taper = 'dpss' (the default) and then choose a combination of cfg.foi and cfg.tapsmofrq that yield the frequency band of interest. E.g. cfg.foi = 20 and cfg.tapsmofrq = 8 gives you a frequency band ranging from 12 to 28 Hz. Best, Eelke On 5 December 2013 20:32, Azeez Adebimpe wrote: > > hello, > > 1. I used ASA head model to projected electrode on it to calculated the > lead field and perform source analysis. I ma having problem with the > projection of source on MRI after source interpolation. The source couldn't > align with the MRI image. The first picture is for the source (before > interpolation) and the second is after interpolation. I have tried several > methods like volumeresclice but no good result. Please help me! > > > 2. I want to do source analysis in frequency band (like alpha, beta etc) > with frequency analysed data (ouput of ft_frequencyanalysis). But in the > source analysis, I can only select one frequency (not band). Please I how > can I play with it to get the frequency range of interest? > > Best regards, > Azeez Adebimpe > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ayobimpe2004 at hotmail.com Fri Dec 6 16:21:52 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Fri, 6 Dec 2013 16:21:52 +0100 Subject: [FieldTrip] Source Analysis In-Reply-To: References: Message-ID: Thank you Eelke,I got the second part very well.I ensured that the sensor aligned very well on the head model before calculating there source analysis. I don't have the MRI for the subjects but want to use any of the template MRI to view the result of source analysis. I made use of T1,mii in spm8 but couldn't get it as it was done in online tutorial. I don't have MRI for the patients but used head model from ASA software.I will be glad for more info. Azeez > Date: Fri, 6 Dec 2013 16:07:24 +0100 > From: eelke.spaak at donders.ru.nl > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Source Analysis > > Hi Azeez, > > For your question (1), I think it would be helpful if you give a bit > more information on what you are doing. If the source reconstruction > is not aligned to your MRI, probably some ingredient for the source > analysis was also misaligned. Could you see whether your source model, > volume conduction model, and sensor definition are all in alignment? > (See here http://fieldtrip.fcdonders.nl/faq/how_can_i_check_whether_the_grid_that_i_have_is_aligned_to_the_segmented_volume_and_to_the_sensor_gradiometer > ) > > Regarding (2): typically I would use cfg.taper = 'dpss' (the default) > and then choose a combination of cfg.foi and cfg.tapsmofrq that yield > the frequency band of interest. E.g. cfg.foi = 20 and cfg.tapsmofrq = > 8 gives you a frequency band ranging from 12 to 28 Hz. > > Best, > Eelke > > On 5 December 2013 20:32, Azeez Adebimpe wrote: > > > > hello, > > > > 1. I used ASA head model to projected electrode on it to calculated the > > lead field and perform source analysis. I ma having problem with the > > projection of source on MRI after source interpolation. The source couldn't > > align with the MRI image. The first picture is for the source (before > > interpolation) and the second is after interpolation. I have tried several > > methods like volumeresclice but no good result. Please help me! > > > > > > 2. I want to do source analysis in frequency band (like alpha, beta etc) > > with frequency analysed data (ouput of ft_frequencyanalysis). But in the > > source analysis, I can only select one frequency (not band). Please I how > > can I play with it to get the frequency range of interest? > > > > Best regards, > > Azeez Adebimpe > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Sun Dec 8 20:46:55 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Sun, 8 Dec 2013 20:46:55 +0100 Subject: [FieldTrip] fit volume segment and sensors Message-ID: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> Dear Fieldtrippers I 'm trying to perform source analysis on MEG data. I use an AtB system (usually it is described as 'itab' in fieldtrip) First I have preprocessed my data and I have calculated the cross spectral density matrix Then I have constructed the forward model mri = ft_read_mri('Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; [segmentedmri] = ft_volumesegment(cfg, mri); and segmented the brain surface: cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); With the command ft_read_sens I have also read the sensors positions. Before going on I have checked the results plotting the volume and the sensors using the commands vol = ft_convert_units(vol,'cm'); sens = ft_read_sens(rawdataname); figure ft_plot_sens(sens, 'style', '*b'); hold on ft_plot_vol(vol); and I have noticed that the result is wrong because the volume soesn't fit the sensors as shown in the attachment Moreover, following some topics in the mailing list I have used ft_determine_coordsys(mri) ft_determine_coordsys(vol) ft_determine_coordsys(sens) and I have found that the coordinate systems are diffeerent. As far as I understand I should use the ctf coordinate system to perform the source analysis. But even if I try to specify this coordinate system it did not work. Any suggestion to solve this problem? Kind regards ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3401689815 tel +39 0818675361 fax +39 0818675128 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -------------- next part -------------- A non-text attachment was scrubbed... Name: brain&sensors.png Type: image/png Size: 22007 bytes Desc: not available URL: From a.todorovic at fcdonders.ru.nl Sun Dec 8 22:44:03 2013 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Sun, 8 Dec 2013 22:44:03 +0100 (CET) Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Dear 'trippers, I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. This is how I normally do it: cfg = []; cfg.planarmethod = 'sincos'; cfg.channel = {'MEG'}; cfg.trials = 'all'; cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) data_planar = ft_megplanar(cfg,data); Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? Cheers, Ana From ayobimpe2004 at hotmail.com Sun Dec 8 22:44:42 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 8 Dec 2013 22:44:42 +0100 Subject: [FieldTrip] TOPOPLOTER Message-ID: Dear all, Please I am using the topopotER but I ma getting the below error message: ??? Index exceeds matrix dimensions. Error in ==> ft_plot_topo at 182 mask{i}(end+1,:) = mask{i}(1,:); % force them to be closed Error in ==> topoplot_common at 709 ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ==> ft_topoplotER at 169cfg = topoplot_common(cfg, varargin{:});Please help of what am missing here.Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Dec 9 09:16:11 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 9 Dec 2013 09:16:11 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: Hi Ana, Are you by any chance doing ICA followed by ft_rejectcomponent at some point before ft_megplanar? After rejecting a component, grad.chanpos and grad.chanori will contain only NaNs (as of some months ago indeed), as the channel positions are ill-defined at that point (i.e. each 'data'-channel is in fact a weighted mixture of the original, physical, MEG channels). Since ft_megplanar needs the channel positions, it can no longer operate on data after ft_rejectcomponent. However, there is an easy workaround: the original channel positions should quite nicely approximate the positions after ft_rejectcomponent. So, what I do is simply store the original data.grad somewhere, and then make sure to stick in the data just before ft_megplanar. Note that the reason why ft_rejectcomponent updates the grad is that creating an accurate forward model (for source reconstruction) requires accurate sensor information. Therefore it fills grad.chanpos with NaNs, while updating grad.coilpos etc. to reflect the new projection. So you should *not* use the original grad for source analysis after ft_rejectcomponent, in that case just use the updated one with the NaNs inside. Best, Eelke On 8 December 2013 22:44, Todorovic, A. wrote: > Dear 'trippers, > > I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. > > This is how I normally do it: > > cfg = []; > cfg.planarmethod = 'sincos'; > cfg.channel = {'MEG'}; > cfg.trials = 'all'; > cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) > data_planar = ft_megplanar(cfg,data); > > > Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? > > > Cheers, > Ana > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Dec 9 09:19:04 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 9 Dec 2013 09:19:04 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: PS: Note that a bug is assigned to me to facilitate ft_megplanar after reprojection without artificially restoring the grad (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2332), so this should be fixed at some point. On 9 December 2013 09:16, Eelke Spaak wrote: > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. wrote: >> Dear 'trippers, >> >> I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. >> >> This is how I normally do it: >> >> cfg = []; >> cfg.planarmethod = 'sincos'; >> cfg.channel = {'MEG'}; >> cfg.trials = 'all'; >> cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) >> data_planar = ft_megplanar(cfg,data); >> >> >> Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? >> >> >> Cheers, >> Ana >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Mon Dec 9 10:36:08 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Mon, 9 Dec 2013 11:36:08 +0200 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand Message-ID: Hi, I want to save my multichannel EEG recordings after an experiment to process them offline with fieldtrip. I'm using Python to develop this system so I need some pointers to a Python package to save my data in a format that FT will understand. EDF, GDF can be read by FT but I couldn't find a writer library for those formats for Python. Will plain .mat files work? Thanks. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From jm.horschig at donders.ru.nl Mon Dec 9 11:30:30 2013 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 09 Dec 2013 11:30:30 +0100 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand In-Reply-To: References: Message-ID: <52A59BC6.5060408@donders.ru.nl> Dear Ozan, plain mat-files will do, but you will have to write your own wrapper: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import I don't know any Python toolboxes, so I cannot help with that (and that is because I don't know Python) Best, Jörn Ozan Çağlayan wrote: > Hi, > > I want to save my multichannel EEG recordings after an experiment to > process them offline with fieldtrip. I'm using Python to develop this > system so I need some pointers to a Python package to save my data in > a format that FT will understand. EDF, GDF can be read by FT but I > couldn't find a writer library for those formats for Python. Will > plain .mat files work? > > Thanks. > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 9 11:36:14 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 09 Dec 2013 11:36:14 +0100 Subject: [FieldTrip] TOPOPLOTER In-Reply-To: References: Message-ID: <52A59D1E.1000409@donders.ru.nl> Dear Azeez, at the moment it is hard to know why the error appears, there could be several reasons. Could you please provide some more information on what you are doing? Something along these lines: http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#example_message Best, Jörn Azeez Adebimpe wrote: > Dear all, > > Please I am using the topopotER but I ma getting the below error message: > > /??? Index exceeds matrix dimensions./ > / > / > /Error in ==> ft_plot_topo at 182/ > / mask{i}(end+1,:) = mask{i}(1,:); % force them to > be closed/ > / > / > /Error in ==> topoplot_common at 709/ > /ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,.../ > / > / > /Error in ==> ft_topoplotER at 169/ > /cfg = topoplot_common(cfg, varargin{:});/ > Please help of what am missing here. > Azeez Adebimpe > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 9 11:54:14 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 09 Dec 2013 11:54:14 +0100 Subject: [FieldTrip] fit volume segment and sensors In-Reply-To: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> References: <20131208204655.u4o78jn1wcg40woo@arco.cib.na.cnr.it> Message-ID: <52A5A156.3070408@donders.ru.nl> Dear Sara, the procedure described on the FT-page is tailored towards data gathered from CTF data just because we happen to have a CTF-system here. Since you have itab-data, the coordinate system of your sensors (gradiometers) is not in ctf-space. Some more information on the different coordinate systems can be found here: http://fieldtrip.fcdonders.nl/faq/how_are_the_different_head_and_mri_coordinate_systems_defined?s[]=coordinate&s[]=system#details_of_the_chieti_itab_coordinate_system Your first step needs to be to coregister the gradiometer information with the MRI. Afaik, ft_volumerealign will then also take care of the coordinate system then (or, more precisely, return the appropriate transformation). See also here http://fieldtrip.fcdonders.nl/faq/how_to_coregister_an_anatomical_mri_with_the_gradiometer_or_electrode_positions?s[]=coordinate&s[]=system If I remember correctly, this will not change the coordinate system of the gradiometers, but adjust the transformation matrix of the MRI instead. You do not need to be in CTF-space, you just need to make sure that all your data are in the same coordinate-system. Once you got that, it should work. For example, for EEG source reconstruction you can stay in MNI-space all the time. Dealing with these transformation between coordinate systems is some nasty job, so take care you do it correctly and e.g. not get confused by neurological and radiological convention And note that there is also ft_convert_coordsys for transformation, but I am not sure whether that works for gradiometers, yet. I think this all just works for volumes. I hope this works for you. Best, Jörn s.rombetto at cib.na.cnr.it wrote: > Dear Fieldtrippers > > I 'm trying to perform source analysis on MEG data. > I use an AtB system (usually it is described as 'itab' in fieldtrip) > > First I have preprocessed my data and I have calculated the cross > spectral density matrix > > Then I have constructed the forward model > > mri = ft_read_mri('Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > [segmentedmri] = ft_volumesegment(cfg, mri); > > and segmented the brain surface: > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > With the command ft_read_sens I have also read the sensors positions. > > Before going on I have checked the results plotting the volume and the > sensors using the commands > vol = ft_convert_units(vol,'cm'); > sens = ft_read_sens(rawdataname); > figure > ft_plot_sens(sens, 'style', '*b'); > hold on > ft_plot_vol(vol); > > and I have noticed that the result is wrong because the volume soesn't > fit the sensors as shown in the attachment > Moreover, following some topics in the mailing list I have used > > ft_determine_coordsys(mri) > ft_determine_coordsys(vol) > ft_determine_coordsys(sens) > > and I have found that the coordinate systems are diffeerent. > > As far as I understand I should use the ctf coordinate system to > perform the source analysis. But even if I try to specify this > coordinate system it did not work. > Any suggestion to solve this problem? > > Kind regards > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From christoph.herrmann at uni-oldenburg.de Mon Dec 9 14:18:55 2013 From: christoph.herrmann at uni-oldenburg.de (Christoph Herrmann) Date: Mon, 09 Dec 2013 14:18:55 +0100 Subject: [FieldTrip] Job offer (PhD student position) Message-ID: <52A5C33F.9080307@uni-oldenburg.de> Dear EEGLAB users, I am offering a position as a PhD student in my lab (see attachment). I would be happy if you could bring this job advertisement to the attention of students who might be suited candidates. The task of the PhD student will be to record EEG while participants receive transcranial alternating current stimulation (tACS). The project aims at investiagting which stimulation protocols are capable of modulating human EEG and perception. The project will be carried out in collaboration with the University Clinic in Hamburg Eppendorf (Andreas Engel) where similar experiments will be conducted in ferrets as well as with Münster University Clinic (Carsten Wolters) where a finite element model of tACS will be used to predict the pattern of current flow inside the brain. Best wishes, Christoph Herrmann -- Prof. Dr. Christoph Herrmann Departement of Psychology European Medical School Carl von Ossietzky University Ammerländer Heerstr. 114-118 26111 Oldenburg, Germany Tel: +49 441 798 4936 Fax: +49 441 798 3865 Office: A7/019 Web: http://www.uni-oldenburg.de/allgemeine-psychologie -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD in EEG-tACS.pdf Type: application/pdf Size: 114350 bytes Desc: not available URL: From a.todorovic at fcdonders.ru.nl Mon Dec 9 14:29:46 2013 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Mon, 9 Dec 2013 14:29:46 +0100 (CET) Subject: [FieldTrip] fieldtrip Digest, Vol 37, Issue 8 In-Reply-To: Message-ID: <1088480008.912147.1386595786285.JavaMail.root@monoceros.zimbra.ru.nl> Hi Eelke, Thanks for your quick reply! ICA is indeed what I normally do (including saving the original gradiometer definitions), but the NaNs appear even if I skip ICA and just preprocess and then do ft_megplanar directly after. However I am now starting to think that these NaNs are a normal consequence of doing a planar gradient transformation and that I was wrong to assume that this is what it causing my problem further down the pipeline. I dug up some old TFRs and saw that their grad.chanori structures also consist of NaNs. My apologies for not checking this previously. And the problem that I have is that the channel labels disappear after ft_freqdescriptives and that the powspctrm field is empty (or if I use a variant of ft_freqdescriptives which is newer than the one I normally use, an error with reshape occurs). The original TFRs prior to ft_freqdescriptives look OK though. But I will dig further to see what could be causing it - in most cases it's something I did. Cheers, Ana > > Message: 3 > Date: Mon, 9 Dec 2013 09:16:11 +0100 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] gradiometer definitions after ft_megplanar > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. > wrote: > > Dear 'trippers, > > > > I am attempting to do a TFR on planar gradient data. I first > > preprocess, then do ft_megplanar, then ft_freqanalysis, followed by > > ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori > > field consists only of NaNs. I see that some changes were made a few > > months ago on how gradiometers are described, so I am wondering > > whether there are some changes I should now make to the cfg > > structure when doing the planar gradient transformation. > > > > This is how I normally do it: > > > > cfg = []; > > cfg.planarmethod = 'sincos'; > > cfg.channel = {'MEG'}; > > cfg.trials = 'all'; > > cfg.neighbours = neighbours; % > > neighbours=ft_prepare_neighbours(cfg,data) > > data_planar = ft_megplanar(cfg,data); > > > > > > Alternatively, is there some workaround I could now implement to fix > > my already calculated TFR structures? > > > > > > Cheers, > > Ana > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 4 > Date: Mon, 9 Dec 2013 09:19:04 +0100 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] gradiometer definitions after ft_megplanar > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > PS: Note that a bug is assigned to me to facilitate ft_megplanar after > reprojection without artificially restoring the grad > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2332), so this should be > fixed at some point. > From a.stolk8 at gmail.com Mon Dec 9 15:48:35 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 9 Dec 2013 15:48:35 +0100 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Inna, Testing ft_regressconfound with some fake data, everything seems to be fine here: timelock = []; timelock.label = {'1' '2'}; timelock.time = 1:5; timelock.dimord = 'rpt_chan_time'; timelock.trial = randn(20,2,5); timelock.avg = randn(2,5); cfg = []; cfg.confound = randn(20,3); cfg.reject = [1:3]; timelock_out = ft_regressconfound(cfg, timelock); Does this example code work for you? I could not detect any mistake in your lines of code. What does your 'timelock' structure look like? Are there any real values in the data? (don't think this is causing it, but please update to newest Ft version just to be sure) Yours, Arjen 2013/12/2 McGowin, Inna > Thank you Arjen, > Actually, I am testing the FieldTrip motion regression on MEG data > specifically collected with a current phantom and known motion. I can treat > the data as ERP data and average over 1 sec trials if needed. > Following your advise on reduction of the regressors number (on 120 trials > of 1 sec long) I was able to avoid the "out of memory" issue. Though I run > into the different set of problems now that I need help to understand: > ______________________________________________ > ??? Error using ==> mxSerialize > Error during serialization of (null) > > Error in ==> ft_postamble_provenance at 91 > cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); > > Error in ==> ft_postamble at 55 > evalin('caller', ['ft_postamble_' cmd]); > > Error in ==> ft_timelockanalysis at 370 > ft_postamble provenance timelock > > Error in ==> ft_regressconfound at 313 > dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging > _________________________________________________________ > > Here is the code I run to regress the head motion: > %% > addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 > ft_defaults > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > cfg.trialdef.triallength=1; > cfg.trialdef.ntrials=120; > cfg.continuous = 'yes'; > cfg = ft_definetrial(cfg); > cfg.channel = {'MEG'}; > cfg.demean = 'yes'; > data = ft_preprocessing(cfg); > > %% > cfg = []; > cfg.keeptrials = 'yes'; > timelock = ft_timelockanalysis(cfg, data); > > %% > cfg = []; > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > cfg.trialdef.triallength=1; > cfg.trialdef.ntrials=120; > cfg.continuous = 'yes'; > cfg = ft_definetrial(cfg); > > %% > cfg.channel = {'HLC0011','HLC0012','HLC0013', ... > 'HLC0021','HLC0022','HLC0023', ... > 'HLC0031','HLC0032','HLC0033'}; > headpos = ft_preprocessing(cfg); > > ntrials = length(headpos.sampleinfo) > for t = 1:ntrials > coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); > mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; > coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); > mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; > coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); > mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; > end > > cc = circumcenter(coil1, coil2, coil3); > cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; > > %% > confound = [cc_dem ... > ones(size(cc_dem,1),1)]; > > %% > cfg = []; > cfg.confound = confound; > cfg.reject = [1:6]; > regr = ft_regressconfound(cfg, timelock); > %% > > _________________________________________________________________ > Sorry for the lengthy letter and thanks for the help! > > Inna > > > > > > On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Hi Inna, >> >> Are you using the same design matrix as on the wiki page? That one covers >> the primary head translations and rotations, but also their >> derivatives. You could try using the primary measures only (3 >> translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant >> regressors). It is also mentionworthy that there should be a balance >> between the number of regressors and the number of observations >> (i.e. trials). I believe on the respective wiki page on head movement >> regression it states that the ratio is recommended to be not larger >> than 1:10 (regressors:trials), accompanied with a reference. Accordingly, >> I'd suggest to use those 7 regressors, and your data (120s resting state) >> split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These >> specifications might hopefully also allow working around your memory issue. >> >> Second, it may be worth mentioning what you would like to do with the >> data post-movement-regression. Namely, the movement compensation will >> remove contributions from head movement to the signal. But this requires >> that signal to behave consistently over trials, which does not seem the >> case with the signal in your resting study? That is, with an ERP study, the >> signal fluctuations appear consistent over trials, with amplitudes being >> modulated by head movement (i.e. sensor-source distance, see our neuroimage >> paper - 2013) in a predictable fashion. So if you're planning on doing >> frequency analysis, or maybe connectivity analysis, after head movement >> compensation, I'd recommend reversing that order. The rule of thumb is to >> use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise >> unexplained variance (over trials) due to head movement, benefitting your >> statistical assessments. >> >> Hope these suggestions may help you with further analyses. I'm >> not familiar with anyone implementing this method to resting state >> analyses, but maybe someone else has some first-hand experience here. >> Furthermore, too late for your current dataset, but for a next one I'd >> recommend using the online head position monitoring/respositioning tool >> that we have developed for CTF systems (a neuromag version is approaching >> the final stage). This tool is routinely used in our lab to monitor >> and reduce head movment throughout recording (after which >> ft_regressconfound is being used to deal with the trial-by-trial crumbles). >> >> Yours, >> Arjen >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Mon Dec 9 17:49:06 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Mon, 9 Dec 2013 11:49:06 -0500 Subject: [FieldTrip] Sample Data Message-ID: Hey guys, I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I was wondering if anyone could point me in the direction of some sample data, preferably in Brainvision format. I was unable to retrieve any from websites such as eegdatabase.kiv. Thank you -Norman -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrolland at ucsd.edu Mon Dec 9 18:31:24 2013 From: mrolland at ucsd.edu (Matthieu Rolland) Date: Mon, 09 Dec 2013 09:31:24 -0800 Subject: [FieldTrip] Filtering before epoching Message-ID: <52A5FE6C.4030002@ucsd.edu> Hi everybody, Is it possible to filter data prior to epoching? And more generally is it possible to epoch data that has already been preprocessed? I have tried without success many variations of this: 1. Preprocessing step on continuous data with filtering. /cfg=[];// //cfg.dataset = 'raw_data.fif';// //cfg.bpfilter = 'yes';// //cfg.bpfreq = [a b];// //data = ft_preprocessing(cfg);/ 2. Define trial. /cfg =// ft_definetrial(cfg);/ 3. Preprocessing step for epoching data on filtered data. /final_data = ft_preprocessing(cfg,data);/ Thank you for your help. Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Dec 9 19:04:20 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 9 Dec 2013 13:04:20 -0500 Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: References: <2046766750.4089031.1385659396420.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Thanks you Your code works fine. Here is the Matlab output for this code: *the input is timelock data with 2 channels and 5 timebinsremoving confound 1 2 3 keeping confound normalizing the confounds, except the constant estimating the regression weights and removing the confounds updating descriptives the input is timelock data with 2 channels and 5 timebinsWarning: the data does not contain a trial definition > In utilities\private\warning_once at 158 In utilities\private\fixsampleinfo at 66 In ft_datatype_raw at 154 In ft_checkdata at 298 In ft_timelockanalysis at 105 In ft_regressconfound at 313Warning: reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuousrecording > In utilities\private\warning_once at 158 In utilities\private\fixsampleinfo at 79 In ft_datatype_raw at 154 In ft_checkdata at 298 In ft_timelockanalysis at 105 In ft_regressconfound at 313averaging trialsaveraging trial 20 of 20the call to "ft_timelockanalysis" took 1 secondsthe call to "ft_regressconfound" took 4 seconds* The data I am trying to correct for the motion is real. It was collected with a current phantom generating the signal by a dipole. The data is continuous but can be broken into trials of 1 sec (the dipole generates 7 Hz sinusoidal signal continuously). The phantom was mechanically moved during the scan for a precisely known amount (e.g. 1 cm down). The data was recorded by CTF 275-sensor MEG unit with the continuous head coils localization. I was able to apply the SSS motion correction algorithm successfully to this data set. If there is a way I could share this data set. Thanks, Inna Inna McGowin On Mon, Dec 9, 2013 at 9:48 AM, Arjen Stolk wrote: > Hi Inna, > > Testing ft_regressconfound with some fake data, everything seems to be > fine here: > > timelock = []; > timelock.label = {'1' '2'}; > timelock.time = 1:5; > timelock.dimord = 'rpt_chan_time'; > timelock.trial = randn(20,2,5); > timelock.avg = randn(2,5); > > cfg = []; > cfg.confound = randn(20,3); > cfg.reject = [1:3]; > timelock_out = ft_regressconfound(cfg, timelock); > > Does this example code work for you? I could not detect any mistake in > your lines of code. What does your 'timelock' structure look like? Are > there any real values in the data? (don't think this is causing it, but > please update to newest Ft version just to be sure) > > Yours, > Arjen > > > 2013/12/2 McGowin, Inna > > Thank you Arjen, >> Actually, I am testing the FieldTrip motion regression on MEG data >> specifically collected with a current phantom and known motion. I can treat >> the data as ERP data and average over 1 sec trials if needed. >> Following your advise on reduction of the regressors number (on 120 >> trials of 1 sec long) I was able to avoid the "out of memory" issue. Though >> I run into the different set of problems now that I need help to understand: >> ______________________________________________ >> ??? Error using ==> mxSerialize >> Error during serialization of (null) >> >> Error in ==> ft_postamble_provenance at 91 >> cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); >> >> Error in ==> ft_postamble at 55 >> evalin('caller', ['ft_postamble_' cmd]); >> >> Error in ==> ft_timelockanalysis at 370 >> ft_postamble provenance timelock >> >> Error in ==> ft_regressconfound at 313 >> dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging >> _________________________________________________________ >> >> Here is the code I run to regress the head motion: >> %% >> addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 >> ft_defaults >> cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; >> cfg.trialdef.triallength=1; >> cfg.trialdef.ntrials=120; >> cfg.continuous = 'yes'; >> cfg = ft_definetrial(cfg); >> cfg.channel = {'MEG'}; >> cfg.demean = 'yes'; >> data = ft_preprocessing(cfg); >> >> %% >> cfg = []; >> cfg.keeptrials = 'yes'; >> timelock = ft_timelockanalysis(cfg, data); >> >> %% >> cfg = []; >> cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; >> cfg.trialdef.triallength=1; >> cfg.trialdef.ntrials=120; >> cfg.continuous = 'yes'; >> cfg = ft_definetrial(cfg); >> >> %% >> cfg.channel = {'HLC0011','HLC0012','HLC0013', ... >> 'HLC0021','HLC0022','HLC0023', ... >> 'HLC0031','HLC0032','HLC0033'}; >> headpos = ft_preprocessing(cfg); >> >> ntrials = length(headpos.sampleinfo) >> for t = 1:ntrials >> coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); >> mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; >> coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); >> mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; >> coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); >> mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; >> end >> >> cc = circumcenter(coil1, coil2, coil3); >> cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; >> >> %% >> confound = [cc_dem ... >> ones(size(cc_dem,1),1)]; >> >> %% >> cfg = []; >> cfg.confound = confound; >> cfg.reject = [1:6]; >> regr = ft_regressconfound(cfg, timelock); >> %% >> >> _________________________________________________________________ >> Sorry for the lengthy letter and thanks for the help! >> >> Inna >> >> >> >> >> >> On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Hi Inna, >>> >>> Are you using the same design matrix as on the wiki page? That one >>> covers the primary head translations and rotations, but also their >>> derivatives. You could try using the primary measures only (3 >>> translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant >>> regressors). It is also mentionworthy that there should be a balance >>> between the number of regressors and the number of observations >>> (i.e. trials). I believe on the respective wiki page on head movement >>> regression it states that the ratio is recommended to be not larger >>> than 1:10 (regressors:trials), accompanied with a reference. Accordingly, >>> I'd suggest to use those 7 regressors, and your data (120s resting state) >>> split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These >>> specifications might hopefully also allow working around your memory issue. >>> >>> Second, it may be worth mentioning what you would like to do with the >>> data post-movement-regression. Namely, the movement compensation will >>> remove contributions from head movement to the signal. But this requires >>> that signal to behave consistently over trials, which does not seem the >>> case with the signal in your resting study? That is, with an ERP study, the >>> signal fluctuations appear consistent over trials, with amplitudes being >>> modulated by head movement (i.e. sensor-source distance, see our neuroimage >>> paper - 2013) in a predictable fashion. So if you're planning on doing >>> frequency analysis, or maybe connectivity analysis, after head movement >>> compensation, I'd recommend reversing that order. The rule of thumb is to >>> use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise >>> unexplained variance (over trials) due to head movement, benefitting your >>> statistical assessments. >>> >>> Hope these suggestions may help you with further analyses. I'm >>> not familiar with anyone implementing this method to resting state >>> analyses, but maybe someone else has some first-hand experience here. >>> Furthermore, too late for your current dataset, but for a next one I'd >>> recommend using the online head position monitoring/respositioning tool >>> that we have developed for CTF systems (a neuromag version is approaching >>> the final stage). This tool is routinely used in our lab to monitor >>> and reduce head movment throughout recording (after which >>> ft_regressconfound is being used to deal with the trial-by-trial crumbles). >>> >>> Yours, >>> Arjen >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Dec 9 19:59:36 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 9 Dec 2013 13:59:36 -0500 Subject: [FieldTrip] ft_senstype Message-ID: There seems to be a bug in ft_senstype. Even if my data.label has names without spaces, it always returns 'neuromag306', instead of 'neuromag306alt'. Because of that line 103 and 104 in ft_combineplanar returns empty matrices. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Dec 9 20:09:37 2013 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Mon, 9 Dec 2013 20:09:37 +0100 (CET) Subject: [FieldTrip] Fwd: head motion regression with ft_regressconfound on a continuous MEG data In-Reply-To: Message-ID: <729996541.4260388.1386616177029.JavaMail.root@sculptor.zimbra.ru.nl> Dear Inna, The output you get is as one would expect. Could you try and spot any principal differences between the timelock structure you have and the one we just simulated? Alternatively, could you send me a reduced/exchangeable timelock structure with say, about 3 trials, for me to replicate your error (<15mb?, by direct email to a.stolk8 at gmail.com)? Yours Arjen ----- Oorspronkelijk bericht ----- > Van: "Inna McGowin" > Aan: "FieldTrip discussion list" > Verzonden: Maandag 9 december 2013 19:04:20 > Onderwerp: Re: [FieldTrip] Fwd: head motion regression with > ft_regressconfound on a continuous MEG data > Thanks you > Your code works fine. Here is the Matlab output for this code: > the input is timelock data with 2 channels and 5 timebins > removing confound 1 2 3 > keeping confound > normalizing the confounds, except the constant > estimating the regression weights and removing the confounds > updating descriptives > the input is timelock data with 2 channels and 5 timebins > Warning: the data does not contain a trial definition > > In utilities\private\warning_once at 158 > In utilities\private\fixsampleinfo at 66 > In ft_datatype_raw at 154 > In ft_checkdata at 298 > In ft_timelockanalysis at 105 > In ft_regressconfound at 313 > Warning: reconstructing sampleinfo by assuming that the trials are > consecutive segments of a continuous > recording > > In utilities\private\warning_once at 158 > In utilities\private\fixsampleinfo at 79 > In ft_datatype_raw at 154 > In ft_checkdata at 298 > In ft_timelockanalysis at 105 > In ft_regressconfound at 313 > averaging trials > averaging trial 20 of 20 > the call to "ft_timelockanalysis" took 1 seconds > the call to "ft_regressconfound" took 4 seconds > The data I am trying to correct for the motion is real. It was > collected with a current phantom generating the signal by a dipole. > The data is continuous but can be broken into trials of 1 sec (the > dipole generates 7 Hz sinusoidal signal continuously). The phantom was > mechanically moved during the scan for a precisely known amount (e.g. > 1 cm down). The data was recorded by CTF 275-sensor MEG unit with the > continuous head coils localization. I was able to apply the SSS motion > correction algorithm successfully to this data set. If there is a way > I could share this data set. > Thanks, > Inna > Inna McGowin > On Mon, Dec 9, 2013 at 9:48 AM, Arjen Stolk < a.stolk8 at gmail.com > > wrote: > > Hi Inna, > > Testing ft_regressconfound with some fake data, everything seems to > > be > > fine here: > > timelock = []; > > timelock.label = {'1' '2'}; > > timelock.time = 1:5; > > timelock.dimord = 'rpt_chan_time'; > > timelock.trial = randn(20,2,5); > > timelock.avg = randn(2,5); > > cfg = []; > > cfg.confound = randn(20,3); > > cfg.reject = [1:3]; > > timelock_out = ft_regressconfound(cfg, timelock); > > Does this example code work for you? I could not detect any mistake > > in > > your lines of code. What does your 'timelock' structure look like? > > Are > > there any real values in the data? (don't think this is causing it, > > but please update to newest Ft version just to be sure) > > Yours, > > Arjen > > 2013/12/2 McGowin, Inna < mcgoiv0 at wfu.edu > > > > Thank you Arjen, > > > Actually, I am testing the FieldTrip motion regression on MEG data > > > specifically collected with a current phantom and known motion. I > > > can > > > treat the data as ERP data and average over 1 sec trials if > > > needed. > > > Following your advise on reduction of the regressors number (on > > > 120 > > > trials of 1 sec long) I was able to avoid the "out of memory" > > > issue. > > > Though I run into the different set of problems now that I need > > > help > > > to understand: > > > ______________________________________________ > > > ??? Error using ==> mxSerialize > > > Error during serialization of (null) > > > Error in ==> ft_postamble_provenance at 91 > > > cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg)); > > > Error in ==> ft_postamble at 55 > > > evalin('caller', ['ft_postamble_' cmd]); > > > Error in ==> ft_timelockanalysis at 370 > > > ft_postamble provenance timelock > > > Error in ==> ft_regressconfound at 313 > > > dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging > > > _________________________________________________________ > > > Here is the code I run to regress the head motion: > > > %% > > > addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023 > > > ft_defaults > > > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > > > cfg.trialdef.triallength=1; > > > cfg.trialdef.ntrials=120; > > > cfg.continuous = 'yes'; > > > cfg = ft_definetrial(cfg); > > > cfg.channel = {'MEG'}; > > > cfg.demean = 'yes'; > > > data = ft_preprocessing(cfg); > > > %% > > > cfg = []; > > > cfg.keeptrials = 'yes'; > > > timelock = ft_timelockanalysis(cfg, data); > > > %% > > > cfg = []; > > > cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds'; > > > cfg.trialdef.triallength=1; > > > cfg.trialdef.ntrials=120; > > > cfg.continuous = 'yes'; > > > cfg = ft_definetrial(cfg); > > > %% > > > cfg.channel = {'HLC0011','HLC0012','HLC0013', ... > > > 'HLC0021','HLC0022','HLC0023', ... > > > 'HLC0031','HLC0032','HLC0033'}; > > > headpos = ft_preprocessing(cfg); > > > ntrials = length(headpos.sampleinfo) > > > for t = 1:ntrials > > > coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); > > > mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))]; > > > coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); > > > mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))]; > > > coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); > > > mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))]; > > > end > > > cc = circumcenter(coil1, coil2, coil3); > > > cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]'; > > > %% > > > confound = [cc_dem ... > > > ones(size(cc_dem,1),1)]; > > > %% > > > cfg = []; > > > cfg.confound = confound; > > > cfg.reject = [1:6]; > > > regr = ft_regressconfound(cfg, timelock); > > > %% > > > _________________________________________________________________ > > > Sorry for the lengthy letter and thanks for the help! > > > Inna > > > On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) < > > > a.stolk at fcdonders.ru.nl > wrote: > > > > Hi Inna, > > > > Are you using the same design matrix as on the wiki page? That > > > > one > > > > covers the primary head translations and rotations, but also > > > > their > > > > derivatives. You could try using the primary measures only (3 > > > > translastions, and 3 rotations of the circumcenter, totaling 6 + > > > > 1 > > > > constant regressors). It is also mentionworthy that there should > > > > be > > > > a > > > > balance between the number of regressors and the number of > > > > observations (i.e. trials). I believe on the respective wiki > > > > page > > > > on > > > > head movement regression it states that the ratio is recommended > > > > to > > > > be > > > > not larger than 1:10 (regressors:trials), accompanied with a > > > > reference. Accordingly, I'd suggest to use those 7 regressors, > > > > and > > > > your data (120s resting state) split in segments of 1 or 2 > > > > seconds, > > > > totaling 60 or 120 trials. These specifications might hopefully > > > > also > > > > allow working around your memory issue. > > > > Second, it may be worth mentioning what you would like to do > > > > with > > > > the > > > > data post-movement-regression. Namely, the movement compensation > > > > will > > > > remove contributions from head movement to the signal. But this > > > > requires that signal to behave consistently over trials, which > > > > does > > > > not seem the case with the signal in your resting study? That > > > > is, > > > > with > > > > an ERP study, the signal fluctuations appear consistent over > > > > trials, > > > > with amplitudes being modulated by head movement (i.e. > > > > sensor-source > > > > distance, see our neuroimage paper - 2013) in a predictable > > > > fashion. > > > > So if you're planning on doing frequency analysis, or maybe > > > > connectivity analysis, after head movement compensation, I'd > > > > recommend > > > > reversing that order. The rule of thumb is to use > > > > ft_regressconfound > > > > just prior to ft_xxxstatistics, removing otherwise unexplained > > > > variance (over trials) due to head movement, benefitting your > > > > statistical assessments. > > > > Hope these suggestions may help you with further analyses. I'm > > > > not > > > > familiar with anyone implementing this method to resting state > > > > analyses, but maybe someone else has some first-hand experience > > > > here. > > > > Furthermore, too late for your current dataset, but for a next > > > > one > > > > I'd > > > > recommend using the online head position > > > > monitoring/respositioning > > > > tool that we have developed for CTF systems (a neuromag version > > > > is > > > > approaching the final stage). This tool is routinely used in our > > > > lab > > > > to monitor and reduce head movment throughout recording (after > > > > which > > > > ft_regressconfound is being used to deal with the trial-by-trial > > > > crumbles). > > > > Yours, > > > > Arjen > > > > _______________________________________________ > > > > fieldtrip mailing list > > > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From faranak.farzan at gmail.com Mon Dec 9 20:45:51 2013 From: faranak.farzan at gmail.com (Faranak Farzan) Date: Mon, 9 Dec 2013 14:45:51 -0500 Subject: [FieldTrip] 3D Cluster Based Correction Message-ID: Dear Fieldtripers, In response to message 1 bellow, We have a new question: We are correcting for multiple comparisons using cluster-based algorithms suggested by Maris and Oostenveld. Can we retrieve the cluster "LABELS" from the 3D matrix of ChanXTimXFreq (shuffled for subjects). For instance as an output of this Fieldtrip function statcondfieldtrip.m Thank you! Faranak Message: 1 Date: Fri, 29 Nov 2013 15:14:26 +0400 From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Question regarding cluster-based permutation test Message-ID: Content-Type: text/plain; charset="utf-8" Hello Faranak, If you're doing a within-subjects design, then testing channels*time*freq on grand average data should be possible; see http://fieldtrip .fcdonders.nl/tutorial/cluster_permutation_freq#within_subjects_experiments . Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Dec 10 08:57:34 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 10 Dec 2013 08:57:34 +0100 Subject: [FieldTrip] Filtering before epoching In-Reply-To: <52A5FE6C.4030002@ucsd.edu> References: <52A5FE6C.4030002@ucsd.edu> Message-ID: <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> Hi Matt, Yes, it's possible. The only thing you should change in your approach is step 3: use ft_redefinetrial, rather than ft_preprocessing So: 1. Preprocessing step on continuous data with filtering. cfg=[]; cfg.dataset = 'raw_data.fif'; cfg.bpfilter = 'yes'; cfg.bpfreq = [a b]; data = ft_preprocessing(cfg); 2. Define trial. cfg = []; cfg.dataset = 'blabla'; cfg.trialdef.xxx etc some settings here. cfg = ft_definetrial(cfg); trl = cfg.trl; 3. Preprocessing step for epoching data on filtered data. cfg = []; cfg.trl = trl; final_data = ft_redefinetrial(cfg,data); Best, JM On Dec 9, 2013, at 6:31 PM, Matthieu Rolland wrote: > Hi everybody, > > Is it possible to filter data prior to epoching? And more generally is it possible to epoch data that has already been preprocessed? > > I have tried without success many variations of this: > > 1. Preprocessing step on continuous data with filtering. > cfg=[]; > cfg.dataset = 'raw_data.fif'; > cfg.bpfilter = 'yes'; > cfg.bpfreq = [a b]; > data = ft_preprocessing(cfg); > > 2. Define trial. > cfg = ft_definetrial(cfg); > > 3. Preprocessing step for epoching data on filtered data. > final_data = ft_preprocessing(cfg,data); > > > Thank you for your help. > Matt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 10:09:11 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 11:09:11 +0200 Subject: [FieldTrip] Best way of saving data in format that fieldtrip will understand In-Reply-To: <52A59BC6.5060408@donders.ru.nl> References: <52A59BC6.5060408@donders.ru.nl> Message-ID: On Mon, Dec 9, 2013 at 12:30 PM, "Jörn M. Horschig" wrote: > Dear Ozan, > > plain mat-files will do, but you will have to write your own wrapper: > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import > > I don't know any Python toolboxes, so I cannot help with that (and that is > because I don't know Python) Hi, I think I managed out doing this but there are some points I like to discuss. My EEG stream is made of 14 channels. Sampling rate is 128. I don't have separate trials but a single continuous recording. So if I understand correctly I have to create the data structure like this: data.fsample = 128 data.labels = cell array of channel labels data.trial = {[14xNsamples]} (Single element cell array containing the whole EEG data) data.sampleinfo = [1 Nsamples] data.time = {linspace(0, Nsamples/fsample, Nsamples)} ?? What should the data.time be? Is it the whole recording duration divided by Nsamples? Thanks. From jean-baptiste.versini at etu.univ-lyon1.fr Tue Dec 10 11:43:06 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Tue, 10 Dec 2013 10:43:06 +0000 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl>, Message-ID: <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Hello, data.trial is a <1 x NTrial cell> and each cell in it is a data.time is a <1 x NTrial cell> and each cell in it is a <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial sampled at 5Hz. ________________________________________ De : fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] de la part de Ozan Çağlayan [ozancag at gmail.com] Date d'envoi : mardi 10 décembre 2013 10:09 À : FieldTrip discussion list Objet : Re: [FieldTrip] Best way of saving data in format that fieldtrip will understand On Mon, Dec 9, 2013 at 12:30 PM, "Jörn M. Horschig" wrote: > Dear Ozan, > > plain mat-files will do, but you will have to write your own wrapper: > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import > > I don't know any Python toolboxes, so I cannot help with that (and that is > because I don't know Python) Hi, I think I managed out doing this but there are some points I like to discuss. My EEG stream is made of 14 channels. Sampling rate is 128. I don't have separate trials but a single continuous recording. So if I understand correctly I have to create the data structure like this: data.fsample = 128 data.labels = cell array of channel labels data.trial = {[14xNsamples]} (Single element cell array containing the whole EEG data) data.sampleinfo = [1 Nsamples] data.time = {linspace(0, Nsamples/fsample, Nsamples)} ?? What should the data.time be? Is it the whole recording duration divided by Nsamples? Thanks. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Tue Dec 10 13:48:37 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 14:48:37 +0200 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: On Tue, Dec 10, 2013 at 12:43 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Hello, > > data.trial is a <1 x NTrial cell> and each cell in it is a > data.time is a <1 x NTrial cell> and each cell in it is a <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial sampled at 5Hz. 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? Am I wrong? -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From r.oostenveld at donders.ru.nl Tue Dec 10 14:23:39 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:23:39 +0100 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: <5439AD52-5050-4B5D-87D8-CDCD15F98799@donders.ru.nl> Hi Ozan On 10 Dec 2013, at 13:48, Ozan Çağlayan wrote: > > 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? > Am I wrong? No, at 5 Hz sampling frequency the distance between subsequent samples is 1/5 Hz = 0.2 seconds. So depending on whether you include the edges of the time interval or not, a time interval from 0 to 1 could be represented as 0.0 0.2 0.4. 0.6 0.8 1.0 % including both edges 0.2 0.4. 0.6 0.8 1.0 % including only the rightmost edge 0.0 0.2 0.4. 0.6 0.8 % including only the leftmost edge 0.2 0.4. 0.6 0.8 % not including the edges of the interval In the case of a continuous recording of Nsamples at Fsample I would consider the best representation data.trial{1} = randn(Nchans, Nsamples); data.time{1} = ((1:nSamples)-1)/Fsample; % the first sample is at time=0, the last sample is at (nSamples-1)/Fsample data.label = arrayfun(@num2str, 1:Nchans, 'UniformOutput', false) See also http://fieldtrip.fcdonders.nl/faq/how_can_i_process_continuous_data_without_triggers, http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat and http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_one_dataformat_into_an_other You might want to check out http://martinos.org/mne/mne-python.html and http://code.google.com/p/pyeeg/ for python code related to EEG data. best regards, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Tue Dec 10 14:26:27 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:26:27 +0100 Subject: [FieldTrip] ft_senstype In-Reply-To: References: Message-ID: Hi Raghavan thanks for reporting. I have added it to our bug tracker on http://bugzilla.fcdonders.nl/show_bug.cgi?id=2418. If you want, you can register on bugzilla with your email and automatically get informed when the bug gets resolved. See also http://fieldtrip.fcdonders.nl/bugzilla best regards Robert On 9 Dec 2013, at 19:59, Raghavan Gopalakrishnan wrote: > There seems to be a bug in ft_senstype. > Even if my data.label has names without spaces, it always returns 'neuromag306', instead of 'neuromag306alt'. Because of that line 103 and 104 in ft_combineplanar returns empty matrices. > > Thanks, > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Tue Dec 10 14:32:37 2013 From: stan.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Tue, 10 Dec 2013 14:32:37 +0100 (CET) Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> Message-ID: <04c601cef5ac$4a4c2f90$dee48eb0$@vanpelt@fcdonders.ru.nl> Yes, you are wrong. [ 0. , 0.25, 0.5 , 0.75, 1. ] would mean 4 Hz sampling (steps of 0.25 => 1/0.25=4) 5Hz sampling implies time steps of 0.2s (=1/5) Best, Stan Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen tel: 024-3616288 -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ozan Çaglayan Sent: dinsdag 10 december 2013 13:49 To: FieldTrip discussion list Subject: Re: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand On Tue, Dec 10, 2013 at 12:43 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Hello, > > data.trial is a <1 x NTrial cell> and each cell in it is a NSample double> data.time is a <1 x NTrial cell> and each cell in it is a > <1 x NSample double>, e.g. [0 0.2 0.4 0.6 0.8 1] for one second trial > sampled at 5Hz. 1 second sampled at 5Hz would be [ 0. , 0.25, 0.5 , 0.75, 1. ]? Am I wrong? -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Tue Dec 10 14:35:54 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 10 Dec 2013 14:35:54 +0100 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Hi Norman Welcome in the FieldTrip community. A lot of the FieldTrip tutorials are based on example data and my colleague Nietssche is just working on collecting a list of tutorial data sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you can find a (temporary) excel sheet listing all datasets. The plan is to move that to a FAQ, i.e. "which example dataset is used in which tutorial?" For example the http://fieldtrip.fcdonders.nl/tutorial/continuous tutorial is based on an example BrainVision EEG dataset. Also http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. best regards, Robert On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: > Hey guys, > I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I was wondering if anyone could point me in the direction of some sample data, preferably in Brainvision format. I was unable to retrieve any from websites such as eegdatabase.kiv. Thank you > -Norman > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 15:33:19 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 16:33:19 +0200 Subject: [FieldTrip] RE : Best way of saving data in format that fieldtrip will understand In-Reply-To: <52a71808.c846cd0a.157e.ffff8a29SMTPIN_ADDED_BROKEN@mx.google.com> References: <52A59BC6.5060408@donders.ru.nl> <5271B6068CD8D94DB8225422823792880179096E@mbx2010-02.univ-lyon1.fr> <52a71808.c846cd0a.157e.ffff8a29SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: On Tue, Dec 10, 2013 at 3:32 PM, Stan van Pelt wrote: > Yes, you are wrong. > > [ 0. , 0.25, 0.5 , 0.75, 1. ] would mean 4 Hz sampling (steps of 0.25 > => 1/0.25=4) > > 5Hz sampling implies time steps of 0.2s (=1/5) Thank you for the clear explanations and the pointers Robert and Stan! -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From t.schneider at uke.uni-hamburg.de Tue Dec 10 15:39:55 2013 From: t.schneider at uke.uni-hamburg.de (Till Schneider) Date: Tue, 10 Dec 2013 15:39:55 +0100 Subject: [FieldTrip] gradiometer definitions after ft_megplanar In-Reply-To: References: <817344947.896762.1386538511813.JavaMail.root@monoceros.zimbra.ru.nl> <752486339.896845.1386539043223.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <52A727BB.50603@uke.uni-hamburg.de> Hi Eelke, just to get this issue straight. The correct way for creating an accurate forward model for MEG data after ICA artifact correction is to use the grad structure given by ft_rejectcomponent, right? And the corrected grad stucture is only provided when the third input argument (i.e. the original data) is passed to ft_rejectcomponent? (e.g. data_clean = ft_rejectcomponent(cfg, comp, data_original), where comp is the result of ft_componentanalysis). Or is it sufficient to pass two input arguments (cfg and comp) to ft_rejectcomponent? Best, Till -- Till Schneider, PhD Cognitive and Clinical Neurophysiology Group Dept. of Neurophysiology and Pathophysiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg Germany phone +49-40-7410-53188 fax +49-40-7410-57126 www.uke.de/neurophysiologie Am 09.12.13 09:16, schrieb Eelke Spaak: > Hi Ana, > > Are you by any chance doing ICA followed by ft_rejectcomponent at some > point before ft_megplanar? After rejecting a component, grad.chanpos > and grad.chanori will contain only NaNs (as of some months ago > indeed), as the channel positions are ill-defined at that point (i.e. > each 'data'-channel is in fact a weighted mixture of the original, > physical, MEG channels). Since ft_megplanar needs the channel > positions, it can no longer operate on data after ft_rejectcomponent. > > However, there is an easy workaround: the original channel positions > should quite nicely approximate the positions after > ft_rejectcomponent. So, what I do is simply store the original > data.grad somewhere, and then make sure to stick in the data just > before ft_megplanar. > > Note that the reason why ft_rejectcomponent updates the grad is that > creating an accurate forward model (for source reconstruction) > requires accurate sensor information. Therefore it fills grad.chanpos > with NaNs, while updating grad.coilpos etc. to reflect the new > projection. So you should *not* use the original grad for source > analysis after ft_rejectcomponent, in that case just use the updated > one with the NaNs inside. > > Best, > Eelke > > On 8 December 2013 22:44, Todorovic, A. wrote: >> Dear 'trippers, >> >> I am attempting to do a TFR on planar gradient data. I first preprocess, then do ft_megplanar, then ft_freqanalysis, followed by ft_combineplanar. However, upon doing ft_megplanar, the grad.chanori field consists only of NaNs. I see that some changes were made a few months ago on how gradiometers are described, so I am wondering whether there are some changes I should now make to the cfg structure when doing the planar gradient transformation. >> >> This is how I normally do it: >> >> cfg = []; >> cfg.planarmethod = 'sincos'; >> cfg.channel = {'MEG'}; >> cfg.trials = 'all'; >> cfg.neighbours = neighbours; % neighbours=ft_prepare_neighbours(cfg,data) >> data_planar = ft_megplanar(cfg,data); >> >> >> Alternatively, is there some workaround I could now implement to fix my already calculated TFR structures? >> >> >> Cheers, >> Ana >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From normanbenbrahim at gmail.com Tue Dec 10 15:42:40 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 09:42:40 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Thank you Robert, this is very helpful On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Norman > > Welcome in the FieldTrip community. > > A lot of the FieldTrip tutorials are based on example data and my > colleague Nietssche is just working on collecting a list of tutorial data > sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you can > find a (temporary) excel sheet listing all datasets. The plan is to move > that to a FAQ, i.e. "which example dataset is used in which tutorial?" > > For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also > http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. > > best regards, > Robert > > > On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: > > Hey guys, > I'm a new Grad Student, going to be using Fieldtrip a lot in the future. I > was wondering if anyone could point me in the direction of some sample > data, preferably in Brainvision format. I was unable to retrieve any from > websites such as eegdatabase.kiv. Thank you > -Norman > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrolland at ucsd.edu Tue Dec 10 16:01:38 2013 From: mrolland at ucsd.edu (Matthieu Rolland) Date: Tue, 10 Dec 2013 07:01:38 -0800 Subject: [FieldTrip] Filtering before epoching In-Reply-To: <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> References: <52A5FE6C.4030002@ucsd.edu> <39F4264B-5BA2-43AF-938F-1D8980BCD718@donders.ru.nl> Message-ID: <52A72CD2.3080802@ucsd.edu> Thank you! On 12/09/13 23:57, jan-mathijs schoffelen wrote: > Hi Matt, > > Yes, it's possible. The only thing you should change in your approach > is step 3: use ft_redefinetrial, rather than ft_preprocessing > > So: > > 1. Preprocessing step on continuous data with filtering. > /cfg=[];// > //cfg.dataset = 'raw_data.fif';// > //cfg.bpfilter = 'yes';// > //cfg.bpfreq = [a b];// > //data = ft_preprocessing(cfg);/ > > 2. Define trial. > / > / > /cfg = [];/ > /cfg.dataset = 'blabla';/ > /cfg.trialdef.xxx etc some settings here./ > /cfg =//ft_definetrial(cfg);/ > trl = cfg.trl; > > 3. Preprocessing step for epoching data on filtered data. > / > / > /cfg = [];/ > /cfg.trl = trl;/ > /final_data = ft_redefinetrial(cfg,data);/ > > > Best, > JM > > On Dec 9, 2013, at 6:31 PM, Matthieu Rolland wrote: > >> Hi everybody, >> >> Is it possible to filter data prior to epoching? And more generally >> is it possible to epoch data that has already been preprocessed? >> >> I have tried without success many variations of this: >> >> 1. Preprocessing step on continuous data with filtering. >> /cfg=[];// >> //cfg.dataset = 'raw_data.fif';// >> //cfg.bpfilter = 'yes';// >> //cfg.bpfreq = [a b];// >> //data = ft_preprocessing(cfg);/ >> >> 2. Define trial. >> /cfg =// ft_definetrial(cfg);/ >> >> 3. Preprocessing step for epoching data on filtered data. >> /final_data = ft_preprocessing(cfg,data);/ >> >> >> Thank you for your help. >> Matt >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Tue Dec 10 16:08:01 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 10:08:01 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Robert: I'm trying to download the files but it always gets interrupted for some reason. I've tried it 6 times now on 2 different internet connections On Tue, Dec 10, 2013 at 9:42 AM, Norman Benbrahim wrote: > Thank you Robert, this is very helpful > > > On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Norman >> >> Welcome in the FieldTrip community. >> >> A lot of the FieldTrip tutorials are based on example data and my >> colleague Nietssche is just working on collecting a list of tutorial data >> sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you >> can find a (temporary) excel sheet listing all datasets. The plan is to >> move that to a FAQ, i.e. "which example dataset is used in which tutorial?" >> >> For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also >> http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. >> >> best regards, >> Robert >> >> >> On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: >> >> Hey guys, >> I'm a new Grad Student, going to be using Fieldtrip a lot in the future. >> I was wondering if anyone could point me in the direction of some sample >> data, preferably in Brainvision format. I was unable to retrieve any from >> websites such as eegdatabase.kiv. Thank you >> -Norman >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbenbrahim at gmail.com Tue Dec 10 16:11:49 2013 From: normanbenbrahim at gmail.com (Norman Benbrahim) Date: Tue, 10 Dec 2013 10:11:49 -0500 Subject: [FieldTrip] Sample Data In-Reply-To: References: Message-ID: Nevermind it's working now On Tue, Dec 10, 2013 at 10:08 AM, Norman Benbrahim < normanbenbrahim at gmail.com> wrote: > Robert: I'm trying to download the files but it always gets interrupted > for some reason. I've tried it 6 times now on 2 different internet > connections > > > On Tue, Dec 10, 2013 at 9:42 AM, Norman Benbrahim < > normanbenbrahim at gmail.com> wrote: > >> Thank you Robert, this is very helpful >> >> >> On Tue, Dec 10, 2013 at 8:35 AM, Robert Oostenveld < >> r.oostenveld at donders.ru.nl> wrote: >> >>> Hi Norman >>> >>> Welcome in the FieldTrip community. >>> >>> A lot of the FieldTrip tutorials are based on example data and my >>> colleague Nietssche is just working on collecting a list of tutorial data >>> sets. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=2382 where you >>> can find a (temporary) excel sheet listing all datasets. The plan is to >>> move that to a FAQ, i.e. "which example dataset is used in which tutorial?" >>> >>> For example the http://fieldtrip.fcdonders.nl/tutorial/continuoustutorial is based on an example BrainVision EEG dataset. Also >>> http://fieldtrip.fcdonders.nl/tutorial/tms-eeg has EEG data in it. >>> >>> best regards, >>> Robert >>> >>> >>> On 9 Dec 2013, at 17:49, Norman Benbrahim wrote: >>> >>> Hey guys, >>> I'm a new Grad Student, going to be using Fieldtrip a lot in the future. >>> I was wondering if anyone could point me in the direction of some sample >>> data, preferably in Brainvision format. I was unable to retrieve any from >>> websites such as eegdatabase.kiv. Thank you >>> -Norman >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozancag at gmail.com Tue Dec 10 17:40:49 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 18:40:49 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis Message-ID: Hi, I was struggling with the problem below for an hour and digging through the code I found out that I was setting cfg.fsample = 128 instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad which was causing a type mismatch in the below line. I think either in the docs it should be told that the fsample needs to be a double or FT should cast it to double transparently. Or can this be caused by Matlab 2013a as told by the warnings :) >> [freqs] = ft_freqanalysis(cfg, data) Warning: You are using MATLAB 2013a. FieldTrip is currently not supported on 2013a (8.1) or newer. Using your current MATLAB version can lead to unexpected behaviour, which might not be easily noticable. Continuing is not advised. > In ft_defaults at 64 In ft_freqanalysis at 191 the input is raw data with 14 channels and 1 trials Error using .* Integers can only be combined with integers of the same class, or scalar doubles. Error in ft_freqanalysis (line 423) fboi = round(cfg.foi .* cfg.pad) + 1; ********* Here cfg.pad is an int32 with 10 in it and cfg.foi = []. >> [] .* double(10) ans = [] >> [] .* int32(10) Error using .* Integers can only be combined with integers of the same class, or scalar doubles. and pad is set as: padding = max(trllength); cfg.pad = padding/data.fsample; // trllength == 1280, fsample == 128 in my case. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From ozancag at gmail.com Tue Dec 10 17:41:35 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 10 Dec 2013 18:41:35 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: On Tue, Dec 10, 2013 at 6:40 PM, Ozan Çağlayan wrote: > Hi, > > I was struggling with the problem below for an hour and digging > through the code I found out that I was setting cfg.fsample = 128 > instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad > which was causing a type mismatch in the below line. not cfg.fsample of course, data.fsample.. -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From nheugel89 at gmail.com Tue Dec 10 18:23:55 2013 From: nheugel89 at gmail.com (Nicholas Heugel) Date: Tue, 10 Dec 2013 11:23:55 -0600 Subject: [FieldTrip] Error after MNE Message-ID: I a trying to go through the tutorial for the - Source reconstruction of event-related fields using minimum-norm estimate I am able to run everything up to the MNE with no problem, and it seems like the MNE portion works. But when I run the command bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); and then plot it to visualize the source space. I get the error Reference to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; I have looked on this site and online and can't find an explanation of what is wrong or how to fix the problem. Any help would be appreciated. I am using an Anatomical MRI scan for the head model analysis, the skull is present and I manually am Identifying the fiducials. Also, a few steps earlier it had me check the white matter segmentation done by Freesurfer and that worked fine and what I get closely resembles the tutorial. So I think the problem is somewhere in the MNE I am just not sure where. Any help would be appreciated. Thank you for your time. Nicholas -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Dec 11 09:04:35 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 11 Dec 2013 09:04:35 +0100 Subject: [FieldTrip] Error after MNE In-Reply-To: References: Message-ID: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> Hi Nicholas, It seems that the fif files lacks some information that FieldTrip assumes to be present. I would say that this can only be caused by the fact that the version of mne_make_source_space you used does not write the triangle area information into the fif file. Could you go to bugzilla.fcdonders.nl, create yourself an account, and file the issue as a bug? Please then also upload the fif-file you mentioned. I'll have a look at it and make the ft_read_headshape function more robust. In the mean time you could comment out line 421. Best, Jan-Mathijs On Dec 10, 2013, at 6:23 PM, Nicholas Heugel wrote: > I a trying to go through the tutorial for the > Source reconstruction of event-related fields using minimum-norm estimate > > I am able to run everything up to the MNE with no problem, and it seems like the MNE portion works. But when I run the command bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > and then plot it to visualize the source space. I get the error Reference to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; > I have looked on this site and online and can't find an explanation of what is wrong or how to fix the problem. Any help would be appreciated. I am using an Anatomical MRI scan for the head model analysis, the skull is present and I manually am Identifying the fiducials. Also, a few steps earlier it had me check the white matter segmentation done by Freesurfer and that worked fine and what I get closely resembles the tutorial. So I think the problem is somewhere in the MNE I am just not sure where. Any help would be appreciated. Thank you for your time. > Nicholas > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Dec 11 10:41:17 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 11 Dec 2013 10:41:17 +0100 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: Hi Ozan, It is unclear to me why cfg.pad would be an integer, see what happens when I execute the following (in either Matlab 2012a or 2013a): >> class(32) ans = double Maybe you have some Matlab setting enabled causing it to store numbers that appear to be integer as an int32? On a sidenote, please note that, as the warning indicates, not all changes with 2013a are expected to result in errors, they might actually just lead to unexpected (i.e. wrong) results, without you necessarily noticing. Therefore, it would really be better to stick to an older version until the code has been properly updated. We are working on making fieldtrip work with 2013a, you can see the progress here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2095 Best, Eelke On 10 December 2013 17:41, Ozan Çağlayan wrote: > On Tue, Dec 10, 2013 at 6:40 PM, Ozan Çağlayan wrote: >> Hi, >> >> I was struggling with the problem below for an hour and digging >> through the code I found out that I was setting cfg.fsample = 128 >> instead of cfg.fsample = 128.0 which was causing an int32 cfg.pad >> which was causing a type mismatch in the below line. > > not cfg.fsample of course, data.fsample.. > > > -- > Ozan Çağlayan > Research Assistant > Galatasaray University - Computer Engineering Dept. > http://www.ozancaglayan.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ozancag at gmail.com Wed Dec 11 11:11:58 2013 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Wed, 11 Dec 2013 12:11:58 +0200 Subject: [FieldTrip] type mismatch error in ft_freqanalysis In-Reply-To: References: Message-ID: On Wed, Dec 11, 2013 at 11:41 AM, Eelke Spaak wrote: > Hi Ozan, > > It is unclear to me why cfg.pad would be an integer, see what happens > when I execute the following (in either Matlab 2012a or 2013a): > >>> class(32) > ans = > double This is double on my system too but since I save the .mat file from Python, I was setting fsample to 128 which was exported by Python as int, which I think can be expected. Setting it to 128.0 fixes the problem but maybe this can be ensured in FieldTrip code pathway by casting the fsample to double. Anyways not a big deal until I found the cause behind this :) -- Ozan Çağlayan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From daniele.marinazzo at ugent.be Wed Dec 11 13:09:03 2013 From: daniele.marinazzo at ugent.be (Daniele Marinazzo) Date: Wed, 11 Dec 2013 13:09:03 +0100 Subject: [FieldTrip] Course: Practical data analysis and modeling in cognitive and clinical neuroscience, April 14-18, Gent, Beligum Message-ID: Hi all The Multidisciplinary Research Partnership in Neuroscience, part of the Institute for Neuroscience at Ghent University, with the support of the INCF program for Teaching and Training , is organizing an international 5-day training course, focusing on *data analysis in cognitive and clinical neuroscience*. The participants will be able to design and implement pipelines for effective and reproducible experiments. The course will be held at the Faculty of Psychology and Pedagogical Sciences of the university of Ghent, from april 14 to April 18, 2014. There will be two theoretical talks in the morning, describing the state fo the art of specific steps of neuroimaging based reseach, and application-oriented short lectures followed by hands on sessions in the afternoon; some of them parallel for the focus on EEG or fMRI. Target audience The course is open to PhD students and young postdoctoral researchers who use neuroimaging data for their experiments in psychology and clinical neuroscience. Ideally the candidates are in the stage of having already acquired part of their dataset, or they are about to design their own experiment. Applicants are encouraged to present their dataset in the application (format, subjects, conditions,etc), and to bring a sample of it to the School, where they will have the chance to analyze it under the guidance of the lecturers. More info and registration on the school website http://www.da.ugent.be/school2014 -- Daniele Marinazzo -- Department of Data Analysis Faculty of Psychology and Pedagogical Sciences, Gent University Henri Dunantlaan 1, B-9000 Gent, Belgium +32 (0) 9 264 6375 http://users.ugent.be/~dmarinaz/ * * *School: Data analysis in experimental and clinical neuroscience, Gent, April 14-18 2014* *Frontiers Research Topic: Information based methods for neuroimaging data analysis * http://helpdesk.ugent.be/e-maildisclaimer.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Wed Dec 11 18:35:59 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 11 Dec 2013 12:35:59 -0500 Subject: [FieldTrip] frequency analysis Message-ID: I have a few questions regarding frequency analysis using wavelets. 1. Is it possible to z-score the TF spectrograms? Is so how and where should I specify the baseline? 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make sure all sensors from multi subject are matched. However, why is this not performed before grand averaging time-frequency data since the powspctrm is specific to each channel? 3. Is combineplanar a necessary step before any grand averaging i.e. ERF or TFR? I am using neuromag data, so can I perform grand averaging and statistics without combineplanar? 4. Fieldtrip only reads neuromag FIF files that has been processed through maxfilter. There are times when there is a need not to use maxfilter, is there a work around? Thanks very much. Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfegen at gmail.com Wed Dec 11 19:13:40 2013 From: dfegen at gmail.com (Drew Fegen) Date: Wed, 11 Dec 2013 13:13:40 -0500 Subject: [FieldTrip] ft_freqanalysis() on entire continuous data followed by ft_redefinetrial() error - incorrect data format? Message-ID: Hello, Trying to do time-frequency analysis on some intracranial EEG data and I would like to apply the time-frequency analysis to the entire continuous data to avoid any boundary effects and padding issues. However, after I run the time-frequency analysis on the entire continuous data and then try to define trials I get errors due to the input data being in the incorrect format. The data are .edf files that were being imported incorrectly and being parsed into short segments, thus I have been using "cfg.continuous='yes' " in ft_preprocessing() and then using ft_redefinetrial() to subsequently define trials. So I read the data in like this: cfg=[]; cfg.reref='yes'; cfg.dataset = 'data.edf'; cfg.headerfile = 'data.edf'; cfg.dataformat = 'edf'; cfg.headerformat = 'edf'; cfg.continuous = 'yes'; cfg.demean='yes'; data = ft_preprocessing(cfg); and the data looks like: >> data data = hdr: [1x1 struct] label: {101x1 cell} time: {[1x535040 double]} trial: {[101x535040 double]} fsample: 512 sampleinfo: [1 535040] cfg: [1x1 struct] Then my time-frequency analysis looks like this: cfg = []; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 1:2:30; cfg.toi = -0.5:0.05:1.5; cfg.channel = 'all'; TFRwave = ft_freqanalysis(cfg, data); and the output looks like this: >> TFRwave TFRwave = label: {101x1 cell} dimord: 'chan_freq_time' freq: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29] time: [1x41 double] powspctrm: [101x15x41 double] cumtapcnt: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] cfg: [1x1 struct] then I define trials like this (which works fine in other processing streams I have): [TFRwave_byTrial] = ft_redefinetrial(cfg, TFRwave) gives this error: the input is freq data with 101 channels, 15 frequencybins and 41 timebins ??? Error using ==> ft_checkdata>freq2raw at 1669 this only works for dimord='rpt_chan_freq_time' Error in ==> ft_checkdata at 317 data = freq2raw(data); Error in ==> ft_redefinetrial at 104 data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); So it seems like ft_redefinetrial() does not like the data in the format "chan_freq_time" and instead wants the format "rpt_chan_freq_time". I tried changing the output format of the time-frequency analysis by changing the "cfg.output" option to 'powandcsc' and 'fourier', and I also tried converting the time-frequency data using "freqnew=ft_checkdata(data,'cmbrepresentation','full');" and "freqnew=ft_checkdata(data,'cmbrepresentation','sparsewithpow');" but could not get the data in a format that could be used by ft_redefinetrial(). Maybe I missed something in the documentation or mailing list? Does anyone have any thoughts or ideas? Thanks! David -------------- next part -------------- An HTML attachment was scrubbed... URL: From nheugel89 at gmail.com Thu Dec 12 02:42:29 2013 From: nheugel89 at gmail.com (Nicholas Heugel) Date: Wed, 11 Dec 2013 19:42:29 -0600 Subject: [FieldTrip] Error after MNE In-Reply-To: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> References: <17F395A3-5627-4410-9030-97FF73B52C9B@donders.ru.nl> Message-ID: I did as you asked. I put it in the core category with the error as the title On Wed, Dec 11, 2013 at 2:04 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Nicholas, > > It seems that the fif files lacks some information that FieldTrip assumes > to be present. I would say that this can only be caused by the fact that > the version of mne_make_source_space you used does not write the triangle > area information into the fif file. Could you go to bugzilla.fcdonders.nl, > create yourself an account, and file the issue as a bug? Please then also > upload the fif-file you mentioned. I'll have a look at it and make the > ft_read_headshape function more robust. In the mean time you could comment > out line 421. > > Best, > Jan-Mathijs > > > > On Dec 10, 2013, at 6:23 PM, Nicholas Heugel wrote: > > I a trying to go through the tutorial for the > > - Source reconstruction of event-related fields using minimum-norm > estimate > > I am able to run everything up to the MNE with no problem, and it > seems like the MNE portion works. But when I run the command bnd = > ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > and then plot it to visualize the source space. I get the error Reference > to non-existent field 'use_tri_area'. Error in ft_read_headshape (line 421) > shape.area = [src(1).use_tri_area(:); src(2).use_tri_area(:)]; > I have looked on this site and online and can't find an explanation > of what is wrong or how to fix the problem. Any help would be appreciated. > I am using an Anatomical MRI scan for the head model analysis, the skull > is present and I manually am Identifying the fiducials. Also, a few > steps earlier it had me check the white matter segmentation done by > Freesurfer and that worked fine and what I get closely resembles the > tutorial. So I think the problem is somewhere in the MNE I am just not > sure where. Any help would be appreciated. Thank you for your time. > > Nicholas > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luckyluke1979 at yahoo.com.ar Thu Dec 12 09:19:46 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Thu, 12 Dec 2013 00:19:46 -0800 (PST) Subject: [FieldTrip] Time-Frequency Plot Granger Causality Message-ID: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Hi, Following the tutorial on connectivity analysis I am trying to implement Granger Causality on simulated signals. I can reproduce all the results that appear in the tutorial in my dataset but I cannot obtain a graph of Wavelet-based granger causality with the format: -x axis: time -y axis: frequency This  graph should allow me to compare in a single figure how channel 1 granger causes channel 2 at a range of frequencies as a function of time (like in Fig 3 of Dhamala et al, 2008). My problem is that I cannot figure out how to produce this graph with the tutorial functions as they seem to automatically compute Granger Spectra for the whole epoch. In the tutorial demo the structure 'freq' has dimord: 'rpttap_chan_freq', and the structure 'granger' has dimord: 'chan_chan_freq'. What I am looking for is a function that returns a structure with the granger spectra computed with dimord of 'chan_chan_freq_time' 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then '[output] = ft_connectivity_csd2transfer(freq);' with all types of parameters but I could not reach to a solution. Is there a way of building a time-frequency granger spectra within fieldtrip? 2- Alternatively to 1, I thought that I could compute non-parametric Granger Spectra for different time windows inside each epoch and then concatenate the results. Before doing this I would like to be sure that I am not missing a way of doing it that it's already implemented in fieldtrip (I have just started using Fieldtrip a short time ago) Thanks a lot Cheers   Lisandro Kaunitz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Dec 12 09:28:09 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 12 Dec 2013 09:28:09 +0100 Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Message-ID: <47E648A2-F681-409F-9A08-0F44B62939F2@donders.ru.nl> Dear Luckyluke, In principle what you want should be possible, but it is not well tested. Rather I would suggest to go for solution 2, i.e. re-epoch your data and compile a time-frequency map by hand. If you want to try it anyway, the key would be to use cfg.method = 'mtmconvol', rather than 'mtmfft' when computing the spectral representation of your data. Best, Jan-Mathijs On Dec 12, 2013, at 9:19 AM, Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to implement Granger Causality on simulated signals. I can reproduce all the results that appear in the tutorial in my dataset but I cannot obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This graph should allow me to compare in a single figure how channel 1 granger causes channel 2 at a range of frequencies as a function of time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with the tutorial functions as they seem to automatically compute Granger Spectra for the whole epoch. In the tutorial demo the structure 'freq' has dimord: 'rpttap_chan_freq', and the structure 'granger' has dimord: 'chan_chan_freq'. What I am looking for is a function that returns a structure with the granger spectra computed with dimord of 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then '[output] = ft_connectivity_csd2transfer(freq);' with all types of parameters but I could not reach to a solution. Is there a way of building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric Granger Spectra for different time windows inside each epoch and then concatenate the results. Before doing this I would like to be sure that I am not missing a way of doing it that it's already implemented in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > > Lisandro Kaunitz > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Dec 12 09:33:11 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:33:11 +0100 Subject: [FieldTrip] frequency analysis In-Reply-To: References: Message-ID: <52A974C7.3080104@donders.ru.nl> Dear Raghavan, 1) Sure is it possible, z-scoring is nothing else then subtracting the mean and dividing by the standard deviation. The time-period from which you obtain the mean and standard deviation depend on what you want and how you define it. 2) Usually we do not use megrealign at all and assume that subjects are approximately similarly seated in the helmet for computing the grandaverage. MEG sensor-level analysis is not suited very well for making spatial inferences anyway, I would advise to go to source space for such a thing. 3) For neuromag data, you already have planar gradiometers, so you do not need megplanar and combineplanar. We, on the other hand, only have axial gradiometers with our CTF system, thus we need a planar transformation to get a planar representation. 4) I cannot help with this one, sorry. Best, Jörn Raghavan Gopalakrishnan wrote: > I have a few questions regarding frequency analysis using wavelets. > > 1. Is it possible to z-score the TF spectrograms? Is so how and where > should I specify the baseline? > 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make > sure all sensors from multi subject are matched. However, why is this > not performed before grand averaging time-frequency data since the > powspctrm is specific to each channel? > 3. Is combineplanar a necessary step before any grand averaging i.e. > ERF or TFR? I am using neuromag data, so can I perform grand averaging > and statistics without combineplanar? > 4. Fieldtrip only reads neuromag FIF files that has been processed > through maxfilter. There are times when there is a need not to use > maxfilter, is there a work around? > > Thanks very much. > Raghavan > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Thu Dec 12 09:33:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:33:50 +0100 Subject: [FieldTrip] ft_freqanalysis() on entire continuous data followed by ft_redefinetrial() error - incorrect data format? In-Reply-To: References: Message-ID: <52A974EE.8030601@donders.ru.nl> Hi David, try specifying cfg.keeptrials = 'yes' before computing the power spectrum. Best, Jörn Drew Fegen wrote: > Hello, > > Trying to do time-frequency analysis on some intracranial EEG data and > I would like to apply the time-frequency analysis to the entire > continuous data to avoid any boundary effects and padding issues. > However, after I run the time-frequency analysis on the entire > continuous data and then try to define trials I get errors due to the > input data being in the incorrect format. > > The data are .edf files that were being imported incorrectly and being > parsed into short segments, thus I have been using > "cfg.continuous='yes' " in ft_preprocessing() and then using > ft_redefinetrial() to subsequently define trials. > > So I read the data in like this: > > cfg=[]; > cfg.reref='yes'; > cfg.dataset = 'data.edf'; > cfg.headerfile = 'data.edf'; > cfg.dataformat = 'edf'; > cfg.headerformat = 'edf'; > cfg.continuous = 'yes'; > cfg.demean='yes'; > data = ft_preprocessing(cfg); > > > and the data looks like: > > >> data > > data = > > hdr: [1x1 struct] > label: {101x1 cell} > time: {[1x535040 double]} > trial: {[101x535040 double]} > fsample: 512 > sampleinfo: [1 535040] > cfg: [1x1 struct] > > > Then my time-frequency analysis looks like this: > > cfg = []; > cfg.method = 'wavelet'; > cfg.width = 7; > cfg.output = 'pow'; > cfg.foi = 1:2:30; > cfg.toi = -0.5:0.05:1.5; > cfg.channel = 'all'; > TFRwave = ft_freqanalysis(cfg, data); > > > and the output looks like this: > > >> TFRwave > > TFRwave = > > label: {101x1 cell} > dimord: 'chan_freq_time' > freq: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29] > time: [1x41 double] > powspctrm: [101x15x41 double] > cumtapcnt: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] > cfg: [1x1 struct] > > > then I define trials like this (which works fine in other processing > streams I have): > > [TFRwave_byTrial] = ft_redefinetrial(cfg, TFRwave) > > > gives this error: > > the input is freq data with 101 channels, 15 frequencybins and 41 timebins > ??? Error using ==> ft_checkdata>freq2raw at 1669 > this only works for dimord='rpt_chan_freq_time' > > Error in ==> ft_checkdata at 317 > data = freq2raw(data); > > Error in ==> ft_redefinetrial at 104 > data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); > > > So it seems like ft_redefinetrial() does not like the data in the > format "chan_freq_time" and instead wants the format > "rpt_chan_freq_time". I tried changing the output format of the > time-frequency analysis by changing the "cfg.output" option to > 'powandcsc' and 'fourier', and I also tried converting the > time-frequency data using > "freqnew=ft_checkdata(data,'cmbrepresentation','full');" and > "freqnew=ft_checkdata(data,'cmbrepresentation','sparsewithpow');" but > could not get the data in a format that could be used by > ft_redefinetrial(). > > Maybe I missed something in the documentation or mailing list? Does > anyone have any thoughts or ideas? > > Thanks! > David > > > > > > > > > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Thu Dec 12 09:39:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 12 Dec 2013 09:39:50 +0100 Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> Message-ID: <52A97656.9020506@donders.ru.nl> Hi Lisandro, actually, for me it works by just computing a time-frequency representation and shoving that into ft_connectivityanalysis. Is there an error if you try that? I literally do cfg = []; cfg.channelcmb = ...; cfg.method = 'granger'; granger = ft_connectivityanalysis(cfg, freq); With freq obtained by cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foi = 1:32; cfg.t_ftimwin = 0.5.*ones(size(4./cfg.foi'), 1); cfg.toi = -1:0.05:1; freq = ft_freqanalysis(cfg, data); Otherwise, solution 2 is something that definitely works and what I also did first, and it worked fine. There should be nothing wrong imho, as JM also pointed out. Best, Jörn Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to > implement Granger Causality on simulated signals. I can reproduce all > the results that appear in the tutorial in my dataset but I cannot > obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This graph should allow me to compare in a single figure how channel > 1 granger causes channel 2 at a range of frequencies as a function of > time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with > the tutorial functions as they seem to automatically compute Granger > Spectra for the whole epoch. In the tutorial demo the structure 'freq' > has dimord: 'rpttap_chan_freq', and the structure 'granger' has > dimord: 'chan_chan_freq'. What I am looking for is a function that > returns a structure with the granger spectra computed with dimord of > 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then > '[output] = ft_connectivity_csd2transfer(freq);' with all types of > parameters but I could not reach to a solution. Is there a way of > building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric > Granger Spectra for different time windows inside each epoch and then > concatenate the results. Before doing this I would like to be sure > that I am not missing a way of doing it that it's already implemented > in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > Lisandro Kaunitz > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Thu Dec 12 09:45:19 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 12 Dec 2013 09:45:19 +0100 Subject: [FieldTrip] Low-pass filter before resampling? Message-ID: Hi all, A quick question: in your experience, is it necessary (or advisable) to explicitly apply a low-pass filter (using e.g. ft_preprocessing) before calling ft_resampledata? I previously assumed ft_resampledata (or the low-level implementation, pchip) was taking care of this, but looking in the code I cannot find evidence for or against my assumption. Thanks, Eelke From eelke.spaak at donders.ru.nl Thu Dec 12 09:48:15 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 12 Dec 2013 09:48:15 +0100 Subject: [FieldTrip] Low-pass filter before resampling? In-Reply-To: References: Message-ID: Oops, I was looking in the wrong part of the code for ft_resampledata (usetime = 1, while I should have been looking at usefsample = 1). There, it is clear that Matlab's resample() is being used, which tells me in the documentation "resample applies an anti-aliasing (lowpass) FIR filter to x during the resampling process. It designs the filter using firls with a Kaiser window." So, it is definitely not needed. Sorry for filling up your inboxes :) Eelke On 12 December 2013 09:45, Eelke Spaak wrote: > Hi all, > > A quick question: in your experience, is it necessary (or advisable) > to explicitly apply a low-pass filter (using e.g. ft_preprocessing) > before calling ft_resampledata? I previously assumed ft_resampledata > (or the low-level implementation, pchip) was taking care of this, but > looking in the code I cannot find evidence for or against my > assumption. > > Thanks, > Eelke From thomas.wunderle at esi-frankfurt.de Thu Dec 12 10:46:49 2013 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Thu, 12 Dec 2013 09:46:49 +0000 Subject: [FieldTrip] Low-pass filter before resampling? In-Reply-To: References: Message-ID: <27E5CAD9145EEC41BB9B34C01716A1983049F31C@UM-EXCDAG-A01.um.gwdg.de> Hi all, I was also thinking about resampling data recently. The reason is that I saw (as Eelke mentioned) that the Matlab "resample" function applies a Kaiser window function to lowpass filter the data before (down/resampling). Now, I was not sure if this can create a problem for directed connectivity analysis (like Granger connectivity), because you apply a non-causal kernel which "contaminates" a given moment in time with the future. I'm not an expert enough to see through if this is a problem for methods like Granger which rely on predicting a signal given the data in the past. If so, one should be careful in using non-causal filters e.g. for resampling. At the moment I'm using the Matlab function "resample" with the option "0" ( like: y = resample(data,D,N,0) ), which does then nearest neighbor interpolation. What's your opinions about that topic? Best, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel:   +49 69 96769 519 Fax:   +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries -----Ursprüngliche Nachricht----- Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Eelke Spaak Gesendet: Donnerstag, 12. Dezember 2013 09:48 An: Email discussion list for the FieldTrip project Betreff: Re: [FieldTrip] Low-pass filter before resampling? Oops, I was looking in the wrong part of the code for ft_resampledata (usetime = 1, while I should have been looking at usefsample = 1). There, it is clear that Matlab's resample() is being used, which tells me in the documentation "resample applies an anti-aliasing (lowpass) FIR filter to x during the resampling process. It designs the filter using firls with a Kaiser window." So, it is definitely not needed. Sorry for filling up your inboxes :) Eelke On 12 December 2013 09:45, Eelke Spaak wrote: > Hi all, > > A quick question: in your experience, is it necessary (or advisable) > to explicitly apply a low-pass filter (using e.g. ft_preprocessing) > before calling ft_resampledata? I previously assumed ft_resampledata > (or the low-level implementation, pchip) was taking care of this, but > looking in the code I cannot find evidence for or against my > assumption. > > Thanks, > Eelke _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From luckyluke1979 at yahoo.com.ar Thu Dec 12 12:27:55 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Thu, 12 Dec 2013 03:27:55 -0800 (PST) Subject: [FieldTrip] Time-Frequency Plot Granger Causality In-Reply-To: <52A97656.9020506@donders.ru.nl> References: <1386836386.70138.YahooMailNeo@web140306.mail.bf1.yahoo.com> <52A97656.9020506@donders.ru.nl> Message-ID: <1386847675.60465.YahooMailNeo@web140306.mail.bf1.yahoo.com> Thanks a lot for the fast responses. I'll try both methods and test whether there are differences in the results Cheers   Lisandro Kaunitz El día jueves, 12 de diciembre de 2013 19:39, Jörn M. Horschig escribió: Hi Lisandro, actually, for me it works by just computing a time-frequency representation and shoving that into ft_connectivityanalysis. Is there an error if you try that? I literally do     cfg = [];     cfg.channelcmb = ...;     cfg.method    = 'granger';     granger    = ft_connectivityanalysis(cfg, freq); With freq obtained by       cfg          = [];       cfg.method    = 'mtmconvol';       cfg.output    = 'fourier';       cfg.taper    = 'hanning';       cfg.foi      = 1:32;       cfg.t_ftimwin = 0.5.*ones(size(4./cfg.foi'), 1);       cfg.toi      = -1:0.05:1;       freq          = ft_freqanalysis(cfg, data); Otherwise, solution 2 is something that definitely works and what I also did first, and it worked fine. There should be nothing wrong imho, as JM also pointed out. Best, Jörn Lisandro Kaunitz wrote: > Hi, > > Following the tutorial on connectivity analysis I am trying to > implement Granger Causality on simulated signals. I can reproduce all > the results that appear in the tutorial in my dataset but I cannot > obtain a graph of Wavelet-based granger causality with the format: > > -x axis: time > -y axis: frequency > > This  graph should allow me to compare in a single figure how channel > 1 granger causes channel 2 at a range of frequencies as a function of > time (like in Fig 3 of Dhamala et al, 2008). > > My problem is that I cannot figure out how to produce this graph with > the tutorial functions as they seem to automatically compute Granger > Spectra for the whole epoch. In the tutorial demo the structure 'freq' > has dimord: 'rpttap_chan_freq', and the structure 'granger' has > dimord: 'chan_chan_freq'. What I am looking for is a function that > returns a structure with the granger spectra computed with dimord of > 'chan_chan_freq_time' > > 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then > '[output] = ft_connectivity_csd2transfer(freq);' with all types of > parameters but I could not reach to a solution. Is there a way of > building a time-frequency granger spectra within fieldtrip? > > 2- Alternatively to 1, I thought that I could compute non-parametric > Granger Spectra for different time windows inside each epoch and then > concatenate the results. Before doing this I would like to be sure > that I am not missing a way of doing it that it's already implemented > in fieldtrip (I have just started using Fieldtrip a short time ago) > > Thanks a lot > > Cheers > > > Lisandro Kaunitz > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel:    +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Thu Dec 12 13:22:26 2013 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Thu, 12 Dec 2013 12:22:26 +0000 Subject: [FieldTrip] Offline use of Fieldtrip for TMSi file formats (.poly5, .s00) Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094E7A08@PEXMB001B.vu.local> Hi all, I used the TMSi software to acquire EEG and EMG data and so my files have the poly5 format. I'm trying to read my poly5 files into matlab using fieldtrip so it immediately get's the format desired for further analyses using fieldtrip, but it doesn't work and online I only find information on how to use fieldtrip together with TMSi realtime and not in offline data analyses. Does anybody know how to do this or where I can find how to do this? Thanks in advance, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From emanuelvandenbroeke at hotmail.com Thu Dec 12 13:34:04 2013 From: emanuelvandenbroeke at hotmail.com (emanuel vandenbroeke) Date: Thu, 12 Dec 2013 13:34:04 +0100 Subject: [FieldTrip] Normality Message-ID: Hi, Maybe someone can help me with a question.I collected data of 16 subjects in a repeated measures design with 2 within subject factors (time (3 levels) and arm (2 levels)). I measured several dependent variables.Before applying a RM ANOVA to my data i first inspected each dependent variable (with its levels) regarding the assumption of normality. Some variables look positively skewed and some look negatively skewed. These deviations of normality can be corrected with a reflection first and then log transformation in the case of a negative skew distribution and the positive skew distributions can be corrected by a log transform alone. Some people say that the RM ANOVA is robust for mild violations of normality but I can not find any papers confirming this.Now my question, should I apply these transformations to my data or not? And secondly, if I apply a transformation to one variable (for example the negatively skewed variables) should I also use this transform for the other variables or can I differentiate and decide the appropriate transform for each dependent variable? Many thanks, Best,Emanuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From santiago.torres at mail.mcgill.ca Fri Dec 13 18:06:54 2013 From: santiago.torres at mail.mcgill.ca (Santiago Torres, Mr) Date: Fri, 13 Dec 2013 17:06:54 +0000 Subject: [FieldTrip] ft_spikedensity Message-ID: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> Hello All, I am trying to run the spike analysis script ft_spikedensity and have the following problem: When defining the begSample variable in line 234 of the code: begSample = nearest(timeAxis, cfg.latency(1)) Error using nearest Too many input arguments. the code is set such that it inputs two variables to the function nearest, which only allows for one variable as input. This should always give an error independent of the variables that are given to nearest. I tried to do a temporary fix by eliminating the second input which seems unnecessary (given that further code uses the values in the timeAxis matrix only) or by making a matrix using cfg.latency(1) as the final value of nearest(timeAxis). Neither of this options work as they give a bigger sampleSel than timeAxis (sampleSel(sampleSel>length(timeAxis)) = []). However, I do not want to mess with something that may have other implications further down, and I assume the second variable (cf.latency(1)) is there for a reason. Can someone help explain how to go around this problem or why it may not be working? timeAxis is a 1*n double matrix with increasing positive time values starting at 0. cfg.latency(1) is 0. I am using a 32-bit matlab version R2012a. Thanks, Santiago Torres -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Fri Dec 13 19:06:41 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Fri, 13 Dec 2013 19:06:41 +0100 Subject: [FieldTrip] Leadfield and source contain NaN Message-ID: Dear All, I calculated leadfield with 64 electrodes but majority of part of leadfield.leadfield consist of NaN and some with values and I ensured the electrode is projected on the head (but some not touching the head directly but at the right position). Please help me with what I am missing please. Whenever I used the leadfield to calculate source, it also contain NaN. Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From luckyluke1979 at yahoo.com.ar Mon Dec 16 08:21:17 2013 From: luckyluke1979 at yahoo.com.ar (Lisandro Kaunitz) Date: Sun, 15 Dec 2013 23:21:17 -0800 (PST) Subject: [FieldTrip] Estimating Single-trial Granger Causality Message-ID: <1387178477.14427.YahooMailNeo@web140303.mail.bf1.yahoo.com> Hi, I am trying to compute grangerspectra for simulated single trials. Whenver I run granger causality on a single trial with 2 or more channels I got the following warning: Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In connectivity/private/sfactorization_wilson at 81   In ft_connectivity_csd2transfer at 180   In ft_connectivityanalysis at 400   In example_maillingList at 51 This warning disappears if I use the same number of trials and channels / signals in my dataset (i.e, 2 trials with 2 channels, 3 trials for  3 channels, etc). Is it possible to obtain granger spectra for single trials with Fieldtrip? I would like to average the spectra across single trials to run statistics and compare across conditions later on. This is the code I am using in my simulation, if the value of cfg.ntrials is changed to 2 (both times is is declared), then the warning disappears: nTrials = 5; for tr = 1 : nTrials             %% Simulate data         cfg             = [];     cfg.ntrials     = 1;     cfg.triallength = 2; % in secs     cfg.nsignal     = 2;     cfg.fsample     = 200;     cfg.method      = 'ar';     cfg.bpfilter    = 'no'; % (or 'no')     cfg.bpfreq      = [0 300]; % (default: [15 25])         cfg.params(:,:,1) = [ 0.8  0 ;                           0.9  0.9];         cfg.params(:,:,2) = [-0.5    0;                           0.9   -0.8];         cfg.noisecov      = [ 0.3  0; 0 0.2];         data            = ft_connectivitysimulation(cfg);            %% Non-parametric computation of the cross-spectral density matrix         cfg                 = [];     cfg.ntrials         = 1;     cfg.triallength     = 2; % in secs     cfg.nsignal         = 2;     cfg.method          = 'mtmconvol';     cfg.output          = 'fourier';     cfg.taper           = 'hanning';     cfg.foi             = 2:2:100;     cfg.t_ftimwin       = 0.05 .* ones(size(4./cfg.foi', 1), 1);     cfg.toi             = 0:0.05:2;         freq                = ft_freqanalysis(cfg, data);             %% GRANGER CAUSALITY         cfg           = [];     cfg.method    = 'granger';     granger       = ft_connectivityanalysis(cfg, freq);         sp_chan1_chan2(:,:,tr) = squeeze(granger.grangerspctrm(1,2, :, :)); %#ok     sp_chan2_chan1(:,:,tr) = squeeze(granger.grangerspctrm(2,1, :, :)); %#ok     end Thanks a lot Cheers   Lisandro Kaunitz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Dec 16 09:22:16 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 09:22:16 +0100 Subject: [FieldTrip] Leadfield and source contain NaN In-Reply-To: References: Message-ID: <52AEB838.10702@donders.ru.nl> Dear Azeez, some gridpoints might fall outside the head, thus no source activity is computed and the respective value is set to nan. In your grid or leadfield-structure you got the fields .inside and .outside. You can use these as indices to find the respective values of sourceactivity only inside (or outside) the brain. You can use the indices in analog to this example: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#computing_the_sourcemodel (see the call to ft_plot_mesh) Best, Jörn On 12/13/2013 7:06 PM, Azeez Adebimpe wrote: > Dear All, > > I calculated leadfield with 64 electrodes but majority of part of > leadfield.leadfield consist of NaN and some with values and I ensured > the electrode is projected on the head (but some not touching the head > directly but at the right position). Please help me with what I am > missing please. Whenever I used the leadfield to calculate source, it > also contain NaN. > > > > Azeez Adebimpe > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Dec 16 09:25:35 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 09:25:35 +0100 Subject: [FieldTrip] ft_spikedensity In-Reply-To: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> References: <05D3AAA674E2DA418A85E11B9F4B5DC43178E2AA@EXMBX2010-1.campus.MCGILL.CA> Message-ID: <52AEB8FF.4050404@donders.ru.nl> Dear Santiago, maybe you forgot to call ft_defaults prior to doing anything with Fieldtrip? Fieldtrip has an own nearest function, which needs *at least* two input arguments. Calling ft_defaults should add the necessary paths so that Matlab knows which nearest function to use. You can also easily verify this by calling which nearest in the command window. If this refers to a Fieldtrip function, you are fine. However, from what you describe, the path is not set correctly and this will refer to some function outside Fieldtrip. Best, Jörn On 12/13/2013 6:06 PM, Santiago Torres, Mr wrote: > Hello All, > I am trying to run the spike analysis script ft_spikedensity and have > the following problem: > When defining the begSample variable in line 234 of the code: > > begSample = nearest(timeAxis, cfg.latency(1)) > Error using nearest > Too many input arguments. > > the code is set such that it inputs two variables to the function > nearest, which only allows for one variable as input. This should > always give an error independent of the variables that are given to > nearest. I tried to do a temporary fix by eliminating the second input > which seems unnecessary (given that further code uses the values in > the timeAxis matrix only) or by making a matrix using cfg.latency(1) > as the final value of nearest(timeAxis). Neither of this options work > as they give a bigger sampleSel than timeAxis > (sampleSel(sampleSel>length(timeAxis)) = []). However, I do not want > to mess with something that may have other implications further down, > and I assume the second variable (cf.latency(1)) is there for a > reason. Can someone help explain how to go around this problem or why > it may not be working? > > timeAxis is a 1*n double matrix with increasing positive time values > starting at 0. cfg.latency(1) is 0. I am using a 32-bit matlab version > R2012a. > > Thanks, > Santiago Torres > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jean-baptiste.versini at etu.univ-lyon1.fr Mon Dec 16 12:29:22 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Mon, 16 Dec 2013 11:29:22 +0000 Subject: [FieldTrip] Single trial baseline correction Message-ID: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> Dear fieldtrip users, I wanted to know if there is a way in fieldtrip to average trials after doing the baseline correction, as it is suggested in this article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ Regards, Versini JB -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Dec 16 14:17:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 16 Dec 2013 14:17:50 +0100 Subject: [FieldTrip] Single trial baseline correction In-Reply-To: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> References: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr> Message-ID: <52AEFD7E.3050606@donders.ru.nl> Dear Jean-Baptiste, of course there is, but it depends on the representation of your data. There is ft_timelockbaseline and ft_freqbaseline, both do a baseline per trial if the representation allows so. For ft_timelockbaseline, you can explicitly specify cfg.parameter = 'trials', and for ft_freqbaseline baselining per trial is the default if there are multiple observations in your data. Best, Jörn On 12/16/2013 12:29 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Dear fieldtrip users, > > I wanted to know if there is a way in fieldtrip to average trials > *after *doing the baseline correction, as it is suggested in this > article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ > > Regards, > Versini JB > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From gopalar.ccf at gmail.com Mon Dec 16 18:35:28 2013 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 16 Dec 2013 12:35:28 -0500 Subject: [FieldTrip] dbs artifact Message-ID: Is there some experience around in fieldtrip community on ways to deal with dbs artifact in MEG data? Are there plans of including such artifact rejection routines in FT? Thanks very much. Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Mon Dec 16 19:38:29 2013 From: alik.widge at gmail.com (Alik Widge) Date: Mon, 16 Dec 2013 13:38:29 -0500 Subject: [FieldTrip] dbs artifact In-Reply-To: References: Message-ID: I can't tell you about MEG, but here's a method for EEG: http://dx.doi.org/10.1016/j.clinph.2010.02.156 We are playing around right now with questions of source localization and whether it might be possible to clearly localize the DBS to its subcortical source. Ask me in three months. If you have any capacity to request things of your subjects' neurologists, there are some papers in the literature suggesting that artifact is weaker in a bipolar configuration compared to monopolar. Again, EEG only. Here at Martinos the only recommendation I've heard about DBS+MEG is "doesn't work well". I don't know of anyone who's really studied the problem. Alik Widge alik.widge at gmail.com (206) 866-5435 On Mon, Dec 16, 2013 at 12:35 PM, Raghavan Gopalakrishnan < gopalar.ccf at gmail.com> wrote: > Is there some experience around in fieldtrip community on ways to deal > with dbs artifact in MEG data? Are there plans of including such artifact > rejection routines in FT? > > Thanks very much. > Raghavan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Mon Dec 16 19:58:57 2013 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Mon, 16 Dec 2013 19:58:57 +0100 Subject: [FieldTrip] dbs artifact In-Reply-To: References: Message-ID: In MEG, there are two methods which deal with suppression of DBS artifacts. The tSSS method is used for Elekta Neuromag MEG system for removing DBS artifacts. I came to know that the authors also made a software called MaxFilter for the same manufacturer. http://www.sciencedirect.com/science/article/pii/S0531513107001422 The other method is called Spectral Signal Space separation where authors claim to have better performance than tSSS. http://www.sciencedirect.com/science/article/pii/S105381191100139X I have tried 4 methods in removing the artifacts in EEG including the one Alik mentions and this performed poorly. Feel free to contact me if you need anything more. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Mon, Dec 16, 2013 at 7:38 PM, Alik Widge wrote: > I can't tell you about MEG, but here's a method for EEG: > http://dx.doi.org/10.1016/j.clinph.2010.02.156 > > We are playing around right now with questions of source localization and > whether it might be possible to clearly localize the DBS to its subcortical > source. Ask me in three months. > > If you have any capacity to request things of your subjects' neurologists, > there are some papers in the literature suggesting that artifact is weaker > in a bipolar configuration compared to monopolar. Again, EEG only. Here at > Martinos the only recommendation I've heard about DBS+MEG is "doesn't work > well". I don't know of anyone who's really studied the problem. > > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Mon, Dec 16, 2013 at 12:35 PM, Raghavan Gopalakrishnan < > gopalar.ccf at gmail.com> wrote: > >> Is there some experience around in fieldtrip community on ways to deal >> with dbs artifact in MEG data? Are there plans of including such artifact >> rejection routines in FT? >> >> Thanks very much. >> Raghavan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From merhart at ucsd.edu Tue Dec 17 01:41:02 2013 From: merhart at ucsd.edu (Matt Erhart) Date: Mon, 16 Dec 2013 16:41:02 -0800 Subject: [FieldTrip] Epoching continuous time frequency data Message-ID: I would like to run freqanalysis on my continuous data and then redefine trials with a cfg.trl, but ft_redefinetrial is turning my continuous time frequency data into something other than timefreq data. Is ft_redefinetrial even designed to epoch continuous freqdata? Is there a working code snippet around that shows exactly how to efficiently run freqanalysis on continuous data and then epoch it? % this cfg seems to produce reasonable results per some imagesc plotting: cfg.method = 'hilbert' cfg.foi = [2:4:56]; cfg.toi = data_ds.time; %every time point works cfg.filttype = 'fir'; % fir seems better than firls, butter has unit circle error cfg.keeptrials = 'yes'; cfg.output = 'pow'; TFRwave = ft_freqanalysis(cfg, data_ds); % continuous data to tf [cfg.trl, cfg.event] = txt2trl(cfg); %cfg.trl epochs non-freq data just fine TFRwave_trials = ft_redefinetrial(cfg,TFRwave); % warns that no trial def. provided but doesn't error ft_singleplotTFR(cfg, TFRwave_trials); % says TFRwave_trials is not freqdata -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean-baptiste.versini at etu.univ-lyon1.fr Tue Dec 17 09:40:04 2013 From: jean-baptiste.versini at etu.univ-lyon1.fr (VERSINI JEAN-BAPTISTE p1207642) Date: Tue, 17 Dec 2013 08:40:04 +0000 Subject: [FieldTrip] RE : Single trial baseline correction In-Reply-To: <52AEFD7E.3050606@donders.ru.nl> References: <5271B6068CD8D94DB822542282379288017A790D@mbx2010-02.univ-lyon1.fr>, <52AEFD7E.3050606@donders.ru.nl> Message-ID: <5271B6068CD8D94DB822542282379288017A895A@mbx2010-02.univ-lyon1.fr> Hello, Thanks, that's exactly what I was looking for. Best, Jean-Baptiste ________________________________________ De : fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] de la part de "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Date d'envoi : lundi 16 décembre 2013 14:17 À : FieldTrip discussion list Objet : Re: [FieldTrip] Single trial baseline correction Dear Jean-Baptiste, of course there is, but it depends on the representation of your data. There is ft_timelockbaseline and ft_freqbaseline, both do a baseline per trial if the representation allows so. For ft_timelockbaseline, you can explicitly specify cfg.parameter = 'trials', and for ft_freqbaseline baselining per trial is the default if there are multiple observations in your data. Best, Jörn On 12/16/2013 12:29 PM, VERSINI JEAN-BAPTISTE p1207642 wrote: > Dear fieldtrip users, > > I wanted to know if there is a way in fieldtrip to average trials > *after *doing the baseline correction, as it is suggested in this > article : http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183439/ > > Regards, > Versini JB > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From i.e.j.de.vries at student.vu.nl Wed Dec 18 07:35:55 2013 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 18 Dec 2013 06:35:55 +0000 Subject: [FieldTrip] EEG cap layout Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094E8B74@PEXMB001B.vu.local> Hi all, I used the TMSi EEG cap with 64 electrodes, but this exact layout doesn't seem to be present in the fieldtrip layout database. The layout named: "quickcap64.mat" comes closest to the caps I used, but isn't the exact same one. Did anybody make their own specific layout for fieldtrip? cheers Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 09:48:40 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 08:48:40 +0000 Subject: [FieldTrip] ft_topoplotCC question Message-ID: Hi all, *Explanation* So I have a matrix with the dimensions: SUBJECT X CONNECTIVITY X CHANa X CHANb X FREQ size: 63 X 12 X 128 X 128 X 6 meaning: - Subject 1:30 patients, 31:63 controls - Connectivity different kinds of connectivity measures (dtf, coherence, ...) - CHANa, CHANb: channels from biosemi128 layout - Freq: connectivity measures at different frequencies (2Hz, 5.5Hz, 10.5Hz, ...) *Current way of doing it* I want to plot the grand average (patient-control comparison) into one figure. What I am doing now is: 1) Looking for significant values: ttest2 for all patient and all controls nested in 4 for-loops. Sweeping trough connectivity, frequency, first channel and second channel. Where 1st and 2d channel can't be equal) 2) Taking the grand average of patient and controls, multiplying with H0 reject/accept binary matrix resulting in zero connectivity strengths for non significant values and saving the connectivity matrix in 2 structures CONN_PAT and CONN_CON 3) Manually updating the rest of the CONN_PAT and CONN_CON fields (such as frequencies of interest) and eventually using it as an input for ft_topoplotCC. (one figure for every connectivity measure) *Questions:* 1) It appears that ft_topoplotCC doesn't really look at the data field (eg cohspctrm) of CONN_PAT or CONN_CON, not declaring width of lines or opacity results in plotting all the connection lines, Am I doing something wrong? 2) If using the data field (eg plvspctrm) for controlling the opacity, shouldn't I first normalize the data? Eg: (data-average)/std(data) or /max(data) ? 3) How can I plot all the frequencies in different colors? I tried to use the hold on; hold off; command in a for loop for all frequencies but it does plot new figures. 4) Is there a way for plotting patients and controls in 1 figure? CONN_PAT - CONN_CON isn't a good way a one can get negative values. Any ideas for plotting all this information in a matrix are more then welcome! Bests, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Wed Dec 18 10:34:18 2013 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Wed, 18 Dec 2013 10:34:18 +0100 Subject: [FieldTrip] EEG cap layout In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094E8B74@PEXMB001B.vu.local>, Message-ID: Hi Ingmar, Try this tutorial; http://fieldtrip.fcdonders.nl/tutorial/layoutthat is what I used to create mine. Azeez Adebimpe From: i.e.j.de.vries at student.vu.nl To: fieldtrip at science.ru.nl Date: Wed, 18 Dec 2013 06:35:55 +0000 Subject: [FieldTrip] EEG cap layout Hi all, I used the TMSi EEG cap with 64 electrodes, but this exact layout doesn't seem to be present in the fieldtrip layout database. The layout named: "quickcap64.mat" comes closest to the caps I used, but isn't the exact same one. Did anybody make their own specific layout for fieldtrip? cheers Ingmar _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Wed Dec 18 14:39:16 2013 From: narayan.ps at tut.fi (Narayan Puthanmadam Subramaniyam) Date: Wed, 18 Dec 2013 15:39:16 +0200 Subject: [FieldTrip] question on TF analysis Message-ID: <000301cefbf6$8ba424c0$a2ec6e40$@tut.fi> Dear FT experts I have ERP data ranging from -200 ms to 1198 ms at sampling frequency of 500 Hz (Totally 700 samples). I would like to use wavelets to analyze TF between 1 to 30 Hz. I have never used wavelets so I did some reading on them and figured out that for analyzing high frequency wavelet cycles of 5 or more is good. However, my analysis is confined to relatively low frequency bands (1-4, 4-8, 8-13 and 13-30). How should I make the choice for number of cycles so that I can have clear picture of what is happening at these bands ? Plus my epoch has only 700 time points, so I assume having few cycles will increase the window length at low frequency and thus I loose time info ? Best regards Narayan -------------- next part -------------- An HTML attachment was scrubbed... URL: From joscha.schmiedt at esi-frankfurt.de Wed Dec 18 16:06:58 2013 From: joscha.schmiedt at esi-frankfurt.de (Schmiedt, Joscha) Date: Wed, 18 Dec 2013 15:06:58 +0000 Subject: [FieldTrip] Wavelet bandwidth on tutorial website Message-ID: <26F2DFC0-6ABF-4029-A569-4F2FD7643DEC@esi-frankfurt.de> Hi, The fieldtrip tutorial website on TFRs with wavelets (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis#morlet_wavelets) states that "at a given frequency F is equal to F/width*2 (so, at 30 Hz and a width of 7, the spectral bandwidth is 30/7*2 = 8.6 Hz) while the wavelet duration is equal to width/F/pi (in this case, 7/30/pi = 0.074s = 74ms)”. According to the help of ft_freqanalysis and the code of ft_specest_wavelet the spectral bandwidth (standard deviation in frequency domain) is F/width. Is the website outdated? Best, Joscha From michielb at tcd.ie Wed Dec 18 16:15:41 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:15:41 +0000 Subject: [FieldTrip] charpath, distance matrix Message-ID: Hi all, I want to calculate the characteristic path length with ft_networkanalysis but it needs a distance matrix. What is the quickest way to calculate this? Or should I calculate it myself as a distance of 1 to go to a neighbouring electrode and do this for all my biosemi128 electrodes? Thanks, Bests, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Dec 18 16:31:45 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 18 Dec 2013 16:31:45 +0100 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: References: Message-ID: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> Bart, You probably could use ft_networkanalysis in two steps. First with cfg.method='distance', then with cfg.method = 'charpath'. Best, JM On Dec 18, 2013, at 4:15 PM, Bart Michiels wrote: > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 16:51:29 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:51:29 +0000 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: References: Message-ID: edit: Nevermind, have to use the ft_networkanalysis with cfg.parameter = distance first. On 18 December 2013 15:15, Bart Michiels wrote: > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis > but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring > electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Wed Dec 18 16:52:18 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 18 Dec 2013 15:52:18 +0000 Subject: [FieldTrip] charpath, distance matrix In-Reply-To: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> References: <95A21FB8-A030-4DA6-BC89-2A792003CF7F@donders.ru.nl> Message-ID: Thanks Jan-Mathijs, didn't see your e-mail :) On 18 December 2013 15:31, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Bart, > You probably could use ft_networkanalysis in two steps. First with > cfg.method='distance', then with cfg.method = 'charpath'. > Best, > JM > > On Dec 18, 2013, at 4:15 PM, Bart Michiels wrote: > > Hi all, > > I want to calculate the characteristic path length with ft_networkanalysis > but it needs a distance matrix. What is the quickest way to calculate this? > Or should I calculate it myself as a distance of 1 to go to a neighbouring > electrode and do this for all my biosemi128 electrodes? > > Thanks, > Bests, > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Dec 19 15:38:34 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 19 Dec 2013 15:38:34 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem Message-ID: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> Dear all, I have a problem of which I can't really find the source. When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. Does anyone have an idea at which point this problem might occur? Thanks a lot. Julian P.S.: Below are the basic steps I use: %% 2.1. Build individual BEM-Model % First Realign Volume. Set Nas LPA, RPA, and positive z-values cfg=[]; cfg.method='interactive'; cfg.coordsys = 'ctf'; mri_r = ft_volumerealign(cfg,mri); cfg=[]; mri_rs = ft_volumereslice(cfg,mri_r); %% Segment the individual volume cfg=[]; cfg.output={'brain' 'scalp' 'skull'}; cfg.brainsmooth = 5; cfg.scalpsmooth = 5; cfg.brainthreshold = .5; cfg.scalpthreshold = .1; mri_s = ft_volumesegment(cfg,mri_rs); %% Create Headmodel cfg=[]; cfg.interactive = 'no'; cfg.numvertices = 1000; bnd_s = ft_prepare_mesh(cfg,mri_s); cfg=[]; cfg.method='dipoli'; % cfg.conductivity=[0.3300 0.0041 0.3300]; vol_s = ft_prepare_headmodel(cfg,bnd_s); cfg = []; cfg.mri = mri_s; grid = ft_prepare_sourcemodel(cfg); grid.inside = find(grid.brain==1)'; grid.outside = find(grid.brain==0)'; grid.pos = grid.pos*10; % Set right dimensions %% Align Electrodes cfg=[]; cfg.method='interactive'; cfg.elec=elec_128; cfg.headshape=vol_s.bnd(1); elec_new=ft_electroderealign(cfg); %% 4. Make the Leadfield. elec_new.type='eeg'; cfg=[]; cfg.channel = 1:126; cfg.elec=elec_new; cfg.vol=vol_s; cfg.grid=grid; lf = ft_prepare_leadfield(cfg); %% BEAMFORMER cfg=[]; cfg.channel=1:126; cfg.method='lcmv'; %Time-Domain-Beamformer cfg.grid=lf; cfg.vol=vol_s; cfg.elec=elec_new; cfg.reducerank = 3; cfg.keepfilter='yes'; beamfilter = ft_sourceanalysis(cfg, dat4beam); %% Keep the cfg, just add the filter. cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above lcmv_bl = ft_sourceanalysis(cfg, bl_dat); lcmv_act = ft_sourceanalysis(cfg, act_dat); ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EEG_Vol_Alignment.pdf Type: application/pdf Size: 539791 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1_standard_brain.png Type: image/png Size: 187540 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Thu Dec 19 16:35:47 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 19 Dec 2013 16:35:47 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> Message-ID: <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? best, Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 19/12/2013, a las 15:38, Julian Keil escribió: > Dear all, > > I have a problem of which I can't really find the source. > > When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). > > However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. > > The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. > > I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. > > Does anyone have an idea at which point this problem might occur? > > Thanks a lot. > > Julian > > > > P.S.: Below are the basic steps I use: > > %% 2.1. Build individual BEM-Model > % First Realign Volume. Set Nas LPA, RPA, and positive z-values > > cfg=[]; > cfg.method='interactive'; > cfg.coordsys = 'ctf'; > > mri_r = ft_volumerealign(cfg,mri); > > cfg=[]; > > mri_rs = ft_volumereslice(cfg,mri_r); > > %% Segment the individual volume > cfg=[]; > cfg.output={'brain' 'scalp' 'skull'}; > cfg.brainsmooth = 5; > cfg.scalpsmooth = 5; > cfg.brainthreshold = .5; > cfg.scalpthreshold = .1; > mri_s = ft_volumesegment(cfg,mri_rs); > > %% Create Headmodel > cfg=[]; > cfg.interactive = 'no'; > cfg.numvertices = 1000; > > bnd_s = ft_prepare_mesh(cfg,mri_s); > > cfg=[]; > cfg.method='dipoli'; % > cfg.conductivity=[0.3300 0.0041 0.3300]; > > vol_s = ft_prepare_headmodel(cfg,bnd_s); > > cfg = []; > cfg.mri = mri_s; > grid = ft_prepare_sourcemodel(cfg); > > grid.inside = find(grid.brain==1)'; > grid.outside = find(grid.brain==0)'; > grid.pos = grid.pos*10; % Set right dimensions > > %% Align Electrodes > cfg=[]; > cfg.method='interactive'; > cfg.elec=elec_128; > cfg.headshape=vol_s.bnd(1); > > elec_new=ft_electroderealign(cfg); > > %% 4. Make the Leadfield. > elec_new.type='eeg'; > > cfg=[]; > cfg.channel = 1:126; > cfg.elec=elec_new; > cfg.vol=vol_s; > cfg.grid=grid; > > lf = ft_prepare_leadfield(cfg); > > %% BEAMFORMER > > cfg=[]; > cfg.channel=1:126; > cfg.method='lcmv'; %Time-Domain-Beamformer > cfg.grid=lf; > cfg.vol=vol_s; > cfg.elec=elec_new; > cfg.reducerank = 3; > cfg.keepfilter='yes'; > > beamfilter = ft_sourceanalysis(cfg, dat4beam); > > %% Keep the cfg, just add the filter. > > cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above > > lcmv_bl = ft_sourceanalysis(cfg, bl_dat); > lcmv_act = ft_sourceanalysis(cfg, act_dat); > > > > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Dec 19 17:08:47 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 19 Dec 2013 17:08:47 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> Message-ID: <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> Hi Stephan, thanks for your quick reply. If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? Thanks a lot once more. Julian Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: > > hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? > > best, > > Stephan > > ________________________________________________________ > Stephan Moratti, PhD > > see also: http://web.me.com/smoratti/ > > Universidad Complutense de Madrid > Facultad de Psicología > Departamento de Psicología Básica I > Campus de Somosaguas > 28223 Pozuelo de Alarcón (Madrid) > Spain > > and > > Center for Biomedical Technology > Laboratory for Cognitive and Computational Neuroscience > Parque Científico y Tecnológico de la Universidad Politecnica de Madrid > Campus Montegancedo > 28223 Pozuelo de Alarcón (Madrid) > Spain > > > email: smoratti at psi.ucm.es > Tel.: +34 679219982 > > El 19/12/2013, a las 15:38, Julian Keil escribió: > >> Dear all, >> >> I have a problem of which I can't really find the source. >> >> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >> >> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >> >> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >> >> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >> >> Does anyone have an idea at which point this problem might occur? >> >> Thanks a lot. >> >> Julian >> >> >> >> P.S.: Below are the basic steps I use: >> >> %% 2.1. Build individual BEM-Model >> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >> >> cfg=[]; >> cfg.method='interactive'; >> cfg.coordsys = 'ctf'; >> >> mri_r = ft_volumerealign(cfg,mri); >> >> cfg=[]; >> >> mri_rs = ft_volumereslice(cfg,mri_r); >> >> %% Segment the individual volume >> cfg=[]; >> cfg.output={'brain' 'scalp' 'skull'}; >> cfg.brainsmooth = 5; >> cfg.scalpsmooth = 5; >> cfg.brainthreshold = .5; >> cfg.scalpthreshold = .1; >> mri_s = ft_volumesegment(cfg,mri_rs); >> >> %% Create Headmodel >> cfg=[]; >> cfg.interactive = 'no'; >> cfg.numvertices = 1000; >> >> bnd_s = ft_prepare_mesh(cfg,mri_s); >> >> cfg=[]; >> cfg.method='dipoli'; % >> cfg.conductivity=[0.3300 0.0041 0.3300]; >> >> vol_s = ft_prepare_headmodel(cfg,bnd_s); >> >> cfg = []; >> cfg.mri = mri_s; >> grid = ft_prepare_sourcemodel(cfg); >> >> grid.inside = find(grid.brain==1)'; >> grid.outside = find(grid.brain==0)'; >> grid.pos = grid.pos*10; % Set right dimensions >> >> %% Align Electrodes >> cfg=[]; >> cfg.method='interactive'; >> cfg.elec=elec_128; >> cfg.headshape=vol_s.bnd(1); >> >> elec_new=ft_electroderealign(cfg); >> >> %% 4. Make the Leadfield. >> elec_new.type='eeg'; >> >> cfg=[]; >> cfg.channel = 1:126; >> cfg.elec=elec_new; >> cfg.vol=vol_s; >> cfg.grid=grid; >> >> lf = ft_prepare_leadfield(cfg); >> >> %% BEAMFORMER >> >> cfg=[]; >> cfg.channel=1:126; >> cfg.method='lcmv'; %Time-Domain-Beamformer >> cfg.grid=lf; >> cfg.vol=vol_s; >> cfg.elec=elec_new; >> cfg.reducerank = 3; >> cfg.keepfilter='yes'; >> >> beamfilter = ft_sourceanalysis(cfg, dat4beam); >> >> %% Keep the cfg, just add the filter. >> >> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >> >> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >> lcmv_act = ft_sourceanalysis(cfg, act_dat); >> >> >> >> ******************** >> Dr. Julian Keil >> >> AG Multisensorische Integration >> Psychiatrische Universitätsklinik >> der Charité im St. Hedwig-Krankenhaus >> Große Hamburger Straße 5-11, Raum E 307 >> 10115 Berlin >> >> Telefon: +49-30-2311-1879 >> Fax: +49-30-2311-2209 >> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Thu Dec 19 17:18:50 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 19 Dec 2013 16:18:50 +0000 Subject: [FieldTrip] frequency analysis In-Reply-To: <52A974C7.3080104@donders.ru.nl> References: <52A974C7.3080104@donders.ru.nl> Message-ID: Dear Raghavan, For your 3rd question, I would add to Jorn's answer that you can, but not are required to, use combineplanar of your planar gradiometer pairs if you want one answer (of ERF or TFR) per channel location rather than 2, prior to grandaveraging. For statistics, be sure to use the correct neighbours template file: neuromag306planar_neighb.mat if you have not combined, and neuromag306cmb_neighb.mat if you have combined. Best, Johanna 2013/12/12 "Jörn M. Horschig" > Dear Raghavan, > > 1) Sure is it possible, z-scoring is nothing else then subtracting the > mean and dividing by the standard deviation. The time-period from which you > obtain the mean and standard deviation depend on what you want and how you > define it. > > 2) Usually we do not use megrealign at all and assume that subjects are > approximately similarly seated in the helmet for computing the > grandaverage. MEG sensor-level analysis is not suited very well for making > spatial inferences anyway, I would advise to go to source space for such a > thing. > > 3) For neuromag data, you already have planar gradiometers, so you do not > need megplanar and combineplanar. We, on the other hand, only have axial > gradiometers with our CTF system, thus we need a planar transformation to > get a planar representation. > > 4) I cannot help with this one, sorry. > > Best, > Jörn > > Raghavan Gopalakrishnan wrote: > >> I have a few questions regarding frequency analysis using wavelets. >> >> 1. Is it possible to z-score the TF spectrograms? Is so how and where >> should I specify the baseline? >> 2. Before grand averaging ERFs, the pipeline has 'megrealign' to make >> sure all sensors from multi subject are matched. However, why is this not >> performed before grand averaging time-frequency data since the powspctrm is >> specific to each channel? >> 3. Is combineplanar a necessary step before any grand averaging i.e. ERF >> or TFR? I am using neuromag data, so can I perform grand averaging and >> statistics without combineplanar? >> 4. Fieldtrip only reads neuromag FIF files that has been processed >> through maxfilter. There are times when there is a need not to use >> maxfilter, is there a work around? >> >> Thanks very much. >> Raghavan >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Thu Dec 19 20:44:35 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 19 Dec 2013 20:44:35 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> Message-ID: <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> I thought of changing the dat4beam.elec to newelec. Does this help? Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 19/12/2013, a las 17:08, Julian Keil escribió: > Hi Stephan, > > thanks for your quick reply. > > If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. > > If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. > > Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? > > Thanks a lot once more. > > Julian > > Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: > >> >> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? >> >> best, >> >> Stephan >> >> ________________________________________________________ >> Stephan Moratti, PhD >> >> see also: http://web.me.com/smoratti/ >> >> Universidad Complutense de Madrid >> Facultad de Psicología >> Departamento de Psicología Básica I >> Campus de Somosaguas >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> and >> >> Center for Biomedical Technology >> Laboratory for Cognitive and Computational Neuroscience >> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >> Campus Montegancedo >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> >> email: smoratti at psi.ucm.es >> Tel.: +34 679219982 >> >> El 19/12/2013, a las 15:38, Julian Keil escribió: >> >>> Dear all, >>> >>> I have a problem of which I can't really find the source. >>> >>> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >>> >>> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >>> >>> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >>> >>> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >>> >>> Does anyone have an idea at which point this problem might occur? >>> >>> Thanks a lot. >>> >>> Julian >>> >>> >>> >>> P.S.: Below are the basic steps I use: >>> >>> %% 2.1. Build individual BEM-Model >>> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >>> >>> cfg=[]; >>> cfg.method='interactive'; >>> cfg.coordsys = 'ctf'; >>> >>> mri_r = ft_volumerealign(cfg,mri); >>> >>> cfg=[]; >>> >>> mri_rs = ft_volumereslice(cfg,mri_r); >>> >>> %% Segment the individual volume >>> cfg=[]; >>> cfg.output={'brain' 'scalp' 'skull'}; >>> cfg.brainsmooth = 5; >>> cfg.scalpsmooth = 5; >>> cfg.brainthreshold = .5; >>> cfg.scalpthreshold = .1; >>> mri_s = ft_volumesegment(cfg,mri_rs); >>> >>> %% Create Headmodel >>> cfg=[]; >>> cfg.interactive = 'no'; >>> cfg.numvertices = 1000; >>> >>> bnd_s = ft_prepare_mesh(cfg,mri_s); >>> >>> cfg=[]; >>> cfg.method='dipoli'; % >>> cfg.conductivity=[0.3300 0.0041 0.3300]; >>> >>> vol_s = ft_prepare_headmodel(cfg,bnd_s); >>> >>> cfg = []; >>> cfg.mri = mri_s; >>> grid = ft_prepare_sourcemodel(cfg); >>> >>> grid.inside = find(grid.brain==1)'; >>> grid.outside = find(grid.brain==0)'; >>> grid.pos = grid.pos*10; % Set right dimensions >>> >>> %% Align Electrodes >>> cfg=[]; >>> cfg.method='interactive'; >>> cfg.elec=elec_128; >>> cfg.headshape=vol_s.bnd(1); >>> >>> elec_new=ft_electroderealign(cfg); >>> >>> %% 4. Make the Leadfield. >>> elec_new.type='eeg'; >>> >>> cfg=[]; >>> cfg.channel = 1:126; >>> cfg.elec=elec_new; >>> cfg.vol=vol_s; >>> cfg.grid=grid; >>> >>> lf = ft_prepare_leadfield(cfg); >>> >>> %% BEAMFORMER >>> >>> cfg=[]; >>> cfg.channel=1:126; >>> cfg.method='lcmv'; %Time-Domain-Beamformer >>> cfg.grid=lf; >>> cfg.vol=vol_s; >>> cfg.elec=elec_new; >>> cfg.reducerank = 3; >>> cfg.keepfilter='yes'; >>> >>> beamfilter = ft_sourceanalysis(cfg, dat4beam); >>> >>> %% Keep the cfg, just add the filter. >>> >>> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >>> >>> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >>> lcmv_act = ft_sourceanalysis(cfg, act_dat); >>> >>> >>> >>> ******************** >>> Dr. Julian Keil >>> >>> AG Multisensorische Integration >>> Psychiatrische Universitätsklinik >>> der Charité im St. Hedwig-Krankenhaus >>> Große Hamburger Straße 5-11, Raum E 307 >>> 10115 Berlin >>> >>> Telefon: +49-30-2311-1879 >>> Fax: +49-30-2311-2209 >>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Fri Dec 20 09:01:13 2013 From: michielb at tcd.ie (Bart Michiels) Date: Fri, 20 Dec 2013 08:01:13 +0000 Subject: [FieldTrip] connectivity analysis In-Reply-To: <19A3518D-5E2A-452B-BA89-918B8FD18BC5@donders.ru.nl> References: <19A3518D-5E2A-452B-BA89-918B8FD18BC5@donders.ru.nl> Message-ID: Good morning Jan-Mathijs, Some weeks ago you've sent me the following answer to my question on doing some connectivity and network analysis on some frequency data separated in frequency bins. I totally agree with you that electrode level analysis is a bad way for doing the connectivity analysis, but I have to use electrode level data (for the moment). I also listened to your advance and only averaged the connectivity measures between subjects for the grand average comparison. For the ft_freqanalysis I used the smoothing box and the foi in such a way it would overlap my frequency band of interest, but why can't one just average frequency data for a range of frequencies? And why wouldn't you do it across trials? For the trials I just used cfg.keeptrials = 'yes' and used it as an input for ft_connectivityanalysis where the dimension trials is lost. So I presume averaging over trials is done in the right way within the ft_connectivityanalysis function? Bests, Bart On 12 November 2013 10:57, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Bart, > > If you 7 frequency bins within each frequency bin are considered to belong > to the same frequency band, I'd suggest to use the multitaper approach to > estimate the spectral parameters per frequency band, using just a single > frequency bin to represent the whole band of interest. So, rather than for > example estimating from 15 until 21 Hz in steps of 1 Hz, you can also > estimate only at 18, using cfg.tapsmofrq = 3 in ft_freqanalysis. I suggest > to have a look at the documentation on the FT-wiki that is concerned with > frequency analysis. I would certainly not average the spectral > representation prior to computing the coherence, neither across the > individual frequency bins, and even more certainly not across trials. > > Regarding statistics, I don't want to discourage you, but I don't think it > makes sense to attempt doing statistics at the channel level to begin with, > due to the effects of volume conduction. Also, in any group comparison (but > also when doing a comparison across conditions), if there is any between > groups in terms of SNR (e.g. more or less alpha power across groups) you > are bound to find a statistically significant difference in estimated > connectivity as well. It remains to be motivated in such a case, that the > change in estimated connectivity actually reflects a change in true > connectivity. > > If you want to do statistics irrespective of these caveats, you may want > to look into FieldTrip's implementation of the non-parametric permutation > testing framework. There is ample documentation about this on our wiki as > well. > > Best wishes, > > Jan-Mathijs > > > > On Oct 30, 2013, at 1:22 PM, Bart Michiels wrote: > > Hi, > > I have 30 patients and 30 controls and I'm investigating their coherence > (EEG, 128 electrodes). Every patient has ~30 trials resting state eyes open > consisting of 7 frequency bins with 7 frequencies in each bin. My goal is > to show connectivity differences between different brain regions in the > control and patient group (doing electrode-level analysis now, source-level > analysis is next step). > > - Is it more appropriate to keep the averaging step as the latest step > (ie. calculate all coherence for all the different subjects, for all > trials, for all different frequencies in frequency bins) or is it better to > do the averaging asap (ie. average all frequencies in 1 frequency bin at > the time-frequency analysis step, average all trials at the > ft_freqdescriptives step, ...) > > - Is there any better way to do some statistics on the 128x128x7x7 (128 > electrodes, 7 frequency bins, 7 frequencies in each bin) besides using the > ttest2() matlab function? > > Any tips & tricks are more then welcome! > > Bart > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Fri Dec 20 10:07:42 2013 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 20 Dec 2013 10:07:42 +0100 Subject: [FieldTrip] EEG Electrode / Volume Alignment Problem In-Reply-To: <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> References: <1BF12C37-F5F7-4EBC-8A8D-43B44AB4CF65@gmail.com> <48FF5B2A-518B-4F48-97D3-7F73E559C283@psi.ucm.es> <732CAEDA-5FD1-4343-A3BF-AB65DBDBF589@gmail.com> <14D7D3F5-C13E-4869-A5A8-BEC2BB25C0EB@psi.ucm.es> Message-ID: Hi Stephan, Ah, I forgot that the electrode definition is added to the EEG-structure. Unfortunately, neither removing this nor setting all .elec-fields to the aligned elec_new helps. Happy end-of-the-year wishes, Julian Am 19.12.2013 um 20:44 schrieb smoratti at psi.ucm.es: > > I thought of changing the dat4beam.elec to newelec. Does this help? > > Stephan > > ________________________________________________________ > Stephan Moratti, PhD > > see also: http://web.me.com/smoratti/ > > Universidad Complutense de Madrid > Facultad de Psicología > Departamento de Psicología Básica I > Campus de Somosaguas > 28223 Pozuelo de Alarcón (Madrid) > Spain > > and > > Center for Biomedical Technology > Laboratory for Cognitive and Computational Neuroscience > Parque Científico y Tecnológico de la Universidad Politecnica de Madrid > Campus Montegancedo > 28223 Pozuelo de Alarcón (Madrid) > Spain > > > email: smoratti at psi.ucm.es > Tel.: +34 679219982 > > El 19/12/2013, a las 17:08, Julian Keil escribió: > >> Hi Stephan, >> >> thanks for your quick reply. >> >> If I change the cfg.elec definition in the call to the beamformer, the source projection follows the electrodes, i.e. when I use the misaligned electrodes, the source is in the visual cortex, and if I use the aligned electrodes, the source is left temporal. >> >> If I leave the info for cfg.elec out, ft_sourceanalysis takes the electrode info from the lead field. >> >> Am I maybe missing some step during the call to ft_prepare_leadfield? Maybe some rotation of the volume or something like this? >> >> Thanks a lot once more. >> >> Julian >> >> Am 19.12.2013 um 16:35 schrieb smoratti at psi.ucm.es: >> >>> >>> hmm… in theory every thing should be fine as the lead field is calculated with aligned electrodes to bnd_s. However, try to change the electrode positions as well in dat4beam. Does this help? >>> >>> best, >>> >>> Stephan >>> >>> ________________________________________________________ >>> Stephan Moratti, PhD >>> >>> see also: http://web.me.com/smoratti/ >>> >>> Universidad Complutense de Madrid >>> Facultad de Psicología >>> Departamento de Psicología Básica I >>> Campus de Somosaguas >>> 28223 Pozuelo de Alarcón (Madrid) >>> Spain >>> >>> and >>> >>> Center for Biomedical Technology >>> Laboratory for Cognitive and Computational Neuroscience >>> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >>> Campus Montegancedo >>> 28223 Pozuelo de Alarcón (Madrid) >>> Spain >>> >>> >>> email: smoratti at psi.ucm.es >>> Tel.: +34 679219982 >>> >>> El 19/12/2013, a las 15:38, Julian Keil escribió: >>> >>>> Dear all, >>>> >>>> I have a problem of which I can't really find the source. >>>> >>>> When I use the standard BEM-Model and the standard MRI together with our vendor-provided EEG electrode positions, I can nicely and reliably localize effects in source space (e.g. the visual N1, see attached source plot). >>>> >>>> However, when I use an individual MRI (DICOM, imported via ft_read_mri, realigned interactively, resliced and segmented) to build a BEM-Model (Dipoli-Method), realign the electrodes to the new volume (using the interactive mode in ft_electroderealign) and subsequently build an individual lead field, the effect is shifted away from visual cortex and it appears as if the source and the MRI are misaligned. >>>> >>>> The odd thing is, that if I leave the alignment step out, i.e. use the misaligned electrodes to build the lead field, the effect at least moves back to the visual cortex. >>>> >>>> I hope the attached comparison between aligned and misaligned electrodes makes this a bit clearer. >>>> >>>> Does anyone have an idea at which point this problem might occur? >>>> >>>> Thanks a lot. >>>> >>>> Julian >>>> >>>> >>>> >>>> P.S.: Below are the basic steps I use: >>>> >>>> %% 2.1. Build individual BEM-Model >>>> % First Realign Volume. Set Nas LPA, RPA, and positive z-values >>>> >>>> cfg=[]; >>>> cfg.method='interactive'; >>>> cfg.coordsys = 'ctf'; >>>> >>>> mri_r = ft_volumerealign(cfg,mri); >>>> >>>> cfg=[]; >>>> >>>> mri_rs = ft_volumereslice(cfg,mri_r); >>>> >>>> %% Segment the individual volume >>>> cfg=[]; >>>> cfg.output={'brain' 'scalp' 'skull'}; >>>> cfg.brainsmooth = 5; >>>> cfg.scalpsmooth = 5; >>>> cfg.brainthreshold = .5; >>>> cfg.scalpthreshold = .1; >>>> mri_s = ft_volumesegment(cfg,mri_rs); >>>> >>>> %% Create Headmodel >>>> cfg=[]; >>>> cfg.interactive = 'no'; >>>> cfg.numvertices = 1000; >>>> >>>> bnd_s = ft_prepare_mesh(cfg,mri_s); >>>> >>>> cfg=[]; >>>> cfg.method='dipoli'; % >>>> cfg.conductivity=[0.3300 0.0041 0.3300]; >>>> >>>> vol_s = ft_prepare_headmodel(cfg,bnd_s); >>>> >>>> cfg = []; >>>> cfg.mri = mri_s; >>>> grid = ft_prepare_sourcemodel(cfg); >>>> >>>> grid.inside = find(grid.brain==1)'; >>>> grid.outside = find(grid.brain==0)'; >>>> grid.pos = grid.pos*10; % Set right dimensions >>>> >>>> %% Align Electrodes >>>> cfg=[]; >>>> cfg.method='interactive'; >>>> cfg.elec=elec_128; >>>> cfg.headshape=vol_s.bnd(1); >>>> >>>> elec_new=ft_electroderealign(cfg); >>>> >>>> %% 4. Make the Leadfield. >>>> elec_new.type='eeg'; >>>> >>>> cfg=[]; >>>> cfg.channel = 1:126; >>>> cfg.elec=elec_new; >>>> cfg.vol=vol_s; >>>> cfg.grid=grid; >>>> >>>> lf = ft_prepare_leadfield(cfg); >>>> >>>> %% BEAMFORMER >>>> >>>> cfg=[]; >>>> cfg.channel=1:126; >>>> cfg.method='lcmv'; %Time-Domain-Beamformer >>>> cfg.grid=lf; >>>> cfg.vol=vol_s; >>>> cfg.elec=elec_new; >>>> cfg.reducerank = 3; >>>> cfg.keepfilter='yes'; >>>> >>>> beamfilter = ft_sourceanalysis(cfg, dat4beam); >>>> >>>> %% Keep the cfg, just add the filter. >>>> >>>> cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above >>>> >>>> lcmv_bl = ft_sourceanalysis(cfg, bl_dat); >>>> lcmv_act = ft_sourceanalysis(cfg, act_dat); >>>> >>>> >>>> >>>> ******************** >>>> Dr. Julian Keil >>>> >>>> AG Multisensorische Integration >>>> Psychiatrische Universitätsklinik >>>> der Charité im St. Hedwig-Krankenhaus >>>> Große Hamburger Straße 5-11, Raum E 307 >>>> 10115 Berlin >>>> >>>> Telefon: +49-30-2311-1879 >>>> Fax: +49-30-2311-2209 >>>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From R.Oostenveld at donders.ru.nl Fri Dec 20 14:38:37 2013 From: R.Oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 20 Dec 2013 14:38:37 +0100 Subject: [FieldTrip] Job posting: 9 PhD positions in the Dutch Research Consortium 'Language in Interaction' References: <1517293618.4361293.1387545450952.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <5A236B39-57EC-4178-9F97-4106E05B1428@donders.ru.nl> Begin forwarded message: > From: "Lorenz, C.M." > Date: 20 December 2013 14:17:30 CET > To: R.Oostenveld at donders.ru.nl > Subject: Job posting: 9 PhD positions in the Dutch Research Consortium 'Language in Interaction' > > Nine PhD Positions in the Dutch Research Consortium 'Language in Interaction' > > We are looking for highly motivated PhD candidates to enrich a unique consortium of researchers that aims to unravel the neurocognitive mechanisms of language at multiple levels. The goal is to understand both the universality and the variability of the human language faculty from genes to behaviour. > > The Netherlands has an outstanding track record in the language sciences. This research consortium sponsored by a large grant from the Netherlands Organization for Scientific research (NWO) brings together many of the excellent research groups in the Netherlands with a research programme on the foundations of language. The research team consists of 43 Principal Investigators. In addition to the excellence in the domain of language and related relevant fields of cognition, our consortium provides state-of-the-art research facilities and a research team with ample experience in the complex research methods that will be invoked to address the scientific questions at the highest level of methodological sophistication. These include methods from genetics, neuroimaging, computational modelling, and patient-related research. This consortium realizes both quality and critical mass for studying human language at a scale not easily found anywhere else. > > Currently, the consortium advertises nine PhD positions for a period of 4 years. These positions provide the opportunity for conducting world-class research as a member of an interdisciplinary team. > > Closing date for application: February 2, 2014 > > Click here for more information on the PhD positions and how to apply. > > (url = http://www.ru.nl/vacatures/details/details_vacature_0?recid=529314) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mje.mads at gmail.com Fri Dec 20 23:43:02 2013 From: mje.mads at gmail.com (Mads Jensen) Date: Fri, 20 Dec 2013 23:43:02 +0100 Subject: [FieldTrip] permutation test on extracted sources? Message-ID: <52B4C7F6.6060609@gmail.com> Hi all, I have some data that are extracted time series from a source reconstruction. I would like to use the statistical apparatus of Fieldtrip to do permutation tests on these data. Is is possible to create a "virtual" channel and do a permutation test on that, and what about multiple "virtual" channels at the same time? best wishes, mads From n.lam at fcdonders.ru.nl Sat Dec 21 09:53:47 2013 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Sat, 21 Dec 2013 09:53:47 +0100 (CET) Subject: [FieldTrip] permutation test on extracted sources? In-Reply-To: <52B4C7F6.6060609@gmail.com> Message-ID: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> Hi Mads, FieldTrip has a virtual sensor tutorial. http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors?s[]=beamformer&s[]=extended I'm not too familiar with it, but I do know that it uses a time-series source reconstruction (LCMV Beamformer) which is probably similar to what you've done. Further down the tutorial they do a source analysis with ft_sourceanalysis which the output I think you can use to do statistics (ft_sourcestatistics). I'm sure some other FT members can add to the details. Hope this helps. Best, Nietzsche ----- Original Message ----- > From: "Mads Jensen" > To: fieldtrip at science.ru.nl > Sent: Friday, 20 December, 2013 11:43:02 PM > Subject: [FieldTrip] permutation test on extracted sources? > Hi all, > > I have some data that are extracted time series from a source > reconstruction. I would like to use the statistical apparatus of > Fieldtrip to do permutation tests on these data. > > Is is possible to create a "virtual" channel and do a permutation test > on that, and what about multiple "virtual" channels at the same time? > > > best wishes, > mads > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From mje.mads at gmail.com Fri Dec 27 10:46:06 2013 From: mje.mads at gmail.com (Mads Jensen) Date: Fri, 27 Dec 2013 10:46:06 +0100 Subject: [FieldTrip] permutation test on extracted sources? In-Reply-To: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> References: <1705707062.828572.1387616027820.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <52BD4C5E.8020106@gmail.com> Hi Liam, Thanks I had missed that tutorial, very useful. best, mads On 12/21/2013 09:53 AM, Lam, Nietzsche wrote: > Hi Mads, > > FieldTrip has a virtual sensor tutorial. > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors?s[]=beamformer&s[]=extended > > I'm not too familiar with it, but I do know that it uses a time-series source reconstruction (LCMV Beamformer) which is probably similar to what you've done. Further down the tutorial they do a source analysis with ft_sourceanalysis which the output I think you can use to do statistics (ft_sourcestatistics). I'm sure some other FT members can add to the details. > > Hope this helps. > > Best, > Nietzsche > > ----- Original Message ----- >> From: "Mads Jensen" >> To: fieldtrip at science.ru.nl >> Sent: Friday, 20 December, 2013 11:43:02 PM >> Subject: [FieldTrip] permutation test on extracted sources? >> Hi all, >> >> I have some data that are extracted time series from a source >> reconstruction. I would like to use the statistical apparatus of >> Fieldtrip to do permutation tests on these data. >> >> Is is possible to create a "virtual" channel and do a permutation test >> on that, and what about multiple "virtual" channels at the same time? >> >> >> best wishes, >> mads >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >