From mengtongxiao at gmail.com Mon Apr 1 16:05:57 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 1 Apr 2013 22:05:57 +0800 Subject: [FieldTrip] How can I use DICS to get the waveforms? Message-ID: Dear all, I use DICS-beamformer to get the source,as follow: cfg = []; cfg.frequency = freqP.freq; cfg.elec = grid.cfg.elec; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = grid; cfg.vol = vol; cfg.dics.lambda = '5%';; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freqP); source = dim: [19 25 19] freq: 17.9481 cumtapcnt: 3 pos: [9025x3 double] inside: [1x4686 double] outside: [1x4339 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] source.avg pow: [1x9025 double] is it right? if I want to get the waveforms in order to do the correlation,how can I do ? thanks, best xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 2 09:32:16 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 02 Apr 2013 09:32:16 +0200 Subject: [FieldTrip] How can I use DICS to get the waveforms? In-Reply-To: References: Message-ID: <515A8980.7030503@donders.ru.nl> Dear Xiao, the DICS algorithm computes power of a certain frequency band of *one *time window (it works in the frequency domain with the cross-spectral density matrix, i.e. no time axis anymore). The source.avg.pow field contains thus the power value of this one time-frequency bin. I assume you want to get time-spectral evolution information? In that case it might be best to use the LCMV beamformer in the time-domain, extract the spatial location (voxel) of interest and apply the whatever-Fourier transform (short time, wavelet, welch, taper) on that. Please have a look at our various tutorials, for example: http://fieldtrip.fcdonders.nl/tutorial/beamformer (on DICS) http://fieldtrip.fcdonders.nl/tutorial/beamformingextended (appendix for LCMV) http://fieldtrip.fcdonders.nl/tutorial/connectivity (also includes LCMV) And here for the DICS paper: http://www.ncbi.nlm.nih.gov/pubmed/11209067 Best regards, Jörn On 4/1/2013 4:05 PM, ?? wrote: > Dear all, > I use DICS-beamformer to get the source,as follow: > cfg = []; > cfg.frequency = freqP.freq; > cfg.elec = grid.cfg.elec; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.lambda = '5%';; > cfg.dics.realfilter = 'yes'; > source = ft_sourceanalysis(cfg, freqP); > source = > > dim: [19 25 19] > freq: 17.9481 > cumtapcnt: 3 > pos: [9025x3 double] > inside: [1x4686 double] > outside: [1x4339 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > source.avg > > pow: [1x9025 double] > is it right? if I want to get the waveforms in order to do the > correlation,how can I do ? > thanks, > best > xiao > > > _______________________________________________ > 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 eelke.spaak at donders.ru.nl Tue Apr 2 09:48:30 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 2 Apr 2013 09:48:30 +0200 Subject: [FieldTrip] How can I use DICS to get the waveforms? In-Reply-To: <515A8980.7030503@donders.ru.nl> References: <515A8980.7030503@donders.ru.nl> Message-ID: Dear Xiao, In addition to Jörn's excellent tips, specifically refer to the appendix of the beamformingextended tutorial (http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space), where the steps needed to extract a waveform from a specific grid point (in this case, the peak voxel after a DICS beamformer) are explained. Best, Eelke On 2 April 2013 09:32, "Jörn M. Horschig" wrote: > Dear Xiao, > > the DICS algorithm computes power of a certain frequency band of one time > window (it works in the frequency domain with the cross-spectral density > matrix, i.e. no time axis anymore). The source.avg.pow field contains thus > the power value of this one time-frequency bin. I assume you want to get > time-spectral evolution information? In that case it might be best to use > the LCMV beamformer in the time-domain, extract the spatial location (voxel) > of interest and apply the whatever-Fourier transform (short time, wavelet, > welch, taper) on that. Please have a look at our various tutorials, for > example: > > http://fieldtrip.fcdonders.nl/tutorial/beamformer (on DICS) > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended (appendix for > LCMV) > http://fieldtrip.fcdonders.nl/tutorial/connectivity (also includes LCMV) > > And here for the DICS paper: > http://www.ncbi.nlm.nih.gov/pubmed/11209067 > > Best regards, > Jörn > > > > On 4/1/2013 4:05 PM, 陈雪 wrote: > > Dear all, > I use DICS-beamformer to get the source,as follow: > cfg = []; > cfg.frequency = freqP.freq; > cfg.elec = grid.cfg.elec; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.lambda = '5%';; > cfg.dics.realfilter = 'yes'; > source = ft_sourceanalysis(cfg, freqP); > > source = > > dim: [19 25 19] > freq: 17.9481 > cumtapcnt: 3 > pos: [9025x3 double] > inside: [1x4686 double] > outside: [1x4339 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > source.avg > > pow: [1x9025 double] > is it right? if I want to get the waveforms in order to do the > correlation,how can I do ? > > thanks, > best > xiao > > > _______________________________________________ > 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 mengtongxiao at gmail.com Wed Apr 3 10:07:27 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Wed, 3 Apr 2013 16:07:27 +0800 Subject: [FieldTrip] Help with ft_sourceanalysis ? Message-ID: Dear all, I want use ' ft_connectivityanalysis' do correlation as follow: cfg = []; cfg.method = 'lcmv'; cfg.vol = vol; cfg.grid.pos = maxpos; cfg.lcmv.fixedori='yes'; cfg.elec = data_org.hdr.elec; cfg.lcmv.keepfilter = 'yes'; source1 = ft_sourceanalysis(cfg, timelock); cfg=[]; cfg.method = 'powcorr_ortho'; stat = ft_connectivityanalysis(cfg, source1) ource1 = time: [1x102099 double] pos: [2x3 double] inside: [2x1 double] outside: [0x1 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] the error is that ??? Reference to non-existent field 'cumtapcnt'. Error in ==> ft_connectivityanalysis at 734 optarg = {'refindx', cfg.refindx, 'tapvec', data.cumtapcnt}; Is right using tne ''lcmv'' method When I do the 'powcorr_ortho'? If the method is ringht , the 'cumtapcnt'.what means and how do get it.[when I use the 'dics' method ,some error is that Reference to non-existent field 'mom'.] How should I do? thanks for your attention. best, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From K.Kalogianni at tudelft.nl Wed Apr 3 11:01:26 2013 From: K.Kalogianni at tudelft.nl (Konstantina Kalogianni) Date: Wed, 3 Apr 2013 09:01:26 +0000 Subject: [FieldTrip] FW: chop_raw cnt data into segments_&ICA Message-ID: <4DF682D3A10EAC46B462A46E16F0B0491287BC53@SRV366.tudelft.net> Dear fieldtrip users, I am new to fieldtrip and I have the following issue regarding preprocessing of EEG and ICA. I want to: 1. import my .cnt data 2. chop my file to 5 different files that correspond to each of my tasks 3. then take one part of my file that correspond to one of my tasks and filter, demean, rerefernce, resample raw data 4. ICA raw data 5. Then define epochs 6. & then proceed with the rest of the analysis One of my tasks has repetitive triggers with the code 1 So I want to take only the part of my raw data that corresponds to this task(including some ms before the first trigger and some after ) and then at a later stage epoch my data. Should I create one trial_fun that chop my data to 5 datasets corresponding to each task, then call ft_definetrial, then preprocess the data, ICA them and then call again the ft_defientrial with another trial_fun to chop my data into epochs? Is that even possible ? The way I try to do it now is : first define trial with : cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = '1' cfg.trialdef.prestim = 0.005; % in seconds cfg.trialdef.poststim = 0.01; % in seconds cfg1 = ft_definetrial(cfg); Then I call ft_preprocessing(cfg); with cfg.continuous = 'yes'; to make sure that when I ll perform ICA it will be on continuous data. and then when I run ICA it produces an expected error that I cannot run ICA on epoched data (it needs raw). So I have to epoch after the ICA, but how should I select the part that only corresponds to one of my tasks? Thank you for your time. Best, Nadia -------------- next part -------------- An HTML attachment was scrubbed... URL: From kai.hwang at gmail.com Wed Apr 3 15:32:56 2013 From: kai.hwang at gmail.com (Kai Hwang) Date: Wed, 3 Apr 2013 09:32:56 -0400 Subject: [FieldTrip] Postdoctoral position in developmental cognitive neuroscience (Pittsburgh) Message-ID: Postdoctoral Position**** Laboratory of Neurocognitive Development**** Department of Psychiatry**** University of Pittsburgh, Pennsylvania**** Principal investigator: Bea Luna, Ph.D. Applicants are invited for a funded postdoctoral position at the University of Pittsburgh investigating cognitive development using a multimodal neuroimaging approach combining fMRI, DTI, MEG, and behavioral testing. We are looking for exceptional Ph.D. researchers with prior experience in MEG/EEG methodology and neuroimaging data analyses. Inherent interest in developmental cognitive neuroscience is a plus. Potential projects will involve investigating the development of functional brain networks supporting cognitive control and/or cognitive-affect interactions during adolescence. Applicants should be willing to commit to a minimum two year appointment. Applicants will be reviewed on an on-going basis until the position is filled. Applicants should send a CV, statement of research interest and contact information of three referees to Dr. Bea Luna (lunab at upmc.edu). -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Wed Apr 3 17:14:18 2013 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Wed, 3 Apr 2013 11:14:18 -0400 Subject: [FieldTrip] preprocessing cfg.trials Message-ID: Dear Fieldstripers: I used to use the ft_preprocessing (fieldtrip-20120521) function to sort my data (eg. sort the trials in terms of response time). In a newest version I downloaded a couples of weeks ago I can't do it anymore. Question: there is another function which was implemented to do this, or is a bug of the preprocessing function? or it's me? In simple terms, in the older version, the cfg.trials input preserved the order of the trials provided, now is not working, and just select the trials but keep the original sequence of trials. Thanks a lot! Best Y -------------- next part -------------- An HTML attachment was scrubbed... URL: From munsif.jatoi at gmail.com Thu Apr 4 12:01:02 2013 From: munsif.jatoi at gmail.com (Munsif Jatoi) Date: Thu, 4 Apr 2013 03:01:02 -0700 Subject: [FieldTrip] Help in code Message-ID: Dear Sir/Madam, I hope you are fine. Sir, I am doing PhD in EEG Source localization using FEM. I was using the codes available at your website for implementation of head model using FEM. I have written following program in MATLAB: *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip');* *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip\utilities');* *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip\external\freesurfer');* *addpath('C:\Users\Munsif\Desktop\Kelantan Dr. Bornot\fieldtrip\external\simbio');* *mri = ft_read_mri('G:\tutorial_fieldtrip\Subject01\Subject01.mri');* * * *% reslice* *cfg = [];* *cfg.dim = mri.dim;* *mri = ft_volumereslice(cfg,mri);* * * *% segmentation* *cfg = [];* *cfg.output = {'gray','white','csf','skull','scalp'};* *segmentedmri = ft_volumesegment(cfg, mri);* * * *% mesh* *cfg=[];* *cfg.method = 'hexahedral';* *mesh = ft_prepare_mesh(cfg,segmentedmri);* * * *% simbio* *cfg = [];* *cfg.method ='simbio';* *cfg.conductivity = [0.1 0.2 0.3 0.4 0.5]; % order follows tissuelabel in vol* *vol = ft_prepare_headmodel(cfg, segmentedmri);* * * when I run this programme by using MATLAB with Fieldtrip, There were some errors stating that a file tp5084846f_e0f2_4004_9e7c_8_6fe72f5707.v which is mesh file is missing. Upon investigation, I come to know that SIMBIO which is used for FEM implementation is missing form Fieldtrip package. Therefore, it is requested in your kind honor to please guide me in this regard as I am working on Fieldtrip these days and need your urgent help. I hope you will send me positive and helpful response. -- Munsif Ali H.Jatoi, Ph D Scholar, Centre for Intelligent Signals and Imaging Research, Universiti Teknologi PETRONAS, Malaysia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.brovelli at univ-amu.fr Thu Apr 4 14:18:23 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 14:18:23 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI Message-ID: <515D6F8F.9010005@univ-amu.fr> Dear all, I used DICS and compared the quality of the beamforming using two different source spaces (3D grids): 1) MNI template space as described in http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space 2) Single subject 3D grid using anatomical MRI The number of sources in the two models is similar (approx. 3500 sources). However, the results using the MNI template are less significant. That is, the statistical analysis testing a significant increase in power post-stimulus with respect to baseline give higher p-values (in some region of interest). Questions: Does anyone know why ? Is the use of the MNI template the only (and best) way to allow statistical analysis across subjects in the source space ? thanks a lot Andrea -- From eelke.spaak at donders.ru.nl Thu Apr 4 14:18:59 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 4 Apr 2013 14:18:59 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? Message-ID: Dear FieldTrippers, I am trying to do source reconstruction, but am encountering two weird things in my pipeline related to anatomy. It could be that everything is OK, but I am worried I might have introduced a left/right flip somewhere. To read in my (dicom) MRI, I use: % read the mri fprintf('loading mri for subject %d...\n', subjects(k).id); mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); and then I mark the fiducials as follows: % align to fiducials in CTF coordsys cfg = []; cfg.coordsys = 'ctf'; cfg.method = 'interactive'; cfg.clim = [0 800]; mri = ft_volumerealign(cfg, mri); In attachment ft_volumerealign.png I show the plot that comes up. Although the position of the different slices is not what I usually expect, this should all still be fine, right? The yellow crosshair is in the right fiducial location, as evidenced by the white blob below the ear (which is always on the right hand side during MRI acquisition). After marking r, l and n (and quitting with 'q') I do: % reslice to make everything right-side up mri = ft_volumereslice([], mri); In attachment ft_sourceplot-1.png I show output of ft_sourceplot([],mri) after this step. Note that the positions of the axial/coronal/sagittal slices are not what one would typically expect. Also note (and this is problem 1) that the right hand side of the anatomy is displayed on the right hand side in the bottom (axial) slice, but on the left hand side in the top right (coronal) slice. Initially I thought this was just a benign visualisation issue (analogous to http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), but it might be a real problem after all, because of what I found next. After these steps, I proceed to do segmentation and I create a headmodel: cfg = []; cfg.coordsys = 'ctf'; mri = ft_volumesegment(cfg, mri); % make single shell model cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, mri); As outlined in the beamformingextended tutorial, I create a subject-specific source model which I inverse-warp to MNI: % load template sourcemodel (grid) in mni space template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); % warp the grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template.sourcemodel; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; sourcemodel = ft_prepare_sourcemodel(cfg); (See attachment grid-hdm-grad.png for a plot of all three geometrical objects superimposed. Looks fine to me.) Then I create a leadfield: cfg = []; cfg.grid = sourcemodel; cfg.vol = headmodel; cfg.channel = {'MEG'}; cfg.grad = data.grad; leadfield = ft_prepare_leadfield(cfg, data); The next step, which is the one which alerted me to the potential problem in the steps above, is to do an LCMV beamformer on a small time window of my ERF: % compute ERF covariance in small window cfg = []; cfg.covariance = 'yes'; cfg.covariancewindow = [1.5 1.55]; tl_right = ft_timelockanalysis(cfg, rightErf); % do beamforming cfg = []; cfg.method = 'lcmv'; cfg.grid = leadfield; cfg.vol = headmodel; cfg.lcmv.lambda = '5%'; cfg.lcmv.projectnoise = 'yes'; cfg.lcmv.keepfilter = 'yes'; sourceRight = ft_sourceanalysis(cfg, tl_right); % normalise with noise sourceRightNAI = sourceRight; sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; % copy over pos and dim from template sourceRight.pos = template.sourcemodel.pos; sourceRight.dim = template.sourcemodel.dim; sourceRightNAI.pos = template.sourcemodel.pos; sourceRightNAI.dim = template.sourcemodel.dim; % interpolate onto template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.pow'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); % plot cfg = []; cfg.funparameter = 'avg.pow'; cfg.method = 'ortho'; cfg.location = 'max'; cfg.coordsys = 'mni'; ft_sourceplot(cfg, sourceRightNAI_int); The output of the above step is shown in ft_sourceplot-2.png. Note that there clearly is a maximum in the posterior right hemisphere. Now compare this to when I just plot the sensor-level ERF for the same time interval: c2=[]; c2.layout='CTF275.lay'; c2.xlim = [1.5 1.55]; figure;ft_topoplotER(c2,rightErf); (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me as if there should be a dipole in the left hemisphere. (That's problem 2.) Now of course I know that interpreting axial gradient data by eye is difficult, but this left-side increase is present in the majority of my subjects, yet the resulting LCMV maximum always ends up in the right hemisphere. Therefore my question: am I doing something wrong in my anatomical pipeline, causing a left-right flip? An indication that this might be the case is the weird display in ft_sourceplot after my ft_volumereslice step. Or is it really possible that for many subjects, a left-sided sensor topography ends up in the right hemisphere after beamforming? (My intuitions on this are not very strong.) Apologies for the lengthy e-mail. I thought it wise to provide all possible details :) Hopefully someone can help me! Best, Eelke -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot-1.png Type: image/png Size: 89562 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_volumerealign.png Type: image/png Size: 154439 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot-2.png Type: image/png Size: 36589 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_topoplotER.png Type: image/png Size: 20860 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grid-hdm-grad.png Type: image/png Size: 49287 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Apr 4 14:38:15 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 14:38:15 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: References: Message-ID: <515D7437.3070900@donders.ru.nl> Hi Eelke, the peak is on the left, don't be fooled by what you see. Trust the numbers :) The x-coordinate that is given back is in MNI coordinates and is negative. Since in MNI space, the x-axis goes to the right, this means that you are at the left side of the brain. See also this awesome appendix of an even greater tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space (scroll down til 'We will now determine the positions on which...') :) Greetings Jörn On 4/4/2013 2:18 PM, Eelke Spaak wrote: > Dear FieldTrippers, > > I am trying to do source reconstruction, but am encountering two weird > things in my pipeline related to anatomy. It could be that everything > is OK, but I am worried I might have introduced a left/right flip > somewhere. > > To read in my (dicom) MRI, I use: > > % read the mri > fprintf('loading mri for subject %d...\n', subjects(k).id); > mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); > > and then I mark the fiducials as follows: > > % align to fiducials in CTF coordsys > cfg = []; > cfg.coordsys = 'ctf'; > cfg.method = 'interactive'; > cfg.clim = [0 800]; > mri = ft_volumerealign(cfg, mri); > > In attachment ft_volumerealign.png I show the plot that comes up. > Although the position of the different slices is not what I usually > expect, this should all still be fine, right? The yellow crosshair is > in the right fiducial location, as evidenced by the white blob below > the ear (which is always on the right hand side during MRI > acquisition). > > After marking r, l and n (and quitting with 'q') I do: > > % reslice to make everything right-side up > mri = ft_volumereslice([], mri); > > In attachment ft_sourceplot-1.png I show output of > ft_sourceplot([],mri) after this step. Note that the positions of the > axial/coronal/sagittal slices are not what one would typically expect. > Also note (and this is problem 1) that the right hand side of the > anatomy is displayed on the right hand side in the bottom (axial) > slice, but on the left hand side in the top right (coronal) slice. > Initially I thought this was just a benign visualisation issue > (analogous to http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), > but it might be a real problem after all, because of what I found > next. > > After these steps, I proceed to do segmentation and I create a headmodel: > > cfg = []; > cfg.coordsys = 'ctf'; > mri = ft_volumesegment(cfg, mri); > > % make single shell model > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, mri); > > As outlined in the beamformingextended tutorial, I create a > subject-specific source model which I inverse-warp to MNI: > > % load template sourcemodel (grid) in mni space > template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); > > % warp the grid > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > (See attachment grid-hdm-grad.png for a plot of all three geometrical > objects superimposed. Looks fine to me.) Then I create a leadfield: > > cfg = []; > cfg.grid = sourcemodel; > cfg.vol = headmodel; > cfg.channel = {'MEG'}; > cfg.grad = data.grad; > leadfield = ft_prepare_leadfield(cfg, data); > > The next step, which is the one which alerted me to the potential > problem in the steps above, is to do an LCMV beamformer on a small > time window of my ERF: > > % compute ERF covariance in small window > cfg = []; > cfg.covariance = 'yes'; > cfg.covariancewindow = [1.5 1.55]; > tl_right = ft_timelockanalysis(cfg, rightErf); > > % do beamforming > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = leadfield; > cfg.vol = headmodel; > cfg.lcmv.lambda = '5%'; > cfg.lcmv.projectnoise = 'yes'; > cfg.lcmv.keepfilter = 'yes'; > > sourceRight = ft_sourceanalysis(cfg, tl_right); > > % normalise with noise > sourceRightNAI = sourceRight; > sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; > > % copy over pos and dim from template > sourceRight.pos = template.sourcemodel.pos; > sourceRight.dim = template.sourcemodel.dim; > sourceRightNAI.pos = template.sourcemodel.pos; > sourceRightNAI.dim = template.sourcemodel.dim; > > % interpolate onto template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); > sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); > > % plot > cfg = []; > cfg.funparameter = 'avg.pow'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.coordsys = 'mni'; > ft_sourceplot(cfg, sourceRightNAI_int); > > The output of the above step is shown in ft_sourceplot-2.png. Note > that there clearly is a maximum in the posterior right hemisphere. Now > compare this to when I just plot the sensor-level ERF for the same > time interval: > > c2=[]; > c2.layout='CTF275.lay'; > c2.xlim = [1.5 1.55]; > figure;ft_topoplotER(c2,rightErf); > > (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me > as if there should be a dipole in the left hemisphere. (That's problem > 2.) > > Now of course I know that interpreting axial gradient data by eye is > difficult, but this left-side increase is present in the majority of > my subjects, yet the resulting LCMV maximum always ends up in the > right hemisphere. Therefore my question: am I doing something wrong in > my anatomical pipeline, causing a left-right flip? An indication that > this might be the case is the weird display in ft_sourceplot after my > ft_volumereslice step. Or is it really possible that for many > subjects, a left-sided sensor topography ends up in the right > hemisphere after beamforming? (My intuitions on this are not very > strong.) > > Apologies for the lengthy e-mail. I thought it wise to provide all > possible details :) Hopefully someone can help me! > > Best, > Eelke > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Thu Apr 4 14:50:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 14:50:33 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D6F8F.9010005@univ-amu.fr> References: <515D6F8F.9010005@univ-amu.fr> Message-ID: <515D7719.5040705@donders.ru.nl> Dear Andrea, > Questions: > > Does anyone know why ? I am not sure as you provide minimalistic insight into what you are exactly doing. If you use a single subject grid, the actual grid points for which you estimate source activity will be slightly different than when you base this on a template, so that might be one reason. Also you are probably doing monte carlo statistics, for which p-values will vary anyway for different runs (sidenote: check the newly implemented p-value confidecen interval, if they are overlapping, no need to worry). However, since you do not say how much the p-values differ, how many permutations you are running, what other parameters you choose etc., it's hard to judge whether this is something to worry about. > > Is the use of the MNI template the only (and best) way to allow > statistical analysis across subjects in the source space ? No, but I think the answer most suited to what you actually want to ask is yes. No, because you can use any other template,you can define any T1 as a template, e.g. of one of your subjects. Yes, however, because using the MNI template you know what coordinate (roughly) corresponds to what anatomical region. With a different template you would need to find a reliable way to determine an anatomical label. There is also a way to do everything on subject-specific space and only after source reconstruction warp back to the MNI template. This used to be the way before I started working on all this, so I am not exactly sure how this works. The only thing I know is that we recommend the way that you took. Another way would be to use a localizer task to anatomically localize the region of interest per subject, beam only activity of that region and run statistics only on that one region. Then there is no need to go to some template space. Hope this helps :) Best, Jörn On 4/4/2013 2:18 PM, Andrea Brovelli wrote: > Dear all, > > I used DICS and compared the quality of the beamforming using two > different source spaces (3D grids): > > 1) MNI template space as described in > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > 2) Single subject 3D grid using anatomical MRI > > The number of sources in the two models is similar (approx. 3500 > sources). However, the results using the MNI template are less > significant. That is, the statistical analysis testing a significant > increase in power post-stimulus with respect to baseline give higher > p-values (in some region of interest). > > Questions: > > Does anyone know why ? > > Is the use of the MNI template the only (and best) way to allow > statistical analysis across subjects in the source space ? > > thanks a lot > > Andrea > > > -- 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 Apr 4 14:53:40 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 4 Apr 2013 14:53:40 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: <515D7437.3070900@donders.ru.nl> References: <515D7437.3070900@donders.ru.nl> Message-ID: Awesome, thanks a lot Jörn! I didn't think to check the numbers, newbie mistake... :) Now all that's left is to find an easy way to flip the image, but I imagine that shouldn't be too hard. Or just label the axes, I guess. On 4 April 2013 14:38, "Jörn M. Horschig" wrote: > Hi Eelke, > > the peak is on the left, don't be fooled by what you see. Trust the numbers > :) > > The x-coordinate that is given back is in MNI coordinates and is negative. > Since in MNI space, the x-axis goes to the right, this means that you are at > the left side of the brain. > See also this awesome appendix of an even greater tutorial: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space > (scroll down til 'We will now determine the positions on which...') :) > > Greetings > Jörn > > > On 4/4/2013 2:18 PM, Eelke Spaak wrote: > > Dear FieldTrippers, > > I am trying to do source reconstruction, but am encountering two weird > things in my pipeline related to anatomy. It could be that everything > is OK, but I am worried I might have introduced a left/right flip > somewhere. > > To read in my (dicom) MRI, I use: > > % read the mri > fprintf('loading mri for subject %d...\n', subjects(k).id); > mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); > > and then I mark the fiducials as follows: > > % align to fiducials in CTF coordsys > cfg = []; > cfg.coordsys = 'ctf'; > cfg.method = 'interactive'; > cfg.clim = [0 800]; > mri = ft_volumerealign(cfg, mri); > > In attachment ft_volumerealign.png I show the plot that comes up. > Although the position of the different slices is not what I usually > expect, this should all still be fine, right? The yellow crosshair is > in the right fiducial location, as evidenced by the white blob below > the ear (which is always on the right hand side during MRI > acquisition). > > After marking r, l and n (and quitting with 'q') I do: > > % reslice to make everything right-side up > mri = ft_volumereslice([], mri); > > In attachment ft_sourceplot-1.png I show output of > ft_sourceplot([],mri) after this step. Note that the positions of the > axial/coronal/sagittal slices are not what one would typically expect. > Also note (and this is problem 1) that the right hand side of the > anatomy is displayed on the right hand side in the bottom (axial) > slice, but on the left hand side in the top right (coronal) slice. > Initially I thought this was just a benign visualisation issue > (analogous to > http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), > but it might be a real problem after all, because of what I found > next. > > After these steps, I proceed to do segmentation and I create a headmodel: > > cfg = []; > cfg.coordsys = 'ctf'; > mri = ft_volumesegment(cfg, mri); > > % make single shell model > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, mri); > > As outlined in the beamformingextended tutorial, I create a > subject-specific source model which I inverse-warp to MNI: > > % load template sourcemodel (grid) in mni space > template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); > > % warp the grid > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > (See attachment grid-hdm-grad.png for a plot of all three geometrical > objects superimposed. Looks fine to me.) Then I create a leadfield: > > cfg = []; > cfg.grid = sourcemodel; > cfg.vol = headmodel; > cfg.channel = {'MEG'}; > cfg.grad = data.grad; > leadfield = ft_prepare_leadfield(cfg, data); > > The next step, which is the one which alerted me to the potential > problem in the steps above, is to do an LCMV beamformer on a small > time window of my ERF: > > % compute ERF covariance in small window > cfg = []; > cfg.covariance = 'yes'; > cfg.covariancewindow = [1.5 1.55]; > tl_right = ft_timelockanalysis(cfg, rightErf); > > % do beamforming > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = leadfield; > cfg.vol = headmodel; > cfg.lcmv.lambda = '5%'; > cfg.lcmv.projectnoise = 'yes'; > cfg.lcmv.keepfilter = 'yes'; > > sourceRight = ft_sourceanalysis(cfg, tl_right); > > % normalise with noise > sourceRightNAI = sourceRight; > sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; > > % copy over pos and dim from template > sourceRight.pos = template.sourcemodel.pos; > sourceRight.dim = template.sourcemodel.dim; > sourceRightNAI.pos = template.sourcemodel.pos; > sourceRightNAI.dim = template.sourcemodel.dim; > > % interpolate onto template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); > sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); > > % plot > cfg = []; > cfg.funparameter = 'avg.pow'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.coordsys = 'mni'; > ft_sourceplot(cfg, sourceRightNAI_int); > > The output of the above step is shown in ft_sourceplot-2.png. Note > that there clearly is a maximum in the posterior right hemisphere. Now > compare this to when I just plot the sensor-level ERF for the same > time interval: > > c2=[]; > c2.layout='CTF275.lay'; > c2.xlim = [1.5 1.55]; > figure;ft_topoplotER(c2,rightErf); > > (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me > as if there should be a dipole in the left hemisphere. (That's problem > 2.) > > Now of course I know that interpreting axial gradient data by eye is > difficult, but this left-side increase is present in the majority of > my subjects, yet the resulting LCMV maximum always ends up in the > right hemisphere. Therefore my question: am I doing something wrong in > my anatomical pipeline, causing a left-right flip? An indication that > this might be the case is the weird display in ft_sourceplot after my > ft_volumereslice step. Or is it really possible that for many > subjects, a left-sided sensor topography ends up in the right > hemisphere after beamforming? (My intuitions on this are not very > strong.) > > Apologies for the lengthy e-mail. I thought it wise to provide all > possible details :) Hopefully someone can help me! > > Best, > Eelke > > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Thu Apr 4 15:13:34 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 15:13:34 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: References: <515D7437.3070900@donders.ru.nl> Message-ID: <515D7C7E.7010201@donders.ru.nl> We got Adobe Photoshop at our institute ;) Actually, I think it would be good to implement a cfg.flipimage option to ft_sourceplot. However, people should only use it when they know what they are doing and not just flip because it looks nicer :) Maybe we should discuss that in the next FT meeting in two weeks. Greetings, Jörn On 4/4/2013 2:53 PM, Eelke Spaak wrote: > Awesome, thanks a lot Jörn! > > I didn't think to check the numbers, newbie mistake... :) Now all > that's left is to find an easy way to flip the image, but I imagine > that shouldn't be too hard. Or just label the axes, I guess. > > On 4 April 2013 14:38, "Jörn M. Horschig" wrote: >> Hi Eelke, >> >> the peak is on the left, don't be fooled by what you see. Trust the numbers >> :) >> >> The x-coordinate that is given back is in MNI coordinates and is negative. >> Since in MNI space, the x-axis goes to the right, this means that you are at >> the left side of the brain. >> See also this awesome appendix of an even greater tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space >> (scroll down til 'We will now determine the positions on which...') :) >> >> Greetings >> Jörn >> >> >> On 4/4/2013 2:18 PM, Eelke Spaak wrote: >> >> Dear FieldTrippers, >> >> I am trying to do source reconstruction, but am encountering two weird >> things in my pipeline related to anatomy. It could be that everything >> is OK, but I am worried I might have introduced a left/right flip >> somewhere. >> >> To read in my (dicom) MRI, I use: >> >> % read the mri >> fprintf('loading mri for subject %d...\n', subjects(k).id); >> mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); >> >> and then I mark the fiducials as follows: >> >> % align to fiducials in CTF coordsys >> cfg = []; >> cfg.coordsys = 'ctf'; >> cfg.method = 'interactive'; >> cfg.clim = [0 800]; >> mri = ft_volumerealign(cfg, mri); >> >> In attachment ft_volumerealign.png I show the plot that comes up. >> Although the position of the different slices is not what I usually >> expect, this should all still be fine, right? The yellow crosshair is >> in the right fiducial location, as evidenced by the white blob below >> the ear (which is always on the right hand side during MRI >> acquisition). >> >> After marking r, l and n (and quitting with 'q') I do: >> >> % reslice to make everything right-side up >> mri = ft_volumereslice([], mri); >> >> In attachment ft_sourceplot-1.png I show output of >> ft_sourceplot([],mri) after this step. Note that the positions of the >> axial/coronal/sagittal slices are not what one would typically expect. >> Also note (and this is problem 1) that the right hand side of the >> anatomy is displayed on the right hand side in the bottom (axial) >> slice, but on the left hand side in the top right (coronal) slice. >> Initially I thought this was just a benign visualisation issue >> (analogous to >> http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), >> but it might be a real problem after all, because of what I found >> next. >> >> After these steps, I proceed to do segmentation and I create a headmodel: >> >> cfg = []; >> cfg.coordsys = 'ctf'; >> mri = ft_volumesegment(cfg, mri); >> >> % make single shell model >> cfg = []; >> cfg.method = 'singleshell'; >> headmodel = ft_prepare_headmodel(cfg, mri); >> >> As outlined in the beamformingextended tutorial, I create a >> subject-specific source model which I inverse-warp to MNI: >> >> % load template sourcemodel (grid) in mni space >> template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); >> >> % warp the grid >> cfg = []; >> cfg.grid.warpmni = 'yes'; >> cfg.grid.template = template.sourcemodel; >> cfg.grid.nonlinear = 'yes'; >> cfg.mri = mri; >> sourcemodel = ft_prepare_sourcemodel(cfg); >> >> (See attachment grid-hdm-grad.png for a plot of all three geometrical >> objects superimposed. Looks fine to me.) Then I create a leadfield: >> >> cfg = []; >> cfg.grid = sourcemodel; >> cfg.vol = headmodel; >> cfg.channel = {'MEG'}; >> cfg.grad = data.grad; >> leadfield = ft_prepare_leadfield(cfg, data); >> >> The next step, which is the one which alerted me to the potential >> problem in the steps above, is to do an LCMV beamformer on a small >> time window of my ERF: >> >> % compute ERF covariance in small window >> cfg = []; >> cfg.covariance = 'yes'; >> cfg.covariancewindow = [1.5 1.55]; >> tl_right = ft_timelockanalysis(cfg, rightErf); >> >> % do beamforming >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = leadfield; >> cfg.vol = headmodel; >> cfg.lcmv.lambda = '5%'; >> cfg.lcmv.projectnoise = 'yes'; >> cfg.lcmv.keepfilter = 'yes'; >> >> sourceRight = ft_sourceanalysis(cfg, tl_right); >> >> % normalise with noise >> sourceRightNAI = sourceRight; >> sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; >> >> % copy over pos and dim from template >> sourceRight.pos = template.sourcemodel.pos; >> sourceRight.dim = template.sourcemodel.dim; >> sourceRightNAI.pos = template.sourcemodel.pos; >> sourceRightNAI.dim = template.sourcemodel.dim; >> >> % interpolate onto template brain >> cfg = []; >> cfg.voxelcoord = 'no'; >> cfg.parameter = 'avg.pow'; >> cfg.interpmethod = 'nearest'; >> cfg.coordsys = 'mni'; >> sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); >> sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); >> >> % plot >> cfg = []; >> cfg.funparameter = 'avg.pow'; >> cfg.method = 'ortho'; >> cfg.location = 'max'; >> cfg.coordsys = 'mni'; >> ft_sourceplot(cfg, sourceRightNAI_int); >> >> The output of the above step is shown in ft_sourceplot-2.png. Note >> that there clearly is a maximum in the posterior right hemisphere. Now >> compare this to when I just plot the sensor-level ERF for the same >> time interval: >> >> c2=[]; >> c2.layout='CTF275.lay'; >> c2.xlim = [1.5 1.55]; >> figure;ft_topoplotER(c2,rightErf); >> >> (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me >> as if there should be a dipole in the left hemisphere. (That's problem >> 2.) >> >> Now of course I know that interpreting axial gradient data by eye is >> difficult, but this left-side increase is present in the majority of >> my subjects, yet the resulting LCMV maximum always ends up in the >> right hemisphere. Therefore my question: am I doing something wrong in >> my anatomical pipeline, causing a left-right flip? An indication that >> this might be the case is the weird display in ft_sourceplot after my >> ft_volumereslice step. Or is it really possible that for many >> subjects, a left-sided sensor topography ends up in the right >> hemisphere after beamforming? (My intuitions on this are not very >> strong.) >> >> Apologies for the lengthy e-mail. I thought it wise to provide all >> possible details :) Hopefully someone can help me! >> >> Best, >> Eelke >> >> >> >> _______________________________________________ >> 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 > _______________________________________________ > 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 smoratti at psi.ucm.es Thu Apr 4 15:43:58 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 4 Apr 2013 15:43:58 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D6F8F.9010005@univ-amu.fr> References: <515D6F8F.9010005@univ-amu.fr> Message-ID: <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> Dear Andrea, ¿Did you normalize the volume of the individuals after source reconstruction and before doing statistics? If not, this might explain the difference. 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 04/04/2013, a las 14:18, Andrea Brovelli escribió: > Dear all, > > I used DICS and compared the quality of the beamforming using two different source spaces (3D grids): > > 1) MNI template space as described in http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > 2) Single subject 3D grid using anatomical MRI > > The number of sources in the two models is similar (approx. 3500 sources). However, the results using the MNI template are less significant. That is, the statistical analysis testing a significant increase in power post-stimulus with respect to baseline give higher p-values (in some region of interest). > > Questions: > > Does anyone know why ? > > Is the use of the MNI template the only (and best) way to allow statistical analysis across subjects in the source space ? > > thanks a lot > > Andrea > > > > -- > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.brovelli at univ-amu.fr Thu Apr 4 16:14:16 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 16:14:16 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> References: <515D6F8F.9010005@univ-amu.fr> <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> Message-ID: <515D8AB8.3080307@univ-amu.fr> Thanks for the reply. No, I did not normalise it. In fact, I find that using the normalised template (the MNI) I get less significant result... Any idea ? Thanks Le 04/04/2013 15:43, smoratti at psi.ucm.es a écrit : > If not, this might explain the difference -- From andrea.brovelli at univ-amu.fr Thu Apr 4 16:31:29 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 16:31:29 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D7719.5040705@donders.ru.nl> References: <515D6F8F.9010005@univ-amu.fr> <515D7719.5040705@donders.ru.nl> Message-ID: <515D8EC1.5020809@univ-amu.fr> Thanks a lot Jorn, I 'll try out the different methods you suggested to understand better at which step I loose significance. Bye Andrea Le 04/04/2013 14:50, "Jörn M. Horschig" a écrit : > I am not sure as you provide minimalistic insight into what you are > exactly doing. If you use a single subject grid, the actual grid > points for which you estimate source activity will be slightly > different than when you base this on a template, so that might be one > reason. Also you are probably doing monte carlo statistics, for which > p-values will vary anyway for different runs (sidenote: check the > newly implemented p-value confidecen interval, if they are > overlapping, no need to worry). However, since you do not say how much > the p-values differ, how many permutations you are running, what other > parameters you choose etc., it's hard to judge whether this is > something to worry about. -- From andmib at gmail.com Thu Apr 4 17:38:41 2013 From: andmib at gmail.com (Andrew Brooks) Date: Thu, 4 Apr 2013 11:38:41 -0400 Subject: [FieldTrip] Where to access Siemens sequence code? Message-ID: Hello all, I am trying to setup a real-time fMRI pipeline using the fieldtrip gui_streamer and buffer. In the documentation, it suggests inserting three lines of code into the 'fSeqCheck' function in the sequence code in order for protocol information to be dumped to the E: drive. The facility I use has the Siemens idea license, which I believe allows for sequence code modification. Is there somebody who can direct me on how to edit sequence code? I attempted the manual text file creation method, but did not know where to find information on one of the parameters (lContrasts), so I left it to 5. However, doing that I get header errors when running any of the realtime fieldtrip scripts (the omri quality and the pipeline scripts). Sincerely, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From raminazodiaval at gmail.com Fri Apr 5 09:49:47 2013 From: raminazodiaval at gmail.com (Ramin Azodi) Date: Fri, 5 Apr 2013 09:49:47 +0200 Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' Message-ID: Hello, In case that I want just to calculate imaginary part of coherence instead of coherence with 'indepsamplesZcoh', what kind of operation should I do for that? can anybody lead me through the right way ? You can find my code as following, cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq1 = ft_freqanalysis(cfg, data1); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.complex = 'imag'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq2 = ft_freqanalysis(cfg, data2); cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesZcoh'; cfg.parameter = 'fourierspctrm'; cfg.computecritval = 'yes'; cfg.numrandomization = 500; cfg.design = [ones(size(freq1.fourierspctrm,1),1); 2*ones(size(freq2.fourierspctrm,1),1)]'; cfg.label = freq.label; stat = ft_freqstatistics(cfg, freq,freq1); Thanks in advanced for your consideration. Best Regards, Ramin Azodi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 5 16:34:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 05 Apr 2013 16:34:33 +0200 Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' In-Reply-To: References: Message-ID: <515EE0F9.8070507@donders.ru.nl> Hi Ramin, hope you are doing fine. For the imaginary part of coherence you need to call ft_connectivityanalysis with cfg.output = 'imag'. Afaik, z-scoring for the imaginary part is different from doing it for the plain coherence, so you should not use indepsamplesZcoh. You could have a look at Guido Nolte's paper on imaginary coherence and look it up in the methods section how he is computing it - similar but different from what I know how the z-scoring for coherence is computed. Thus, I am not sure how to best do cluster-based statistics on that (that means, I know how you could do it, but not what the best way to do it would be). Of course, you write an own statistics function, something like 'indepsamplesZicoh'... but that would be tons of work. Good luck! I hope anyone out there has other/better ideas :) Best, Jörn On 4/5/2013 9:49 AM, Ramin Azodi wrote: > Hello, > In case that I want just to calculate imaginary part of coherence > instead of coherence with 'indepsamplesZcoh', what kind of operation > should I do for that? can anybody lead me through the right way ? > You can find my code as following, > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.taper = 'hanning'; > cfg.foilim = [12 20]; > freq1 = ft_freqanalysis(cfg, data1); > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.complex = 'imag'; > cfg.taper = 'hanning'; > cfg.foilim = [12 20]; > freq2 = ft_freqanalysis(cfg, data2); > cfg = []; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesZcoh'; > cfg.parameter = 'fourierspctrm'; > cfg.computecritval = 'yes'; > cfg.numrandomization = 500; > cfg.design = [ones(size(freq1.fourierspctrm,1),1); > 2*ones(size(freq2.fourierspctrm,1),1)]'; > cfg.label = freq.label; > stat = ft_freqstatistics(cfg, freq,freq1); > > Thanks in advanced for your consideration. > Best Regards, > Ramin Azodi > > > > > > > > _______________________________________________ > 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 sabato45 at hotmail.com Fri Apr 5 23:56:12 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Fri, 5 Apr 2013 14:56:12 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Message-ID: Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,Ana -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sat Apr 6 17:19:07 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Sat, 6 Apr 2013 11:19:07 -0400 Subject: [FieldTrip] Fwd: [Eeglabnews] EEGLAB warning for users of Matlab 2013a In-Reply-To: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> References: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> Message-ID: Dear Fieldtrip, I've been having trouble with old but previously working scripts, trying to figure out what errors are based on new implementations in Fieldtrip and those that are due to file type ( ANT .cnt). However, I've been using Matlab 2013A - could this be a source of errors as well? Do the changes in Matlab 2013A have similar implications for Fieldtrip? See message below from Arnaud Delorme: Best, Raquel Sent from my iPhone Begin forwarded message: *From:* Arnaud Delorme *Date:* April 5, 2013, 4:09:57 PM EDT *To:* eeglabnews at sccn.ucsd.edu *Subject:* *[Eeglabnews] EEGLAB warning for users of Matlab 2013a* The MathWorks has implemented minor changes in Matlab 2013a with dramatic consequences as they could potentially break or corrupt the output of about 10% of EEGLAB functions. EEGLAB graphic interface or command line users (all versions) should not upgrade to this version of Matlab until the issues have been fixed in EEGLAB (probably within a month). Details of some of the non backward compatible changes implemented by the Mathworks are described below. Arno >From http://www.mathworks.com/help/matlab/release-notes.html The behavior of unique, union, intersect, setdiff, setxor, and ismember has changed. • If there are repeated elements in the input arrays, the functions unique, union, intersect, setdiff, and setxor return the index to the first occurrence of the repeated elements (or rows). • All index vectors returned by unique, union, intersect, setdiff, or setxor are column vectors. _______________________________________________ eeglabnews mailing list eeglabnews at sccn.ucsd.edu eeglabnews mailing list Web: http://www.sccn.ucsd.edu/eeglab/eeglabmail.html To unsubscribe: send an empty email to eeglabnews-unsub at sccn.ucsd.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From evaladez at psych.udel.edu Sat Apr 6 22:25:02 2013 From: evaladez at psych.udel.edu (Emilio Valadez) Date: Sat, 6 Apr 2013 16:25:02 -0400 Subject: [FieldTrip] Instantaneous phase angles/ baseline adjust for resting alpha activity Message-ID: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> Dear FieldTrippers, I have two independent questions that I hope are relatively simple: 1) How can one obtain the instantaneous phase angles for time-frequency data? I believe one workaround method to achieve this would be to use ft_freqanalysis on the raw data with cfg.output = 'fourier' to return the complex Fourier transform, and then use MATLAB's "angle" function on the complex output to compute the phase angles. But is there a more direct way to get the phase angles from FieldTrip? 2) Can FieldTrip be used to make a baseline adjustment for resting alpha-band activity or average alpha activity in time-frequency data? And if so, how? Thanks very much for your help, in advance. All the best, Emilio -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Sun Apr 7 17:04:25 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Sun, 7 Apr 2013 17:04:25 +0200 Subject: [FieldTrip] Instantaneous phase angles/ baseline adjust for resting alpha activity In-Reply-To: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> References: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> Message-ID: Dear Emilio, For (1), you can also call ft_preprocessing on raw data, with cfg.hilbert='angle' to get the instantaneous angle from the Hilbert transform. (and appropriate filter settings so that it's filtered into your frequency of interest first). For (2), does ft_freqbaseline answer your question? Cheers, Johanna 2013/4/6 Emilio Valadez > Dear FieldTrippers,**** > > ** ** > > I have two independent questions that I hope are relatively simple:**** > > ** ** > > **1) **How can one obtain the instantaneous phase angles for > time-frequency data? I believe one workaround method to achieve this would > be to use ft_freqanalysis on the raw data with cfg.output = ‘fourier’ to > return the complex Fourier transform, and then use MATLAB’s “angle” > function on the complex output to compute the phase angles. But is there a > more direct way to get the phase angles from FieldTrip?**** > > ** ** > > **2) **Can FieldTrip be used to make a baseline adjustment for > resting alpha-band activity or average alpha activity in time-frequency > data? And if so, how?**** > > ** ** > > Thanks very much for your help, in advance.**** > > ** ** > > All the best,**** > > Emilio**** > > _______________________________________________ > fieldtrip 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 Mon Apr 8 09:29:00 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 8 Apr 2013 09:29:00 +0200 Subject: [FieldTrip] Fwd: [Eeglabnews] EEGLAB warning for users of Matlab 2013a In-Reply-To: References: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> Message-ID: Dear Raquel, Thanks for the e-mail. We're aware of these potential issues, see this entry on our bugzilla to track the progress of fixing them: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2095 Best, Eelke On 6 April 2013 17:19, Raquel Bibi wrote: > Dear Fieldtrip, > I've been having trouble with old but previously working scripts, trying to > figure out what errors are based on new implementations in Fieldtrip and > those that are due to file type ( ANT .cnt). However, I've been using > Matlab 2013A - could this be a source of errors as well? Do the changes in > Matlab 2013A have similar implications for Fieldtrip? See message below > from Arnaud Delorme: > > Best, > > Raquel > > Sent from my iPhone > > Begin forwarded message: > > From: Arnaud Delorme > Date: April 5, 2013, 4:09:57 PM EDT > To: eeglabnews at sccn.ucsd.edu > Subject: [Eeglabnews] EEGLAB warning for users of Matlab 2013a > > The MathWorks has implemented minor changes in Matlab 2013a with dramatic > consequences as they could potentially break or corrupt the output of about > 10% of EEGLAB functions. > > EEGLAB graphic interface or command line users (all versions) should not > upgrade to this version of Matlab until the issues have been fixed in EEGLAB > (probably within a month). Details of some of the non backward compatible > changes implemented by the Mathworks are described below. > > Arno > > From http://www.mathworks.com/help/matlab/release-notes.html > > > The behavior of unique, union, intersect, setdiff, setxor, and ismember has > changed. > • If there are repeated elements in the input arrays, the functions > unique, union, intersect, setdiff, and setxor return the index to the first > occurrence of the repeated elements (or rows). > • All index vectors returned by unique, union, intersect, setdiff, or > setxor are column vectors. > > > _______________________________________________ > eeglabnews mailing list eeglabnews at sccn.ucsd.edu > eeglabnews mailing list > Web: http://www.sccn.ucsd.edu/eeglab/eeglabmail.html > To unsubscribe: send an empty email to eeglabnews-unsub at sccn.ucsd.edu > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From nathanweisz at mac.com Mon Apr 8 09:48:33 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Mon, 08 Apr 2013 09:48:33 +0200 Subject: [FieldTrip] postdoc position @ cimec MEG lab Message-ID: dear all, please pass this on to potentially interested people. earliest starting date will be september (slightly later date negotiable). best, nathan ERC-funded post-doc in conscious perception research Research in the Ongoing Brain Oscillations and Behaviour Lab at the Center for Mind/Brain Sciences focuses on brain activity / connectivity patterns predisposing conscious perception. Our works mostly involves MEG, intracranial EEG and combined TMS/EEG studies. https://sites.google.com/site/obobcimec/ We are currently looking for a candidate at a Postdoc level to strengthen our team. This postdoc is expected to have solid experience with at least one of the aforementioned methods and proficiency in Matlab applied to the analysis of MEG / EEG data. The Center for Mind/Brain Sciences at the University of Trento is an oustanding work-place situated in a beautiful surrounding (e.g. Dolomites, diverse lakes; see http://www.visittrentino.it/en). It offers an international and vibrant research setting with state-of-the-art neuroimaging methodologies, including a research-only MRI scanner, MEG, EEG and TMS, as well as behavioral, eye tracking and motion tracking laboratories. The University of Trento is ranked first among research universities in Italy, and the Trentino region is consistently at the top for quality of life and for the most efficient services in Italy. English is the official language of the CIMeC, where a large proportion of the faculty, post-docs and students come from a wide range of countries outside of Italy. Interested candidates are encouraged to contact me by email at nathan.weisz at unitn.it -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Tue Apr 9 02:04:20 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 08 Apr 2013 17:04:20 -0700 Subject: [FieldTrip] source analysis EEG data without MRI Message-ID: <51635B04.7090004@berkeley.edu> Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From jm.horschig at donders.ru.nl Tue Apr 9 08:37:13 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 09 Apr 2013 08:37:13 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51635B04.7090004@berkeley.edu> References: <51635B04.7090004@berkeley.edu> Message-ID: <5163B719.7010002@donders.ru.nl> Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: /% read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit))/ Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: > Hi all, > > I'd like to do source analysis (loreta and or DICS) on my EEG data. I > don't have anatomical MRIs and I don't have a measurement of the scalp > surface. So I'd like to use a template MRI or a template head model > that is located in the FieldTrip template directory. I have EGI (128 > channels) data and electrode positions (not subject specific, just the > standard file also available in FieldTrip electrode template, > GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see > any examples on the FieldTrip page of how to make a headmodel and > volume conduction model giving only this limited data. I'd be happy to > make it into a example Matlab script on the FieldTrip page after I got > it to work. Would someone be able to give me some pointers, or example > code? > > Thanks a lot! > Ingrid > -- 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 jm.horschig at donders.ru.nl Tue Apr 9 08:57:26 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 09 Apr 2013 08:57:26 +0200 Subject: [FieldTrip] Workshop on 'How cognitive neuroscience can guide therapy' Message-ID: <5163BBD6.2040403@donders.ru.nl> Dear colleagues, We are happy to announce the workshop 'How cognitive neuroscience can guide therapy'; May 16-17, 2013 at the The Royal Netherlands Academy of Arts and Sciences (The Trippenhuis, Amsterdam). For more information and registration please see: https://www.hersenenencognitie.nl/contents/1839?locale=en Best regards, Ole Jensen, Ruud Smolders, Gojko Zaric, Jörn Horschig, Mariska van Steensel, Renate van de Ven, Jaap Murre, and Benny van der Vijgh -- 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 tzvetan.popov at uni-konstanz.de Tue Apr 9 09:32:53 2013 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 9 Apr 2013 09:32:53 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5163B719.7010002@donders.ru.nl> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> Message-ID: <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); > Hi Ingrid, > > I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: > % read in the template MRI > if isunix > mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); > elseif ispc > mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); > end > > > % segment the MRI > cfg = []; > cfg.output = {'brain' 'skull' 'scalp'}; > segmentedmri = ft_volumesegment(cfg, mris); > > > % create the headmodel (BEM) > cfg = []; > %cfg.method ='openmeeg'; % TODO FIXME download openmeeg > if isunix > cfg.method ='dipoli'; % dipoli only works under linux > else > disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); > keyboard; > end > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > elec = ft_read_sens('standard_1020.elc'); > hdm = ft_convert_units(hdm, elec.unit); > > cfg = []; > cfg.grid.xgrid = -125:8:125; > cfg.grid.ygrid = -125:8:125; > cfg.grid.zgrid = -125:8:125; > cfg.grid.tight = 'yes'; > cfg.grid.unit = hdm.unit; > cfg.inwardshift = -1.5; > cfg.vol = hdm; > grid = ft_prepare_sourcemodel(cfg) > grid = ft_convert_units(grid, elec.unit); > > figure; > hold on; > ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > ft_plot_mesh(grid.pos(grid.inside, :)); > > % this step is not necessary, cause you will see that everything is already aligned > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = hdm.bnd(1); > tmp = ft_electroderealign(cfg); > elec = tmp; % I had a bug here that I couldn't assign elec directly > > %% verify location of occipital electrodes > > occ_elec = elec; > occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); > occ_idx = match_str(elec.label, occ_chan); > occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); > occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); > occ_elec.label = occ_elec.label(occ_idx, :); > figure; > ft_plot_sens(occ_elec) > hold on; > ft_plot_vol(ft_convert_units(hdm, elec.unit)) > > > Afair, that's all that is needed. Of course you need to adjust folder and file names. > > Greetings > Jörn > > On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >> Hi all, >> >> I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? >> >> Thanks a lot! >> Ingrid >> > > > -- > 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From niccol000 at yahoo.it Tue Apr 9 10:33:17 2013 From: niccol000 at yahoo.it (=?iso-8859-1?Q?Niccol=C3=B2_Pescetelli?=) Date: Tue, 9 Apr 2013 09:33:17 +0100 (BST) Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) Message-ID: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Dear all, I am new to fieldtrip and I would like to have your opinion about a bizarre error that I find trying to execute the function ft_combineplanar(). What am I trying to do is to  obtain the planar gradient from raw data. I use a neuromag306 Elekta MEG system. I tried to dig deeper into the scripts and I notice some quirks the error could derive from: 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from 840 trials to 192 trials, without any command being provided that is BEFORE the first line of ft_combineplanar(cfg, data) being executed! At the same time all data.trials becomes empty arrays 2. my data structure does not contain the fields 'grad' before ft_combineplanar(cfg, data) has been called but it does afterwards . Again this happen without any command having been given 3. The error finally occurs in line 210 of the ft_combineplanar function (indexing error) and it's due to the data.trial array being empty What do you think? Best Nic -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Tue Apr 9 11:00:18 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 09 Apr 2013 11:00:18 +0200 Subject: [FieldTrip] postdoc @ Univ Trento (Language Interaction and Computation Lab) Message-ID: <1AB8AFEC-002D-4AD5-8C35-796BFFA2A837@mac.com> POST-DOCTORAL POSITION IN USING BRAIN DATA TO SUPPORT THE DEVELOPMENT OF EMOTIONALLY PLAUSIBLE VIRTUAL AGENTS AT CIMEC/CLIC, UNIVERSITY OF TRENTO A postdoctoral position will soon become available at the CLIC laboratory of the Center for Mind / Brain Sciences, University of Trento (http://clic.cimec.unitn.it/) starting as soon as possible from June 2013. The successful candidate will join a team of computational linguists and computational neuroscientists whose research is focused on using machine learning methods to analyze recordings of neural activity (EEG, MEG and fMRI) to gain insights about conceptual knowledge and other aspects of the cognitive models of agents involved in language use and interaction. This particular position will be in the PRESTO project, a collaboration between CIMEC, Delta Informatica, the University's Computer Science Department, and Fondazione Bruno Kessler (FBK). The objective of the project is the development of training environments based on immersion in virtual reality situations in which the trainee interacts with artificial agents (avatars). The role of the postdoc in the project will be to run experiments testing the emotional plausibility of the artificial agents, and studying the interaction between emotions and decision making in the trainees. The ideal candidate for the position is a cognitive neuroscientist with a strong research curriculum in the use of fMRI and/or EEG to study emotions and interaction. Familiarity with machine learning methods to analyze such data (eg MVPA) a plus. The fellowship has a duration of 1 year with the possibility of renewal for a second year if the results of the first year are satisfactory. The Language Interaction and Computation Lab (CLIC) is a unit of the University of Trento's Centre for Mind/Brain Sciences (CIMEC) (www.cimec.unitn.it): an interdisciplinary Centre for the research in brain and cognition including neuroscientists, psychologists, (computational) linguists, computational neuroscientists, and physicists. CLIC consists of researchers from the Departments of Computer Science and Cognitive Science carrying out research on a range of topics, including concept acquisition and information extraction from very large multi-modal corpora, combining brain data and data from corpora to study cognition, and theoretical linguistics. The official call for the position can be found at: http://www.unitn.it/en/cimec/11882/study-and-job-opportunities Deadline for the application is April 30th. For additional information please contact Massimo Poesio (massimo.poesio at unitn.it), attaching your CV. From eelke.spaak at donders.ru.nl Tue Apr 9 11:50:21 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 9 Apr 2013 11:50:21 +0200 Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: Dear Nic, That is very weird. The fact that a grad seems to be created out of thin air by ft_combineplanar suggests to me that there might be an error in your script. (However, of course it could also be a bug in fieldtrip.) Could you perhaps send a functional (small) piece of data, along with a script, that reproduces the error? Your e-mail currently does not have enough information to judge what's truly going on. If your data is >1MB, please use one of the file sharing services listed here: http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers Best, Eelke On 9 April 2013 10:33, Niccolò Pescetelli wrote: > Dear all, > > I am new to fieldtrip and I would like to have your opinion about a bizarre > error that I find trying to execute the function ft_combineplanar(). What am > I trying to do is to obtain the planar gradient from raw data. I use a > neuromag306 Elekta MEG system. > I tried to dig deeper into the scripts and I notice some quirks the error > could derive from: > > 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from > 840 trials to 192 trials, without any command being provided that is BEFORE > the first line of ft_combineplanar(cfg, data) being executed! At the same > time all data.trials becomes empty arrays > > 2. my data structure does not contain the fields 'grad' before > ft_combineplanar(cfg, data) has been called but it does afterwards . Again > this happen without any command having been given > > 3. The error finally occurs in line 210 of the ft_combineplanar function > (indexing error) and it's due to the data.trial array being empty > > What do you think? > > Best > > Nic > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Tue Apr 9 12:09:03 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 9 Apr 2013 12:09:03 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: Message-ID: <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, Ana -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Tue Apr 9 12:18:40 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 9 Apr 2013 12:18:40 +0200 (CEST) Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' In-Reply-To: <515EE0F9.8070507@donders.ru.nl> References: <515EE0F9.8070507@donders.ru.nl> Message-ID: <01c501ce350b$9ca9d010$d5fd7030$@maris@psych.ru.nl> Hi Ramin and Jörn, In multiple-subject study, it is straightforward to statistically test differences in imaginary coherence using Fieldtrip. This is analogous to the statistical testing of regular coherence, which I outlined in a reply to Ana. For a single-subject study, you would have to write your own statfun. This requires some skill, but it is conceptually straightforward. Importantly, for any test statistic that you would like to use for comparing imaginary coherence, you do not(!) have to know it’s parametric reference distribution (thanks to the beauty of permutation inference (-;) Best, Eric Maris From: "Jörn M. Horschig" [mailto:jm.horschig at donders.ru.nl] Sent: vrijdag 5 april 2013 16:35 To: FieldTrip discussion list Subject: Re: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' Hi Ramin, hope you are doing fine. For the imaginary part of coherence you need to call ft_connectivityanalysis with cfg.output = 'imag'. Afaik, z-scoring for the imaginary part is different from doing it for the plain coherence, so you should not use indepsamplesZcoh. You could have a look at Guido Nolte's paper on imaginary coherence and look it up in the methods section how he is computing it - similar but different from what I know how the z-scoring for coherence is computed. Thus, I am not sure how to best do cluster-based statistics on that (that means, I know how you could do it, but not what the best way to do it would be). Of course, you write an own statistics function, something like 'indepsamplesZicoh'... but that would be tons of work. Good luck! I hope anyone out there has other/better ideas :) Best, Jörn On 4/5/2013 9:49 AM, Ramin Azodi wrote: Hello, In case that I want just to calculate imaginary part of coherence instead of coherence with 'indepsamplesZcoh', what kind of operation should I do for that? can anybody lead me through the right way ? You can find my code as following, cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq1 = ft_freqanalysis(cfg, data1); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.complex = 'imag'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq2 = ft_freqanalysis(cfg, data2); cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesZcoh'; cfg.parameter = 'fourierspctrm'; cfg.computecritval = 'yes'; cfg.numrandomization = 500; cfg.design = [ones(size(freq1.fourierspctrm,1),1); 2*ones(size(freq2.fourierspctrm,1),1)]'; cfg.label = freq.label; stat = ft_freqstatistics(cfg, freq,freq1); Thanks in advanced for your consideration. Best Regards, Ramin Azodi _______________________________________________ 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 ingenieureniso at gmail.com Tue Apr 9 16:41:28 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Tue, 9 Apr 2013 16:41:28 +0200 Subject: [FieldTrip] nearest neighbour interpolation Message-ID: Hi all, Are there any suggestions how to implement the nearest neighbour interpolation? many thanks Ahmed -------------- next part -------------- An HTML attachment was scrubbed... URL: From niccol000 at yahoo.it Tue Apr 9 16:45:56 2013 From: niccol000 at yahoo.it (=?iso-8859-1?Q?Niccol=C3=B2_Pescetelli?=) Date: Tue, 9 Apr 2013 15:45:56 +0100 (BST) Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> Thank you Eelke. I found out that the problem was before calling the combine planar function. The original script read in 5 files of raw data (which I could not upload in dropbox, due to dimensions issues). These have the .grad field, but when I appenddata() the data structure looses its grad field. I managed to artificially attach it again, but I don't understand why the function ft_appenddata() does this Any idea? I will try to send you the files in a way or the other Best Nic ________________________________ Da: Eelke Spaak A: FieldTrip discussion list Inviato: Martedì 9 Aprile 2013 11:50 Oggetto: Re: [FieldTrip] Issues with ft_combineplanar(cfg, data) Dear Nic, That is very weird. The fact that a grad seems to be created out of thin air by ft_combineplanar suggests to me that there might be an error in your script. (However, of course it could also be a bug in fieldtrip.) Could you perhaps send a functional (small) piece of data, along with a script, that reproduces the error? Your e-mail currently does not have enough information to judge what's truly going on. If your data is >1MB, please use one of the file sharing services listed here: http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers Best, Eelke On 9 April 2013 10:33, Niccolò Pescetelli wrote: > Dear all, > > I am new to fieldtrip and I would like to have your opinion about a bizarre > error that I find trying to execute the function ft_combineplanar(). What am > I trying to do is to  obtain the planar gradient from raw data. I use a > neuromag306 Elekta MEG system. > I tried to dig deeper into the scripts and I notice some quirks the error > could derive from: > > 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from > 840 trials to 192 trials, without any command being provided that is BEFORE > the first line of ft_combineplanar(cfg, data) being executed! At the same > time all data.trials becomes empty arrays > > 2. my data structure does not contain the fields 'grad' before > ft_combineplanar(cfg, data) has been called but it does afterwards . Again > this happen without any command having been given > > 3. The error finally occurs in line 210 of the ft_combineplanar function > (indexing error) and it's due to the data.trial array being empty > > What do you think? > > Best > > Nic > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 eelke.spaak at donders.ru.nl Tue Apr 9 16:58:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 9 Apr 2013 16:58:54 +0200 Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> Message-ID: Hi Nic, Good to hear the problem has been solved. If you append multiple data sets, ft_appenddata discards gradiometer information because this might be different in the different data sets. If you are certain one particular gradiometer definition is correct for the appended data, you can simply 'artificially attach it again'. Best, Eelke On 9 April 2013 16:45, Niccolò Pescetelli wrote: > Thank you Eelke. > > I found out that the problem was before calling the combine planar function. > The original script read in 5 files of raw data (which I could not upload in > dropbox, due to dimensions issues). These have the .grad field, but when I > appenddata() the data structure looses its grad field. > > I managed to artificially attach it again, but I don't understand why the > function ft_appenddata() does this > Any idea? > > I will try to send you the files in a way or the other > > Best > > Nic > > > > ________________________________ > Da: Eelke Spaak > A: FieldTrip discussion list > Inviato: Martedì 9 Aprile 2013 11:50 > Oggetto: Re: [FieldTrip] Issues with ft_combineplanar(cfg, data) > > Dear Nic, > > That is very weird. The fact that a grad seems to be created out of > thin air by ft_combineplanar suggests to me that there might be an > error in your script. (However, of course it could also be a bug in > fieldtrip.) Could you perhaps send a functional (small) piece of data, > along with a script, that reproduces the error? Your e-mail currently > does not have enough information to judge what's truly going on. If > your data is >1MB, please use one of the file sharing services listed > here: > http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers > > Best, > Eelke > > On 9 April 2013 10:33, Niccolò Pescetelli wrote: >> Dear all, >> >> I am new to fieldtrip and I would like to have your opinion about a >> bizarre >> error that I find trying to execute the function ft_combineplanar(). What >> am >> I trying to do is to obtain the planar gradient from raw data. I use a >> neuromag306 Elekta MEG system. >> I tried to dig deeper into the scripts and I notice some quirks the error >> could derive from: >> >> 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches >> from >> 840 trials to 192 trials, without any command being provided that is >> BEFORE >> the first line of ft_combineplanar(cfg, data) being executed! At the same >> time all data.trials becomes empty arrays >> >> 2. my data structure does not contain the fields 'grad' before >> ft_combineplanar(cfg, data) has been called but it does afterwards . Again >> this happen without any command having been given >> >> 3. The error finally occurs in line 210 of the ft_combineplanar function >> (indexing error) and it's due to the data.trial array being empty >> >> What do you think? >> >> Best >> >> Nic >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inieuwenhuis at berkeley.edu Tue Apr 9 18:39:26 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Tue, 09 Apr 2013 09:39:26 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> Message-ID: <5164443E.5040909@berkeley.edu> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: > Dear Ingrid, > > in addition to Jorn's approach since you don't have MR and digitized > elec position's you can load and realign the electrodes to the > standard bem. Subsequently you can calculate the lead field and > continue with your analysis pipeline. > Good luck > tzvetan > %% read electrodes > elec = ft_read_sens('/your > path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); > %% read headmodel > templateheadmodel = '/your > path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; > load(templateheadmodel); > %% electrode realign as good as possible > % i.e. translate 0 -2 1.5 > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = vol.bnd(1).pnt; > elecR = ft_electroderealign(cfg); > %% verify how the electrodes fit toghether with the brain volume > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elecR; > cfg.headshape = vol.bnd(3).pnt; > elecR = ft_electroderealign(cfg); > > >> Hi Ingrid, >> >> I just happen to done this a few weeks back, I changed things in the >> meanwhile, but I hope that the below steps are complete: >> /% read in the template MRI >> if isunix >> mri = >> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >> elseif ispc >> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >> 'external', 'spm8', 'templates', 'T1.nii')); >> end >> >> >> % segment the MRI >> cfg = []; >> cfg.output = {'brain' 'skull' 'scalp'}; >> segmentedmri = ft_volumesegment(cfg, mris); >> >> >> % create the headmodel (BEM) >> cfg = []; >> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >> if isunix >> cfg.method ='dipoli'; % dipoli only works under linux >> else >> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >> keyboard; >> end >> hdm = ft_prepare_headmodel(cfg, segmentedmri); >> >> elec = ft_read_sens('standard_1020.elc'); >> hdm = ft_convert_units(hdm, elec.unit); >> >> cfg = []; >> cfg.grid.xgrid = -125:8:125; >> cfg.grid.ygrid = -125:8:125; >> cfg.grid.zgrid = -125:8:125; >> cfg.grid.tight = 'yes'; >> cfg.grid.unit = hdm.unit; >> cfg.inwardshift = -1.5; >> cfg.vol = hdm; >> grid = ft_prepare_sourcemodel(cfg) >> grid = ft_convert_units(grid, elec.unit); >> >> figure; >> hold on; >> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, >> 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> ft_plot_mesh(grid.pos(grid.inside, :)); >> >> % this step is not necessary, cause you will see that everything is >> already aligned >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = hdm.bnd(1); >> tmp = ft_electroderealign(cfg); >> elec = tmp; % I had a bug here that I couldn't assign elec directly >> >> %% verify location of occipital electrodes >> >> occ_elec = elec; >> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >> occ_idx = match_str(elec.label, occ_chan); >> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >> occ_elec.label = occ_elec.label(occ_idx, :); >> figure; >> ft_plot_sens(occ_elec) >> hold on; >> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >> >> >> Afair, that's all that is needed. Of course you need to adjust folder >> and file names. >> >> Greetings >> Jörn >> >> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>> Hi all, >>> >>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>> I don't have anatomical MRIs and I don't have a measurement of the >>> scalp surface. So I'd like to use a template MRI or a template head >>> model that is located in the FieldTrip template directory. I have >>> EGI (128 channels) data and electrode positions (not subject >>> specific, just the standard file also available in FieldTrip >>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how >>> to start. I don't see any examples on the FieldTrip page of how to >>> make a headmodel and volume conduction model giving only this >>> limited data. I'd be happy to make it into a example Matlab script >>> on the FieldTrip page after I got it to work. Would someone be able >>> to give me some pointers, or example code? >>> >>> Thanks a lot! >>> Ingrid >>> >> >> >> -- >> 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 > > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > > ******************************************* > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sabato45 at hotmail.com Tue Apr 9 19:57:23 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Tue, 9 Apr 2013 10:57:23 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> References: , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Message-ID: Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,Ana _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From akiko.ikkai at gmail.com Wed Apr 10 00:32:44 2013 From: akiko.ikkai at gmail.com (Akiko Ikkai) Date: Tue, 9 Apr 2013 18:32:44 -0400 Subject: [FieldTrip] classification with 3 conditions? Message-ID: Hi, I have a 3 conditions, A, B, and C in my MEG data. Multivariate classification using selected sensors between conditions A and B, B and C, and A and C work beautifully with chance = 50%. I'm now curious whether I could run a classification of 3 conditions with chance = 33%. ft_freqstatistics could take more than 2 frequency datasets as inputs, but ft_statistics_crossvalidate using +dmlt/svm.m seems to require 2 datasets (because it's using a linear kernel?). Does anyone have suggestions how I might go about it...? Thanks in advance! Akiko -- Akiko Ikkai, Ph.D. Postdoctoral Fellow Department of Psychological and Brain Sciences Johns Hopkins University Ames Hall, 3400 N. Charles St. Baltimore, MD 21218 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Wed Apr 10 01:29:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Tue, 09 Apr 2013 16:29:31 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5164443E.5040909@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu> Message-ID: <5164A45B.1060502@berkeley.edu> Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using thestandard_bem.mat . (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? *So my question is:* a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: > Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on > the wiki. > Have a great day, > Ingrid > > On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >> Dear Ingrid, >> >> in addition to Jorn's approach since you don't have MR and digitized >> elec position's you can load and realign the electrodes to the >> standard bem. Subsequently you can calculate the lead field and >> continue with your analysis pipeline. >> Good luck >> tzvetan >> %% read electrodes >> elec = ft_read_sens('/your >> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >> %% read headmodel >> templateheadmodel = '/your >> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >> load(templateheadmodel); >> %% electrode realign as good as possible >> % i.e. translate 0 -2 1.5 >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = vol.bnd(1).pnt; >> elecR = ft_electroderealign(cfg); >> %% verify how the electrodes fit toghether with the brain volume >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elecR; >> cfg.headshape = vol.bnd(3).pnt; >> elecR = ft_electroderealign(cfg); >> >> >>> Hi Ingrid, >>> >>> I just happen to done this a few weeks back, I changed things in the >>> meanwhile, but I hope that the below steps are complete: >>> /% read in the template MRI >>> if isunix >>> mri = >>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>> elseif ispc >>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>> 'external', 'spm8', 'templates', 'T1.nii')); >>> end >>> >>> >>> % segment the MRI >>> cfg = []; >>> cfg.output = {'brain' 'skull' 'scalp'}; >>> segmentedmri = ft_volumesegment(cfg, mris); >>> >>> >>> % create the headmodel (BEM) >>> cfg = []; >>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>> if isunix >>> cfg.method ='dipoli'; % dipoli only works under linux >>> else >>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>> keyboard; >>> end >>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> elec = ft_read_sens('standard_1020.elc'); >>> hdm = ft_convert_units(hdm, elec.unit); >>> >>> cfg = []; >>> cfg.grid.xgrid = -125:8:125; >>> cfg.grid.ygrid = -125:8:125; >>> cfg.grid.zgrid = -125:8:125; >>> cfg.grid.tight = 'yes'; >>> cfg.grid.unit = hdm.unit; >>> cfg.inwardshift = -1.5; >>> cfg.vol = hdm; >>> grid = ft_prepare_sourcemodel(cfg) >>> grid = ft_convert_units(grid, elec.unit); >>> >>> figure; >>> hold on; >>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>> ft_plot_mesh(grid.pos(grid.inside, :)); >>> >>> % this step is not necessary, cause you will see that everything is >>> already aligned >>> cfg = []; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = hdm.bnd(1); >>> tmp = ft_electroderealign(cfg); >>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>> >>> %% verify location of occipital electrodes >>> >>> occ_elec = elec; >>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >>> occ_idx = match_str(elec.label, occ_chan); >>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>> occ_elec.label = occ_elec.label(occ_idx, :); >>> figure; >>> ft_plot_sens(occ_elec) >>> hold on; >>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>> >>> >>> Afair, that's all that is needed. Of course you need to adjust >>> folder and file names. >>> >>> Greetings >>> Jörn >>> >>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>> Hi all, >>>> >>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>> I don't have anatomical MRIs and I don't have a measurement of the >>>> scalp surface. So I'd like to use a template MRI or a template head >>>> model that is located in the FieldTrip template directory. I have >>>> EGI (128 channels) data and electrode positions (not subject >>>> specific, just the standard file also available in FieldTrip >>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>> how to start. I don't see any examples on the FieldTrip page of how >>>> to make a headmodel and volume conduction model giving only this >>>> limited data. I'd be happy to make it into a example Matlab script >>>> on the FieldTrip page after I got it to work. Would someone be able >>>> to give me some pointers, or example code? >>>> >>>> Thanks a lot! >>>> Ingrid >>>> >>> >>> >>> -- >>> 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 >> >> ******************************************* >> Tzvetan Popov >> Clinical Psychology >> University of Konstanz >> Box 23 >> 78457 Konstanz, GERMANY >> Phone: 0049-7531-883086 >> Fax: 0049-7531-884601 >> Email: tzvetan.popov at uni-konstanz.de >> >> ******************************************* >> >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: afterbemcp.png Type: image/png Size: 64338 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol3.png Type: image/png Size: 46492 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol.png Type: image/png Size: 47348 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol2.png Type: image/png Size: 31169 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Wed Apr 10 09:06:57 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 10 Apr 2013 09:06:57 +0200 Subject: [FieldTrip] nearest neighbour interpolation In-Reply-To: References: Message-ID: <51650F90.1070900@donders.ru.nl> Dear Ahmed, I am not sure I understood your question. Please have a look here: http://fieldtrip.fcdonders.nl/reference/ft_channelrepair http://fieldtrip.fcdonders.nl/reference/ft_prepare_neighbours http://fieldtrip.fcdonders.nl/faq/how_does_ft_prepare_neighbours_work http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described?s[]=ft&s[]=channelrepair For example code for ft_prepare_neighbours, see the cluster-based permutation test tutorials, e.g.: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock#permutation_test Greetings Jörn On 4/9/2013 4:41 PM, ingenieur eniso wrote: > Hi all, > > Are there any suggestions how to implement the nearest neighbour > interpolation? > > many thanks > > Ahmed > > > _______________________________________________ > 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 e.maris at psych.ru.nl Wed Apr 10 09:21:28 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Wed, 10 Apr 2013 09:21:28 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Message-ID: <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris, thank you for your response. I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I have two conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulation across trials to find out whether condition 1 is different from condition 2 independently of their different number of trials. If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic. I really appreciate your help. Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, Ana _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From irina.simanova at mpi.nl Wed Apr 10 10:07:09 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Wed, 10 Apr 2013 10:07:09 +0200 Subject: [FieldTrip] classification with 3 conditions? In-Reply-To: References: Message-ID: Dear Akiko, you can use DML functions for multiclass classification: dml.one_against_one or dml.one_against_rest one_against_rest builds one SVM per class, trained to distinguish the trials in a single class from the trials in all remaining classes. Classification of a test trial is done according to the maximum output among all SVMs. one_against_one builds one SVM for each pair of classes (a pairwise comparison). Classification of a test trial is done according to the maximum voting , where each SVM votes for one class. You can see for yourself which method is better for your research question/data. You call it like this: cfg.mva = dml.one_against_rest('mva', {dml.standardizer() dml.svm()}) or cfg.mva = dml.one_against_one('mva', {dml.standardizer() dml.svm()}) best, Irina On Apr 10, 2013, at 12:32 AM 4/10/13, Akiko Ikkai wrote: > Hi, > > I have a 3 conditions, A, B, and C in my MEG data. Multivariate classification using selected sensors between conditions A and B, B and C, and A and C work beautifully with chance = 50%. I'm now curious whether I could run a classification of 3 conditions with chance = 33%. > > ft_freqstatistics could take more than 2 frequency datasets as inputs, but ft_statistics_crossvalidate using +dmlt/svm.m seems to require 2 datasets (because it's using a linear kernel?). > > Does anyone have suggestions how I might go about it...? > Thanks in advance! Akiko > > -- > Akiko Ikkai, Ph.D. > Postdoctoral Fellow > Department of Psychological and Brain Sciences > Johns Hopkins University > Ames Hall, 3400 N. Charles St. > Baltimore, MD 21218 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Wed Apr 10 11:36:48 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 10 Apr 2013 11:36:48 +0200 Subject: [FieldTrip] Bug in ft_freqcomparison.m? In-Reply-To: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> References: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> Message-ID: Hi Alex, Thanks for looking into this function. You’re right that ft_freqcomparison initializes the output structure ‘ freq’ (line 87) using the first input structure. This could indeed be problematic when the two input structures are dissimilarly sized. In fact, having a size difference in the powspctrm fields between the two input structure is an exclusion criterion for using this function in the first place, e.g. because it may result in comparing frequency powers of different channels, trials, or subjects. For that reason, a check was built in at lines 92 and 115, which ensures that the input structures have identical matrix size. Although not intuitive clear maybe from a reader’s perspective, this is thus not an issue and it will not affect your data. Also please note that ft_freqcomparison has become outdated with the arrival of ft_math. Technically, this function can do the same, but with more flexibility and better bookkeeping. Best wishes, Arjen 2013/3/13 Alexander Maye > Hi All, > > I just spotted something that could be a bug in ft_freqcomparison.m > (fieldtrip-20130312 and previous versions). Don't now if this is the place > for > report, but if this really is an issue everyone using this function may be > interested. > > The problem is in line 87 where freq = varargin{1}; is initialized to the > *first* freq argument, that according to the doc is used as the norm. So > the > output (powspctrm) has the dimension of the norm, not the second freq > argument, that one wants to become normalized. Strange, hmm? Then, in the > following for-loops the index variable runs over the size of the *second* > freq > argument, updating trials in the powspctrm with the size of the *first* > freq > argument, which seems simply wrong. > > Maybe this is an ingenious programming trick, but initializing freq = > varargin{2}; on line 87 would make more sense from my point of view. > > Best, > > ALEX. > > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen > Rechts; Gerichtsstand: Hamburg > > Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander > Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Wed Apr 10 15:38:16 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 10 Apr 2013 13:38:16 +0000 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5164A45B.1060502@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>,<5164A45B.1060502@berkeley.edu> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> Hi Ingrid, I had a similar issue a few weeks ago, where my lower most electrodes started floating after electrode realign using the ft_electroderealign function. I used the ft_prepare_vol_sens as, [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and brought the electrodes on to the skin. Hope this helps...! Regards Imali From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis [inieuwenhuis at berkeley.edu] Sent: Wednesday, 10 April 2013 9:29 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] source analysis EEG data without MRI Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using the standard_bem.mat. (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? So my question is: a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: % read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit)) Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingenieureniso at gmail.com Wed Apr 10 17:43:55 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Wed, 10 Apr 2013 17:43:55 +0200 Subject: [FieldTrip] nearest neighbour interpolation In-Reply-To: <51650F90.1070900@donders.ru.nl> References: <51650F90.1070900@donders.ru.nl> Message-ID: Dear Jörn, thank you very much for help. yes, this is what i'm looking. All the best Ahmed 2013/4/10 "Jörn M. Horschig" > Dear Ahmed, > > I am not sure I understood your question. Please have a look here: > http://fieldtrip.fcdonders.nl/reference/ft_channelrepair > > http://fieldtrip.fcdonders.nl/reference/ft_prepare_neighbours > http://fieldtrip.fcdonders.nl/faq/how_does_ft_prepare_neighbours_work > > http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described?s > []=ft&s[]=channelrepair > > For example code for ft_prepare_neighbours, see the cluster-based > permutation test tutorials, e.g.: > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock#permutation_test > > Greetings > Jörn > > > > On 4/9/2013 4:41 PM, ingenieur eniso wrote: > > Hi all, > > Are there any suggestions how to implement the nearest neighbour > interpolation? > > many thanks > > Ahmed > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 Lilla.Magyari at mpi.nl Wed Apr 10 18:05:02 2013 From: Lilla.Magyari at mpi.nl (Magyari, Lilla) Date: Wed, 10 Apr 2013 18:05:02 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> Message-ID: <51658DAE.9080207@mpi.nl> hi Ingrid and Imali, I think it is a really good question what to do in Ingrid's case. I do not know the "right" answer, but I would like to share my thoughts about it. The ft_prepare_vol_sens is indeed projects the electrode positions closer to the headsurface as Imali wrote. But this function called automatically when you create your leadfield, so you do not have to do it separately (unless you want to visualize the corrected electrode positions). However, I have been advised to rely on this projection carefully if electrode positions are far from the skin and specially, if the inaccuracies (distance from the skin) are not equally distributed across the electrodes, because that can cause a spatial bias. Therefore, my question would be: why are those electrodes so low? Are those positions reflect the actual positions of the electrodes during the measurement? If yes, I would not change their positions, I would rather try to extend my headmodel e.g. by using another template. (or another (but quite suboptimal) possibility is maybe to exclude those electrodes (and the data) from the analysis if they are anyway far from the brain.) If the position of the electrodes should be higher up on the head, then instead of relying on projection, I would try first to scale the electrodes to fit them into the headsurface with the ft_electroderealign function. I looked to the standard_bem file in the template directory, and I also load in the standard_1020.elc, and those electrodes perfectly fit the vol. So, it seems that the extension of the standard bem headsurface is suitable for the area which is covered by the those template electrodes. And I do not know if the electrode set you use should cover a larger surface of the head, or if it should be just adjusted to the given headsurface. Lilla IMALI THANUJA HETTIARACHCHI wrote: > Hi Ingrid, > > I had a similar issue a few weeks ago, where my lower most electrodes > started floating after electrode realign using the ft_electroderealign > function. > > I used the ft_prepare_vol_sens as, > [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and > brought the electrodes on to the skin. > > Hope this helps...! > > Regards > Imali > > > *From:* fieldtrip-bounces at science.ru.nl > [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis > [inieuwenhuis at berkeley.edu] > *Sent:* Wednesday, 10 April 2013 9:29 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > A follow up on this and some new issues: > > 1) I first tried Jörn's approach by creating my own BEM, always fun to > make it yourself ;) However, I did not succeed since: > a) the dipoli method does not work on Windows > b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe > has stopped working" I've emailed their buglist > c) bemcp did run, but the result was not ok (see attachement). I also > got the warning "% Warning: Matrix is singular, close to singular or > badly scaled. Results may be inaccurate." several times, so that might > be the problem. > d) and asa gave the following error: % Error using ft_prepare_headmodel > (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel > > And away went my determination to do it myself, so I continued using > thestandard_bem.mat > . > (I did not know this existed, I've added this link to note in the > headmodel tutorial > to > make it easier to find, thanks Tzvetan for pointing this out!). > > 2) This worked and after some fiddling to get the electrodes aligned it > looks okay (see attached). > However, as you can see in the figures, I have several very low > electrodes, that are lower than the skin mesh. So I was wondering if > this is a problem? Since for accurate calculation of how the currents > flow from these low electrodes, I assume one needs the skin to go till > there? What happens when I have electrodes floating in thin air? > *So my question is:* > a) will this cause great inaccuracies? > b) if so, how can I extend the skin to go lower? The template MRI only > goes that far to the bottom... Trick anyone? > > Thanks again, > Ingrid > > > On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >> the wiki. >> Have a great day, >> Ingrid >> >> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>> Dear Ingrid, >>> >>> in addition to Jorn's approach since you don't have MR and digitized >>> elec position's you can load and realign the electrodes to the >>> standard bem. Subsequently you can calculate the lead field and >>> continue with your analysis pipeline. >>> Good luck >>> tzvetan >>> %% read electrodes >>> elec = ft_read_sens('/your >>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>> %% read headmodel >>> templateheadmodel = '/your >>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>> load(templateheadmodel); >>> %% electrode realign as good as possible >>> % i.e. translate 0 -2 1.5 >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = vol.bnd(1).pnt; >>> elecR = ft_electroderealign(cfg); >>> %% verify how the electrodes fit toghether with the brain volume >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elecR; >>> cfg.headshape = vol.bnd(3).pnt; >>> elecR = ft_electroderealign(cfg); >>> >>> >>>> Hi Ingrid, >>>> >>>> I just happen to done this a few weeks back, I changed things in the >>>> meanwhile, but I hope that the below steps are complete: >>>> /% read in the template MRI >>>> if isunix >>>> mri = >>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>> elseif ispc >>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>> 'spm8', 'templates', 'T1.nii')); >>>> end >>>> >>>> >>>> % segment the MRI >>>> cfg = []; >>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>> segmentedmri = ft_volumesegment(cfg, mris); >>>> >>>> >>>> % create the headmodel (BEM) >>>> cfg = []; >>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>> if isunix >>>> cfg.method ='dipoli'; % dipoli only works under linux >>>> else >>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>> keyboard; >>>> end >>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> elec = ft_read_sens('standard_1020.elc'); >>>> hdm = ft_convert_units(hdm, elec.unit); >>>> >>>> cfg = []; >>>> cfg.grid.xgrid = -125:8:125; >>>> cfg.grid.ygrid = -125:8:125; >>>> cfg.grid.zgrid = -125:8:125; >>>> cfg.grid.tight = 'yes'; >>>> cfg.grid.unit = hdm.unit; >>>> cfg.inwardshift = -1.5; >>>> cfg.vol = hdm; >>>> grid = ft_prepare_sourcemodel(cfg) >>>> grid = ft_convert_units(grid, elec.unit); >>>> >>>> figure; >>>> hold on; >>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>> >>>> % this step is not necessary, cause you will see that everything is >>>> already aligned >>>> cfg = []; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = hdm.bnd(1); >>>> tmp = ft_electroderealign(cfg); >>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>> >>>> %% verify location of occipital electrodes >>>> >>>> occ_elec = elec; >>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >>>> occ_idx = match_str(elec.label, occ_chan); >>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>> figure; >>>> ft_plot_sens(occ_elec) >>>> hold on; >>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>> >>>> >>>> Afair, that's all that is needed. Of course you need to adjust >>>> folder and file names. >>>> >>>> Greetings >>>> Jörn >>>> >>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>> Hi all, >>>>> >>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>> model that is located in the FieldTrip template directory. I have >>>>> EGI (128 channels) data and electrode positions (not subject >>>>> specific, just the standard file also available in FieldTrip >>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>> to make a headmodel and volume conduction model giving only this >>>>> limited data. I'd be happy to make it into a example Matlab script >>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>> to give me some pointers, or example code? >>>>> >>>>> Thanks a lot! >>>>> Ingrid >>>>> >>>> >>>> >>>> -- >>>> 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 >>> >>> ******************************************* >>> Tzvetan Popov >>> Clinical Psychology >>> University of Konstanz >>> Box 23 >>> 78457 Konstanz, GERMANY >>> Phone: 0049-7531-883086 >>> Fax: 0049-7531-884601 >>> Email: tzvetan.popov at uni-konstanz.de >>> >>> ******************************************* >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inieuwenhuis at berkeley.edu Wed Apr 10 19:17:04 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 10:17:04 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51658DAE.9080207@mpi.nl> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> Message-ID: <51659E90.4020805@berkeley.edu> Hi Lilla and Imali, Thanks for your replies. In my case, the problem is not the aligning. My nasion electrode is on the nasion, and Cz is on Cz, everything is where it should be. The EGI 128 electrode net really has these low electrodes, which are there specifically to make source analysis better by capturing more of the electric field. So I would have the best solution if I'd leave them there. However, in the model as derived from the MNI template, the skin part does not go down low enough. I looked at the picture after ft_prepare_vol_sens (see attachement, black is before, red is after), and indeed, this is not good. The low electrodes are squeezed up, and this will make source analysis worse. So I should indeed remove these electrodes (which is a pity), or find a better MNI template. *So my question is:* Does anyone know of a template in MNI space that extends more down? This template comes from SPM8, is there a version that extends lower? Or could I extend the skin roughly downwards with some triangular magic? I'm also a bit confused about the statement on this wiki page: http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem under "revision information" header "skin" is says: "This skin surface is not used in the BEM model itself for computational reasons, but can be used for visualization." But this does not seem to be the case, since my electrode positions are modified based on till where the skin goes. So the skin surface does significantly influence the source analysis. Anyway, thanks for all the help, and worse case, I just get rid of the low fellows. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 9:05 AM, Magyari, Lilla wrote: > hi Ingrid and Imali, > > > I think it is a really good question what to do in Ingrid's case. I do > not know the "right" answer, but I would like to share my thoughts > about it. > > The ft_prepare_vol_sens is indeed projects the electrode positions > closer to the headsurface as Imali wrote. But this function called > automatically when you create your leadfield, so you do not have to do > it separately (unless you want to visualize the corrected electrode > positions). > > However, I have been advised to rely on this projection carefully if > electrode positions are far from the skin and specially, if the > inaccuracies (distance from the skin) are not equally distributed > across the electrodes, because that can cause a spatial bias. > > Therefore, my question would be: why are those electrodes so low? Are > those positions reflect the actual positions of the electrodes during > the measurement? If yes, I would not change their positions, I would > rather try to extend my headmodel e.g. by using another template. (or > another (but quite suboptimal) possibility is maybe to exclude those > electrodes (and the data) from the analysis if they are anyway far > from the brain.) > > If the position of the electrodes should be higher up on the head, > then instead of relying on projection, I would try first to scale the > electrodes to fit them into the headsurface with the > ft_electroderealign function. > > I looked to the standard_bem file in the template directory, and I > also load in the standard_1020.elc, and those electrodes perfectly fit > the vol. So, it seems that the extension of the standard bem > headsurface is suitable for the area which is covered by the those > template electrodes. And I do not know if the electrode set you use > should cover a larger surface of the head, or if it should be just > adjusted to the given headsurface. > > Lilla > > > > > IMALI THANUJA HETTIARACHCHI wrote: >> Hi Ingrid, >> >> I had a similar issue a few weeks ago, where my lower most electrodes >> started floating after electrode realign using the ft_electroderealign >> function. >> >> I used the ft_prepare_vol_sens as, >> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and >> brought the electrodes on to the skin. >> >> Hope this helps...! >> >> Regards >> Imali >> >> >> *From:* fieldtrip-bounces at science.ru.nl >> [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis >> [inieuwenhuis at berkeley.edu] >> *Sent:* Wednesday, 10 April 2013 9:29 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> A follow up on this and some new issues: >> >> 1) I first tried Jörn's approach by creating my own BEM, always fun to >> make it yourself ;) However, I did not succeed since: >> a) the dipoli method does not work on Windows >> b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe >> has stopped working" I've emailed their buglist >> c) bemcp did run, but the result was not ok (see attachement). I also >> got the warning "% Warning: Matrix is singular, close to singular or >> badly scaled. Results may be inaccurate." several times, so that might >> be the problem. >> d) and asa gave the following error: % Error using ft_prepare_headmodel >> (line 201) % You must supply a valid cfg.hdmfile for use with ASA >> headmodel >> >> And away went my determination to do it myself, so I continued using >> thestandard_bem.mat >> . >> (I did not know this existed, I've added this link to note in the >> headmodel tutorial >> to >> make it easier to find, thanks Tzvetan for pointing this out!). >> >> 2) This worked and after some fiddling to get the electrodes aligned it >> looks okay (see attached). >> However, as you can see in the figures, I have several very low >> electrodes, that are lower than the skin mesh. So I was wondering if >> this is a problem? Since for accurate calculation of how the currents >> flow from these low electrodes, I assume one needs the skin to go till >> there? What happens when I have electrodes floating in thin air? >> *So my question is:* >> a) will this cause great inaccuracies? >> b) if so, how can I extend the skin to go lower? The template MRI only >> goes that far to the bottom... Trick anyone? >> >> Thanks again, >> Ingrid >> >> >> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >>> the wiki. >>> Have a great day, >>> Ingrid >>> >>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>> Dear Ingrid, >>>> >>>> in addition to Jorn's approach since you don't have MR and digitized >>>> elec position's you can load and realign the electrodes to the >>>> standard bem. Subsequently you can calculate the lead field and >>>> continue with your analysis pipeline. >>>> Good luck >>>> tzvetan >>>> %% read electrodes >>>> elec = ft_read_sens('/your >>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>> %% read headmodel >>>> templateheadmodel = '/your >>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>> load(templateheadmodel); >>>> %% electrode realign as good as possible >>>> % i.e. translate 0 -2 1.5 >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = vol.bnd(1).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> %% verify how the electrodes fit toghether with the brain volume >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elecR; >>>> cfg.headshape = vol.bnd(3).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> >>>> >>>>> Hi Ingrid, >>>>> >>>>> I just happen to done this a few weeks back, I changed things in the >>>>> meanwhile, but I hope that the below steps are complete: >>>>> /% read in the template MRI >>>>> if isunix >>>>> mri = >>>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>>> >>>>> elseif ispc >>>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>>> 'spm8', 'templates', 'T1.nii')); >>>>> end >>>>> >>>>> >>>>> % segment the MRI >>>>> cfg = []; >>>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>>> segmentedmri = ft_volumesegment(cfg, mris); >>>>> >>>>> >>>>> % create the headmodel (BEM) >>>>> cfg = []; >>>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>>> if isunix >>>>> cfg.method ='dipoli'; % dipoli only works under linux >>>>> else >>>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>>> keyboard; >>>>> end >>>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>>> >>>>> elec = ft_read_sens('standard_1020.elc'); >>>>> hdm = ft_convert_units(hdm, elec.unit); >>>>> >>>>> cfg = []; >>>>> cfg.grid.xgrid = -125:8:125; >>>>> cfg.grid.ygrid = -125:8:125; >>>>> cfg.grid.zgrid = -125:8:125; >>>>> cfg.grid.tight = 'yes'; >>>>> cfg.grid.unit = hdm.unit; >>>>> cfg.inwardshift = -1.5; >>>>> cfg.vol = hdm; >>>>> grid = ft_prepare_sourcemodel(cfg) >>>>> grid = ft_convert_units(grid, elec.unit); >>>>> >>>>> figure; >>>>> hold on; >>>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>>> >>>>> % this step is not necessary, cause you will see that everything is >>>>> already aligned >>>>> cfg = []; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elec; >>>>> cfg.headshape = hdm.bnd(1); >>>>> tmp = ft_electroderealign(cfg); >>>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>>> >>>>> %% verify location of occipital electrodes >>>>> >>>>> occ_elec = elec; >>>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>>> elec.label); >>>>> occ_idx = match_str(elec.label, occ_chan); >>>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>>> figure; >>>>> ft_plot_sens(occ_elec) >>>>> hold on; >>>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>>> >>>>> >>>>> Afair, that's all that is needed. Of course you need to adjust >>>>> folder and file names. >>>>> >>>>> Greetings >>>>> Jörn >>>>> >>>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>>> Hi all, >>>>>> >>>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>>> model that is located in the FieldTrip template directory. I have >>>>>> EGI (128 channels) data and electrode positions (not subject >>>>>> specific, just the standard file also available in FieldTrip >>>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>>> to make a headmodel and volume conduction model giving only this >>>>>> limited data. I'd be happy to make it into a example Matlab script >>>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>>> to give me some pointers, or example code? >>>>>> >>>>>> Thanks a lot! >>>>>> Ingrid >>>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>> >>>> ******************************************* >>>> Tzvetan Popov >>>> Clinical Psychology >>>> University of Konstanz >>>> Box 23 >>>> 78457 Konstanz, GERMANY >>>> Phone: 0049-7531-883086 >>>> Fax: 0049-7531-884601 >>>> Email: tzvetan.popov at uni-konstanz.de >>>> >>>> ******************************************* >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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: after_preparevolsens.png Type: image/png Size: 33666 bytes Desc: not available URL: From inieuwenhuis at berkeley.edu Wed Apr 10 20:21:59 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 11:21:59 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51659E90.4020805@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> Message-ID: <5165ADC7.6020906@berkeley.edu> Hi all, Just had a brain wave, I'll share it for people with similar situation that might be interested in this thread. I think I should just get a random structural MRI that extends lower (includes ears and bit below), optimally of a subject with a head similar to the MNI template. Make a BEM model (hmm, have to fix these errors I mentioned earlier then, well, should be doable on linux using dipoli). Then use ft_electroderealign to align the electrodes to this MRI, do the source analysis for all subjects using this model, and subsequently use ft_volumenormalise to normalize to MNI template if I want to use any atlas functionality. If anyone did this already using FieldTrip and has a pre-made BEM (just like the standard_bem), would be really nice if you're willing to share :) If not, I'll make my own, and people with low electrodes and no structural MRI and or no linux access can email me if they want to use it. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: > Hi Lilla and Imali, > > Thanks for your replies. In my case, the problem is not the aligning. > My nasion electrode is on the nasion, and Cz is on Cz, everything is > where it should be. The EGI 128 electrode net really has these low > electrodes, which are there specifically to make source analysis > better by capturing more of the electric field. So I would have the > best solution if I'd leave them there. However, in the model as > derived from the MNI template, the skin part does not go down low enough. > > I looked at the picture after ft_prepare_vol_sens (see attachement, > black is before, red is after), and indeed, this is not good. The low > electrodes are squeezed up, and this will make source analysis worse. > So I should indeed remove these electrodes (which is a pity), or find > a better MNI template. > > *So my question is:* > Does anyone know of a template in MNI space that extends more down? > This template comes from SPM8, is there a version that extends lower? > Or could I extend the skin roughly downwards with some triangular magic? > > I'm also a bit confused about the statement on this wiki page: > http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem > under "revision information" header "skin" is says: "This skin surface > is not used in the BEM model itself for computational reasons, but can > be used for visualization." > But this does not seem to be the case, since my electrode positions > are modified based on till where the skin goes. So the skin surface > does significantly influence the source analysis. > > Anyway, thanks for all the help, and worse case, I just get rid of the > low fellows. > > Cheers, > Ingrid > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >> hi Ingrid and Imali, >> >> >> I think it is a really good question what to do in Ingrid's case. I >> do not know the "right" answer, but I would like to share my thoughts >> about it. >> >> The ft_prepare_vol_sens is indeed projects the electrode positions >> closer to the headsurface as Imali wrote. But this function called >> automatically when you create your leadfield, so you do not have to >> do it separately (unless you want to visualize the corrected >> electrode positions). >> >> However, I have been advised to rely on this projection carefully if >> electrode positions are far from the skin and specially, if the >> inaccuracies (distance from the skin) are not equally distributed >> across the electrodes, because that can cause a spatial bias. >> >> Therefore, my question would be: why are those electrodes so low? Are >> those positions reflect the actual positions of the electrodes during >> the measurement? If yes, I would not change their positions, I would >> rather try to extend my headmodel e.g. by using another template. (or >> another (but quite suboptimal) possibility is maybe to exclude those >> electrodes (and the data) from the analysis if they are anyway far >> from the brain.) >> >> If the position of the electrodes should be higher up on the head, >> then instead of relying on projection, I would try first to scale the >> electrodes to fit them into the headsurface with the >> ft_electroderealign function. >> >> I looked to the standard_bem file in the template directory, and I >> also load in the standard_1020.elc, and those electrodes perfectly >> fit the vol. So, it seems that the extension of the standard bem >> headsurface is suitable for the area which is covered by the those >> template electrodes. And I do not know if the electrode set you use >> should cover a larger surface of the head, or if it should be just >> adjusted to the given headsurface. >> >> Lilla >> >> >> >> >> IMALI THANUJA HETTIARACHCHI wrote: >>> Hi Ingrid, >>> >>> I had a similar issue a few weeks ago, where my lower most electrodes >>> started floating after electrode realign using the ft_electroderealign >>> function. >>> >>> I used the ft_prepare_vol_sens as, >>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and >>> brought the electrodes on to the skin. >>> >>> Hope this helps...! >>> >>> Regards >>> Imali >>> >>> >>> *From:* fieldtrip-bounces at science.ru.nl >>> [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis >>> [inieuwenhuis at berkeley.edu] >>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> A follow up on this and some new issues: >>> >>> 1) I first tried Jörn's approach by creating my own BEM, always fun to >>> make it yourself ;) However, I did not succeed since: >>> a) the dipoli method does not work on Windows >>> b) I downloaded the openmeeg toolbox, but got an error >>> "om_minverser.exe >>> has stopped working" I've emailed their buglist >>> c) bemcp did run, but the result was not ok (see attachement). I also >>> got the warning "% Warning: Matrix is singular, close to singular or >>> badly scaled. Results may be inaccurate." several times, so that might >>> be the problem. >>> d) and asa gave the following error: % Error using ft_prepare_headmodel >>> (line 201) % You must supply a valid cfg.hdmfile for use with ASA >>> headmodel >>> >>> And away went my determination to do it myself, so I continued using >>> thestandard_bem.mat >>> . >>> >>> (I did not know this existed, I've added this link to note in the >>> headmodel tutorial >>> to >>> make it easier to find, thanks Tzvetan for pointing this out!). >>> >>> 2) This worked and after some fiddling to get the electrodes aligned it >>> looks okay (see attached). >>> However, as you can see in the figures, I have several very low >>> electrodes, that are lower than the skin mesh. So I was wondering if >>> this is a problem? Since for accurate calculation of how the currents >>> flow from these low electrodes, I assume one needs the skin to go till >>> there? What happens when I have electrodes floating in thin air? >>> *So my question is:* >>> a) will this cause great inaccuracies? >>> b) if so, how can I extend the skin to go lower? The template MRI only >>> goes that far to the bottom... Trick anyone? >>> >>> Thanks again, >>> Ingrid >>> >>> >>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >>>> the wiki. >>>> Have a great day, >>>> Ingrid >>>> >>>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>>> Dear Ingrid, >>>>> >>>>> in addition to Jorn's approach since you don't have MR and digitized >>>>> elec position's you can load and realign the electrodes to the >>>>> standard bem. Subsequently you can calculate the lead field and >>>>> continue with your analysis pipeline. >>>>> Good luck >>>>> tzvetan >>>>> %% read electrodes >>>>> elec = ft_read_sens('/your >>>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>>> %% read headmodel >>>>> templateheadmodel = '/your >>>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>>> load(templateheadmodel); >>>>> %% electrode realign as good as possible >>>>> % i.e. translate 0 -2 1.5 >>>>> cfg=[]; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elec; >>>>> cfg.headshape = vol.bnd(1).pnt; >>>>> elecR = ft_electroderealign(cfg); >>>>> %% verify how the electrodes fit toghether with the brain volume >>>>> cfg=[]; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elecR; >>>>> cfg.headshape = vol.bnd(3).pnt; >>>>> elecR = ft_electroderealign(cfg); >>>>> >>>>> >>>>>> Hi Ingrid, >>>>>> >>>>>> I just happen to done this a few weeks back, I changed things in the >>>>>> meanwhile, but I hope that the below steps are complete: >>>>>> /% read in the template MRI >>>>>> if isunix >>>>>> mri = >>>>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>>>> >>>>>> elseif ispc >>>>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>>>> 'spm8', 'templates', 'T1.nii')); >>>>>> end >>>>>> >>>>>> >>>>>> % segment the MRI >>>>>> cfg = []; >>>>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>>>> segmentedmri = ft_volumesegment(cfg, mris); >>>>>> >>>>>> >>>>>> % create the headmodel (BEM) >>>>>> cfg = []; >>>>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>>>> if isunix >>>>>> cfg.method ='dipoli'; % dipoli only works under linux >>>>>> else >>>>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>>>> keyboard; >>>>>> end >>>>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>>>> >>>>>> elec = ft_read_sens('standard_1020.elc'); >>>>>> hdm = ft_convert_units(hdm, elec.unit); >>>>>> >>>>>> cfg = []; >>>>>> cfg.grid.xgrid = -125:8:125; >>>>>> cfg.grid.ygrid = -125:8:125; >>>>>> cfg.grid.zgrid = -125:8:125; >>>>>> cfg.grid.tight = 'yes'; >>>>>> cfg.grid.unit = hdm.unit; >>>>>> cfg.inwardshift = -1.5; >>>>>> cfg.vol = hdm; >>>>>> grid = ft_prepare_sourcemodel(cfg) >>>>>> grid = ft_convert_units(grid, elec.unit); >>>>>> >>>>>> figure; >>>>>> hold on; >>>>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>>>> >>>>>> % this step is not necessary, cause you will see that everything is >>>>>> already aligned >>>>>> cfg = []; >>>>>> cfg.method = 'interactive'; >>>>>> cfg.elec = elec; >>>>>> cfg.headshape = hdm.bnd(1); >>>>>> tmp = ft_electroderealign(cfg); >>>>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>>>> >>>>>> %% verify location of occipital electrodes >>>>>> >>>>>> occ_elec = elec; >>>>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>>>> elec.label); >>>>>> occ_idx = match_str(elec.label, occ_chan); >>>>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>>>> figure; >>>>>> ft_plot_sens(occ_elec) >>>>>> hold on; >>>>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>>>> >>>>>> >>>>>> Afair, that's all that is needed. Of course you need to adjust >>>>>> folder and file names. >>>>>> >>>>>> Greetings >>>>>> Jörn >>>>>> >>>>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>>>> model that is located in the FieldTrip template directory. I have >>>>>>> EGI (128 channels) data and electrode positions (not subject >>>>>>> specific, just the standard file also available in FieldTrip >>>>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>>>> to make a headmodel and volume conduction model giving only this >>>>>>> limited data. I'd be happy to make it into a example Matlab script >>>>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>>>> to give me some pointers, or example code? >>>>>>> >>>>>>> Thanks a lot! >>>>>>> Ingrid >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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 >>>>> >>>>> ******************************************* >>>>> Tzvetan Popov >>>>> Clinical Psychology >>>>> University of Konstanz >>>>> Box 23 >>>>> 78457 Konstanz, GERMANY >>>>> Phone: 0049-7531-883086 >>>>> Fax: 0049-7531-884601 >>>>> Email: tzvetan.popov at uni-konstanz.de >>>>> >>>>> ******************************************* >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 ith at deakin.edu.au Thu Apr 11 03:14:23 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 11 Apr 2013 01:14:23 +0000 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5165ADC7.6020906@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> Hi Ingrid, I had similar issues with creating my own BEM as I too did not have the individual MRI's nor the digitized electrode positions. I created a BEM using the Curry (Neuroscan) software and imported in .mat format to use with Fieldtrip. However these are also based on the MNI template. I am not sure whether this extends lower enough for your situation. I am attaching here a picture of my head model showing the skull and cortex with my registered electrodes. If you are happy with it, I am more than happy to share it with you. Please let me know. Regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ingrid Nieuwenhuis Sent: Thursday, 11 April 2013 4:22 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] source analysis EEG data without MRI Hi all, Just had a brain wave, I'll share it for people with similar situation that might be interested in this thread. I think I should just get a random structural MRI that extends lower (includes ears and bit below), optimally of a subject with a head similar to the MNI template. Make a BEM model (hmm, have to fix these errors I mentioned earlier then, well, should be doable on linux using dipoli). Then use ft_electroderealign to align the electrodes to this MRI, do the source analysis for all subjects using this model, and subsequently use ft_volumenormalise to normalize to MNI template if I want to use any atlas functionality. If anyone did this already using FieldTrip and has a pre-made BEM (just like the standard_bem), would be really nice if you're willing to share :) If not, I'll make my own, and people with low electrodes and no structural MRI and or no linux access can email me if they want to use it. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: Hi Lilla and Imali, Thanks for your replies. In my case, the problem is not the aligning. My nasion electrode is on the nasion, and Cz is on Cz, everything is where it should be. The EGI 128 electrode net really has these low electrodes, which are there specifically to make source analysis better by capturing more of the electric field. So I would have the best solution if I'd leave them there. However, in the model as derived from the MNI template, the skin part does not go down low enough. I looked at the picture after ft_prepare_vol_sens (see attachement, black is before, red is after), and indeed, this is not good. The low electrodes are squeezed up, and this will make source analysis worse. So I should indeed remove these electrodes (which is a pity), or find a better MNI template. So my question is: Does anyone know of a template in MNI space that extends more down? This template comes from SPM8, is there a version that extends lower? Or could I extend the skin roughly downwards with some triangular magic? I'm also a bit confused about the statement on this wiki page: http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem under "revision information" header "skin" is says: "This skin surface is not used in the BEM model itself for computational reasons, but can be used for visualization." But this does not seem to be the case, since my electrode positions are modified based on till where the skin goes. So the skin surface does significantly influence the source analysis. Anyway, thanks for all the help, and worse case, I just get rid of the low fellows. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 9:05 AM, Magyari, Lilla wrote: hi Ingrid and Imali, I think it is a really good question what to do in Ingrid's case. I do not know the "right" answer, but I would like to share my thoughts about it. The ft_prepare_vol_sens is indeed projects the electrode positions closer to the headsurface as Imali wrote. But this function called automatically when you create your leadfield, so you do not have to do it separately (unless you want to visualize the corrected electrode positions). However, I have been advised to rely on this projection carefully if electrode positions are far from the skin and specially, if the inaccuracies (distance from the skin) are not equally distributed across the electrodes, because that can cause a spatial bias. Therefore, my question would be: why are those electrodes so low? Are those positions reflect the actual positions of the electrodes during the measurement? If yes, I would not change their positions, I would rather try to extend my headmodel e.g. by using another template. (or another (but quite suboptimal) possibility is maybe to exclude those electrodes (and the data) from the analysis if they are anyway far from the brain.) If the position of the electrodes should be higher up on the head, then instead of relying on projection, I would try first to scale the electrodes to fit them into the headsurface with the ft_electroderealign function. I looked to the standard_bem file in the template directory, and I also load in the standard_1020.elc, and those electrodes perfectly fit the vol. So, it seems that the extension of the standard bem headsurface is suitable for the area which is covered by the those template electrodes. And I do not know if the electrode set you use should cover a larger surface of the head, or if it should be just adjusted to the given headsurface. Lilla IMALI THANUJA HETTIARACHCHI wrote: Hi Ingrid, I had a similar issue a few weeks ago, where my lower most electrodes started floating after electrode realign using the ft_electroderealign function. I used the ft_prepare_vol_sens as, [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and brought the electrodes on to the skin. Hope this helps...! Regards Imali *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis [inieuwenhuis at berkeley.edu] *Sent:* Wednesday, 10 April 2013 9:29 AM *To:* fieldtrip at science.ru.nl *Subject:* Re: [FieldTrip] source analysis EEG data without MRI Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using thestandard_bem.mat . (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? *So my question is:* a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: /% read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit))/ Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: curry_vol.jpg Type: image/jpeg Size: 15832 bytes Desc: curry_vol.jpg URL: From inieuwenhuis at berkeley.edu Thu Apr 11 05:44:40 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 20:44:40 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> Message-ID: <516631A8.1030006@berkeley.edu> Hi Imali, Tzvetan shared the bem model made from the tutorial MRI with me, that one extends to low enough, so I'm good! Thanks a lot though! Cheers, Ingird -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: > > Hi Ingrid, > > I had similar issues with creating my own BEM as I too did not have > the individual MRI's nor the digitized electrode positions. > > I created a BEM using the Curry (Neuroscan) software and imported in > .mat format to use with Fieldtrip. However these are also based on the > MNI template. > > I am not sure whether this extends lower enough for your situation. I > am attaching here a picture of my head model showing the skull and > cortex with my registered electrodes. If you are happy with it, I am > more than happy to share it with you. > > Please let me know. > > Regards > > Imali > > *From:*fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid Nieuwenhuis > *Sent:* Thursday, 11 April 2013 4:22 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > Just had a brain wave, I'll share it for people with similar situation > that might be interested in this thread. I think I should just get a > random structural MRI that extends lower (includes ears and bit > below), optimally of a subject with a head similar to the MNI > template. Make a BEM model (hmm, have to fix these errors I mentioned > earlier then, well, should be doable on linux using dipoli). Then use > ft_electroderealign to align the electrodes to this MRI, do the source > analysis for all subjects using this model, and subsequently use > ft_volumenormalise to normalize to MNI template if I want to use any > atlas functionality. > > If anyone did this already using FieldTrip and has a pre-made BEM > (just like the standard_bem), would be really nice if you're willing > to share :) > If not, I'll make my own, and people with low electrodes and no > structural MRI and or no linux access can email me if they want to use it. > > Cheers, > Ingrid > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: > > Hi Lilla and Imali, > > Thanks for your replies. In my case, the problem is not the > aligning. My nasion electrode is on the nasion, and Cz is on Cz, > everything is where it should be. The EGI 128 electrode net really > has these low electrodes, which are there specifically to make > source analysis better by capturing more of the electric field. So > I would have the best solution if I'd leave them there. However, > in the model as derived from the MNI template, the skin part does > not go down low enough. > > I looked at the picture after ft_prepare_vol_sens (see > attachement, black is before, red is after), and indeed, this is > not good. The low electrodes are squeezed up, and this will make > source analysis worse. So I should indeed remove these electrodes > (which is a pity), or find a better MNI template. > > *So my question is:* > Does anyone know of a template in MNI space that extends more > down? This template comes from SPM8, is there a version that > extends lower? Or could I extend the skin roughly downwards with > some triangular magic? > > I'm also a bit confused about the statement on this wiki page: > http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem > > under "revision information" header "skin" is says: "This skin > surface is not used in the BEM model itself for computational > reasons, but can be used for visualization." > But this does not seem to be the case, since my electrode > positions are modified based on till where the skin goes. So the > skin surface does significantly influence the source analysis. > > Anyway, thanks for all the help, and worse case, I just get rid of > the low fellows. > > Cheers, > Ingrid > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > On 4/10/2013 9:05 AM, Magyari, Lilla wrote: > > hi Ingrid and Imali, > > > I think it is a really good question what to do in Ingrid's > case. I do not know the "right" answer, but I would like to > share my thoughts about it. > > The ft_prepare_vol_sens is indeed projects the electrode > positions closer to the headsurface as Imali wrote. But this > function called automatically when you create your leadfield, > so you do not have to do it separately (unless you want to > visualize the corrected electrode positions). > > However, I have been advised to rely on this projection > carefully if electrode positions are far from the skin and > specially, if the inaccuracies (distance from the skin) are > not equally distributed across the electrodes, because that > can cause a spatial bias. > > Therefore, my question would be: why are those electrodes so > low? Are those positions reflect the actual positions of the > electrodes during the measurement? If yes, I would not change > their positions, I would rather try to extend my headmodel > e.g. by using another template. (or another (but quite > suboptimal) possibility is maybe to exclude those electrodes > (and the data) from the analysis if they are anyway far from > the brain.) > > If the position of the electrodes should be higher up on the > head, then instead of relying on projection, I would try first > to scale the electrodes to fit them into the headsurface with > the ft_electroderealign function. > > I looked to the standard_bem file in the template directory, > and I also load in the standard_1020.elc, and those electrodes > perfectly fit the vol. So, it seems that the extension of the > standard bem headsurface is suitable for the area which is > covered by the those template electrodes. And I do not know if > the electrode set you use should cover a larger surface of the > head, or if it should be just adjusted to the given headsurface. > > Lilla > > > > > IMALI THANUJA HETTIARACHCHI wrote: > > Hi Ingrid, > > I had a similar issue a few weeks ago, where my lower most > electrodes > started floating after electrode realign using the > ft_electroderealign > function. > > I used the ft_prepare_vol_sens as, > [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the > trick and > brought the electrodes on to the skin. > > Hope this helps...! > > Regards > Imali > > > *From:* fieldtrip-bounces at science.ru.nl > > [fieldtrip-bounces at science.ru.nl > ] on behalf of Ingrid > Nieuwenhuis > [inieuwenhuis at berkeley.edu ] > *Sent:* Wednesday, 10 April 2013 9:29 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > A follow up on this and some new issues: > > 1) I first tried Jörn's approach by creating my own BEM, > always fun to > make it yourself ;) However, I did not succeed since: > a) the dipoli method does not work on Windows > b) I downloaded the openmeeg toolbox, but got an error > "om_minverser.exe > has stopped working" I've emailed their buglist > c) bemcp did run, but the result was not ok (see attachement). > I also > got the warning "% Warning: Matrix is singular, close to > singular or > badly scaled. Results may be inaccurate." several times, so > that might > be the problem. > d) and asa gave the following error: % Error using > ft_prepare_headmodel > (line 201) % You must supply a valid cfg.hdmfile for use with > ASA headmodel > > And away went my determination to do it myself, so I continued > using > thestandard_bem.mat > > . > > (I did not know this existed, I've added this link to note in the > headmodel tutorial > > > to > make it easier to find, thanks Tzvetan for pointing this out!). > > 2) This worked and after some fiddling to get the electrodes > aligned it > looks okay (see attached). > However, as you can see in the figures, I have several very low > electrodes, that are lower than the skin mesh. So I was > wondering if > this is a problem? Since for accurate calculation of how the > currents > flow from these low electrodes, I assume one needs the skin to > go till > there? What happens when I have electrodes floating in thin air? > *So my question is:* > a) will this cause great inaccuracies? > b) if so, how can I extend the skin to go lower? The template > MRI only > goes that far to the bottom... Trick anyone? > > Thanks again, > Ingrid > > > On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: > > Thanks Jörn and Tzvetan for the scripts! I'll try it out and > put it on > the wiki. > Have a great day, > Ingrid > > On 4/9/2013 12:32 AM, Tzvetan Popov wrote: > > Dear Ingrid, > > in addition to Jorn's approach since you don't have MR and > digitized > elec position's you can load and realign the electrodes to the > standard bem. Subsequently you can calculate the lead field and > continue with your analysis pipeline. > Good luck > tzvetan > %% read electrodes > elec = ft_read_sens('/your > path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); > > %% read headmodel > templateheadmodel = '/your > path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; > load(templateheadmodel); > %% electrode realign as good as possible > % i.e. translate 0 -2 1.5 > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = vol.bnd(1).pnt; > elecR = ft_electroderealign(cfg); > %% verify how the electrodes fit toghether with the brain volume > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elecR; > cfg.headshape = vol.bnd(3).pnt; > elecR = ft_electroderealign(cfg); > > > > Hi Ingrid, > > I just happen to done this a few weeks back, I changed things > in the > meanwhile, but I hope that the below steps are complete: > /% read in the template MRI > if isunix > mri = > ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); > > elseif ispc > mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', > 'external', > 'spm8', 'templates', 'T1.nii')); > end > > > % segment the MRI > cfg = []; > cfg.output = {'brain' 'skull' 'scalp'}; > segmentedmri = ft_volumesegment(cfg, mris); > > > % create the headmodel (BEM) > cfg = []; > %cfg.method ='openmeeg'; % TODO FIXME download openmeeg > if isunix > cfg.method ='dipoli'; % dipoli only works under linux > else > disp('TODO FIXME stick to dipoli for now or download > openmeeg\n'); > keyboard; > end > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > elec = ft_read_sens('standard_1020.elc'); > hdm = ft_convert_units(hdm, elec.unit); > > cfg = []; > cfg.grid.xgrid = -125:8:125; > cfg.grid.ygrid = -125:8:125; > cfg.grid.zgrid = -125:8:125; > cfg.grid.tight = 'yes'; > cfg.grid.unit = hdm.unit; > cfg.inwardshift = -1.5; > cfg.vol = hdm; > grid = ft_prepare_sourcemodel(cfg) > grid = ft_convert_units(grid, elec.unit); > > figure; > hold on; > ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', > 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > ft_plot_mesh(grid.pos(grid.inside, :)); > > % this step is not necessary, cause you will see that > everything is > already aligned > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = hdm.bnd(1); > tmp = ft_electroderealign(cfg); > elec = tmp; % I had a bug here that I couldn't assign elec > directly > > %% verify location of occipital electrodes > > occ_elec = elec; > occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, > elec.label); > occ_idx = match_str(elec.label, occ_chan); > occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); > occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); > occ_elec.label = occ_elec.label(occ_idx, :); > figure; > ft_plot_sens(occ_elec) > hold on; > ft_plot_vol(ft_convert_units(hdm, elec.unit))/ > > > Afair, that's all that is needed. Of course you need to adjust > folder and file names. > > Greetings > Jörn > > On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: > > Hi all, > > I'd like to do source analysis (loreta and or DICS) on my EEG > data. > I don't have anatomical MRIs and I don't have a measurement of > the > scalp surface. So I'd like to use a template MRI or a template > head > model that is located in the FieldTrip template directory. I have > EGI (128 channels) data and electrode positions (not subject > specific, just the standard file also available in FieldTrip > electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck > how to start. I don't see any examples on the FieldTrip page > of how > to make a headmodel and volume conduction model giving only this > limited data. I'd be happy to make it into a example Matlab > script > on the FieldTrip page after I got it to work. Would someone be > able > to give me some pointers, or example code? > > Thanks a lot! > Ingrid > > > > -- > 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 > > > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > > > > ******************************************* > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 sabato45 at hotmail.com Thu Apr 11 06:07:39 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Wed, 10 Apr 2013 21:07:39 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> References: , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Message-ID: Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions?Thanks again,Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Thu Apr 11 12:09:26 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Thu, 11 Apr 2013 12:09:26 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Message-ID: <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> If I were a reviewer, I would object against such a procedure (because you are mixing up units-of-observation; see Maris, Psychophysiology, 2012). But I know people have done in the early days of fMRI analysis (concatenating the data of the multiple subjects; called a level-1 analysis in that community), but this has sparked a lot of criticisms. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: donderdag 11 april 2013 6:08 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions? Thanks again, Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris, thank you for your response. I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I have two conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulation across trials to find out whether condition 1 is different from condition 2 independently of their different number of trials. If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic. I really appreciate your help. Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolai at mersebak.dk Thu Apr 11 14:37:18 2013 From: nicolai at mersebak.dk (Nicolai Mersebak) Date: Thu, 11 Apr 2013 14:37:18 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip Message-ID: Dear all, I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. The purpose of the ICA algorithm is to remove EOG artifacts. Best, Nicolai -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Apr 11 15:21:03 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 11 Apr 2013 07:21:03 -0600 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: References: Message-ID: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> Nicolai, I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Don On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: > Dear all, > > I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. > > The purpose of the ICA algorithm is to remove EOG artifacts. > > Best, > > Nicolai > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From smoratti at psi.ucm.es Thu Apr 11 15:47:07 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 11 Apr 2013 15:47:07 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> Message-ID: <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> I think if you specify "runica" it does the same as EEGLAB. 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 11/04/2013, a las 15:21, Rojas, Don escribió: > Nicolai, > > I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > > Don > > On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: > >> Dear all, >> >> I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. >> >> The purpose of the ICA algorithm is to remove EOG artifacts. >> >> Best, >> >> Nicolai >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 sabato45 at hotmail.com Thu Apr 11 17:45:31 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Thu, 11 Apr 2013 08:45:31 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> References: , , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , , , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl>, , <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> Message-ID: Thanks for you answer and for sending along the paper. What would be the correct approach then in this case? It may be really simple, but I just don't know what to do with one p-value for every single subject. From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Thu, 11 Apr 2013 12:09:26 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence If I were a reviewer, I would object against such a procedure (because you are mixing up units-of-observation; see Maris, Psychophysiology, 2012). But I know people have done in the early days of fMRI analysis (concatenating the data of the multiple subjects; called a level-1 analysis in that community), but this has sparked a lot of criticisms. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: donderdag 11 april 2013 6:08 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions?Thanks again,Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Thu Apr 11 20:30:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Thu, 11 Apr 2013 11:30:31 -0700 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? Message-ID: <51670147.4080803@berkeley.edu> Hi all, When I follow the code according to the example matlab script "Create MNI-aligned grids in individual head-space" something goes all wrong with the units. I've followed the code (pasted below, from the wiki), but when I make the figure with the template head model and dipole grid, it's wrong (see attached ..._problem.png). The dipole grid is tiny in the bottom of the head model. The black area is the dipole grid, not good. template_grid = xgrid: [1x41 double] ygrid: [1x41 double] zgrid: [1x41 double] dim: [41 41 41] pos: [68921x3 double] unit: 'mm' inside: [1x68910 double] outside: [758 759 760 761 799 800 801 802 843 884 925] cfg: [1x1 struct] It's a problem with the units, because the template grid has 'mm' in the unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos field by 10, the grid is not tight (see attached ..._multiplied10.png). It looks like the unit problem messed up the determination of what's inside and outside. As you can see in the template_grid, there are only a few grid point outside, which is clearly not correct (maybe inside/outside was determined on wrong units?). So, it looks like a bug to me, or am I doing something wrong? I'm using the newest FT version. Thanks, Ingrid %%% CODE FROM WIKI %%% template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', filesep,'templates', filesep,'T1.nii']); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): this is needed % for the inside/outside detection of voxels. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates % the source units are in cm % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol); ft_plot_mesh(template_grid); -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- A non-text attachment was scrubbed... Name: templatehead_dipolegrid_problem.png Type: image/png Size: 19636 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: templatehead_dipolegrid_multiplied10.png Type: image/png Size: 9051 bytes Desc: not available URL: From nicolai at mersebak.dk Thu Apr 11 20:41:49 2013 From: nicolai at mersebak.dk (Nicolai Mersebak) Date: Thu, 11 Apr 2013 20:41:49 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> Message-ID: <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> Thank you for the responds. @Don, sorry for my choice of word. I differently meant some of the routines and not the whole package! Maybe I wasn't clear enough. I don't mean the usually ICA algorithms (e.g runica), where you manually reject ICA components after running the algorithm. There are some plugins in EEGLAB, where the artifact removal of EOG is automatic using ICA. Most often you are using it, when you have multiple subjects and don't have time to go through all subjects manually. So my question is if someone has tried to use an automatic artifact removal algorithm based on ICA in fieldtrip? An example is the FASTER plugin in EEGLAB - http://sccn.ucsd.edu/wiki/EEGLAB_Plugins. Best, Nicolai Den 11/04/2013 kl. 15.47 skrev smoratti at psi.ucm.es: > > I think if you specify "runica" it does the same as EEGLAB. > > 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 11/04/2013, a las 15:21, Rojas, Don escribió: > >> Nicolai, >> >> I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts >> >> Don >> >> On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: >> >>> Dear all, >>> >>> I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. >>> >>> The purpose of the ICA algorithm is to remove EOG artifacts. >>> >>> Best, >>> >>> Nicolai >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 Don.Rojas at ucdenver.edu Thu Apr 11 21:28:13 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 11 Apr 2013 13:28:13 -0600 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> Message-ID: No worries - I'm not a developer. I meant to include a smiley to imply my cheekiness, but left that out. I'm afraid I'm not familiar enough with the eeglab software, and in particular the plugin you mention, to address your question about ica-based automated artifact removal, but fieldtrip does have some automated artifact rejection routines that I do not use and can't comment on intelligently. See here in the wiki: http://fieldtrip.fcdonders.nl/tutorial/automatic_artifact_rejection Best, Don On Apr 11, 2013, at 12:41 PM, Nicolai Mersebak > wrote: Thank you for the responds. @Don, sorry for my choice of word. I differently meant some of the routines and not the whole package! Maybe I wasn't clear enough. I don't mean the usually ICA algorithms (e.g runica), where you manually reject ICA components after running the algorithm. There are some plugins in EEGLAB, where the artifact removal of EOG is automatic using ICA. Most often you are using it, when you have multiple subjects and don't have time to go through all subjects manually. So my question is if someone has tried to use an automatic artifact removal algorithm based on ICA in fieldtrip? An example is the FASTER plugin in EEGLAB - http://sccn.ucsd.edu/wiki/EEGLAB_Plugins. Best, Nicolai Den 11/04/2013 kl. 15.47 skrev smoratti at psi.ucm.es: I think if you specify "runica" it does the same as EEGLAB. 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 11/04/2013, a las 15:21, Rojas, Don escribió: Nicolai, I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Don On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak > wrote: Dear all, I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. The purpose of the ICA algorithm is to remove EOG artifacts. Best, Nicolai _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ricardoojm at gmail.com Thu Apr 11 21:40:37 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Thu, 11 Apr 2013 16:40:37 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi, I had to re-install ubuntu in order to provide more space for the analysis (since I was having the problem with the temporary files, which might have been too large for my ubuntu partition). But now the problem I have with the "ft_prepare_headmodel" is even weirder than before. The program now is complaining that there is no dipoli for my system: cfg = []; cfg.method ='dipoli'; vol = ft_prepare_headmodel(cfg, segmentedmri); ??? Error using ==> ft_headmodel_dipoli at 138 there is no dipoli executable for your platform Error in ==> ft_prepare_headmodel at 226 vol = ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); I am running this script in a 2010b matlab version, installed in ubuntu 12.04. It should be working fine, right? Thanks in advance, Ricardo On 28 March 2013 14:39, Ricardo Moura wrote: > Hi Jörn, > thank you very much for your response! > I checked the segmentation and everything seems to be ok (as far as I can > say... No error messages were shown during the processing and I checked the > generated objects and plots). > > But I had a strange error while preparing the head model. Somehow the > command cannot find the dipoli files, even thought they are really where > they should be. And the second message > ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue > of what it means. > > And I am running this command on a ubuntu 12.04 32-bit. > > Do you have any idea of how I can solve it? > > Thanks once again,Best, > Ricardo > > using the executable > "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" > /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: > /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: > /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: > not found > Warning: an error ocurred while running dipoli > > In ft_headmodel_dipoli at 201 > In ft_prepare_headmodel at 226 > > Error using fread > Invalid file identifier. Use fopen to generate a valid file identifier. > Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > > In ft_headmodel_dipoli at 209 > In ft_prepare_headmodel at 226 > > > On 27 March 2013 13:10, Ricardo Moura wrote: > >> Dear all >> I am creating a BEM model for eeg, following the appropriate tutorial, >> but I have a problem when preparing the headmodel. The output I have from >> the ft_prepare_headmodel command does not contain the "mat", and so, when I >> try to generate the leadfield, it returns an error message due to non >> existent "mat". I saw that other users had similar problem, but I haven't >> found a solution though. So, what is wrong with my script? >> >> Thanks a lot in advance! >> Best, >> Ricardo >> >> >> >> >> load standard_mri.mat >> mri_orig=mri; >> disp(mri) >> >> % Segmenting the data >> cfg = []; >> cfg.output= {'scalp','skull','brain'}; >> segmentedmri = ft_volumesegment(cfg, mri_orig); >> disp(segmentedmri) >> save segmentedmri segmentedmri >> >> % MESH >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.numvertices = [3000 2000 1000]; >> bnd=ft_prepare_mesh(cfg,segmentedmri); >> disp(bnd(1)) >> >> % Head Model = variavel vol >> cfg = []; >> cfg.method ='bem_dipoli'; %dipoli singlesphere >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> disp(vol) >> bnd: [1x3 struct] >> cond: [0.3300 0.0041 0.3300] >> skin_surface: 1 >> source: 3 >> type: 'dipoli' >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdien07 at mac.com Fri Apr 12 05:46:47 2013 From: jdien07 at mac.com (Joseph Dien) Date: Thu, 11 Apr 2013 23:46:47 -0400 Subject: [FieldTrip] =?windows-1252?q?Faculty_Research_Assistant_=96_Maryl?= =?windows-1252?q?and_Neuroimaging_Center?= Message-ID: <59162179-C399-4872-90A3-F28AD66DADB7@mac.com> The Neuroscience and Cognitive Sciences Program (NACS) at the University of Maryland College Park is seeking a full-time post baccalaureate faculty research assistant for the Maryland Neuroimaging Center (MNC). The MNC FRA is expected to learn to operate a Siemens 3T MRI machine, to assist on research projects using the MRI machine, assist the MR Physicist as needed in ongoing use and maintenance of the MRI machine and assist as needed with the efforts of the center. The university is establishing a fully-equipped brain imaging center around a new Siemens 3T Trio MRI system. In the future, the MNC will include MEG, and high density EEG facilities. This is a full-time, contractual and benefits eligible position. Salary and benefits are competitive. Start date is late spring, early summer 2013. For best consideration, please electronically submit a resume, cover letter with a description of education, any research experience and computer expertise, and three references by May 17, 2013 to jcgorski at umd.edu with “FRA Search” as the subject line. The Maryland Neuroimaging Center (MNC) is the home for neuroimaging research at the University of Maryland. Housed in a spacious new facility in the Gudelsky Building, adjacent to the main College Park campus, the center has been designed to foster collaboration among neuroscientists, psychologists, cognitive scientists, engineers, and physicists. The MNC is an initiative of the University's interdepartmental Neuroscience and Cognitive Science (NACS) Program, www.nacs.umd.edu. General Description: To assist the MR Physicist as needed in the ongoing use and maintenance of the MRI machine. Primary duties and responsibilities include: Perform research MRI scanning protocols, archive and network-transfer research data. Develop and maintain databases. Coordinate and assist with scheduling. Work with MR Physicist to develop QA/QC procedures. Scan research subjects and phantoms in various MRI scanning environments to include QA/QC. Coordinate and manage scheduling of the scanner in conjunction with MR Physicist and MNC staff. Keep the scanners and control areas supplied and neat. Oversee and maintain the highest standard of safety in the MRI environment for research subjects, UMD staff and equipment. Archive study data and transfer in various modalities. Test and maintain emergency equipment and supplies. Resolve scan and other equipment malfunction issues expeditiously. Order supplies and equipment as necessary. Additional special projects as assigned. Qualifications: College degree required. Applicants must have a strong science background and a B.S. degree, preferably in biomedical sciences, engineering, psychology or neuroscience. Experience with diverse computer environments and other electronic equipment is desirable, as well as basic familiarity with computer programming and/or operating systems (e.g. Linux). Knowledge of MRI scanners/equipment is desirable, preferably the Siemens 3T trio system. We are seeking an individual with experience working in an academic environment, preferably in human subject research. Experience with software/hardware used in human research, including psychophysiology, EEG, MEG is a strong asset. This position is ideal for a recent graduate looking to gain research experience before pursuing long term career options and/or further education. The newly hired person will be trained by current MNC staff on use and maintenance of the scanner. Applicant must demonstrate technical inclination, basic troubleshooting skills, and willingness to learn, and possess a positive, team-oriented attitude. This position requires an individual that is extremely reliable and responsible yet flexible. Must be able to take initiative to implement positive changes, solve problems, and work independently. Strong verbal and written communication skills are required. The University of Maryland is an equal opportunity/affirmative action employer. Women and minorities are encouraged to apply. -------------------------------------------------------------------------------- Joseph Dien, Senior Research Scientist University of Maryland E-mail: jdien07 at mac.com Phone: 301-226-8848 Fax: 301-226-8811 http://joedien.com// -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Fri Apr 12 08:06:32 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Diego Lozano Soldevilla) Date: Fri, 12 Apr 2013 08:06:32 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: <51670147.4080803@berkeley.edu> References: <51670147.4080803@berkeley.edu> Message-ID: Hi Ingrid, I had similar problem with MEG and changing the units with ft_convert_units solved the issue: vol = ft_convert_units(vol,'cm') If not, please file a bug with a piece of data and I'll have a look, best, Diego On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > Hi all, > > When I follow the code according to the example matlab script "Create > MNI-aligned grids in individual head-space" something goes all wrong with > the units. > > I've followed the code (pasted below, from the wiki), but when I make the > figure with the template head model and dipole grid, it's wrong (see > attached ..._problem.png). The dipole grid is tiny in the bottom of the > head model. The black area is the dipole grid, not good. > template_grid = > xgrid: [1x41 double] > ygrid: [1x41 double] > zgrid: [1x41 double] > dim: [41 41 41] > pos: [68921x3 double] > unit: 'mm' > inside: [1x68910 double] > outside: [758 759 760 761 799 800 801 802 843 884 925] > cfg: [1x1 struct] > > It's a problem with the units, because the template grid has 'mm' in the > unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the > numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos > field by 10, the grid is not tight (see attached ..._multiplied10.png). It > looks like the unit problem messed up the determination of what's inside > and outside. As you can see in the template_grid, there are only a few grid > point outside, which is clearly not correct (maybe inside/outside was > determined on wrong units?). > > So, it looks like a bug to me, or am I doing something wrong? I'm using > the newest FT version. > > Thanks, > Ingrid > > %%% CODE FROM WIKI %%% > template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', > filesep,'templates', filesep,'T1.nii']); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol); > ft_plot_mesh(template_grid); > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.tewoerd at fcdonders.ru.nl Fri Apr 12 10:14:43 2013 From: e.tewoerd at fcdonders.ru.nl (Erik te Woerd) Date: Fri, 12 Apr 2013 10:14:43 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? Message-ID: Hi Ingrid, I also encountered this problem when following the tutorial, but was able to solve it in the way Diego suggests it below. While following the tutorial, all variables should be returned with corresponding units, but in ft_prepare_headmodel this doesn't work. I reported it already to bugzilla and it's being looked after... Best, Erik 2013/4/12 Diego Lozano Soldevilla > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > >> Hi all, >> >> When I follow the code according to the example matlab script "Create >> MNI-aligned grids in individual head-space" something goes all wrong with >> the units. >> >> I've followed the code (pasted below, from the wiki), but when I make the >> figure with the template head model and dipole grid, it's wrong (see >> attached ..._problem.png). The dipole grid is tiny in the bottom of the >> head model. The black area is the dipole grid, not good. >> template_grid = >> xgrid: [1x41 double] >> ygrid: [1x41 double] >> zgrid: [1x41 double] >> dim: [41 41 41] >> pos: [68921x3 double] >> unit: 'mm' >> inside: [1x68910 double] >> outside: [758 759 760 761 799 800 801 802 843 884 925] >> cfg: [1x1 struct] >> >> It's a problem with the units, because the template grid has 'mm' in the >> unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the >> numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos >> field by 10, the grid is not tight (see attached ..._multiplied10.png). It >> looks like the unit problem messed up the determination of what's inside >> and outside. As you can see in the template_grid, there are only a few grid >> point outside, which is clearly not correct (maybe inside/outside was >> determined on wrong units?). >> >> So, it looks like a bug to me, or am I doing something wrong? I'm using >> the newest FT version. >> >> Thanks, >> Ingrid >> >> %%% CODE FROM WIKI %%% >> template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', >> filesep,'templates', filesep,'T1.nii']); >> template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the >> coordinate system >> >> % segment the template brain and construct a volume conduction model >> (i.e. head model): this is needed >> % for the inside/outside detection of voxels. >> cfg = []; >> template_seg = ft_volumesegment(cfg, template); >> >> cfg = []; >> cfg.method = 'singleshell'; >> template_vol = ft_prepare_headmodel(cfg, template_seg); >> >> % construct the dipole grid in the template brain coordinates >> % the source units are in cm >> % the negative inwardshift means an outward shift of the brain surface >> for inside/outside detection >> cfg = []; >> cfg.grid.xgrid = -20:1:20; >> cfg.grid.ygrid = -20:1:20; >> cfg.grid.zgrid = -20:1:20; >> cfg.grid.unit = 'cm'; >> cfg.grid.tight = 'yes'; >> cfg.inwardshift = -1.5; >> cfg.vol = template_vol; >> template_grid = ft_prepare_sourcemodel(cfg); >> >> % make a figure with the template head model and dipole grid >> figure >> hold on >> ft_plot_vol(template_vol); >> ft_plot_mesh(template_grid); >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 Lilla.Magyari at mpi.nl Fri Apr 12 14:54:16 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 12 Apr 2013 14:54:16 +0200 (CEST) Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <51149.131.174.45.70.1365771256.squirrel@131.174.45.70> hi Ricardo, The dipoli method works on Mac and Linux. I guess it should work also on Ubuntu, but I do not know if ever anyone tested it. It seems to me from the error message that the problem is that the code does not return the right path for the file with the binary code of this method. The path is important, because different executable file is called depending on the operation system. The operation system is identified by the mexext matlab command in the script of ft_headmodel_dipoli. What do you get when you type in mexext in your matlab command line? Lilla > Hi, > > I had to re-install ubuntu in order to provide more space for the analysis > (since I was having the problem with the temporary files, which might have > been too large for my ubuntu partition). > But now the problem I have with the "ft_prepare_headmodel" is even weirder > than before. The program now is complaining that there is no dipoli for my > system: > > > cfg = []; > cfg.method ='dipoli'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > > ??? Error using ==> ft_headmodel_dipoli at 138 > there is no dipoli executable for your platform > > Error in ==> ft_prepare_headmodel at 226 > vol > ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); > > > I am running this script in a 2010b matlab version, installed in ubuntu > 12.04. It should be working fine, right? > > Thanks in advance, > Ricardo > > > On 28 March 2013 14:39, Ricardo Moura wrote: > >> Hi Jörn, >> thank you very much for your response! >> I checked the segmentation and everything seems to be ok (as far as I >> can >> say... No error messages were shown during the processing and I checked >> the >> generated objects and plots). >> >> But I had a strange error while preparing the head model. Somehow the >> command cannot find the dipoli files, even thought they are really where >> they should be. And the second message >> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no >> clue >> of what it means. >> >> And I am running this command on a ubuntu 12.04 32-bit. >> >> Do you have any idea of how I can solve it? >> >> Thanks once again,Best, >> Ricardo >> >> using the executable >> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >> not found >> Warning: an error ocurred while running dipoli >> > In ft_headmodel_dipoli at 201 >> In ft_prepare_headmodel at 226 >> >> Error using fread >> Invalid file identifier. Use fopen to generate a valid file identifier. >> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >> found. >> > In ft_headmodel_dipoli at 209 >> In ft_prepare_headmodel at 226 >> >> >> On 27 March 2013 13:10, Ricardo Moura wrote: >> >>> Dear all >>> I am creating a BEM model for eeg, following the appropriate tutorial, >>> but I have a problem when preparing the headmodel. The output I have >>> from >>> the ft_prepare_headmodel command does not contain the "mat", and so, >>> when I >>> try to generate the leadfield, it returns an error message due to non >>> existent "mat". I saw that other users had similar problem, but I >>> haven't >>> found a solution though. So, what is wrong with my script? >>> >>> Thanks a lot in advance! >>> Best, >>> Ricardo >>> >>> >>> >>> >>> load standard_mri.mat >>> mri_orig=mri; >>> disp(mri) >>> >>> % Segmenting the data >>> cfg = []; >>> cfg.output= {'scalp','skull','brain'}; >>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>> disp(segmentedmri) >>> save segmentedmri segmentedmri >>> >>> % MESH >>> cfg=[]; >>> cfg.tissue={'brain','skull','scalp'}; >>> cfg.numvertices = [3000 2000 1000]; >>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>> disp(bnd(1)) >>> >>> % Head Model = variavel vol >>> cfg = []; >>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> >>> >> disp(vol) >>> bnd: [1x3 struct] >>> cond: [0.3300 0.0041 0.3300] >>> skin_surface: 1 >>> source: 3 >>> type: 'dipoli' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Lilla.Magyari at mpi.nl Fri Apr 12 17:03:11 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 12 Apr 2013 17:03:11 +0200 (CEST) Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <516631A8.1030006@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> Message-ID: <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> hi Ingrid, I would like to comment on this because I have been discussing this with Robert, and we thought that for the lower electrodes, it is still not optimal when only the skin is extended which is more conductive then the skull. I have attached two images for illustration. The FT segmentation will produce the segmentation in origskull.jpg. This is fine when the electrodes do not extend lower than the skull. When the electrodes are lower, a segmentation like the one in extendedskull.jpg is probably more useful. I created this extended skull based on the skin segmentation with the imerode function of the matlab image processing toolbox (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). Best, Lilla > Hi Imali, > > Tzvetan shared the bem model made from the tutorial MRI with me, that > one extends to low enough, so I'm good! Thanks a lot though! > > Cheers, > Ingird > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >> >> Hi Ingrid, >> >> I had similar issues with creating my own BEM as I too did not have >> the individual MRI's nor the digitized electrode positions. >> >> I created a BEM using the Curry (Neuroscan) software and imported in >> .mat format to use with Fieldtrip. However these are also based on the >> MNI template. >> >> I am not sure whether this extends lower enough for your situation. I >> am attaching here a picture of my head model showing the skull and >> cortex with my registered electrodes. If you are happy with it, I am >> more than happy to share it with you. >> >> Please let me know. >> >> Regards >> >> Imali >> >> *From:*fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >> Nieuwenhuis >> *Sent:* Thursday, 11 April 2013 4:22 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> Just had a brain wave, I'll share it for people with similar situation >> that might be interested in this thread. I think I should just get a >> random structural MRI that extends lower (includes ears and bit >> below), optimally of a subject with a head similar to the MNI >> template. Make a BEM model (hmm, have to fix these errors I mentioned >> earlier then, well, should be doable on linux using dipoli). Then use >> ft_electroderealign to align the electrodes to this MRI, do the source >> analysis for all subjects using this model, and subsequently use >> ft_volumenormalise to normalize to MNI template if I want to use any >> atlas functionality. >> >> If anyone did this already using FieldTrip and has a pre-made BEM >> (just like the standard_bem), would be really nice if you're willing >> to share :) >> If not, I'll make my own, and people with low electrodes and no >> structural MRI and or no linux access can email me if they want to use >> it. >> >> Cheers, >> Ingrid >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >> >> Hi Lilla and Imali, >> >> Thanks for your replies. In my case, the problem is not the >> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >> everything is where it should be. The EGI 128 electrode net really >> has these low electrodes, which are there specifically to make >> source analysis better by capturing more of the electric field. So >> I would have the best solution if I'd leave them there. However, >> in the model as derived from the MNI template, the skin part does >> not go down low enough. >> >> I looked at the picture after ft_prepare_vol_sens (see >> attachement, black is before, red is after), and indeed, this is >> not good. The low electrodes are squeezed up, and this will make >> source analysis worse. So I should indeed remove these electrodes >> (which is a pity), or find a better MNI template. >> >> *So my question is:* >> Does anyone know of a template in MNI space that extends more >> down? This template comes from SPM8, is there a version that >> extends lower? Or could I extend the skin roughly downwards with >> some triangular magic? >> >> I'm also a bit confused about the statement on this wiki page: >> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >> >> under "revision information" header "skin" is says: "This skin >> surface is not used in the BEM model itself for computational >> reasons, but can be used for visualization." >> But this does not seem to be the case, since my electrode >> positions are modified based on till where the skin goes. So the >> skin surface does significantly influence the source analysis. >> >> Anyway, thanks for all the help, and worse case, I just get rid of >> the low fellows. >> >> Cheers, >> Ingrid >> >> >> -- >> >> Ingrid Nieuwenhuis PhD >> >> Postdoctoral Fellow >> >> Sleep and Neuroimaging Laboratory >> >> Department of Psychology >> >> University of California, Berkeley >> >> California 94720-1650 >> >> Tolman Hall, room 5305 >> >> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >> >> hi Ingrid and Imali, >> >> >> I think it is a really good question what to do in Ingrid's >> case. I do not know the "right" answer, but I would like to >> share my thoughts about it. >> >> The ft_prepare_vol_sens is indeed projects the electrode >> positions closer to the headsurface as Imali wrote. But this >> function called automatically when you create your leadfield, >> so you do not have to do it separately (unless you want to >> visualize the corrected electrode positions). >> >> However, I have been advised to rely on this projection >> carefully if electrode positions are far from the skin and >> specially, if the inaccuracies (distance from the skin) are >> not equally distributed across the electrodes, because that >> can cause a spatial bias. >> >> Therefore, my question would be: why are those electrodes so >> low? Are those positions reflect the actual positions of the >> electrodes during the measurement? If yes, I would not change >> their positions, I would rather try to extend my headmodel >> e.g. by using another template. (or another (but quite >> suboptimal) possibility is maybe to exclude those electrodes >> (and the data) from the analysis if they are anyway far from >> the brain.) >> >> If the position of the electrodes should be higher up on the >> head, then instead of relying on projection, I would try first >> to scale the electrodes to fit them into the headsurface with >> the ft_electroderealign function. >> >> I looked to the standard_bem file in the template directory, >> and I also load in the standard_1020.elc, and those electrodes >> perfectly fit the vol. So, it seems that the extension of the >> standard bem headsurface is suitable for the area which is >> covered by the those template electrodes. And I do not know if >> the electrode set you use should cover a larger surface of the >> head, or if it should be just adjusted to the given headsurface. >> >> Lilla >> >> >> >> >> IMALI THANUJA HETTIARACHCHI wrote: >> >> Hi Ingrid, >> >> I had a similar issue a few weeks ago, where my lower most >> electrodes >> started floating after electrode realign using the >> ft_electroderealign >> function. >> >> I used the ft_prepare_vol_sens as, >> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >> trick and >> brought the electrodes on to the skin. >> >> Hope this helps...! >> >> Regards >> Imali >> >> >> *From:* fieldtrip-bounces at science.ru.nl >> >> [fieldtrip-bounces at science.ru.nl >> ] on behalf of Ingrid >> Nieuwenhuis >> [inieuwenhuis at berkeley.edu ] >> *Sent:* Wednesday, 10 April 2013 9:29 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> A follow up on this and some new issues: >> >> 1) I first tried Jörn's approach by creating my own BEM, >> always fun to >> make it yourself ;) However, I did not succeed since: >> a) the dipoli method does not work on Windows >> b) I downloaded the openmeeg toolbox, but got an error >> "om_minverser.exe >> has stopped working" I've emailed their buglist >> c) bemcp did run, but the result was not ok (see attachement). >> I also >> got the warning "% Warning: Matrix is singular, close to >> singular or >> badly scaled. Results may be inaccurate." several times, so >> that might >> be the problem. >> d) and asa gave the following error: % Error using >> ft_prepare_headmodel >> (line 201) % You must supply a valid cfg.hdmfile for use with >> ASA headmodel >> >> And away went my determination to do it myself, so I continued >> using >> thestandard_bem.mat >> >> . >> >> (I did not know this existed, I've added this link to note in >> the >> headmodel tutorial >> >> >> to >> make it easier to find, thanks Tzvetan for pointing this out!). >> >> 2) This worked and after some fiddling to get the electrodes >> aligned it >> looks okay (see attached). >> However, as you can see in the figures, I have several very low >> electrodes, that are lower than the skin mesh. So I was >> wondering if >> this is a problem? Since for accurate calculation of how the >> currents >> flow from these low electrodes, I assume one needs the skin to >> go till >> there? What happens when I have electrodes floating in thin air? >> *So my question is:* >> a) will this cause great inaccuracies? >> b) if so, how can I extend the skin to go lower? The template >> MRI only >> goes that far to the bottom... Trick anyone? >> >> Thanks again, >> Ingrid >> >> >> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >> >> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >> put it on >> the wiki. >> Have a great day, >> Ingrid >> >> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >> >> Dear Ingrid, >> >> in addition to Jorn's approach since you don't have MR and >> digitized >> elec position's you can load and realign the electrodes to the >> standard bem. Subsequently you can calculate the lead field and >> continue with your analysis pipeline. >> Good luck >> tzvetan >> %% read electrodes >> elec = ft_read_sens('/your >> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >> >> %% read headmodel >> templateheadmodel = '/your >> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >> load(templateheadmodel); >> %% electrode realign as good as possible >> % i.e. translate 0 -2 1.5 >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = vol.bnd(1).pnt; >> elecR = ft_electroderealign(cfg); >> %% verify how the electrodes fit toghether with the brain volume >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elecR; >> cfg.headshape = vol.bnd(3).pnt; >> elecR = ft_electroderealign(cfg); >> >> >> >> Hi Ingrid, >> >> I just happen to done this a few weeks back, I changed things >> in the >> meanwhile, but I hope that the below steps are complete: >> /% read in the template MRI >> if isunix >> mri = >> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >> >> elseif ispc >> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >> 'external', >> 'spm8', 'templates', 'T1.nii')); >> end >> >> >> % segment the MRI >> cfg = []; >> cfg.output = {'brain' 'skull' 'scalp'}; >> segmentedmri = ft_volumesegment(cfg, mris); >> >> >> % create the headmodel (BEM) >> cfg = []; >> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >> if isunix >> cfg.method ='dipoli'; % dipoli only works under linux >> else >> disp('TODO FIXME stick to dipoli for now or download >> openmeeg\n'); >> keyboard; >> end >> hdm = ft_prepare_headmodel(cfg, segmentedmri); >> >> elec = ft_read_sens('standard_1020.elc'); >> hdm = ft_convert_units(hdm, elec.unit); >> >> cfg = []; >> cfg.grid.xgrid = -125:8:125; >> cfg.grid.ygrid = -125:8:125; >> cfg.grid.zgrid = -125:8:125; >> cfg.grid.tight = 'yes'; >> cfg.grid.unit = hdm.unit; >> cfg.inwardshift = -1.5; >> cfg.vol = hdm; >> grid = ft_prepare_sourcemodel(cfg) >> grid = ft_convert_units(grid, elec.unit); >> >> figure; >> hold on; >> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> ft_plot_mesh(grid.pos(grid.inside, :)); >> >> % this step is not necessary, cause you will see that >> everything is >> already aligned >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = hdm.bnd(1); >> tmp = ft_electroderealign(cfg); >> elec = tmp; % I had a bug here that I couldn't assign elec >> directly >> >> %% verify location of occipital electrodes >> >> occ_elec = elec; >> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >> elec.label); >> occ_idx = match_str(elec.label, occ_chan); >> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >> occ_elec.label = occ_elec.label(occ_idx, :); >> figure; >> ft_plot_sens(occ_elec) >> hold on; >> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >> >> >> Afair, that's all that is needed. Of course you need to adjust >> folder and file names. >> >> Greetings >> Jörn >> >> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >> >> Hi all, >> >> I'd like to do source analysis (loreta and or DICS) on my EEG >> data. >> I don't have anatomical MRIs and I don't have a measurement of >> the >> scalp surface. So I'd like to use a template MRI or a template >> head >> model that is located in the FieldTrip template directory. I >> have >> EGI (128 channels) data and electrode positions (not subject >> specific, just the standard file also available in FieldTrip >> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >> how to start. I don't see any examples on the FieldTrip page >> of how >> to make a headmodel and volume conduction model giving only this >> limited data. I'd be happy to make it into a example Matlab >> script >> on the FieldTrip page after I got it to work. Would someone be >> able >> to give me some pointers, or example code? >> >> Thanks a lot! >> Ingrid >> >> >> >> -- >> 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 >> >> >> ******************************************* >> Tzvetan Popov >> Clinical Psychology >> University of Konstanz >> Box 23 >> 78457 Konstanz, GERMANY >> Phone: 0049-7531-883086 >> Fax: 0049-7531-884601 >> Email: tzvetan.popov at uni-konstanz.de >> >> >> >> ******************************************* >> >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- A non-text attachment was scrubbed... Name: origskull.jpg Type: image/jpeg Size: 67045 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: extendedskull.jpg Type: image/jpeg Size: 69863 bytes Desc: not available URL: From ricardoojm at gmail.com Fri Apr 12 18:39:10 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Fri, 12 Apr 2013 13:39:10 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Lilla, Thank you very much for your reply. It returns "mexglx", which is expected for a linux system, right? I tried to change the path by my self in the ft_headmodel_dipoli but it didnt work. Do you know how can I change it properly? Best wishes Ricardo On 11 April 2013 16:40, Ricardo Moura wrote: > Hi, > > I had to re-install ubuntu in order to provide more space for the analysis > (since I was having the problem with the temporary files, which might have > been too large for my ubuntu partition). > But now the problem I have with the "ft_prepare_headmodel" is even > weirder than before. The program now is complaining that there is no dipoli > for my system: > > > cfg = []; > cfg.method ='dipoli'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > > ??? Error using ==> ft_headmodel_dipoli at 138 > there is no dipoli executable for your platform > > Error in ==> ft_prepare_headmodel at 226 > vol = > ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); > > > I am running this script in a 2010b matlab version, installed in ubuntu > 12.04. It should be working fine, right? > > Thanks in advance, > Ricardo > > > On 28 March 2013 14:39, Ricardo Moura wrote: > >> Hi Jörn, >> thank you very much for your response! >> I checked the segmentation and everything seems to be ok (as far as I can >> say... No error messages were shown during the processing and I checked the >> generated objects and plots). >> >> But I had a strange error while preparing the head model. Somehow the >> command cannot find the dipoli files, even thought they are really where >> they should be. And the second message >> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue >> of what it means. >> >> And I am running this command on a ubuntu 12.04 32-bit. >> >> Do you have any idea of how I can solve it? >> >> Thanks once again,Best, >> Ricardo >> >> using the executable >> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >> not found >> Warning: an error ocurred while running dipoli >> > In ft_headmodel_dipoli at 201 >> In ft_prepare_headmodel at 226 >> >> Error using fread >> Invalid file identifier. Use fopen to generate a valid file identifier. >> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >> found. >> > In ft_headmodel_dipoli at 209 >> In ft_prepare_headmodel at 226 >> >> >> On 27 March 2013 13:10, Ricardo Moura wrote: >> >>> Dear all >>> I am creating a BEM model for eeg, following the appropriate tutorial, >>> but I have a problem when preparing the headmodel. The output I have from >>> the ft_prepare_headmodel command does not contain the "mat", and so, when I >>> try to generate the leadfield, it returns an error message due to non >>> existent "mat". I saw that other users had similar problem, but I haven't >>> found a solution though. So, what is wrong with my script? >>> >>> Thanks a lot in advance! >>> Best, >>> Ricardo >>> >>> >>> >>> >>> load standard_mri.mat >>> mri_orig=mri; >>> disp(mri) >>> >>> % Segmenting the data >>> cfg = []; >>> cfg.output= {'scalp','skull','brain'}; >>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>> disp(segmentedmri) >>> save segmentedmri segmentedmri >>> >>> % MESH >>> cfg=[]; >>> cfg.tissue={'brain','skull','scalp'}; >>> cfg.numvertices = [3000 2000 1000]; >>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>> disp(bnd(1)) >>> >>> % Head Model = variavel vol >>> cfg = []; >>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> >>> >> disp(vol) >>> bnd: [1x3 struct] >>> cond: [0.3300 0.0041 0.3300] >>> skin_surface: 1 >>> source: 3 >>> type: 'dipoli' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Fri Apr 12 19:51:34 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Fri, 12 Apr 2013 10:51:34 -0700 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: References: Message-ID: <516849A6.2080604@berkeley.edu> Thanks both, I do agree it's a bug then, because the units are known to the functions and they should not behave like this. The units should be converted automatically, or an error should appear telling the user to convert units to match. Anyway, a bugs already filed and a work around is possible, so all good. By the way, I also found a way around my self that might be useful for others to know. There are templates in FieldTrip now (great all this pre-made stuff). So I just did below, and voila :) Thanks, Ingrid %%% my work around %%% load('standard_sourcemodel3d7point5mm') % read the single subject anatomical MRI mri = ft_read_mri(['D:\FT_DATA\Subject01', filesep, 'Subject01.mri']); % create the subject specific grid, using the template grid that has just been loaded cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.sourceunits = 'mm'; grid = ft_prepare_sourcemodel(cfg); On 4/12/2013 1:14 AM, Erik te Woerd wrote: > Hi Ingrid, > > I also encountered this problem when following the tutorial, but was > able to solve it in the way Diego suggests it below. While following > the tutorial, all variables should be returned with corresponding > units, but in ft_prepare_headmodel this doesn't work. > I reported it already to bugzilla and it's being looked after... > > Best, > > Erik > > > 2013/4/12 Diego Lozano Soldevilla > > > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis > > wrote: > > Hi all, > > When I follow the code according to the example matlab script > "Create MNI-aligned grids in individual head-space" something > goes all wrong with the units. > > I've followed the code (pasted below, from the wiki), but when > I make the figure with the template head model and dipole > grid, it's wrong (see attached ..._problem.png). The dipole > grid is tiny in the bottom of the head model. The black area > is the dipole grid, not good. > template_grid = > xgrid: [1x41 double] > ygrid: [1x41 double] > zgrid: [1x41 double] > dim: [41 41 41] > pos: [68921x3 double] > unit: 'mm' > inside: [1x68910 double] > outside: [758 759 760 761 799 800 801 802 843 884 925] > cfg: [1x1 struct] > > It's a problem with the units, because the template grid has > 'mm' in the unit field, but when I look in the xgrid, ygrid, > zgrid and pos fields the numbers are clearly cm not mm. > However, when I multiply my xyzgrid and pos field by 10, the > grid is not tight (see attached ..._multiplied10.png). It > looks like the unit problem messed up the determination of > what's inside and outside. As you can see in the > template_grid, there are only a few grid point outside, which > is clearly not correct (maybe inside/outside was determined on > wrong units?). > > So, it looks like a bug to me, or am I doing something wrong? > I'm using the newest FT version. > > Thanks, > Ingrid > > %%% CODE FROM WIKI %%% > template = ft_read_mri([cur_path_FT 'external', > filesep, 'spm8', filesep,'templates', filesep,'T1.nii']); > template.coordsys = 'spm'; % so that FieldTrip knows how to > interpret the coordinate system > > % segment the template brain and construct a volume conduction > model (i.e. head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain > surface for inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol); > ft_plot_mesh(template_grid); > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Fri Apr 12 20:08:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Fri, 12 Apr 2013 11:08:31 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> Message-ID: <51684D9F.8020207@berkeley.edu> Hi Lilla, Yeah, the skull, I was thinking about that too. So if I understand the pics you sent, the skull is now extended as if it's massive just under the skin. I don't know enough about the volume conduction model and the exact effect of the skull/skin in it to really know what would be better: Not extended skull or massive extended skull. But here's my 2 cents: In my case, the low electrodes are mostly on the cheek and low in the neck. As you can see on the pic I attached to this email, the neck bone does not extend that low, and the cheek doesn't really have bone. So, I'm not sure the extended massive-bone one would be better. Best would be of course to segment the real bone from the MRI, but I have no clue how the segmentation magic takes place, probably is not trivial. Currently it only finds the not extended skull. And making the rest of the bone, if you could segment it, into a mesh is not possible I think, so it has to be sort of massive (meshable). So indeed, to extend or not to extend, that's the question. Probably depends on the location of the low electrodes. I think in my case I would tend to lean towards choosing not to extend. Thanks, Ingrid On 4/12/2013 8:03 AM, Lilla.Magyari at mpi.nl wrote: > hi Ingrid, > > I would like to comment on this because I have been discussing this with > Robert, and we thought that for the lower electrodes, it is still not > optimal when only the skin is extended which is more conductive then the > skull. I have attached two images for illustration. The FT segmentation > will produce the segmentation in origskull.jpg. This is fine when the > electrodes do not extend lower than the skull. When the electrodes are > lower, a segmentation like the one in extendedskull.jpg is probably more > useful. > > I created this extended skull based on the skin segmentation with the > imerode function of the matlab image processing toolbox > (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). > > Best, > Lilla > > > >> Hi Imali, >> >> Tzvetan shared the bem model made from the tutorial MRI with me, that >> one extends to low enough, so I'm good! Thanks a lot though! >> >> Cheers, >> Ingird >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >>> Hi Ingrid, >>> >>> I had similar issues with creating my own BEM as I too did not have >>> the individual MRI's nor the digitized electrode positions. >>> >>> I created a BEM using the Curry (Neuroscan) software and imported in >>> .mat format to use with Fieldtrip. However these are also based on the >>> MNI template. >>> >>> I am not sure whether this extends lower enough for your situation. I >>> am attaching here a picture of my head model showing the skull and >>> cortex with my registered electrodes. If you are happy with it, I am >>> more than happy to share it with you. >>> >>> Please let me know. >>> >>> Regards >>> >>> Imali >>> >>> *From:*fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >>> Nieuwenhuis >>> *Sent:* Thursday, 11 April 2013 4:22 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> Just had a brain wave, I'll share it for people with similar situation >>> that might be interested in this thread. I think I should just get a >>> random structural MRI that extends lower (includes ears and bit >>> below), optimally of a subject with a head similar to the MNI >>> template. Make a BEM model (hmm, have to fix these errors I mentioned >>> earlier then, well, should be doable on linux using dipoli). Then use >>> ft_electroderealign to align the electrodes to this MRI, do the source >>> analysis for all subjects using this model, and subsequently use >>> ft_volumenormalise to normalize to MNI template if I want to use any >>> atlas functionality. >>> >>> If anyone did this already using FieldTrip and has a pre-made BEM >>> (just like the standard_bem), would be really nice if you're willing >>> to share :) >>> If not, I'll make my own, and people with low electrodes and no >>> structural MRI and or no linux access can email me if they want to use >>> it. >>> >>> Cheers, >>> Ingrid >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >>> >>> Hi Lilla and Imali, >>> >>> Thanks for your replies. In my case, the problem is not the >>> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >>> everything is where it should be. The EGI 128 electrode net really >>> has these low electrodes, which are there specifically to make >>> source analysis better by capturing more of the electric field. So >>> I would have the best solution if I'd leave them there. However, >>> in the model as derived from the MNI template, the skin part does >>> not go down low enough. >>> >>> I looked at the picture after ft_prepare_vol_sens (see >>> attachement, black is before, red is after), and indeed, this is >>> not good. The low electrodes are squeezed up, and this will make >>> source analysis worse. So I should indeed remove these electrodes >>> (which is a pity), or find a better MNI template. >>> >>> *So my question is:* >>> Does anyone know of a template in MNI space that extends more >>> down? This template comes from SPM8, is there a version that >>> extends lower? Or could I extend the skin roughly downwards with >>> some triangular magic? >>> >>> I'm also a bit confused about the statement on this wiki page: >>> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >>> >>> under "revision information" header "skin" is says: "This skin >>> surface is not used in the BEM model itself for computational >>> reasons, but can be used for visualization." >>> But this does not seem to be the case, since my electrode >>> positions are modified based on till where the skin goes. So the >>> skin surface does significantly influence the source analysis. >>> >>> Anyway, thanks for all the help, and worse case, I just get rid of >>> the low fellows. >>> >>> Cheers, >>> Ingrid >>> >>> >>> -- >>> >>> Ingrid Nieuwenhuis PhD >>> >>> Postdoctoral Fellow >>> >>> Sleep and Neuroimaging Laboratory >>> >>> Department of Psychology >>> >>> University of California, Berkeley >>> >>> California 94720-1650 >>> >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >>> >>> hi Ingrid and Imali, >>> >>> >>> I think it is a really good question what to do in Ingrid's >>> case. I do not know the "right" answer, but I would like to >>> share my thoughts about it. >>> >>> The ft_prepare_vol_sens is indeed projects the electrode >>> positions closer to the headsurface as Imali wrote. But this >>> function called automatically when you create your leadfield, >>> so you do not have to do it separately (unless you want to >>> visualize the corrected electrode positions). >>> >>> However, I have been advised to rely on this projection >>> carefully if electrode positions are far from the skin and >>> specially, if the inaccuracies (distance from the skin) are >>> not equally distributed across the electrodes, because that >>> can cause a spatial bias. >>> >>> Therefore, my question would be: why are those electrodes so >>> low? Are those positions reflect the actual positions of the >>> electrodes during the measurement? If yes, I would not change >>> their positions, I would rather try to extend my headmodel >>> e.g. by using another template. (or another (but quite >>> suboptimal) possibility is maybe to exclude those electrodes >>> (and the data) from the analysis if they are anyway far from >>> the brain.) >>> >>> If the position of the electrodes should be higher up on the >>> head, then instead of relying on projection, I would try first >>> to scale the electrodes to fit them into the headsurface with >>> the ft_electroderealign function. >>> >>> I looked to the standard_bem file in the template directory, >>> and I also load in the standard_1020.elc, and those electrodes >>> perfectly fit the vol. So, it seems that the extension of the >>> standard bem headsurface is suitable for the area which is >>> covered by the those template electrodes. And I do not know if >>> the electrode set you use should cover a larger surface of the >>> head, or if it should be just adjusted to the given headsurface. >>> >>> Lilla >>> >>> >>> >>> >>> IMALI THANUJA HETTIARACHCHI wrote: >>> >>> Hi Ingrid, >>> >>> I had a similar issue a few weeks ago, where my lower most >>> electrodes >>> started floating after electrode realign using the >>> ft_electroderealign >>> function. >>> >>> I used the ft_prepare_vol_sens as, >>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >>> trick and >>> brought the electrodes on to the skin. >>> >>> Hope this helps...! >>> >>> Regards >>> Imali >>> >>> >>> *From:* fieldtrip-bounces at science.ru.nl >>> >>> [fieldtrip-bounces at science.ru.nl >>> ] on behalf of Ingrid >>> Nieuwenhuis >>> [inieuwenhuis at berkeley.edu ] >>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> A follow up on this and some new issues: >>> >>> 1) I first tried Jörn's approach by creating my own BEM, >>> always fun to >>> make it yourself ;) However, I did not succeed since: >>> a) the dipoli method does not work on Windows >>> b) I downloaded the openmeeg toolbox, but got an error >>> "om_minverser.exe >>> has stopped working" I've emailed their buglist >>> c) bemcp did run, but the result was not ok (see attachement). >>> I also >>> got the warning "% Warning: Matrix is singular, close to >>> singular or >>> badly scaled. Results may be inaccurate." several times, so >>> that might >>> be the problem. >>> d) and asa gave the following error: % Error using >>> ft_prepare_headmodel >>> (line 201) % You must supply a valid cfg.hdmfile for use with >>> ASA headmodel >>> >>> And away went my determination to do it myself, so I continued >>> using >>> thestandard_bem.mat >>> >>> . >>> >>> (I did not know this existed, I've added this link to note in >>> the >>> headmodel tutorial >>> >>> >>> to >>> make it easier to find, thanks Tzvetan for pointing this out!). >>> >>> 2) This worked and after some fiddling to get the electrodes >>> aligned it >>> looks okay (see attached). >>> However, as you can see in the figures, I have several very low >>> electrodes, that are lower than the skin mesh. So I was >>> wondering if >>> this is a problem? Since for accurate calculation of how the >>> currents >>> flow from these low electrodes, I assume one needs the skin to >>> go till >>> there? What happens when I have electrodes floating in thin air? >>> *So my question is:* >>> a) will this cause great inaccuracies? >>> b) if so, how can I extend the skin to go lower? The template >>> MRI only >>> goes that far to the bottom... Trick anyone? >>> >>> Thanks again, >>> Ingrid >>> >>> >>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>> >>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >>> put it on >>> the wiki. >>> Have a great day, >>> Ingrid >>> >>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>> >>> Dear Ingrid, >>> >>> in addition to Jorn's approach since you don't have MR and >>> digitized >>> elec position's you can load and realign the electrodes to the >>> standard bem. Subsequently you can calculate the lead field and >>> continue with your analysis pipeline. >>> Good luck >>> tzvetan >>> %% read electrodes >>> elec = ft_read_sens('/your >>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>> >>> %% read headmodel >>> templateheadmodel = '/your >>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>> load(templateheadmodel); >>> %% electrode realign as good as possible >>> % i.e. translate 0 -2 1.5 >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = vol.bnd(1).pnt; >>> elecR = ft_electroderealign(cfg); >>> %% verify how the electrodes fit toghether with the brain volume >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elecR; >>> cfg.headshape = vol.bnd(3).pnt; >>> elecR = ft_electroderealign(cfg); >>> >>> >>> >>> Hi Ingrid, >>> >>> I just happen to done this a few weeks back, I changed things >>> in the >>> meanwhile, but I hope that the below steps are complete: >>> /% read in the template MRI >>> if isunix >>> mri = >>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>> >>> elseif ispc >>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>> 'external', >>> 'spm8', 'templates', 'T1.nii')); >>> end >>> >>> >>> % segment the MRI >>> cfg = []; >>> cfg.output = {'brain' 'skull' 'scalp'}; >>> segmentedmri = ft_volumesegment(cfg, mris); >>> >>> >>> % create the headmodel (BEM) >>> cfg = []; >>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>> if isunix >>> cfg.method ='dipoli'; % dipoli only works under linux >>> else >>> disp('TODO FIXME stick to dipoli for now or download >>> openmeeg\n'); >>> keyboard; >>> end >>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> elec = ft_read_sens('standard_1020.elc'); >>> hdm = ft_convert_units(hdm, elec.unit); >>> >>> cfg = []; >>> cfg.grid.xgrid = -125:8:125; >>> cfg.grid.ygrid = -125:8:125; >>> cfg.grid.zgrid = -125:8:125; >>> cfg.grid.tight = 'yes'; >>> cfg.grid.unit = hdm.unit; >>> cfg.inwardshift = -1.5; >>> cfg.vol = hdm; >>> grid = ft_prepare_sourcemodel(cfg) >>> grid = ft_convert_units(grid, elec.unit); >>> >>> figure; >>> hold on; >>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>> ft_plot_mesh(grid.pos(grid.inside, :)); >>> >>> % this step is not necessary, cause you will see that >>> everything is >>> already aligned >>> cfg = []; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = hdm.bnd(1); >>> tmp = ft_electroderealign(cfg); >>> elec = tmp; % I had a bug here that I couldn't assign elec >>> directly >>> >>> %% verify location of occipital electrodes >>> >>> occ_elec = elec; >>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>> elec.label); >>> occ_idx = match_str(elec.label, occ_chan); >>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>> occ_elec.label = occ_elec.label(occ_idx, :); >>> figure; >>> ft_plot_sens(occ_elec) >>> hold on; >>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>> >>> >>> Afair, that's all that is needed. Of course you need to adjust >>> folder and file names. >>> >>> Greetings >>> Jörn >>> >>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>> >>> Hi all, >>> >>> I'd like to do source analysis (loreta and or DICS) on my EEG >>> data. >>> I don't have anatomical MRIs and I don't have a measurement of >>> the >>> scalp surface. So I'd like to use a template MRI or a template >>> head >>> model that is located in the FieldTrip template directory. I >>> have >>> EGI (128 channels) data and electrode positions (not subject >>> specific, just the standard file also available in FieldTrip >>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>> how to start. I don't see any examples on the FieldTrip page >>> of how >>> to make a headmodel and volume conduction model giving only this >>> limited data. I'd be happy to make it into a example Matlab >>> script >>> on the FieldTrip page after I got it to work. Would someone be >>> able >>> to give me some pointers, or example code? >>> >>> Thanks a lot! >>> Ingrid >>> >>> >>> >>> -- >>> 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 >>> >>> >>> ******************************************* >>> Tzvetan Popov >>> Clinical Psychology >>> University of Konstanz >>> Box 23 >>> 78457 Konstanz, GERMANY >>> Phone: 0049-7531-883086 >>> Fax: 0049-7531-884601 >>> Email: tzvetan.popov at uni-konstanz.de >>> >>> >>> >>> ******************************************* >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sb10063654e-001.jpg Type: image/jpeg Size: 64547 bytes Desc: not available URL: From polomacnenad at gmail.com Fri Apr 12 21:16:27 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 12 Apr 2013 21:16:27 +0200 Subject: [FieldTrip] ft_read_sens on brain vision eeg data Message-ID: Dear all, I would like to read sensors locations with ft_read_sens and it doesn't work. I have eeg data recorded with Brain Vision Recorder. It seems that that ft_read_sens doesn't recognize this file format. Please help! Thank you in advance! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Apr 15 12:13:28 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 15 Apr 2013 12:13:28 +0200 (CEST) Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <49931.131.174.45.70.1366020808.squirrel@131.174.45.70> hi Ricardo, I'd change forward/ft_headmodel_dipoli.m in line 134 from this: case {'mexglnx86' 'mexa64'} to this: case {'mexglnx86' 'mexa64' 'mexglx'} Please, try this first, and if it is still not working, it is possible that you should compile it yourself. If that still doesn't work out, please, send a message to the bugzilla. http://bugzilla.fcdonders.nl/ And if you could run it, please, also give us a feedback about it. Thanks. Best, Lilla > Hi Lilla, > Thank you very much for your reply. > It returns "mexglx", which is expected for a linux system, right? > I tried to change the path by my self in the ft_headmodel_dipoli but it > didnt work. Do you know how can I change it properly? > > Best wishes > Ricardo > > > On 11 April 2013 16:40, Ricardo Moura wrote: > >> Hi, >> >> I had to re-install ubuntu in order to provide more space for the >> analysis >> (since I was having the problem with the temporary files, which might >> have >> been too large for my ubuntu partition). >> But now the problem I have with the "ft_prepare_headmodel" is even >> weirder than before. The program now is complaining that there is no >> dipoli >> for my system: >> >> >> cfg = []; >> cfg.method ='dipoli'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> ??? Error using ==> ft_headmodel_dipoli at 138 >> there is no dipoli executable for your platform >> >> Error in ==> ft_prepare_headmodel at 226 >> vol > >> ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); >> >> >> I am running this script in a 2010b matlab version, installed in ubuntu >> 12.04. It should be working fine, right? >> >> Thanks in advance, >> Ricardo >> >> >> On 28 March 2013 14:39, Ricardo Moura wrote: >> >>> Hi Jörn, >>> thank you very much for your response! >>> I checked the segmentation and everything seems to be ok (as far as I >>> can >>> say... No error messages were shown during the processing and I checked >>> the >>> generated objects and plots). >>> >>> But I had a strange error while preparing the head model. Somehow the >>> command cannot find the dipoli files, even thought they are really >>> where >>> they should be. And the second message >>> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no >>> clue >>> of what it means. >>> >>> And I am running this command on a ubuntu 12.04 32-bit. >>> >>> Do you have any idea of how I can solve it? >>> >>> Thanks once again,Best, >>> Ricardo >>> >>> using the executable >>> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >>> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >>> not found >>> Warning: an error ocurred while running dipoli >>> > In ft_headmodel_dipoli at 201 >>> In ft_prepare_headmodel at 226 >>> >>> Error using fread >>> Invalid file identifier. Use fopen to generate a valid file >>> identifier. >>> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >>> found. >>> > In ft_headmodel_dipoli at 209 >>> In ft_prepare_headmodel at 226 >>> >>> >>> On 27 March 2013 13:10, Ricardo Moura wrote: >>> >>>> Dear all >>>> I am creating a BEM model for eeg, following the appropriate tutorial, >>>> but I have a problem when preparing the headmodel. The output I have >>>> from >>>> the ft_prepare_headmodel command does not contain the "mat", and so, >>>> when I >>>> try to generate the leadfield, it returns an error message due to non >>>> existent "mat". I saw that other users had similar problem, but I >>>> haven't >>>> found a solution though. So, what is wrong with my script? >>>> >>>> Thanks a lot in advance! >>>> Best, >>>> Ricardo >>>> >>>> >>>> >>>> >>>> load standard_mri.mat >>>> mri_orig=mri; >>>> disp(mri) >>>> >>>> % Segmenting the data >>>> cfg = []; >>>> cfg.output= {'scalp','skull','brain'}; >>>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>>> disp(segmentedmri) >>>> save segmentedmri segmentedmri >>>> >>>> % MESH >>>> cfg=[]; >>>> cfg.tissue={'brain','skull','scalp'}; >>>> cfg.numvertices = [3000 2000 1000]; >>>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>>> disp(bnd(1)) >>>> >>>> % Head Model = variavel vol >>>> cfg = []; >>>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> >>>> >> disp(vol) >>>> bnd: [1x3 struct] >>>> cond: [0.3300 0.0041 0.3300] >>>> skin_surface: 1 >>>> source: 3 >>>> type: 'dipoli' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> >>> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Lilla.Magyari at mpi.nl Mon Apr 15 13:05:36 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 15 Apr 2013 13:05:36 +0200 (CEST) Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51684D9F.8020207@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> <51684D9F.8020207@berkeley.edu> Message-ID: <50252.131.174.45.70.1366023936.squirrel@131.174.45.70> hi Ingrid, FieldTrip segments the skull by a rough estimation: when it finds the brain surface, it extends it with using an image processing function of matlab. We have found this good enough for the BEM model, but in your case, maybe it is not satisfactory. But you can overlay the segmentation with the anatomy of the mri image with ft_sourceplot and check it at the coordinates of your electrodes and you can see then whether your skull segmentation should be extended or corrected. If you use the tutorial data, you can download the mri and the already made segmentation. I do not know exactly how other software are doing the segmentation of the skull, but you can find a plot of the brain, skull and scalp surfaces using FieldTrip and FreeSurfer on this page, http://fieldtrip.fcdonders.nl/development/replicate_functionality_of_mne_software#anatomical_processingeeg when you scroll a bit down . None of them seems to exactly fit to your need, but maybe there are other software (or FS has also a different algorithm?) which segments the skull and bone more precisely. Otherwise, it is also OK to correct the segmentation manually. Unfortunately, FieldTrip doesn't have an editing function for the segmentation yet. Therefore, I was suggesting to work with the matlab image processing toolbox functions. I hope this helps. Best, Lilla > Hi Lilla, > > Yeah, the skull, I was thinking about that too. So if I understand the > pics you sent, the skull is now extended as if it's massive just under > the skin. I don't know enough about the volume conduction model and the > exact effect of the skull/skin in it to really know what would be > better: Not extended skull or massive extended skull. But here's my 2 > cents: > > In my case, the low electrodes are mostly on the cheek and low in the > neck. As you can see on the pic I attached to this email, the neck bone > does not extend that low, and the cheek doesn't really have bone. So, > I'm not sure the extended massive-bone one would be better. Best would > be of course to segment the real bone from the MRI, but I have no clue > how the segmentation magic takes place, probably is not trivial. > Currently it only finds the not extended skull. And making the rest of > the bone, if you could segment it, into a mesh is not possible I think, > so it has to be sort of massive (meshable). So indeed, to extend or not > to extend, that's the question. Probably depends on the location of the > low electrodes. I think in my case I would tend to lean towards choosing > not to extend. > > Thanks, > Ingrid > > > On 4/12/2013 8:03 AM, Lilla.Magyari at mpi.nl wrote: >> hi Ingrid, >> >> I would like to comment on this because I have been discussing this with >> Robert, and we thought that for the lower electrodes, it is still not >> optimal when only the skin is extended which is more conductive then the >> skull. I have attached two images for illustration. The FT segmentation >> will produce the segmentation in origskull.jpg. This is fine when the >> electrodes do not extend lower than the skull. When the electrodes are >> lower, a segmentation like the one in extendedskull.jpg is probably more >> useful. >> >> I created this extended skull based on the skin segmentation with the >> imerode function of the matlab image processing toolbox >> (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). >> >> Best, >> Lilla >> >> >> >>> Hi Imali, >>> >>> Tzvetan shared the bem model made from the tutorial MRI with me, that >>> one extends to low enough, so I'm good! Thanks a lot though! >>> >>> Cheers, >>> Ingird >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >>>> Hi Ingrid, >>>> >>>> I had similar issues with creating my own BEM as I too did not have >>>> the individual MRI's nor the digitized electrode positions. >>>> >>>> I created a BEM using the Curry (Neuroscan) software and imported in >>>> .mat format to use with Fieldtrip. However these are also based on the >>>> MNI template. >>>> >>>> I am not sure whether this extends lower enough for your situation. I >>>> am attaching here a picture of my head model showing the skull and >>>> cortex with my registered electrodes. If you are happy with it, I am >>>> more than happy to share it with you. >>>> >>>> Please let me know. >>>> >>>> Regards >>>> >>>> Imali >>>> >>>> *From:*fieldtrip-bounces at science.ru.nl >>>> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >>>> Nieuwenhuis >>>> *Sent:* Thursday, 11 April 2013 4:22 AM >>>> *To:* fieldtrip at science.ru.nl >>>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>>> >>>> Hi all, >>>> >>>> Just had a brain wave, I'll share it for people with similar situation >>>> that might be interested in this thread. I think I should just get a >>>> random structural MRI that extends lower (includes ears and bit >>>> below), optimally of a subject with a head similar to the MNI >>>> template. Make a BEM model (hmm, have to fix these errors I mentioned >>>> earlier then, well, should be doable on linux using dipoli). Then use >>>> ft_electroderealign to align the electrodes to this MRI, do the source >>>> analysis for all subjects using this model, and subsequently use >>>> ft_volumenormalise to normalize to MNI template if I want to use any >>>> atlas functionality. >>>> >>>> If anyone did this already using FieldTrip and has a pre-made BEM >>>> (just like the standard_bem), would be really nice if you're willing >>>> to share :) >>>> If not, I'll make my own, and people with low electrodes and no >>>> structural MRI and or no linux access can email me if they want to use >>>> it. >>>> >>>> Cheers, >>>> Ingrid >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Hi Lilla and Imali, >>>> >>>> Thanks for your replies. In my case, the problem is not the >>>> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >>>> everything is where it should be. The EGI 128 electrode net >>>> really >>>> has these low electrodes, which are there specifically to make >>>> source analysis better by capturing more of the electric field. >>>> So >>>> I would have the best solution if I'd leave them there. However, >>>> in the model as derived from the MNI template, the skin part does >>>> not go down low enough. >>>> >>>> I looked at the picture after ft_prepare_vol_sens (see >>>> attachement, black is before, red is after), and indeed, this is >>>> not good. The low electrodes are squeezed up, and this will make >>>> source analysis worse. So I should indeed remove these electrodes >>>> (which is a pity), or find a better MNI template. >>>> >>>> *So my question is:* >>>> Does anyone know of a template in MNI space that extends more >>>> down? This template comes from SPM8, is there a version that >>>> extends lower? Or could I extend the skin roughly downwards with >>>> some triangular magic? >>>> >>>> I'm also a bit confused about the statement on this wiki page: >>>> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >>>> >>>> under "revision information" header "skin" is says: "This skin >>>> surface is not used in the BEM model itself for computational >>>> reasons, but can be used for visualization." >>>> But this does not seem to be the case, since my electrode >>>> positions are modified based on till where the skin goes. So the >>>> skin surface does significantly influence the source analysis. >>>> >>>> Anyway, thanks for all the help, and worse case, I just get rid >>>> of >>>> the low fellows. >>>> >>>> Cheers, >>>> Ingrid >>>> >>>> >>>> -- >>>> >>>> Ingrid Nieuwenhuis PhD >>>> >>>> Postdoctoral Fellow >>>> >>>> Sleep and Neuroimaging Laboratory >>>> >>>> Department of Psychology >>>> >>>> University of California, Berkeley >>>> >>>> California 94720-1650 >>>> >>>> Tolman Hall, room 5305 >>>> >>>> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >>>> >>>> hi Ingrid and Imali, >>>> >>>> >>>> I think it is a really good question what to do in Ingrid's >>>> case. I do not know the "right" answer, but I would like to >>>> share my thoughts about it. >>>> >>>> The ft_prepare_vol_sens is indeed projects the electrode >>>> positions closer to the headsurface as Imali wrote. But this >>>> function called automatically when you create your leadfield, >>>> so you do not have to do it separately (unless you want to >>>> visualize the corrected electrode positions). >>>> >>>> However, I have been advised to rely on this projection >>>> carefully if electrode positions are far from the skin and >>>> specially, if the inaccuracies (distance from the skin) are >>>> not equally distributed across the electrodes, because that >>>> can cause a spatial bias. >>>> >>>> Therefore, my question would be: why are those electrodes so >>>> low? Are those positions reflect the actual positions of the >>>> electrodes during the measurement? If yes, I would not change >>>> their positions, I would rather try to extend my headmodel >>>> e.g. by using another template. (or another (but quite >>>> suboptimal) possibility is maybe to exclude those electrodes >>>> (and the data) from the analysis if they are anyway far from >>>> the brain.) >>>> >>>> If the position of the electrodes should be higher up on the >>>> head, then instead of relying on projection, I would try >>>> first >>>> to scale the electrodes to fit them into the headsurface with >>>> the ft_electroderealign function. >>>> >>>> I looked to the standard_bem file in the template directory, >>>> and I also load in the standard_1020.elc, and those >>>> electrodes >>>> perfectly fit the vol. So, it seems that the extension of the >>>> standard bem headsurface is suitable for the area which is >>>> covered by the those template electrodes. And I do not know >>>> if >>>> the electrode set you use should cover a larger surface of >>>> the >>>> head, or if it should be just adjusted to the given >>>> headsurface. >>>> >>>> Lilla >>>> >>>> >>>> >>>> >>>> IMALI THANUJA HETTIARACHCHI wrote: >>>> >>>> Hi Ingrid, >>>> >>>> I had a similar issue a few weeks ago, where my lower most >>>> electrodes >>>> started floating after electrode realign using the >>>> ft_electroderealign >>>> function. >>>> >>>> I used the ft_prepare_vol_sens as, >>>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >>>> trick and >>>> brought the electrodes on to the skin. >>>> >>>> Hope this helps...! >>>> >>>> Regards >>>> Imali >>>> >>>> >>>> *From:* fieldtrip-bounces at science.ru.nl >>>> >>>> [fieldtrip-bounces at science.ru.nl >>>> ] on behalf of Ingrid >>>> Nieuwenhuis >>>> [inieuwenhuis at berkeley.edu >>>> ] >>>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>>> *To:* fieldtrip at science.ru.nl >>>> >>>> *Subject:* Re: [FieldTrip] source analysis EEG data without >>>> MRI >>>> >>>> Hi all, >>>> >>>> A follow up on this and some new issues: >>>> >>>> 1) I first tried Jörn's approach by creating my own BEM, >>>> always fun to >>>> make it yourself ;) However, I did not succeed since: >>>> a) the dipoli method does not work on Windows >>>> b) I downloaded the openmeeg toolbox, but got an error >>>> "om_minverser.exe >>>> has stopped working" I've emailed their buglist >>>> c) bemcp did run, but the result was not ok (see >>>> attachement). >>>> I also >>>> got the warning "% Warning: Matrix is singular, close to >>>> singular or >>>> badly scaled. Results may be inaccurate." several times, so >>>> that might >>>> be the problem. >>>> d) and asa gave the following error: % Error using >>>> ft_prepare_headmodel >>>> (line 201) % You must supply a valid cfg.hdmfile for use with >>>> ASA headmodel >>>> >>>> And away went my determination to do it myself, so I >>>> continued >>>> using >>>> thestandard_bem.mat >>>> >>>> . >>>> >>>> (I did not know this existed, I've added this link to note in >>>> the >>>> headmodel tutorial >>>> >>>> >>>> to >>>> make it easier to find, thanks Tzvetan for pointing this >>>> out!). >>>> >>>> 2) This worked and after some fiddling to get the electrodes >>>> aligned it >>>> looks okay (see attached). >>>> However, as you can see in the figures, I have several very >>>> low >>>> electrodes, that are lower than the skin mesh. So I was >>>> wondering if >>>> this is a problem? Since for accurate calculation of how the >>>> currents >>>> flow from these low electrodes, I assume one needs the skin >>>> to >>>> go till >>>> there? What happens when I have electrodes floating in thin >>>> air? >>>> *So my question is:* >>>> a) will this cause great inaccuracies? >>>> b) if so, how can I extend the skin to go lower? The template >>>> MRI only >>>> goes that far to the bottom... Trick anyone? >>>> >>>> Thanks again, >>>> Ingrid >>>> >>>> >>>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >>>> put it on >>>> the wiki. >>>> Have a great day, >>>> Ingrid >>>> >>>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>> >>>> Dear Ingrid, >>>> >>>> in addition to Jorn's approach since you don't have MR and >>>> digitized >>>> elec position's you can load and realign the electrodes to >>>> the >>>> standard bem. Subsequently you can calculate the lead field >>>> and >>>> continue with your analysis pipeline. >>>> Good luck >>>> tzvetan >>>> %% read electrodes >>>> elec = ft_read_sens('/your >>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>> >>>> %% read headmodel >>>> templateheadmodel = '/your >>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>> load(templateheadmodel); >>>> %% electrode realign as good as possible >>>> % i.e. translate 0 -2 1.5 >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = vol.bnd(1).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> %% verify how the electrodes fit toghether with the brain >>>> volume >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elecR; >>>> cfg.headshape = vol.bnd(3).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> >>>> >>>> >>>> Hi Ingrid, >>>> >>>> I just happen to done this a few weeks back, I changed things >>>> in the >>>> meanwhile, but I hope that the below steps are complete: >>>> /% read in the template MRI >>>> if isunix >>>> mri = >>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>> >>>> elseif ispc >>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>>> 'external', >>>> 'spm8', 'templates', 'T1.nii')); >>>> end >>>> >>>> >>>> % segment the MRI >>>> cfg = []; >>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>> segmentedmri = ft_volumesegment(cfg, mris); >>>> >>>> >>>> % create the headmodel (BEM) >>>> cfg = []; >>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>> if isunix >>>> cfg.method ='dipoli'; % dipoli only works under linux >>>> else >>>> disp('TODO FIXME stick to dipoli for now or download >>>> openmeeg\n'); >>>> keyboard; >>>> end >>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> elec = ft_read_sens('standard_1020.elc'); >>>> hdm = ft_convert_units(hdm, elec.unit); >>>> >>>> cfg = []; >>>> cfg.grid.xgrid = -125:8:125; >>>> cfg.grid.ygrid = -125:8:125; >>>> cfg.grid.zgrid = -125:8:125; >>>> cfg.grid.tight = 'yes'; >>>> cfg.grid.unit = hdm.unit; >>>> cfg.inwardshift = -1.5; >>>> cfg.vol = hdm; >>>> grid = ft_prepare_sourcemodel(cfg) >>>> grid = ft_convert_units(grid, elec.unit); >>>> >>>> figure; >>>> hold on; >>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], >>>> 'facealpha', >>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>> >>>> % this step is not necessary, cause you will see that >>>> everything is >>>> already aligned >>>> cfg = []; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = hdm.bnd(1); >>>> tmp = ft_electroderealign(cfg); >>>> elec = tmp; % I had a bug here that I couldn't assign elec >>>> directly >>>> >>>> %% verify location of occipital electrodes >>>> >>>> occ_elec = elec; >>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>> elec.label); >>>> occ_idx = match_str(elec.label, occ_chan); >>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>> figure; >>>> ft_plot_sens(occ_elec) >>>> hold on; >>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>> >>>> >>>> Afair, that's all that is needed. Of course you need to >>>> adjust >>>> folder and file names. >>>> >>>> Greetings >>>> Jörn >>>> >>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Hi all, >>>> >>>> I'd like to do source analysis (loreta and or DICS) on my EEG >>>> data. >>>> I don't have anatomical MRIs and I don't have a measurement >>>> of >>>> the >>>> scalp surface. So I'd like to use a template MRI or a >>>> template >>>> head >>>> model that is located in the FieldTrip template directory. I >>>> have >>>> EGI (128 channels) data and electrode positions (not subject >>>> specific, just the standard file also available in FieldTrip >>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of >>>> stuck >>>> how to start. I don't see any examples on the FieldTrip page >>>> of how >>>> to make a headmodel and volume conduction model giving only >>>> this >>>> limited data. I'd be happy to make it into a example Matlab >>>> script >>>> on the FieldTrip page after I got it to work. Would someone >>>> be >>>> able >>>> to give me some pointers, or example code? >>>> >>>> Thanks a lot! >>>> Ingrid >>>> >>>> >>>> >>>> -- >>>> 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 >>>> >>>> >>>> ******************************************* >>>> Tzvetan Popov >>>> Clinical Psychology >>>> University of Konstanz >>>> Box 23 >>>> 78457 Konstanz, GERMANY >>>> Phone: 0049-7531-883086 >>>> Fax: 0049-7531-884601 >>>> Email: tzvetan.popov at uni-konstanz.de >>>> >>>> >>>> >>>> ******************************************* >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> fieldtrip mailing list >>>> >>>> fieldtrip at donders.ru.nl >>>> >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From h.morgan at bangor.ac.uk Tue Apr 16 17:06:32 2013 From: h.morgan at bangor.ac.uk (Helen Morgan) Date: Tue, 16 Apr 2013 16:06:32 +0100 Subject: [FieldTrip] ERP Summer School, Bangor, UK Message-ID: <516D68F8.7020808@bangor.ac.uk> School of Psychology, Bangor University, Wales, UK 1st-5th July 2013 ERP Summer School "Brainwaves and the Human Mind" This Summer School is part of the celebrations of the 50th Anniversary of the School of Psychology, Bangor University. We invite applications for a summer school on the neuroscientific investigation of the human mind. Attendees will learn how to conduct, analyse, and interpret event-related potential studies in psychological domains like memory, development, mindfulness, language, and perception and cognition. The emphasis will be on practical sessions covering the analysis of event-related potentials like the treatment of artefacts and eye movements, filtering, segmentation, averaging, baseline correction, and data measurements. Travel grants are available and will be awarded on a competitive basis to support applicants who otherwise would have financial difficulties attending. Course fee: £270 (including accommodation), £170 (no accommodation). Please contact Becca Henderson at erpsummerschool at bangor.ac.uk for information about the Summer School. -- Rhif Elusen Gofrestredig / Registered Charity No. 1141565 Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi, gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar unwaith a dilëwch y neges. Os na fwriadwyd anfon y neges atoch chi, rhaid i chi beidio â defnyddio, cadw neu ddatgelu unrhyw wybodaeth a gynhwysir ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i hanfonodd yn unig ac nid yw o anghenraid yn cynrychioli barn Prifysgol Bangor. Nid yw Prifysgol Bangor yn gwarantu bod y neges e-bost hon neu unrhyw atodiadau yn rhydd rhag firysau neu 100% yn ddiogel. Oni bai fod hyn wedi ei ddatgan yn uniongyrchol yn nhestun yr e-bost, nid bwriad y neges e-bost hon yw ffurfio contract rhwymol - mae rhestr o lofnodwyr awdurdodedig ar gael o Swyddfa Cyllid Prifysgol Bangor. www.bangor.ac.uk This email and any attachments may contain confidential material and is solely for the use of the intended recipient(s). If you have received this email in error, please notify the sender immediately and delete this email. If you are not the intended recipient(s), you must not use, retain or disclose any information contained in this email. Any views or opinions are solely those of the sender and do not necessarily represent those of Bangor University. Bangor University does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of the text of the email, this email is not intended to form a binding contract - a list of authorised signatories is available from the Bangor University Finance Office. www.bangor.ac.uk From r.oostenveld at donders.ru.nl Thu Apr 18 10:23:59 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 18 Apr 2013 10:23:59 +0200 Subject: [FieldTrip] Calculating goodness of fit In-Reply-To: <51522E38.8040309@telus.net> References: <51522E38.8040309@telus.net> Message-ID: <7CEE609D-841C-475B-A0DE-EEF87E43F2EA@donders.ru.nl> Hi Jim On 27 Mar 2013, at 0:24, Jim McKay wrote: > I am trying to figure out how to calculate the goodness of fit (gof) after a dipole fit on MEG data. The equation for gof has two input variables, the measured data vector and the model data vector from the EC dipole fit. The measured data vector is easy, but I am confused which vector to use for the model data, which is a vector of length (1:Num_sensors). If dip1 is the output from the ft_dipolefitting function, candidates are: > > dip1.Vdata - perhaps this is the measured data? > dip1.Vmodel - sounds promising? > dip1.dip.pot - or maybe this? The output from ft_dipolefitting is a bit archaic. It is on the todo list to update this data structure and make it more self-explanatory. dip1.Vdata is the Nchans*Ntime matrix with the data that was fitted (can be either EEG or MEG, so don't be comfused by the "V" in the name) dip1.Vmodel is the Nchans*Ntime matrix with the forward solution predicted by the dipole model you can subtract the two and for example visualize the resudual. The field dip.dip.pot contains the same as dip.Vmodel. You might want to take a look at ft_dipolefitting around line 500, where these fields and the gof (actually residual variance) are dealt with. best regards, Robert From cmuehl at gmail.com Thu Apr 18 13:19:58 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Thu, 18 Apr 2013 13:19:58 +0200 Subject: [FieldTrip] Deadline Extension! Workshop of Affective Brain-Computer Interfaces at ACII2013 Message-ID: ** Submission deadline extension until 28th of April** 3rd Workshop on Affective Brain-Computer Interfaces (aBCI) Workshop at ACII 2013 (September 2-5), Geneva, Switzerland, September 2, 2013 http://hmi.ewi.utwente.nl/abci2013 http://www.acii2013.org During the last decade, brain computer interface (BCI) research has developed into a major research field establishing methodological frameworks, guidelines and a core community of established researchers. Besides proving valuable as a communication channel that bypasses impeded muscular pathways, the novel technology also spurred the investigation of applications for able-bodied users, foremost in the fields of entertainment, health and lifestyle. Affective BCI systems allowing users to control computer games, support relaxation training, or trigger your alarm clock during a shallow sleep stage have been proposed, implemented, and sold. Moreover, the affordable hardware and software tools also encouraged artists to play with the idea of a direct access to people’s most private information: their affective and cognitive states. From these explorations followed a number of interesting installations, suggesting novel ways of human-computer as well as human-human interaction: neurotechnology-based systems that encourage affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. The third workshop on affective brain-computer interfaces will explore the advantages and limitations of using neuro-physiological signals as a modality for the automatic recognition of affective and cognitive states, and the possibilities of using this information about the user state in applications for domains like health, arts, and entertainment. The goal is to bring researchers, artists, and practitioners together to present state-of-the-art progress and their visions, and thus to spur the development of guidelines and frameworks for affective BCI. Topics of interest include, but are not limited to: • affective/cognitive state induction and data collection for affective BCI • detection of mental state via BCI and other modalities • innovative concepts for adaptive interfaces and affective BCI • demos of affective BCI systems and artworks Submission Instructions * The papers should feature original empirical work, theoretical work, or a well defendable but arguable position of the authors. * Papers will be published in the proceedings of ACII 2013 by IEEE. Papers should be limited to 6 pages. * Further details about the submission instructions and format can be found on the website of ACII 2013. * For further information, contact abci at ewi.utwente.nl Important Dates: April 28, 2013: Submission of manuscripts May 27, 2013: Acceptance/Rejection notification June 17, 2013: Submission of camera-ready papers and presenting author’s registration September 2, 2013: Date of the Workshop Programme Chairs: * Brendan Allison, University of California, San Diego, USA * Guilliaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland, * Christian Mühl, INRIA Bordeaux - Sud-Ouest, France * Anton Nijholt, Universiteit Twente, the Netherlands Programme Committee: * Egon L. van den Broek, TNO Technical Sciences, Delft, The Netherlands * Anne-Marie Brouwer, TNO Perceptual and Cognitive Systems, Soesterberg, the Netherlands * Stephen Fairclough, John Moores University, Liverpool, UK * Didier Grandjean, Swiss Center for Affective Sciences, Geneva, Switzerland * Hayrettin Gürkök, University of Twente, Enschede, the Netherlands * Jonghwa Kim, University of Augsburg, Germany * Brent Lance, Army Research Laboratory/TNB, Aberdeen Proving Ground, USA, * Fabien Lotte, INRIA Bordeaux - Sud-Ouest, France * Winfried Menninghaus, Freie Universität Berlin, Germany * Gary Garcia Molina, Philips Research North America, Briarcliff, USA * Christopher Honey, Princeton University, USA * Ioannis Patras, Queen Mary University, London, UK * Mannes Poel, University of Twente, Enschede, the Netherlands * Olga Sourina, NanYang Technological University, Singapore * Ed Tan, Universiteit van Amsterdam, the Netherlands * Aleksander Valjamae, University of Graz, Austria * Thorsten Zander, Technische Universität Berlin, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Apr 19 08:53:43 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 19 Apr 2013 08:53:43 +0200 Subject: [FieldTrip] ft_read_sens on brain vision eeg data In-Reply-To: References: Message-ID: <606401BD-7553-4E6B-BD93-CF13D162C7A3@donders.ru.nl> Hi Nenad, The Brain Vision Recorder software writes EEG data into three files, that are usually called *.vhdr, *.vmrk and *.dat. Sometime the latter one is caller *.eeg, and also *.seg might happen (after processing the data in Brain Vision Analyzer). But none of the three files contains electrode positions, therefore ft_read_sens won't work on them. EEG electrode positions are usually recorded with a Polhemus electromagnetic tracking device. Sometimes an optical tracker (e.g. Optotrak), acoustic tracker (Zebris) or camera-based system is used. However, there is not a single unique file format for the Polhemus recordings. Depending on the company from which you purchased the Polhemus tracker (usually an EEG system integration company, like ANT), you will get different software with it that writes teh position to different file formats. The ft_read_sens function understands some of the formats, but probably not all. Usually the files that are written by the software that comes with the Polhemus are in ascii, so you can edit (and convert) them with a text editor. So rather than looking at the EEG amplifier with software, you should look at the electrode position recording device+software that you have been using. best regards, Robert PS it might be tha On 12 Apr 2013, at 21:16, Nenad Polomac wrote: > Dear all, > > I would like to read sensors locations with ft_read_sens and it doesn't work. I have eeg data recorded with Brain Vision Recorder. It seems that that ft_read_sens doesn't recognize this file format. > Please help! > > Thank you in advance! > > Nenad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From haiteng.jiang at gmail.com Fri Apr 19 10:25:33 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 19 Apr 2013 10:25:33 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge Message-ID: Hi FTer, I am doing Cluster-based permutation statistic after beamforming on two condition over subjects following the tutorial http://fieldtrip.fcdonders.nl/example/source_statistics, but I get something funny. In my case , I would expect decreased activity in the visual and posterior area. The effect is quite strong, which is showed in the grand average difference (log ratio to reduce inter subject variability). However , from the statistic , the identified areas go to the temporal area , which doesn't make sense at all . Please see the below and attached pictures. I understand cluster-based permutation test doesn't necessary pick the peak difference, but in general it should find main different area. Any comment would be greatly appreciated. Average: [image: Inline images 2] Statistic: [image: Inline images 1] Best, Haiteng -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: statistic.jpg Type: image/jpeg Size: 128261 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grandaverage.jpg Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grandaverage.jpg Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: statistic.jpg Type: image/jpeg Size: 128261 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Fri Apr 19 11:35:44 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 19 Apr 2013 11:35:44 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge In-Reply-To: References: Message-ID: <51710FF0.5040904@donders.ru.nl> Dear Haiteng, I think in the example the design matrix is wrongly computed. If you compare the single and the group-level example, it is described exactly the same, which does not make much sense. Afaik it should be this instead (analogue to freq statisics on group level): /subj = numel(sourceA.trial); design = zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; / Let me know if this makes things better (not in today, working from home, so better reply to this lis). Best, Jörn On 4/19/2013 10:25 AM, Haiteng Jiang wrote: > Hi FTer, > I am doing Cluster-based permutation statistic after > beamforming on two condition over subjects following the tutorial > http://fieldtrip.fcdonders.nl/example/source_statistics, but I get > something funny. > In my case , I would expect decreased activity in the visual and > posterior area. The effect is quite strong, which is showed in the > grand average difference (log ratio to reduce inter subject > variability). However , from the statistic , the identified areas > go to the temporal area , which doesn't make sense at all . Please > see the below and attached pictures. I understand cluster-based > permutation test doesn't necessary pick the peak difference, but in > general it should find main different area. Any comment would be > greatly appreciated. > > Average: > > Inline images 2 > > > > Statistic: > Inline images 1 > Best, > Haiteng > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 128261 bytes Desc: not available URL: From litvak.vladimir at gmail.com Sat Apr 20 05:46:38 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sat, 20 Apr 2013 04:46:38 +0100 Subject: [FieldTrip] Statistical Parametric Mapping for MEG/EEG 2013 course - final reminder Message-ID: Dear colleagues, There are still a few places left for the May SPM for M/EEG course in London. This is the first course where SPM12b will be taught. The course program will also include a new extended demo of a group analysis of multimodal MEG-EEG dataset in SPM. Please see below for further details. With best wishes, Vladimir Litvak on behalf of the course faculty --------------------------------------------------------------------------------------------------------- Dear colleagues, We are happy to advertise the 2013 Statistical Parametric Mapping for MEG/EEG course presented by the Wellcome Trust Centre for Neuroimaging. The course will take place on Monday 13th May –Wednesday 15th May 2013 at the Wellcome Trust Centre for Neuroimaging in London. This course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course will cover (1) data pre-processing, (2) statistical analysis of sensor-space maps using GLMs and Random Field theory, (3) source reconstruction and (4) Dynamic Causal Modelling for EEG/MEG. The course will be followed by the long-established three-day course on ‘SPM for fMRI’ so it is possible to attend both courses. The course is suitable for beginners and more advanced users. We advise students to gain at least minimal familiarity with the methodology, for example, from reading the paper available at http://www.hindawi.com/journals/cin/2011/852961/ and other introductory articles listed at the SPM website or by following data analysis examples in the SPM manual. Video lectures from the 2012 course are available at http://www.fil.ion.ucl.ac.uk/spm/course/video/#MEEG For the practical part of the course please bring a laptop that can run Matlab (7.4 or later, no toolboxes are required) and is powerful enough to analyse your data (64-bit OS is highly recommended). The detailed schedule and booking forms can be found at http://www.ion.ucl.ac.uk/articles/events/SPM . For further details and registration please contact Jean Reynolds (jean.reynolds at ucl.ac.uk). With best wishes, Vladimir Litvak Ph.D. Lecturer Wellcome Trust Centre for Neuroimaging -------------------------------------------------------------------------------------------------- SPM (http://www.fil.ion.ucl.ac.uk/spm/) is free and open source software written in MATLAB (The MathWorks, Inc.). In addition to standard M/EEG pre-processing, we presently offer three main analysis tools: (i) statistical analysis of scalp-maps, time-frequency images and volumetric 3D source reconstruction images based on the general linear model, with correction for multiple comparisons using random field theory; (ii) Bayesian M/EEG source reconstruction, including support for group studies, simultaneous EEG and MEG, and fMRI priors; (iii) Dynamic Causal Modelling (DCM), an approach combining neural modelling with data analysis for which there are several variants dealing with evoked responses, steady state responses (power spectra and cross-spectra), induced responses and phase coupling. SPM is integrated with the FieldTrip toolbox (http://fieldtrip.fcdonders.nl/), making it possible for users to combine a variety of standard analysis methods with new schemes implemented in SPM and build custom analysis tools using powerful graphical user interface (GUI) and batching tools. -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Sat Apr 20 08:08:27 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Sat, 20 Apr 2013 08:08:27 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge Message-ID: > > Hi Jorn, > Thanks for your response . It is Within subjects experiments design. The result remains same because the design doesn't change . They are only just different expression on the source statistic comparing to sensor statistic on group level on FT tutorial. In my data, the cluster randomization picks something funny and doesn't make sense while the difference plots is more informative and more consistent with the topos. Technically speaking - the cluster randomization does not test for location , but only if there is a difference or not - thus the clusters should be interpreted with caution. Therefore , I think about trying another statistic method as well although cluster randomization is wildly used within donders institute . Do you have any suggestion? Best, Haiteng On 19 April 2013 11:35, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > > Today's Topics: > > 1. Re: Source statistic doesn't match grand average difference > at all and prior knowledge (J?rn M. Horschig) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 19 Apr 2013 11:35:44 +0200 > From: "J?rn M. Horschig" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Source statistic doesn't match grand average > difference at all and prior knowledge > Message-ID: <51710FF0.5040904 at donders.ru.nl> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Dear Haiteng, > > I think in the example the design matrix is wrongly computed. If you > compare the single and the group-level example, it is described exactly > the same, which does not make much sense. Afaik it should be this > instead (analogue to freq statisics on group level): > > /subj = numel(sourceA.trial); > design = zeros(2,2*subj); > for i = 1:subj > design(1,i) = i; > end > for i = 1:subj > design(1,subj+i) = i; > end > design(2,1:subj) = 1; > design(2,subj+1:2*subj) = 2; > / > Let me know if this makes things better (not in today, working from > home, so better reply to this lis). > > Best, > J?rn > > On 4/19/2013 10:25 AM, Haiteng Jiang wrote: > > Hi FTer, > > I am doing Cluster-based permutation statistic after > > beamforming on two condition over subjects following the tutorial > > http://fieldtrip.fcdonders.nl/example/source_statistics, but I get > > something funny. > > In my case , I would expect decreased activity in the visual and > > posterior area. The effect is quite strong, which is showed in the > > grand average difference (log ratio to reduce inter subject > > variability). However , from the statistic , the identified areas > > go to the temporal area , which doesn't make sense at all . Please > > see the below and attached pictures. I understand cluster-based > > permutation test doesn't necessary pick the peak difference, but in > > general it should find main different area. Any comment would be > > greatly appreciated. > > > > Average: > > > > Inline images 2 > > > > > > > > Statistic: > > Inline images 1 > > Best, > > Haiteng > > > > -- > > Haiteng Jiang > > PhD candidate > > Neuronal Oscillations Group > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > > > Visiting address > > Room 2.32 > > Donders Centre for Cognitive Neuroimaging > > Kapittelweg 29 > > 6525 EN Nijmegen > > the Netherlands > > > > Tel.: +31 (0)243668291 > > Web: https://sites.google.com/site/haitengjiang/ > > > > > > _______________________________________________ > > 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: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: not available > Type: image/jpeg > Size: 119056 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment.jpe > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: not available > Type: image/jpeg > Size: 128261 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment-0001.jpe > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 29, Issue 36 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sun Apr 21 04:11:11 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sun, 21 Apr 2013 10:11:11 +0800 Subject: [FieldTrip] Dose have some method that used to determine it in which brain regions (BA areas)? Message-ID: Dear all, I use the 'DICS' ,and got the cortical position of the power.(x,y,z) Dose have some method that used to determine it in which brain regions (BA areas)? thanks best xue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sun Apr 21 04:23:02 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sun, 21 Apr 2013 10:23:02 +0800 Subject: [FieldTrip] about EEGLAB Message-ID: Dear all, I got the '.set ' file from EEGLAB and read into FieldTrip . I'm confused about the coordinate of the tool is different . Do I need to convert the coordinates of the channel ? And how do it ? best, xue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From strauss.mel at gmail.com Mon Apr 22 16:02:41 2013 From: strauss.mel at gmail.com (=?ISO-8859-1?Q?M=E9lanie_Strauss?=) Date: Mon, 22 Apr 2013 16:02:41 +0200 Subject: [FieldTrip] Help to convert FIF MEG/EEG files to EDF format Message-ID: Dear fieldtrip members, I have some difficulties to convert a MEG+EEG FIF file (Elekta neuromag) to EDF format. I used the following functions : data = ft_preprocessing(cfg) filename = 'outfile'; ft_write_data(filename, data.trial{1,1},'header',data.hdr,'dataformat','edf'); There isn't any error during the execution of the function but the converted file seems to be empty. Would anybody have any suggestion to help me? Thanks a lot, Melanie Strauss --- MD, PhD student. CEA/DSV/I2BM / NeuroSpin INSERM U992 - Cognitive Neuroimaging Unit Bât 145 - Point Courrier 156 Gif sur Yvette F-91191 FRANCE Ph: +33(0)1.69.08.22.23 <%2B33%280%29169.08.65.21> E-mail: strauss.mel at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From m_wink10 at uni-muenster.de Mon Apr 22 20:36:18 2013 From: m_wink10 at uni-muenster.de (Martin Winkels) Date: Mon, 22 Apr 2013 20:36:18 +0200 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR Message-ID: Hello Guys, I am trying to perform connectivity analysis in sensor domain (fieldtrip and matlab are up to date). Within doing that I am facing a small problem in the ICA analysis in combination with a MVAR analysis. If I execute the following code, I get an error message as follows: Error using chol Matrix must be positive definite. Error in armorf (line 40) ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); Error in ft_mvaranalysis (line 390) [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), size(tmpdata.trial{1},2), cfg.order); Error in mu_firstexample (line 90) mdata = ft_mvaranalysis(cfg, data_ma_ica); Can anybody help me with that issue? % artifact correction: ica component analysis cfg = []; cfg.method = 'runica'; cfg.runica.pca = 40; comp = ft_componentanalysis(cfg, data_ma); cfg = []; cfg.layout = 'CTF275.lay'; cfg.viewmode = 'component'; ft_databrowser(cfg, comp) %% artifact correction: ica component rejection cfg = []; cfg.component = [4]; % to be removed component(s) data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); %% compute MVAR, spectral transfer and granger % mvar cfg = []; cfg.order = 5; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis(cfg, data_ma_ica); Thank you, -- Martin Winkels B.Sc. / Ingenieur in Medizininformatik und Biomedizintechnik University of Münster phone: +49 177 6090603 mail: m_wink10 at uni-muenster.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From ricardoojm at gmail.com Tue Apr 23 02:33:02 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Mon, 22 Apr 2013 21:33:02 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Lilla, Thanks a lot. It worked perfectly. Best, Ricardo On 12 April 2013 13:39, Ricardo Moura wrote: > Hi Lilla, > Thank you very much for your reply. > It returns "mexglx", which is expected for a linux system, right? > I tried to change the path by my self in the ft_headmodel_dipoli but it > didnt work. Do you know how can I change it properly? > > Best wishes > Ricardo > > > On 11 April 2013 16:40, Ricardo Moura wrote: > >> Hi, >> >> I had to re-install ubuntu in order to provide more space for the >> analysis (since I was having the problem with the temporary files, which >> might have been too large for my ubuntu partition). >> But now the problem I have with the "ft_prepare_headmodel" is even >> weirder than before. The program now is complaining that there is no dipoli >> for my system: >> >> >> cfg = []; >> cfg.method ='dipoli'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> ??? Error using ==> ft_headmodel_dipoli at 138 >> there is no dipoli executable for your platform >> >> Error in ==> ft_prepare_headmodel at 226 >> vol = >> ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); >> >> >> I am running this script in a 2010b matlab version, installed in ubuntu >> 12.04. It should be working fine, right? >> >> Thanks in advance, >> Ricardo >> >> >> On 28 March 2013 14:39, Ricardo Moura wrote: >> >>> Hi Jörn, >>> thank you very much for your response! >>> I checked the segmentation and everything seems to be ok (as far as I >>> can say... No error messages were shown during the processing and I checked >>> the generated objects and plots). >>> >>> But I had a strange error while preparing the head model. Somehow the >>> command cannot find the dipoli files, even thought they are really where >>> they should be. And the second message >>> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue >>> of what it means. >>> >>> And I am running this command on a ubuntu 12.04 32-bit. >>> >>> Do you have any idea of how I can solve it? >>> >>> Thanks once again,Best, >>> Ricardo >>> >>> using the executable >>> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >>> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >>> not found >>> Warning: an error ocurred while running dipoli >>> > In ft_headmodel_dipoli at 201 >>> In ft_prepare_headmodel at 226 >>> >>> Error using fread >>> Invalid file identifier. Use fopen to generate a valid file identifier. >>> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >>> found. >>> > In ft_headmodel_dipoli at 209 >>> In ft_prepare_headmodel at 226 >>> >>> >>> On 27 March 2013 13:10, Ricardo Moura wrote: >>> >>>> Dear all >>>> I am creating a BEM model for eeg, following the appropriate tutorial, >>>> but I have a problem when preparing the headmodel. The output I have from >>>> the ft_prepare_headmodel command does not contain the "mat", and so, when I >>>> try to generate the leadfield, it returns an error message due to non >>>> existent "mat". I saw that other users had similar problem, but I haven't >>>> found a solution though. So, what is wrong with my script? >>>> >>>> Thanks a lot in advance! >>>> Best, >>>> Ricardo >>>> >>>> >>>> >>>> >>>> load standard_mri.mat >>>> mri_orig=mri; >>>> disp(mri) >>>> >>>> % Segmenting the data >>>> cfg = []; >>>> cfg.output= {'scalp','skull','brain'}; >>>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>>> disp(segmentedmri) >>>> save segmentedmri segmentedmri >>>> >>>> % MESH >>>> cfg=[]; >>>> cfg.tissue={'brain','skull','scalp'}; >>>> cfg.numvertices = [3000 2000 1000]; >>>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>>> disp(bnd(1)) >>>> >>>> % Head Model = variavel vol >>>> cfg = []; >>>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> >>>> >> disp(vol) >>>> bnd: [1x3 struct] >>>> cond: [0.3300 0.0041 0.3300] >>>> skin_surface: 1 >>>> source: 3 >>>> type: 'dipoli' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Tue Apr 23 09:36:16 2013 From: narayan.ps at tut.fi (Narayan P Subramaniyam) Date: Tue, 23 Apr 2013 10:36:16 +0300 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR In-Reply-To: References: Message-ID: <517639F0.30808@tut.fi> Although I am not an expert in connectivity analysis, but from a mathematical point of view it looks like the case where at least one variable in covariance matrix is a exact linear combination of other and hence it is not positive definite. This could be due to rejection of few components by ICA ? Other experts may shed more light... On 22/04/2013 21:36, Martin Winkels wrote: > Hello Guys, > > I am trying to perform connectivity analysis in sensor domain > (fieldtrip and matlab are up to date). Within doing that I am facing a > small problem in the ICA analysis in combination with a MVAR analysis. > If I execute the following code, I get an error message as follows: > > > Error using chol > Matrix must be positive definite. > > Error in armorf (line 40) > ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); > > Error in ft_mvaranalysis (line 390) > [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), > size(tmpdata.trial{1},2), cfg.order); > > Error in mu_firstexample (line 90) > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Can anybody help me with that issue? > > > % artifact correction: ica component analysis > > cfg = []; > cfg.method = 'runica'; > cfg.runica.pca = 40; > comp = ft_componentanalysis(cfg, data_ma); > > cfg = []; > cfg.layout = 'CTF275.lay'; > cfg.viewmode = 'component'; > ft_databrowser(cfg, comp) > > %% artifact correction: ica component rejection > > cfg = []; > cfg.component = [4]; % to be removed component(s) > data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); > > %% compute MVAR, spectral transfer and granger > > % mvar > cfg = []; > cfg.order = 5; > cfg.toolbox = 'bsmart'; > > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Thank you, > > -- > Martin Winkels > > B.Sc. / Ingenieur in > Medizininformatik und Biomedizintechnik > > University of Münster > > phone: +49 177 6090603 > mail: m_wink10 at uni-muenster.de > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- With Best Regards, Narayan P Subramaniyam, M.Sc. Researcher/PhD student Department of Electronics and Communications Engineering Tampere University of Technology Finn-Medi 1, 4th Floor, Room 203 Biokatu 6, FI-33520 Tampere, Finland Tel: +358 (0)40 198 1951 E-mail: narayan.ps at tut.fi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 23 09:54:39 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 23 Apr 2013 09:54:39 +0200 Subject: [FieldTrip] Dose have some method that used to determine it in which brain regions (BA areas)? In-Reply-To: References: Message-ID: <51763E3F.70001@donders.ru.nl> Dear Xue, please have a look here: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended The atlas thing is sometimes a bit buggy, meaning that sometimes labels are not shown. It depends a bit on the type of atlas and the coordinate system. The method + atlas proposed in the tutorial should work. Best, Jörn On 4/21/2013 4:11 AM, ?? wrote: > Dear all, > I use the 'DICS' ,and got the cortical position of the power.(x,y,z) > Dose have some method that used to determine it in which brain regions > (BA areas)? > thanks > best > xue. > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Tue Apr 23 09:59:58 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 23 Apr 2013 09:59:58 +0200 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR In-Reply-To: References: Message-ID: <51763F7E.4000304@donders.ru.nl> Hi Martin, that error most likely occurs because the rank of your datamatrix is not full. This can e.g. be the case for EEG data where you include the reference channel (or common average rereferenced) or when you used ft_channelrepair or, in your case, when you removed an ICA component, therefore reducing the rank of your data. I am not sure what the best solution for this is, because there are several, e.g. you could do your MVar analysis on ICA data directly, do it on a subset of channels so that the datamatrix is rank sufficient again or just refrain from doing the mvar analysis. Best, Jörn On 4/22/2013 8:36 PM, Martin Winkels wrote: > Hello Guys, > > I am trying to perform connectivity analysis in sensor domain > (fieldtrip and matlab are up to date). Within doing that I am facing a > small problem in the ICA analysis in combination with a MVAR analysis. > If I execute the following code, I get an error message as follows: > > > Error using chol > Matrix must be positive definite. > > Error in armorf (line 40) > ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); > > Error in ft_mvaranalysis (line 390) > [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), > size(tmpdata.trial{1},2), cfg.order); > > Error in mu_firstexample (line 90) > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Can anybody help me with that issue? > > > % artifact correction: ica component analysis > > cfg = []; > cfg.method = 'runica'; > cfg.runica.pca = 40; > comp = ft_componentanalysis(cfg, data_ma); > > cfg = []; > cfg.layout = 'CTF275.lay'; > cfg.viewmode = 'component'; > ft_databrowser(cfg, comp) > > %% artifact correction: ica component rejection > > cfg = []; > cfg.component = [4]; % to be removed component(s) > data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); > > %% compute MVAR, spectral transfer and granger > > % mvar > cfg = []; > cfg.order = 5; > cfg.toolbox = 'bsmart'; > > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Thank you, > > -- > Martin Winkels > > B.Sc. / Ingenieur in > Medizininformatik und Biomedizintechnik > > University of Münster > > phone: +49 177 6090603 > mail: m_wink10 at uni-muenster.de > > > > > _______________________________________________ > 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 b.osuagwu.1 at research.gla.ac.uk Tue Apr 23 11:17:27 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Tue, 23 Apr 2013 10:17:27 +0100 Subject: [FieldTrip] ICA and covariance matrix for CSP Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> Hi Everyone, I want to ask a general mathematical question relating to ICA and common spatial pattern. Hopefully someone will help me out. I have noticed that after using ICA to remove artifact in my signal, I can no longer compute the covariance matrices needed for common spatial pattern without matlab giving me warning regarding the accuracy of the estimated matrix. Indeed the estimated matrix is not accurate. This does not happen if I use only a small subset of my channels after removing noise with ICA. If I do not use ICA at all the warning disappears. I want to ask if anybody knows why ICA causes this issue and how I can fix it. Thanks a lot. Bethel Osuagwu From zriouil.imane at gmail.com Tue Apr 23 16:09:10 2013 From: zriouil.imane at gmail.com (z.imane) Date: Tue, 23 Apr 2013 16:09:10 +0200 Subject: [FieldTrip] (no subject) Message-ID: hi, * * i'm started to use FielTrip, and i want to read data from .plx extension. with data.plx contain LFP and spike data * * when I execute the following function: data=ft_read_header('data.plx') I have the error message: ??? Error using ==> ft_read_header at 1550 * *different sampling rates in continuous data not supported * * * * and when I execute: data=ft_read_spike('data.plx') * * Error in ==> ft_read_spike at 180 * *nchan = length(hdr.ChannelHeader); * * * * Please suggestions thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Tue Apr 23 17:16:28 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Tue, 23 Apr 2013 17:16:28 +0200 Subject: [FieldTrip] ICA and covariance matrix for CSP In-Reply-To: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> References: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> Message-ID: Hi Bethel, Removing a component with ICA will reduce the rank (number linear independent components) of your data. The covariance matrix itself probably can be computed, but I suspect the warning you are getting is when you are computing the inverse. The inverse of a rank-deficient matrix cannot be computed (and so the warnings you get are expected). Regularisation (e.g. adding some 'noise' to the diagonal of the covariance matrix, roughly equal to the amount of estimated sensor noise) prior to inversion is the common way around this problem. In FieldTrip, this is cfg.lambda when calling ft_sourceanalysis, which you can set to a percentage, for example '5%' is common, of the trace of the covariance matrix. Best, Johanna 2013/4/23 Bethel Osuagwu > Hi Everyone, > > I want to ask a general mathematical question relating to ICA and common > spatial pattern. Hopefully someone will help me out. > > I have noticed that after using ICA to remove artifact in my signal, I can > no longer compute the covariance matrices needed for common spatial pattern > without matlab giving me warning regarding the accuracy of the estimated > matrix. Indeed the estimated matrix is not accurate. This does not happen > if I use only a small subset of my channels after removing noise with ICA. > If I do not use ICA at all the warning disappears. > > I want to ask if anybody knows why ICA causes this issue and how I can fix > it. > > Thanks a lot. > Bethel Osuagwu > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coppolar at mail.nih.gov Tue Apr 23 20:53:08 2013 From: coppolar at mail.nih.gov (Coppola, Richard (NIH/NIMH) [E]) Date: Tue, 23 Apr 2013 18:53:08 +0000 Subject: [FieldTrip] Post-doc postion possibility at NIMH Message-ID: <94A0A015317F894DA3A7A53C578E81E90A7450@MLBXV06.nih.gov> We anticipate an opportunity for a post-doctoral fellow to join the research team of the Experimental Therapeutics and Pathophysiology Branch of the NIMH Intramural Research Program, led by Dr Zarate. This group has been involved with the groundbreaking studies examining neural plasticity in antidepressant action with MEG and other imaging modalities (see Cornwell B et al: Biol Psychiatry, 2012; Neuropsychopharmacology, 2010, etc). The fellow would be heavily involved in the planning and analyses of the MEG studies of the Branch in collaboration with the NIMH MEG Core Facility staff and Dr. Coppola. The fellow would have access to the unique large data set already collected as well as opportunity for future studies. The candidate should be a recent or expected Ph.D., and have an appropriate background in Neuroscience, neuroimaging methods, and applied statistics along with specific experience in advanced MEG and/or fMRI analysis. Substantial skills in statistics, programming and scientific writing will be essential. Please email with the subject line ETPB-PostDoc, a cover letter, CV, and names of references to Drs Zarate and Coppola. Dr. Zarate's current research focus is on developing novel medications for treatment-resistant depression and bipolar disorder. His areas of expertise include biological and pharmacological aspects of mood disorders in adults. Dr. Zarate's group conducts proof-of-concept studies utilizing novel compounds and biomarkers (magnetoencephalography [MEG] and polysomnography [PSG], positron emission tomography, functional MRI and magnetic resonance spectroscopy [MRS]) to identify potentially relevant drug targets and biosignatures of treatment response. A multidisciplinary translational research team conducts the research in the ETPB. In addition, the Branch provides training to develop the next generation of clinical translational researchers. Carlos A. Zarate, Jr., M.D. Chief Experimental Therapeutics & Pathophysiology Branch & Section Neurobiology and Treatment of Mood Disorders Division of Intramural Research Program National Institute of Mental Health 10 Center Drive, CRC, Unit 7 SE, Rm. 7-3465 Bethesda, MD 20892-1282 zaratec at mail.nih.gov http://intramural.nimh.nih.gov/research/pi/pi_zarate_c.html The MEG Core provides a state of the art facility supporting the (CTF) Omega 2000 275-channel MEG system for the use of PI's of the Intramural Research Programs of NIMH and NINDS Dr. Richard Coppola Dir. NIMH MEG Core Facility Bldg 10 Room 3C119 Bethesda, MD 20892 coppolar at mail.nih.gov http://kurage.nimh.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Korey.Kam at med.nyu.edu Wed Apr 24 01:18:19 2013 From: Korey.Kam at med.nyu.edu (Kam, Korey) Date: Tue, 23 Apr 2013 23:18:19 +0000 Subject: [FieldTrip] Import of Spike2 data (.smr) Message-ID: Hello everyone, As a potential user of FT, I am interested in performing spike train and spike-LFP analyses. My data files are in .smr (Spike2 file format). Therefore, my question is the following: Is there a function to import .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no avail. Thanks and this really is a great community, Korey -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Wed Apr 24 07:39:20 2013 From: inieuwenhuis at berkeley.edu (Ingrid Lyda Catharina Nieuwenhuis) Date: Tue, 23 Apr 2013 22:39:20 -0700 Subject: [FieldTrip] using sloreta in FieldTrip Message-ID: Hi all, Does anyone has experience with using FieldTrip for looking at sources generated using the Loreta-key program? I've generated sLoreta files and read them into FieldTrip using loreta2fieldtrip as described on the FieldTrip wiki . Note, I first got an "Invalid precision" error from fread due to line 89: activity = fread(fid, [voxnumber 1], 'float = >single'); But after I changed this line to: activity = fread(fid, [voxnumber 1]); it worked. But now I'd like to plot this on an anatomical MRI since without anatomy it looks hard to interpret (see attached). The source should be in MNI space (see info on loreta-key page), so I tried using the T1.nii template from SPM (that's in MNI space, correct?: %read in template MRI (MNI) template = ft_read_mri('C:\Users\Ingrid\Documents\MATLAB\FieldTrip\external\spm8\templates\T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % interpolate cfg = []; cfg.parameter = 'avg.pow'; [interp] = ft_sourceinterpolate(cfg, GA_source, template); %sourceplot cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.coordsys = 'mni'; ft_sourceplot(cfg,interp); But that doesn't work (see capture2). I'm a bit lost now... Anyone any ideas? Maybe I should use the "mni152" template. since that is what the loreta website says it's based on. Anyone know where to get that template in a format FieldTrip can read? So in short: 1) has anyone done this before and has tips / code to share? 2) is the T1.nii template from SPM in MNI space? 3) do you think the mni152 is different from T1.nii, and would work? if so anyone know where to get it in format FieldTrip can read? 4) am I missing something in steps explaining why my source does not match the anatomy? Thanks! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture.PNG Type: image/png Size: 48260 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture2.PNG Type: image/png Size: 94462 bytes Desc: not available URL: From wljj09 at gmail.com Wed Apr 24 09:28:05 2013 From: wljj09 at gmail.com (Jing Wang) Date: Wed, 24 Apr 2013 15:28:05 +0800 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: Dear Korey, As far as I know, you can not import .smr file into FT directly. My experience is to use third sofeware such as Neuroexplore to transform .smr to .nex format, which could be imported directly. Best Jing 2013/4/24 Kam, Korey > Hello everyone, > > As a potential user of FT, I am interested in performing spike train and > spike-LFP analyses. My data files are in .smr (Spike2 file format). > > Therefore, my question is the following: Is there a function to import > .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no > avail. > > Thanks and this really is a great community, > > Korey > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Wed Apr 24 09:31:58 2013 From: zriouil.imane at gmail.com (z.imane) Date: Wed, 24 Apr 2013 09:31:58 +0200 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: hi, have you read the contents of your file. smr by using the function " FT_READ_SPIKE"? thanks 2013/4/24 Jing Wang > Dear Korey, > > As far as I know, you can not import .smr file into FT directly. My > experience is to use third sofeware such as Neuroexplore to transform .smr > to .nex format, which could be imported directly. > > Best > > Jing > > > 2013/4/24 Kam, Korey > >> Hello everyone, >> >> As a potential user of FT, I am interested in performing spike train and >> spike-LFP analyses. My data files are in .smr (Spike2 file format). >> >> Therefore, my question is the following: Is there a function to import >> .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no >> avail. >> >> Thanks and this really is a great community, >> >> Korey >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Zriouil Imane -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonas at obleser.de Wed Apr 24 11:23:20 2013 From: jonas at obleser.de (Jonas Obleser) Date: Wed, 24 Apr 2013 11:23:20 +0200 Subject: [FieldTrip] Postdoctoral posititon in auditory cognition/auditory neuroscience, Max Planck Institute, Leipzig Message-ID: <752383FF-BD27-4536-BDE8-DA390D3BE71B@obleser.de> -- Apologies for cross-postings -- The Max Planck Institute for Human Cognitive and Brain Sciences (MPI–CBS) in Leipzig and the Max Planck Research Group “Auditory Cognition” (headed by Jonas Obleser) are now offering a Postdoctoral researcher Position, for initially 2 years, preferably starting by October 2013. Successful candidates will have a PhD in cognitive neuroscience, psychology, or natural sciences. Prior experience with either fMRI or EEG/MEG methods is expected, and an interest in further applying and combining both domains in their research is highly desirable. Candidates with a background and/or interest in advanced fMRI methods are particularly encouraged to apply. The successful candidate will share our enthusiasm in problems of auditory cognition and auditory neuroscience, and ideally has already demonstrated this by contributing to the field. However, researchers with a background in visual or other neuroscience are also encouraged to apply. He or she should have a solid methods background and strong methods interest, hands-on experience in problems of data and statistical analysis, and the interest to co-supervise the PhD and Master students in the group. The position offered does not include any teaching obligations. Starting date is flexible. Salary is dependent on experience and based on MPI stipends or equivalent salary according to German Public service regulations. The research will be conducted at the MPI–CBS in Leipzig, Germany, an internationally leading centre for cognitive and imaging neuroscience equipped with a 7.0 T MRI scanner, three 3.0 T MRI scanners, a 306 channels MEG system, a TMS system and several EEG suites. All facilities are supported by experienced IT and physics staff. Our institute (just 190 km, or 70 minutes by train, south of Berlin) offers a very international environment, with English being the language spoken in the laboratory. It offers a friendly and generous environment of researchers with diverse backgrounds and with an excellent infrastructure. In order to increase the proportion of female staff members, applications from female scientists are particularly encouraged. Preference will be given to disabled persons with the same qualification. Applications should be kindly sent to personal at cbs.mpg.de using the application code “PD 03/2013” in the subject. Please send your application as a single pdf attachment, with the file name containing your surname. It should enclose a cover letter (max. 2 pages) that also specifies your future research interests; a CV; up to three representative reprints; and contact details of 2 personal references. This call remains open until the position is filled. For further details please contact Dr Jonas Obleser, Max Planck Institute for Human Cognitive and Brain Sciences, Leipzig, Germany, obleser at cbs.mpg.de http://www.cbs.mpg.de http://www.cbs.mpg.de/groups/misc/mprg-ac http://obleserlab.com From b.osuagwu.1 at research.gla.ac.uk Wed Apr 24 11:31:04 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Wed, 24 Apr 2013 10:31:04 +0100 Subject: [FieldTrip] ICA and covariance matrix for CSP In-Reply-To: References: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk>, Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202571@CMS07.campus.gla.ac.uk> Thank you Johanna for that explanation. I guess I should try out the regularization then! Thanks Bethel ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] On Behalf Of Johanna Zumer [johanna.zumer at donders.ru.nl] Sent: 23 April 2013 16:16 To: FieldTrip discussion list Subject: Re: [FieldTrip] ICA and covariance matrix for CSP Hi Bethel, Removing a component with ICA will reduce the rank (number linear independent components) of your data. The covariance matrix itself probably can be computed, but I suspect the warning you are getting is when you are computing the inverse. The inverse of a rank-deficient matrix cannot be computed (and so the warnings you get are expected). Regularisation (e.g. adding some 'noise' to the diagonal of the covariance matrix, roughly equal to the amount of estimated sensor noise) prior to inversion is the common way around this problem. In FieldTrip, this is cfg.lambda when calling ft_sourceanalysis, which you can set to a percentage, for example '5%' is common, of the trace of the covariance matrix. Best, Johanna 2013/4/23 Bethel Osuagwu > Hi Everyone, I want to ask a general mathematical question relating to ICA and common spatial pattern. Hopefully someone will help me out. I have noticed that after using ICA to remove artifact in my signal, I can no longer compute the covariance matrices needed for common spatial pattern without matlab giving me warning regarding the accuracy of the estimated matrix. Indeed the estimated matrix is not accurate. This does not happen if I use only a small subset of my channels after removing noise with ICA. If I do not use ICA at all the warning disappears. I want to ask if anybody knows why ICA causes this issue and how I can fix it. Thanks a lot. Bethel Osuagwu _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From litvak.vladimir at gmail.com Wed Apr 24 11:47:12 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 24 Apr 2013 10:47:12 +0100 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: Dear Korey, FT_READ_SPIKE function does not have anything to do with Spike2 software. It is a function for reading spike data from many formats. You could read .smr files created by Spike2 v. 5 and earlier directly into Fieldtrip using ft_preprocessing. This requires Neuroshare library that you can get from http://neuroshare.sourceforge.net/. For v. 6 and later you can export the data into .mat file from Spike 2 and those mat files can be converted into Fieldtrip. The settings should be something like the attached. Best, Vladimir On Wed, Apr 24, 2013 at 12:18 AM, Kam, Korey wrote: > Hello everyone, > > As a potential user of FT, I am interested in performing spike train and > spike-LFP analyses. My data files are in .smr (Spike2 file format). > > Therefore, my question is the following: Is there a function to import > .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no > avail. > > Thanks and this really is a great community, > > Korey > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nishiokov at gmail.com Wed Apr 24 17:26:24 2013 From: nishiokov at gmail.com (Yoshiyuki Nishio) Date: Wed, 24 Apr 2013 11:26:24 -0400 Subject: [FieldTrip] ft_databrowser with cfg.selectmode='markpeakevent'/'marktroughevent' Message-ID: Dear FieldTrippers, When I tried to identify time-points of interest on ft_databrowser with cfg.selectmode='markpeakevent' or 'marktroughevent', I got the error message below: *Attempt to reference field of non-structure array.* *Error in ft_databrowser>select_range_cb (line 960)* * if any(intersect(begsel:endsel, [opt.event.sample]))* *Error in ft_select_range>evalCallback (line 325)* * feval(funhandle, funargs{:}, val, cmenulab);* *Error in ft_select_range (line 159)* * evalCallback(callback, userData.range); * *Error using waitfor* *Error while evaluating figure WindowButtonDownFcn* * * Here's the script: cfg.viewmode = 'vertical'; cfg.blocksize = 2; cfg.continuous = 'yes'; cfg.channel = 'EEG RMFP_06-REF'; cfg.selectmode = 'marktroughevent'; cfg.trl = 'all'; cfg = ft_databrowser(cfg, data); The error never happens on the 'markaritifact' mode. Can you help me find the problem? Thanks a lot, Yoshi -------------- next part -------------- An HTML attachment was scrubbed... URL: From isabella.premoli at gmail.com Thu Apr 25 13:42:33 2013 From: isabella.premoli at gmail.com (isabella premoli) Date: Thu, 25 Apr 2013 13:42:33 +0200 Subject: [FieldTrip] Problem in importing BVA file Message-ID: Hi! I have a problem in reading .dat Brain Vision files with fieldtrip. The export parameters used in Brain Vision are: *** Generic Data Export *** File name parameter: $n_$h File extension: .dat Write header file: yes Write marker file: yes Format: ASCII Orientation: MULTIPLEXED Line Delimiter: CRLF (PC style) Add channel names: no Overwrite default decimal symbol: yes Decimal symbol: . Export all channels: yes The code in fieldtrip to read the data is: cfg= []; cfg.dataset= sprintf('%s.dat',read_data_name); cfg.trialdef.eventtype= 'Stimulus'; cfg.trialdef.eventvalue= {cond1;cond2;cond3;cond4}'; cfg.trialdef.poststim= 0.5; cfg.trialdef.prestim= 0.3; cfg = ft_definetrial(cfg); cfg.channel = {'all'}; cfg.continuous = 'no'; trl = cfg.trl; The problem is that for some subjects is working and for others not. The files are exported exactly in the same way and they undergo exactly the same steps in the Brain Vision analyzer. The error I encounter is: Error using str2num (line 33) Requires string or character array input. Error in read_brainvision_eeg (line 112) dat(line,:) = str2num(str); Error in ft_read_data (line 340) dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample, chanindx); Error in ft_preprocessing (line 503) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) Do you have any ideas on how I can fix this? Any help would be much appreciated. Cheers, Isabella -- Isabella Premoli, PhD student Department of Neurology, Tübingen University Hospital, Hoppe-Seyler-Str. 3, D-72076 Tübingen -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayelet.landau at gmail.com Thu Apr 25 14:16:36 2013 From: ayelet.landau at gmail.com (Ayelet Landau) Date: Thu, 25 Apr 2013 14:16:36 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: References: <51670147.4080803@berkeley.edu> Message-ID: Hi all, Barbara Händel and I have spent some time checking how deep this unit problem goes. I don't know if the bug control made it to this issue as of yet, but it occurs to us that this can be very easily controlled if one were to add a cfg.unit to ft_plot_mesh and ft_plot_vol. evidently, the defaults for grid and the defaults for volume seem to be different (cm for the first mm for the latter and others). When you run the two plotting commands there is no way to propagate a "common scaling" since those are separate commands. Adding the units and having a single (common) unit for the output which is plotted would deal with this problem. greetings from Frankfurt, Ayelet and Barbara On Fri, Apr 12, 2013 at 8:06 AM, Diego Lozano Soldevilla < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > >> Hi all, >> >> When I follow the code according to the example matlab script "Create >> MNI-aligned grids in individual head-space" something goes all wrong with >> the units. >> >> I've followed the code (pasted below, from the wiki), but when I make the >> figure with the template head model and dipole grid, it's wrong (see >> attached ..._problem.png). The dipole grid is tiny in the bottom of the >> head model. The black area is the dipole grid, not good. >> template_grid = >> xgrid: [1x41 double] >> ygrid: [1x41 double] >> zgrid: [1x41 double] >> dim: [41 41 41] >> pos: [68921x3 double] >> unit: 'mm' >> inside: [1x68910 double] >> outside: [758 759 760 761 799 800 801 802 843 884 925] >> cfg: [1x1 struct] >> >> It's a problem with the units, because the template grid has 'mm' in the >> unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the >> numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos >> field by 10, the grid is not tight (see attached ..._multiplied10.png). It >> looks like the unit problem messed up the determination of what's inside >> and outside. As you can see in the template_grid, there are only a few grid >> point outside, which is clearly not correct (maybe inside/outside was >> determined on wrong units?). >> >> So, it looks like a bug to me, or am I doing something wrong? I'm using >> the newest FT version. >> >> Thanks, >> Ingrid >> >> %%% CODE FROM WIKI %%% >> template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', >> filesep,'templates', filesep,'T1.nii']); >> template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the >> coordinate system >> >> % segment the template brain and construct a volume conduction model >> (i.e. head model): this is needed >> % for the inside/outside detection of voxels. >> cfg = []; >> template_seg = ft_volumesegment(cfg, template); >> >> cfg = []; >> cfg.method = 'singleshell'; >> template_vol = ft_prepare_headmodel(cfg, template_seg); >> >> % construct the dipole grid in the template brain coordinates >> % the source units are in cm >> % the negative inwardshift means an outward shift of the brain surface >> for inside/outside detection >> cfg = []; >> cfg.grid.xgrid = -20:1:20; >> cfg.grid.ygrid = -20:1:20; >> cfg.grid.zgrid = -20:1:20; >> cfg.grid.unit = 'cm'; >> cfg.grid.tight = 'yes'; >> cfg.inwardshift = -1.5; >> cfg.vol = template_vol; >> template_grid = ft_prepare_sourcemodel(cfg); >> >> % make a figure with the template head model and dipole grid >> figure >> hold on >> ft_plot_vol(template_vol); >> ft_plot_mesh(template_grid); >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Ayelet N. Landau Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Mobile: +49 (0)16 22733 110 Fax: +49 (0)69 96769 555 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Thu Apr 25 15:49:00 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Thu, 25 Apr 2013 09:49:00 -0400 Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser Message-ID: dear Fieldtrippers, i am analysing spontaneous data and have some artifacts i'd like to exlcude by visual inspection on the contiunous data. So after prepocessing the data, I use cfg=ft_databrowser(cfg,alldata) and select manually the segments with artfacts. Then i run ft_rejectartifact cleandata = ft_rejectartifact(cfg,alldata); detected 12 visual artifacts rejected 1 trials completely rejected 0 trials partially resulting 0 trials Error using ft_rejectartifact (line 478) No trials left after artifact rejection. any idea which cfg specs should i use? thanks, -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Apr 25 15:59:07 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 25 Apr 2013 15:59:07 +0200 (CEST) Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: Message-ID: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> Hi Jose, Are you analyzing continuous data? If this is the case, you should specify cfg.artfctdef.reject = 'partial' before calling ft_rejectartifact. The reason is that the default is 'complete' and if you're computing continuous data (not stimulus locked) you only have one trial and for instance nothing left after the rejection. best, Diego ----- Original Message ----- > From: "Jose Herrero" > To: "FieldTrip discussion list" > Sent: Thursday, 25 April, 2013 3:49:00 PM > Subject: [FieldTrip] using ft_rejectartifact on continuos data after > manual rejection with ft_databrowser > dear Fieldtrippers, > i am analysing spontaneous data and have some artifacts i'd like to > exlcude by visual inspection on the contiunous data. > So after prepocessing the data, I use > cfg=ft_databrowser(cfg,alldata) > and select manually the segments with artfacts. > Then i run ft_rejectartifact > cleandata = ft_rejectartifact(cfg,alldata); > detected 12 visual artifacts > rejected 1 trials completely > rejected 0 trials partially > resulting 0 trials > Error using ft_rejectartifact (line 478) > No trials left after artifact rejection. > any idea which cfg specs should i use? > thanks, > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Trigon, room 0.83 Kapittelweg 29 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands E-Mail: d.lozanosoldevilla at fcdonders.ru.nl Tel: +31-(0)24-36-66274 Web: http://www.neuosc.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From strauss.mel at gmail.com Thu Apr 25 16:05:17 2013 From: strauss.mel at gmail.com (=?ISO-8859-1?Q?M=E9lanie_Strauss?=) Date: Thu, 25 Apr 2013 16:05:17 +0200 Subject: [FieldTrip] Problem to convert files from fif to edf format Message-ID: Dear all, I have some difficulties to convert a MEG+EEG FIF file (Elekta neuromag) to EDF format. I used the following functions : cfg.dataset = DATA data = ft_preprocessing(cfg) ft_write_data(filename, data.trial{1,1},'dataformat','edf'); There is no error during the execution of the function but the converted file is empty. Has anybody any suggestion to help me? Thanks a lot, Melanie Strauss --- MD, PhD student. CEA/DSV/I2BM / NeuroSpin INSERM U992 - Cognitive Neuroimaging Unit Bât 145 - Point Courrier 156 Gif sur Yvette F-91191 FRANCE Ph: +33(0)1.69.08.22.23 <%2B33%280%29169.08.65.21> E-mail: strauss.mel at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Thu Apr 25 16:51:18 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Thu, 25 Apr 2013 10:51:18 -0400 Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> References: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: thanks so much Diego. that works just fine. it is a nice tool and, as far as i see, you can do it again if necessary [e.g. artf1=ft_databrowser(cfg,cleandata)] and artf1.artfctdef.visual.artifact will keep adding times for artifacts, correct? On Thu, Apr 25, 2013 at 9:59 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Jose, > > Are you analyzing continuous data? If this is the case, you should > specify cfg.artfctdef.reject = 'partial' before calling ft_rejectartifact. > The reason is that the default is 'complete' and if you're computing > continuous data (not stimulus locked) you only have one trial and for > instance nothing left after the rejection. > > best, > > Diego > > ------------------------------ > > *From: *"Jose Herrero" > *To: *"FieldTrip discussion list" > *Sent: *Thursday, 25 April, 2013 3:49:00 PM > *Subject: *[FieldTrip] using ft_rejectartifact on continuos data after > manual rejection with ft_databrowser > > > dear Fieldtrippers, > > i am analysing spontaneous data and have some artifacts i'd like to > exlcude by visual inspection on the contiunous data. > > So after prepocessing the data, I use > cfg=ft_databrowser(cfg,alldata) > and select manually the segments with artfacts. > > Then i run ft_rejectartifact > > cleandata = ft_rejectartifact(cfg,alldata); > detected 12 visual artifacts > rejected 1 trials completely > rejected 0 trials partially > resulting 0 trials > Error using ft_rejectartifact (line 478) > No trials left after artifact rejection. > > any idea which cfg specs should i use? > > thanks, > > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Trigon, room 0.83 > Kapittelweg 29 > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > E-Mail: d.lozanosoldevilla at fcdonders.ru.nl > Tel: +31-(0)24-36-66274 > Web: http://www.neuosc.com/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Apr 25 17:07:34 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 25 Apr 2013 17:07:34 +0200 (CEST) Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: Message-ID: <891914955.730839.1366902454784.JavaMail.root@sculptor.zimbra.ru.nl> Indeed: artf1.artfctdef.visual.artifact is a Nx2 matrix that contains the begin and the end sample that you manually select, being N the number of selected artifacts Saludos! Diego ----- Original Message ----- > From: "Jose Herrero" > To: "Diego Lozano" , > "FieldTrip discussion list" > Sent: Thursday, 25 April, 2013 4:51:18 PM > Subject: Re: [FieldTrip] using ft_rejectartifact on continuos data > after manual rejection with ft_databrowser > thanks so much Diego. that works just fine. > it is a nice tool and, as far as i see, you can do it again if > necessary > [e.g. artf1=ft_databrowser(cfg,cleandata)] and > artf1.artfctdef.visual.artifact will keep adding times for artifacts, > correct? > On Thu, Apr 25, 2013 at 9:59 AM, Lozano Soldevilla, D. (Diego) < > d.lozanosoldevilla at fcdonders.ru.nl > wrote: > > Hi Jose, > > Are you analyzing continuous data? If this is the case, you should > > specify cfg.artfctdef.reject = 'partial' before calling > > ft_rejectartifact. The reason is that the default is 'complete' and > > if > > you're computing continuous data (not stimulus locked) you only have > > one trial and for instance nothing left after the rejection. > > best, > > Diego > > > From: "Jose Herrero" < jose.herrero66 at gmail.com > > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > > Sent: Thursday, 25 April, 2013 3:49:00 PM > > > Subject: [FieldTrip] using ft_rejectartifact on continuos data > > > after > > > manual rejection with ft_databrowser > > > dear Fieldtrippers, > > > i am analysing spontaneous data and have some artifacts i'd like > > > to > > > exlcude by visual inspection on the contiunous data. > > > So after prepocessing the data, I use > > > cfg=ft_databrowser(cfg,alldata) > > > and select manually the segments with artfacts. > > > Then i run ft_rejectartifact > > > cleandata = ft_rejectartifact(cfg,alldata); > > > detected 12 visual artifacts > > > rejected 1 trials completely > > > rejected 0 trials partially > > > resulting 0 trials > > > Error using ft_rejectartifact (line 478) > > > No trials left after artifact rejection. > > > any idea which cfg specs should i use? > > > thanks, > > > -- > > > Jose L Herrero, PhD > > > Department of Psychiatry > > > Columbia University College of Physicians and Surgeons > > > Cognitive Neuroscience and Schizophrenia Program > > > Nathan S. Kline Institute for Psychiatric Research > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > > PhD Student > > Neuronal Oscillations Group > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Trigon, room 0.83 > > Kapittelweg 29 > > Radboud University Nijmegen > > NL-6525 EN Nijmegen > > The Netherlands > > E-Mail: d.lozanosoldevilla at fcdonders.ru.nl > > Tel: +31-(0)24-36-66274 > > Web: http://www.neuosc.com/ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Trigon, room 0.83 Kapittelweg 29 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands E-Mail: d.lozanosoldevilla at fcdonders.ru.nl Tel: +31-(0)24-36-66274 Web: http://www.neuosc.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From robince at gmail.com Fri Apr 26 11:11:05 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 10:11:05 +0100 Subject: [FieldTrip] filter in-memory trials data with mirroring Message-ID: Hello, Is it possible filter in-memory extracted trials data with mirroring at the edges? When I try: % filter cfg = [];cfg.lpfilter = 'yes';cfg.lpfreq = '40';cfg.lpfilttype = 'but';cfg.padtype = 'mirror';% trial length is 1.1s so mirror-pad to 1.5s (200ms each side)cfg.padding = 1.5; flt_data = ft_preprocessing(cfg, block_data); I get: Reference to non-existent field 'Fs'. Error in ft_preprocessing (line 288) padding = round(cfg.padding * data.Fs); Adding block_data.Fs = block_data.fsample; seems to work. But in the resulting data structure the time vectors no longer match the trial data, so obviously something is going wrong: >> size(block_data.time{1}) ans = 1 560 >> size(block_data.trial{1}) ans = 234 560 >> size(flt_data.trial{1}) ans = 234 560 >> size(flt_data.time{1}) ans = 1 357 Is there a correct way to do this? (Filter trials with mirrored edges) Thanks, Robin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 26 11:37:37 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 26 Apr 2013 11:37:37 +0200 Subject: [FieldTrip] filter in-memory trials data with mirroring In-Reply-To: References: Message-ID: <517A4AE1.6000507@donders.ru.nl> Hi Robin, yep, that sounds pretty much like a bug to me. Would you mind creating a bug on bugzilla for this? http://bugzilla.fcdonders.nl/ I will try to look into this next week. Thanks so far for reporting this. Best, Jörn On 4/26/2013 11:11 AM, Robin wrote: > > Hello, > > Is it possible filter in-memory extracted trials data with mirroring > at the edges? > > When I try: > > |% filter > cfg =[]; > cfg.lpfilter ='yes'; > cfg.lpfreq ='40'; > cfg.lpfilttype ='but'; > cfg.padtype ='mirror'; > % trial length is 1.1s so mirror-pad to 1.5s (200ms each side) > cfg.padding =1.5; > flt_data = ft_preprocessing(cfg, block_data);| > > I get: > > |Reference to non-existent field 'Fs'. > > Error in ft_preprocessing (line 288) > padding = round(cfg.padding * data.Fs);| > > Adding |block_data.Fs = block_data.fsample;| seems to work. But in the > resulting data structure the time vectors no longer match the trial > data, so obviously something is going wrong: > > |>> size(block_data.time{1}) > > ans = > > 1 560 > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.time{1}) > > ans = > > 1 357| > > Is there a correct way to do this? (Filter trials with mirrored edges) > > Thanks, > > Robin > > > > _______________________________________________ > 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 robince at gmail.com Fri Apr 26 11:58:56 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 10:58:56 +0100 Subject: [FieldTrip] filter in-memory trials data with mirroring In-Reply-To: <517A4AE1.6000507@donders.ru.nl> References: <517A4AE1.6000507@donders.ru.nl> Message-ID: Hi Jörn, Thanks: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2140 Cheers Robin On Fri, Apr 26, 2013 at 10:37 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Robin, > > yep, that sounds pretty much like a bug to me. Would you mind creating a > bug on bugzilla for this? > http://bugzilla.fcdonders.nl/ > I will try to look into this next week. Thanks so far for reporting this. > > Best, > Jörn > > > On 4/26/2013 11:11 AM, Robin wrote: > > Hello, > > Is it possible filter in-memory extracted trials data with mirroring at > the edges? > > When I try: > > % filter > cfg = [];cfg.lpfilter = 'yes';cfg.lpfreq = '40';cfg.lpfilttype = 'but';cfg.padtype = 'mirror';% trial length is 1.1s so mirror-pad to 1.5s (200ms each side)cfg.padding = 1.5; > flt_data = ft_preprocessing(cfg, block_data); > > I get: > > Reference to non-existent field 'Fs'. > > Error in ft_preprocessing (line 288) > padding = round(cfg.padding * data.Fs); > > Adding block_data.Fs = block_data.fsample; seems to work. But in the > resulting data structure the time vectors no longer match the trial data, > so obviously something is going wrong: > > >> size(block_data.time{1}) > > ans = > > 1 560 > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.time{1}) > > ans = > > 1 357 > > Is there a correct way to do this? (Filter trials with mirrored edges) > > Thanks, > > Robin > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 robince at gmail.com Fri Apr 26 12:19:53 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 11:19:53 +0100 Subject: [FieldTrip] not seeing expected effects of filtering Message-ID: Hello, I am having a problem with simple low-pass filtering where I am not seeing the results I would expect. I am using SVN r8075. I have a block_data structure which is the result of ft_appenddata with several runs. >> block_data block_data = hdr: [1x1 struct] label: {234x1 cell} fsample: 508.6300 trial: {1x1265 cell} time: {1x1265 cell} trialinfo: [1265x1 double] cfg: [1x1 struct] sampleinfo: [1265x2 double] >> size(block_data.trial{1}) ans = 234 560 I then run the following script to lpfilter with two different cut offs and plot the results which are attached. The output of the filter seems to be the same whatever I set lpfreq to (but it is definitely doing something). Am I do something wrong? Cheers Robin % Filtering test % filter cfg = []; cfg.lpfilter = 'yes'; cfg.lpfreq = '5'; cfg.lpfilttype = 'but'; cfg.lpfiltord = 3; flt_data_5 = ft_preprocessing(cfg, block_data); cfg = []; cfg.lpfilter = 'yes'; cfg.lpfreq = '70'; cfg.lpfilttype = 'but'; cfg.lpfiltord = 3; flt_data_70 = ft_preprocessing(cfg, block_data); %% figure subplot(131) trl = 100; chan = 200; plot(block_data.time{trl}, block_data.trial{trl}(chan,:)); title('Raw Data'); axis tight; subplot(132) plot(flt_data_5.time{trl}, flt_data_5.trial{trl}(chan,:)); title('5Hz low pass'); axis tight; subplot(133) plot(flt_data_70.time{trl}, flt_data_70.trial{trl}(chan,:)); title('70Hz low pass'); axis tight; -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: filter_problem.png Type: image/png Size: 10186 bytes Desc: not available URL: From robince at gmail.com Fri Apr 26 12:23:45 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 11:23:45 +0100 Subject: [FieldTrip] not seeing expected effects of filtering In-Reply-To: References: Message-ID: Sorry! Just noticed I had the frequencies quoted! I entered them like that without noticing as I was entering the other arguments. It's working correctly now! On Fri, Apr 26, 2013 at 11:19 AM, Robin wrote: > Hello, > > I am having a problem with simple low-pass filtering where I am not seeing > the results I would expect. I am using SVN r8075. > > I have a block_data structure which is the result of ft_appenddata with > several runs. > > >> block_data > > block_data = > > hdr: [1x1 struct] > label: {234x1 cell} > fsample: 508.6300 > trial: {1x1265 cell} > time: {1x1265 cell} > trialinfo: [1265x1 double] > cfg: [1x1 struct] > sampleinfo: [1265x2 double] > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > I then run the following script to lpfilter with two different cut offs > and plot the results which are attached. The output of the filter seems to > be the same whatever I set lpfreq to (but it is definitely doing > something). Am I do something wrong? > > Cheers > > Robin > > % Filtering test > % filter > cfg = []; > cfg.lpfilter = 'yes'; > cfg.lpfreq = '5'; > cfg.lpfilttype = 'but'; > cfg.lpfiltord = 3; > flt_data_5 = ft_preprocessing(cfg, block_data); > > > cfg = []; > cfg.lpfilter = 'yes'; > cfg.lpfreq = '70'; > cfg.lpfilttype = 'but'; > cfg.lpfiltord = 3; > flt_data_70 = ft_preprocessing(cfg, block_data); > > %% > figure > subplot(131) > trl = 100; > chan = 200; > plot(block_data.time{trl}, block_data.trial{trl}(chan,:)); > title('Raw Data'); axis tight; > subplot(132) > plot(flt_data_5.time{trl}, flt_data_5.trial{trl}(chan,:)); > title('5Hz low pass'); axis tight; > subplot(133) > plot(flt_data_70.time{trl}, flt_data_70.trial{trl}(chan,:)); > title('70Hz low pass'); axis tight; > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.noordenbos at gmail.com Fri Apr 26 15:58:40 2013 From: mark.noordenbos at gmail.com (Mark Noordenbos) Date: Fri, 26 Apr 2013 15:58:40 +0200 Subject: [FieldTrip] cluster-level statistic effect size Message-ID: Dear Fieldtrippers, When computing cluster-level statistics recent versions of Fieldtrip now also compute the SD and confidence interval of the estimated p-value for each cluster. But I was wondering if it is also possible to compute an effect size such as Cohen’s d of the observed effect. Normally, 2*t-value divided by sqrt(df) gives Cohen’s d. However, this does not work for the summed t-values in each cluster. Any suggestion how to compute an effect size for the cluster-level statistic? Best, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Fri Apr 26 16:02:06 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Fri, 26 Apr 2013 16:02:06 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From jose.herrero66 at gmail.com Fri Apr 26 16:40:59 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Fri, 26 Apr 2013 10:40:59 -0400 Subject: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact on continous data Message-ID: dear Fieldtripers, i have cleaned the continuous data manually (ft_databrowser) and then rejected artifacts (ft_rejectartifact). Now i am trying to do freq analysis on the cleaned data after segmentation (ft_redefinetrial, with cfg.length=4;cfg.overlap=0.5). I am getting the folowing warning message(see below). I don't get it if i use the original (not cleaned) continuous data. Should i be concerned? freq = ft_freqanalysis(cfg, trials); the input is raw data with 43 channels and 188 trials Warning: correcting numerical inaccuracy in the time axes > In utilities\private\warning_once at 116 In ft_datatype_raw>fixtimeaxes at 289 In ft_datatype_raw at 241 In ft_checkdata at 213 In ft_freqanalysis at 219 processing trials processing trial 188/188 nfft: 8000 samples, datalength: 8000 samples, 1 tapers thanks -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Fri Apr 26 17:18:43 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Fri, 26 Apr 2013 11:18:43 -0400 Subject: [FieldTrip] select channels using ft_connectivityanalysis and ft_connectivityplot Message-ID: Dear Fieldtripers, a quick question about ft_connectivityanalysis and ft_connectivityplot. Is there a way to select channels when the input data is not univariate? cfg.channel and cfg.partchannel do not work apperently thanks -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Fri Apr 26 17:24:17 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Fri, 26 Apr 2013 17:24:17 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From kekeliao at gmail.com Fri Apr 26 21:46:24 2013 From: kekeliao at gmail.com (liao ke) Date: Fri, 26 Apr 2013 14:46:24 -0500 Subject: [FieldTrip] design matrix for ft_freqstatistics; between subjects In-Reply-To: References: Message-ID: Hi, Kathrin, I meet similar question on comparison of ERP between two group subjects using ft_timelockstatistics and ft_timelockanalysis. One group has 12 subjects, another group has 43 subjects, and my design matrix is like design = zeros(1, 55); design(1, 1:12) = 1; design(1, 12+1:end )= 2; cfg.design = design; % design matrix cfg.ivar = 1; After I invoke ft_timelockanalysis, I use ft_timelockgrandaverage to calculate grand average with cfg.keepindividual = 'yes' . Then the following ft_timelockstatistics works well. If I use cfg.keepindividual = 'no' in ft_timelockgrandaverage , the ft_timelockstatistics has error 'the size of the design matrix does not match the number of observations in the data' in its statistics_wrapper subfunction. My question is why I should keep all trials data (cfg.keepindividual = 'yes') in ft_timelockgrandaverage ? I guess the method in ft_timelockstatistics should use subjects averaged data as sample ( average over trials data of this subject ) not use all subjects trial-based data. Am I correct? Thanks for your help. ke On Sat, Dec 1, 2012 at 9:15 AM, Kathrin Müsch wrote: > Hi Nenad, > > It's like a between trials experiment within one subject (first example of > the tutorial). Your design is correct. Remember to use independent samples > statistics because you compare two independent groups (in your case > subjects). > > cfg.statistic = 'indepsamplesT'; > cfg. design = design; > cfg.ivar = 1; > > Best, > Kathrin > > Am 01.12.2012 um 15:02 schrieb Nenad Polomac: > > > Hi everybody, > > > > I have some doubts concerning statistic in between subjects experiment. > I couldn't find explanation for this case in tutorial. > > I have two groups of subjects. And I would like to compare this two > groups for the same condition using ft_freqstatistics (cfg.correctm = > 'cluster'). I have two time frequency grand average for each group (8 > subjects in each group; cfg.keepindividual = 'yes';). I am not sure how a > design matrix for ft_freqstatistics suppose to look like > > > > I suppose: design=[1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2] > > Is this correct? > > > > Thank you in advance! > > > > Nenad > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen > Rechts; Gerichtsstand: Hamburg > > Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander > Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Fri Apr 26 22:08:36 2013 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 26 Apr 2013 22:08:36 +0200 Subject: [FieldTrip] design matrix for ft_freqstatistics; between subjects In-Reply-To: References: Message-ID: Dear Ke, A grandaverage is typically an average over subjects, not trials - seems appropriate in the case you describe. Does it make sense then? Dear Nenad, Have you taken a look at the end of [user documentation] --> [walkthrough] on the wiki? In it I've made some effort explaining the cfg.design in the statistics functions. It might need more work so if it is still unclear (or if it does help and you have a suggestion for placing a link at an appropriate place in the tutorial) it would be great to hear so I can work on making it clearer. Cheers, Stephen On 26 April 2013 21:46, liao ke wrote: > Hi, Kathrin, > > I meet similar question on comparison of ERP between two group subjects > using ft_timelockstatistics and ft_timelockanalysis. One group has 12 > subjects, another group has 43 subjects, and my design matrix is like > > design = zeros(1, 55); > design(1, 1:12) = 1; > design(1, 12+1:end )= 2; > cfg.design = design; % design matrix > cfg.ivar = 1; > > > After I invoke ft_timelockanalysis, I use ft_timelockgrandaverage to > calculate grand average with cfg.keepindividual = 'yes' . Then the following > ft_timelockstatistics works well. If I use cfg.keepindividual = 'no' in > ft_timelockgrandaverage , the ft_timelockstatistics has error 'the size of > the design matrix does not match the number of observations in the data' in > its statistics_wrapper subfunction. > > My question is why I should keep all trials data (cfg.keepindividual = > 'yes') in ft_timelockgrandaverage ? I guess the method in > ft_timelockstatistics should use subjects averaged data as sample ( average > over trials data of this subject ) not use all subjects trial-based data. Am > I correct? > > Thanks for your help. > > ke > > > On Sat, Dec 1, 2012 at 9:15 AM, Kathrin Müsch > wrote: >> >> Hi Nenad, >> >> It's like a between trials experiment within one subject (first example of >> the tutorial). Your design is correct. Remember to use independent samples >> statistics because you compare two independent groups (in your case >> subjects). >> >> cfg.statistic = 'indepsamplesT'; >> cfg. design = design; >> cfg.ivar = 1; >> >> Best, >> Kathrin >> >> Am 01.12.2012 um 15:02 schrieb Nenad Polomac: >> >> > Hi everybody, >> > >> > I have some doubts concerning statistic in between subjects experiment. >> > I couldn't find explanation for this case in tutorial. >> > I have two groups of subjects. And I would like to compare this two >> > groups for the same condition using ft_freqstatistics (cfg.correctm = >> > 'cluster'). I have two time frequency grand average for each group (8 >> > subjects in each group; cfg.keepindividual = 'yes';). I am not sure how a >> > design matrix for ft_freqstatistics suppose to look like >> > >> > I suppose: design=[1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2] >> > Is this correct? >> > >> > Thank you in advance! >> > >> > Nenad >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >> Genossenschaftsregister sowie das Unternehmensregister (EHUG): >> >> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen >> Rechts; Gerichtsstand: Hamburg >> >> Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander >> Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Sat Apr 27 13:04:21 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Sat, 27 Apr 2013 13:04:21 +0200 (CEST) Subject: [FieldTrip] cluster-level statistic effect size In-Reply-To: References: Message-ID: <002301ce4336$fc1a7390$f44f5ab0$@maris@psych.ru.nl> Dear Mark, When computing cluster-level statistics recent versions of Fieldtrip now also compute the SD and confidence interval of the estimated p-value for each cluster. But I was wondering if it is also possible to compute an effect size such as Cohen’s d of the observed effect. Normally, 2*t-value divided by sqrt(df) gives Cohen’s d. However, this does not work for the summed t-values in each cluster. Any suggestion how to compute an effect size for the cluster-level statistic? Why would you want to compute an effect size for a neuronal variable (such as an evoked response, an induced oscillation)? An effect size for a behavioral variable (such response time or accuracy), on the other hand, would definitely make sense. In cognitive neuroscience, we use neuronal variables to explain behavior; it’s not the neuronal variables that we are trying to explain. This would be more the domain of basic neuroscience. As I see it, cognitive neuroscience would be helped a lot if we could quantify the extent to which a particular neuronal variable can explain some behavioral variable. That is, we would be computing an effect size for a behavioral variable, using the neuronal variable as the explanatory (instead of to-be-explained) variable. Together with Freek van Ede and Malte Köster, I proposed a method that is able to do precisely this (Journal of Neurophysiology 108 (9), 2352-2362, http://jn.physiology.org/content/108/9/2352.short). The crucial methodological issue here is how to deal with the inherent unreliability of the measured neuronal variables. Of course, a basic neuroscientist who is trying to explain to explain the firing rate of a single neuron may very well be interested in an effect size for this firing rate which could show, for instance, that this firing rate is only very weakly determined by the presence/absence of a stimulus. Best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From lmelloni at gmail.com Mon Apr 29 02:38:57 2013 From: lmelloni at gmail.com (Lucia Melloni) Date: Sun, 28 Apr 2013 20:38:57 -0400 Subject: [FieldTrip] Only 1 and Inf as output of ft_connectivityanalysis Message-ID: Hi! I am trying to calculate coherence using ft_connectivityanalysis, but I am getting only ones and infinity as output in cohspctrm with all of my data sets. I first run ft_freqanalysis with cfg.method = 'mtmfft'; cfg.taper = 'dpss'; cfg.output = 'fourier'; cfg.foilim = [1 45]; cfg.tapsmofrq = 1; cfg.keeptrials = 'yes'; cfg.keeptapers = 'yes'; freq = ft_freqanalysis(cfg, data); Whether I do or I do not specify cfg.channel and cfg.channelcmb here does not seem to make a difference for my problem later on. The spectra look absolutely fine. I then run ft_connectivityanalysis with cfg.method = 'coh'; cfg.removemean= 'yes'; cfg.trials = 'all'; cfg.feedback = 'yes'; cfg.complex = 'abs'; coh = ft_connectivityanalysis(cfg, freq); The cohspctrm looks like this: val(:,:,1,1) = 1 Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf (etc.) I get the following warning during ft_connectivityanalysis Warning: Divide by zero. > In ft_connectivity_corr at 103 In ft_connectivityanalysis at 524 Warning: Divide by zero. > In ft_connectivity_corr at 104 In ft_connectivityanalysis at 524 The same happens if I try to calculate PLV through ft_connectivityanalysis. This is with Fieldtrip version 20130422 and 20130427, Matlab R2009a, Windows 7 (64bit). Any advice? Thanks! Lucia From joseangel.pineda at ctb.upm.es Mon Apr 29 12:31:19 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Mon, 29 Apr 2013 12:31:19 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From s.vanpelt at fcdonders.ru.nl Mon Apr 29 12:49:04 2013 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 29 Apr 2013 12:49:04 +0200 (CEST) Subject: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact on continous data In-Reply-To: Message-ID: <1824346511.946519.1367232544565.JavaMail.root@indus.zimbra.ru.nl> Dear Jose, You don't need to worry about the warning. When performing operations like redefining trials, the time axes values might change slightly (in the order of microseconds or so, don't know the exact figure), resulting in different time axes for, e.g., different channels. Nowadays, FT recognizes these time differences as being non-intended (it is very unlikely that you on purpose would want trials to start at such small different moments in time), corrects them, and outputs you the warning. So, in your case, the trials in 'trials.time' would have slightly different time values. In freq.time, these should be equal. Best, Stan ----- Oorspronkelijk bericht ----- > Van: "Jose Herrero" > Aan: "FieldTrip discussion list" > Verzonden: Vrijdag 26 april 2013 16:40:59 > Onderwerp: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact > on        continous data > dear Fieldtripers, > i have cleaned the continuous data manually (ft_databrowser) and then > rejected artifacts (ft_rejectartifact). Now i am trying to do freq > analysis on the cleaned data after segmentation (ft_redefinetrial, > with cfg.length=4;cfg.overlap=0.5). I am getting the folowing warning > message(see below). I don't get it if i use the original (not > cleaned) continuous data. Should i be concerned? > freq = ft_freqanalysis(cfg, trials); > the input is raw data with 43 channels and 188 trials > Warning: correcting numerical inaccuracy in the time axes  > > In utilities\private\warning_once at 116 >   In ft_datatype_raw>fixtimeaxes at 289 >   In ft_datatype_raw at 241 >   In ft_checkdata at 213 >   In ft_freqanalysis at 219  > processing trials > processing trial 188/188 nfft: 8000 samples, datalength: 8000 samples, > 1 tapers > thanks > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Apr 29 15:15:57 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 29 Apr 2013 15:15:57 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape In-Reply-To: References: Message-ID: José, Coregistration is a tricky thing, particularly if you start mixing results from two different software packages. I'd stick to one package, that's my recommendation, unless you really know what all individual steps are doing. Are you sure that your Aff_1 is doing what you think it is doing? E.g. does it apply to an anatomical volume with the same orientation, FOV, etc as the T1.nii? Also, I think that for any automatic registration tool you use, it is necessary to get the geometric objects in approximate alignment, which means you need to select fiducials, otherwise your algorithm will not converge to the correct solution. I usually use ft_volumerealign twice. The first time to get an approximate registration (cfg.method = 'interactive'). If you have a headsurface determined with a polhemus device, you can call ft_volumerealign a second time (with the output to the first call as the input mri), in combination with cfg.method = 'headshape', and cfg.headshape = ft_read_headshape('headshapefile.txt') Finally, I'd recommend not to re-post the same question too quickly after itself. Best wishes, Jan-Mathijs On Apr 29, 2013, at 12:31 PM, José Ángel Pineda wrote: > Dear experts, > > I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. > Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. > > So I already have one affine transformation (Aff_1) > > I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. > > Could you please give me any advice to solve this? > > Thanks > > cheers > > Jose > > > > -- > José Angel Pineda Pardo > Center of Biomedical Technology (CTB) > Parque Científico y Tecnológico de la UPM > Campus de Montegancedo > 28223 Pozuelo de Alarcón, Madrid, ES > Spam detection software, running on the system "brievenbus.science.ru.nl", has > identified this incoming email as possible spam. The original message > has been attached to this so you can view it (if it isn't spam) or label > similar future email. If you have any questions, see > postmaster at science.ru.nl for details. > > Content preview: Dear experts, I was using manual selection of the fiducials > in order to get the affine transformation of the MRI T1 image to the MEG > sensor space. Now, I have decided to use freesurfer for obtaining the head > surface and some function for performing an automatic corregistration from > head surface to fiducials (and polhemus information), in order to avoid manual > selection of the fiducials for each subject. [...] > > Content analysis details: (5.0 points, 5.0 required) > > pts rule name description > ---- ---------------------- -------------------------------------------------- > 3.9 BAYES_99 BODY: Bayesian spam probability is 99 to 100% > [score: 0.9997] > 1.6 HTML_IMAGE_ONLY_28 BODY: HTML: images with 2400-2800 bytes of words > 0.0 HTML_MESSAGE BODY: HTML included in message > -1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low > trust > [209.85.128.179 listed in list.dnswl.org] > 0.6 DC_PNG_UNO_LARGO Message contains a single large inline gif > 0.0 DC_IMAGE_SPAM_TEXT Possible Image-only spam with little text > 0.0 DC_IMAGE_SPAM_HTML Possible Image-only spam > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Mon Apr 29 15:38:36 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Mon, 29 Apr 2013 15:38:36 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape In-Reply-To: References: Message-ID: Thanks Jan, Ill try as you said. cheers Jose 2013/4/29 jan-mathijs schoffelen > José, > > Coregistration is a tricky thing, particularly if you start mixing results > from two different software packages. I'd stick to one package, that's my > recommendation, unless you really know what all individual steps are > doing. Are you sure that your Aff_1 is doing what you think it is doing? > E.g. does it apply to an anatomical volume with the same orientation, FOV, > etc as the T1.nii? > Also, I think that for any automatic registration tool you use, it is > necessary to get the geometric objects in approximate alignment, which > means you need to select fiducials, otherwise your algorithm will not > converge to the correct solution. I usually use ft_volumerealign twice. The > first time to get an approximate registration (cfg.method = 'interactive'). > If you have a headsurface determined with a polhemus device, you can call > ft_volumerealign a second time (with the output to the first call as the > input mri), in combination with cfg.method = 'headshape', and cfg.headshape > = ft_read_headshape('headshapefile.txt') > Finally, I'd recommend not to re-post the same question too quickly after > itself. > > Best wishes, > Jan-Mathijs > > > > > On Apr 29, 2013, at 12:31 PM, José Ángel Pineda wrote: > > Dear experts, > > I was using manual selection of the fiducials in order to get the affine > transformation of the MRI T1 image to the MEG sensor space. > Now, I have decided to use freesurfer for obtaining the head surface and > some function for performing an automatic corregistration from head surface > to fiducials (and polhemus information), in order to avoid manual selection > of the fiducials for each subject. > > So I already have one affine transformation (Aff_1) > > I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the > mri.transform to mri.transform*Aff_1, but when I plot the results > (ft_determine_coordsys) I got what is in the attached snapshot. > > Could you please give me any advice to solve this? > > Thanks > > cheers > > Jose > > > > > -- > José Angel Pineda Pardo > Center of Biomedical Technology (CTB) > Parque Científico y Tecnológico de la UPM > Campus de Montegancedo > 28223 Pozuelo de Alarcón, Madrid, ES > Spam detection software, running on the system "brievenbus.science.ru.nl", > has > identified this incoming email as possible spam. The original message > has been attached to this so you can view it (if it isn't spam) or label > similar future email. If you have any questions, see > postmaster at science.ru.nl for details. > > Content preview: Dear experts, I was using manual selection of the > fiducials > > in order to get the affine transformation of the MRI T1 image to the MEG > sensor space. Now, I have decided to use freesurfer for obtaining the head > surface and some function for performing an automatic corregistration > from > head surface to fiducials (and polhemus information), in order to avoid > manual > selection of the fiducials for each subject. [...] > > Content analysis details: (5.0 points, 5.0 required) > > pts rule name description > ---- ---------------------- > -------------------------------------------------- > 3.9 BAYES_99 BODY: Bayesian spam probability is 99 to 100% > [score: 0.9997] > 1.6 HTML_IMAGE_ONLY_28 BODY: HTML: images with 2400-2800 bytes of words > 0.0 HTML_MESSAGE BODY: HTML included in message > -1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, > low > trust > [209.85.128.179 listed in list.dnswl.org] > 0.6 DC_PNG_UNO_LARGO Message contains a single large inline gif > 0.0 DC_IMAGE_SPAM_TEXT Possible Image-only spam with little text > 0.0 DC_IMAGE_SPAM_HTML Possible Image-only spam > > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggonesc at upo.es Mon Apr 29 23:58:16 2013 From: ggonesc at upo.es (Gabriel Gonzalez Escamilla) Date: Mon, 29 Apr 2013 23:58:16 +0200 Subject: [FieldTrip] beggining Help Message-ID: An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Tue Apr 30 09:51:14 2013 From: zriouil.imane at gmail.com (z.imane) Date: Tue, 30 Apr 2013 09:51:14 +0200 Subject: [FieldTrip] convert dataformat for plexon.plx to plexon.nex? Message-ID: i wan't to convert my data to plexon.nex. if you need me -- Zriouil Imane -------------- next part -------------- An HTML attachment was scrubbed... URL: From mushfa.yousuf at googlemail.com Tue Apr 30 17:19:59 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Tue, 30 Apr 2013 17:19:59 +0200 Subject: [FieldTrip] Source Reconstruction using Openmeeg method Message-ID: Hello Fieldtrippers, I am doing source reconstruction using EEG channels on a fieldtrip. I have computed Forward solution i.e head model using 'Openmeeg' and lead field successfully. For the inverse solution using 'dics' method, I wrote the following syntax cfg = []; cfg.method = 'dics'; cfg.frequency = 130; cfg.elec = dataFIC12.hdr.elec; cfg.grid = grid; cfg.vol = vol; sourcePost = ft_sourceanalysis(cfg, freqPost); and I have received the following error: ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> beamformer_dics at 314 filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ==> ft_sourceanalysis at 595 dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), optarg{:}); Error in ==> newCode at 214 sourcePost = ft_sourceanalysis(cfg, freqPost); Any help would be appreciated. Regards; Mushfa Yousuf Neurozentrum, Universitätsklinikum Schleswig-Holstein, Campus Kiel (UKSH), Deutschland -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Tue Apr 30 18:23:24 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Tue, 30 Apr 2013 18:23:24 +0200 Subject: [FieldTrip] Source Reconstruction using Openmeeg method In-Reply-To: References: Message-ID: Hi Mushfa, My guess is that the channels that have you used to compute .csdspctrm are not the same as the channels in cfg.elec. If you set cfg.channel = freqPost.label, does that solve it? Cheers, Johanna 2013/4/30 Mushfa Yousuf > Hello Fieldtrippers, > > I am doing source reconstruction using EEG channels on a fieldtrip. > > I have computed Forward solution i.e head model using 'Openmeeg' and lead > field successfully. > > For the inverse solution using 'dics' method, I wrote the following syntax > > > > > > cfg = []; > cfg.method = 'dics'; > cfg.frequency = 130; > cfg.elec = dataFIC12.hdr.elec; > cfg.grid = grid; > cfg.vol = vol; > > sourcePost = ft_sourceanalysis(cfg, freqPost); > > > and I have received the following error: > > > ??? Error using ==> mtimes > Inner matrix dimensions must agree. > > Error in ==> beamformer_dics at 314 > filt = pinv(lf' * invCf * lf) * lf' * invCf; % > Gross eqn. 3, use PINV/SVD to cover rank deficient > leadfield > > Error in ==> ft_sourceanalysis at 595 > dip(i) = beamformer_dics(grid, sens, vol, [], > squeeze(Cf(i,:,:)), optarg{:}); > > Error in ==> newCode at 214 > sourcePost = ft_sourceanalysis(cfg, freqPost); > > > > > Any help would be appreciated. > > > Regards; > > > Mushfa Yousuf > > Neurozentrum, > Universitätsklinikum Schleswig-Holstein, > Campus Kiel (UKSH), Deutschland > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Apr 1 16:05:57 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 1 Apr 2013 22:05:57 +0800 Subject: [FieldTrip] How can I use DICS to get the waveforms? Message-ID: Dear all, I use DICS-beamformer to get the source,as follow: cfg = []; cfg.frequency = freqP.freq; cfg.elec = grid.cfg.elec; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = grid; cfg.vol = vol; cfg.dics.lambda = '5%';; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freqP); source = dim: [19 25 19] freq: 17.9481 cumtapcnt: 3 pos: [9025x3 double] inside: [1x4686 double] outside: [1x4339 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] source.avg pow: [1x9025 double] is it right? if I want to get the waveforms in order to do the correlation,how can I do ? thanks, best xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 2 09:32:16 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 02 Apr 2013 09:32:16 +0200 Subject: [FieldTrip] How can I use DICS to get the waveforms? In-Reply-To: References: Message-ID: <515A8980.7030503@donders.ru.nl> Dear Xiao, the DICS algorithm computes power of a certain frequency band of *one *time window (it works in the frequency domain with the cross-spectral density matrix, i.e. no time axis anymore). The source.avg.pow field contains thus the power value of this one time-frequency bin. I assume you want to get time-spectral evolution information? In that case it might be best to use the LCMV beamformer in the time-domain, extract the spatial location (voxel) of interest and apply the whatever-Fourier transform (short time, wavelet, welch, taper) on that. Please have a look at our various tutorials, for example: http://fieldtrip.fcdonders.nl/tutorial/beamformer (on DICS) http://fieldtrip.fcdonders.nl/tutorial/beamformingextended (appendix for LCMV) http://fieldtrip.fcdonders.nl/tutorial/connectivity (also includes LCMV) And here for the DICS paper: http://www.ncbi.nlm.nih.gov/pubmed/11209067 Best regards, Jörn On 4/1/2013 4:05 PM, ?? wrote: > Dear all, > I use DICS-beamformer to get the source,as follow: > cfg = []; > cfg.frequency = freqP.freq; > cfg.elec = grid.cfg.elec; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.lambda = '5%';; > cfg.dics.realfilter = 'yes'; > source = ft_sourceanalysis(cfg, freqP); > source = > > dim: [19 25 19] > freq: 17.9481 > cumtapcnt: 3 > pos: [9025x3 double] > inside: [1x4686 double] > outside: [1x4339 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > source.avg > > pow: [1x9025 double] > is it right? if I want to get the waveforms in order to do the > correlation,how can I do ? > thanks, > best > xiao > > > _______________________________________________ > 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 eelke.spaak at donders.ru.nl Tue Apr 2 09:48:30 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 2 Apr 2013 09:48:30 +0200 Subject: [FieldTrip] How can I use DICS to get the waveforms? In-Reply-To: <515A8980.7030503@donders.ru.nl> References: <515A8980.7030503@donders.ru.nl> Message-ID: Dear Xiao, In addition to Jörn's excellent tips, specifically refer to the appendix of the beamformingextended tutorial (http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space), where the steps needed to extract a waveform from a specific grid point (in this case, the peak voxel after a DICS beamformer) are explained. Best, Eelke On 2 April 2013 09:32, "Jörn M. Horschig" wrote: > Dear Xiao, > > the DICS algorithm computes power of a certain frequency band of one time > window (it works in the frequency domain with the cross-spectral density > matrix, i.e. no time axis anymore). The source.avg.pow field contains thus > the power value of this one time-frequency bin. I assume you want to get > time-spectral evolution information? In that case it might be best to use > the LCMV beamformer in the time-domain, extract the spatial location (voxel) > of interest and apply the whatever-Fourier transform (short time, wavelet, > welch, taper) on that. Please have a look at our various tutorials, for > example: > > http://fieldtrip.fcdonders.nl/tutorial/beamformer (on DICS) > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended (appendix for > LCMV) > http://fieldtrip.fcdonders.nl/tutorial/connectivity (also includes LCMV) > > And here for the DICS paper: > http://www.ncbi.nlm.nih.gov/pubmed/11209067 > > Best regards, > Jörn > > > > On 4/1/2013 4:05 PM, 陈雪 wrote: > > Dear all, > I use DICS-beamformer to get the source,as follow: > cfg = []; > cfg.frequency = freqP.freq; > cfg.elec = grid.cfg.elec; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.lambda = '5%';; > cfg.dics.realfilter = 'yes'; > source = ft_sourceanalysis(cfg, freqP); > > source = > > dim: [19 25 19] > freq: 17.9481 > cumtapcnt: 3 > pos: [9025x3 double] > inside: [1x4686 double] > outside: [1x4339 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > source.avg > > pow: [1x9025 double] > is it right? if I want to get the waveforms in order to do the > correlation,how can I do ? > > thanks, > best > xiao > > > _______________________________________________ > 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 mengtongxiao at gmail.com Wed Apr 3 10:07:27 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Wed, 3 Apr 2013 16:07:27 +0800 Subject: [FieldTrip] Help with ft_sourceanalysis ? Message-ID: Dear all, I want use ' ft_connectivityanalysis' do correlation as follow: cfg = []; cfg.method = 'lcmv'; cfg.vol = vol; cfg.grid.pos = maxpos; cfg.lcmv.fixedori='yes'; cfg.elec = data_org.hdr.elec; cfg.lcmv.keepfilter = 'yes'; source1 = ft_sourceanalysis(cfg, timelock); cfg=[]; cfg.method = 'powcorr_ortho'; stat = ft_connectivityanalysis(cfg, source1) ource1 = time: [1x102099 double] pos: [2x3 double] inside: [2x1 double] outside: [0x1 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] the error is that ??? Reference to non-existent field 'cumtapcnt'. Error in ==> ft_connectivityanalysis at 734 optarg = {'refindx', cfg.refindx, 'tapvec', data.cumtapcnt}; Is right using tne ''lcmv'' method When I do the 'powcorr_ortho'? If the method is ringht , the 'cumtapcnt'.what means and how do get it.[when I use the 'dics' method ,some error is that Reference to non-existent field 'mom'.] How should I do? thanks for your attention. best, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From K.Kalogianni at tudelft.nl Wed Apr 3 11:01:26 2013 From: K.Kalogianni at tudelft.nl (Konstantina Kalogianni) Date: Wed, 3 Apr 2013 09:01:26 +0000 Subject: [FieldTrip] FW: chop_raw cnt data into segments_&ICA Message-ID: <4DF682D3A10EAC46B462A46E16F0B0491287BC53@SRV366.tudelft.net> Dear fieldtrip users, I am new to fieldtrip and I have the following issue regarding preprocessing of EEG and ICA. I want to: 1. import my .cnt data 2. chop my file to 5 different files that correspond to each of my tasks 3. then take one part of my file that correspond to one of my tasks and filter, demean, rerefernce, resample raw data 4. ICA raw data 5. Then define epochs 6. & then proceed with the rest of the analysis One of my tasks has repetitive triggers with the code 1 So I want to take only the part of my raw data that corresponds to this task(including some ms before the first trigger and some after ) and then at a later stage epoch my data. Should I create one trial_fun that chop my data to 5 datasets corresponding to each task, then call ft_definetrial, then preprocess the data, ICA them and then call again the ft_defientrial with another trial_fun to chop my data into epochs? Is that even possible ? The way I try to do it now is : first define trial with : cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = '1' cfg.trialdef.prestim = 0.005; % in seconds cfg.trialdef.poststim = 0.01; % in seconds cfg1 = ft_definetrial(cfg); Then I call ft_preprocessing(cfg); with cfg.continuous = 'yes'; to make sure that when I ll perform ICA it will be on continuous data. and then when I run ICA it produces an expected error that I cannot run ICA on epoched data (it needs raw). So I have to epoch after the ICA, but how should I select the part that only corresponds to one of my tasks? Thank you for your time. Best, Nadia -------------- next part -------------- An HTML attachment was scrubbed... URL: From kai.hwang at gmail.com Wed Apr 3 15:32:56 2013 From: kai.hwang at gmail.com (Kai Hwang) Date: Wed, 3 Apr 2013 09:32:56 -0400 Subject: [FieldTrip] Postdoctoral position in developmental cognitive neuroscience (Pittsburgh) Message-ID: Postdoctoral Position**** Laboratory of Neurocognitive Development**** Department of Psychiatry**** University of Pittsburgh, Pennsylvania**** Principal investigator: Bea Luna, Ph.D. Applicants are invited for a funded postdoctoral position at the University of Pittsburgh investigating cognitive development using a multimodal neuroimaging approach combining fMRI, DTI, MEG, and behavioral testing. We are looking for exceptional Ph.D. researchers with prior experience in MEG/EEG methodology and neuroimaging data analyses. Inherent interest in developmental cognitive neuroscience is a plus. Potential projects will involve investigating the development of functional brain networks supporting cognitive control and/or cognitive-affect interactions during adolescence. Applicants should be willing to commit to a minimum two year appointment. Applicants will be reviewed on an on-going basis until the position is filled. Applicants should send a CV, statement of research interest and contact information of three referees to Dr. Bea Luna (lunab at upmc.edu). -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Wed Apr 3 17:14:18 2013 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Wed, 3 Apr 2013 11:14:18 -0400 Subject: [FieldTrip] preprocessing cfg.trials Message-ID: Dear Fieldstripers: I used to use the ft_preprocessing (fieldtrip-20120521) function to sort my data (eg. sort the trials in terms of response time). In a newest version I downloaded a couples of weeks ago I can't do it anymore. Question: there is another function which was implemented to do this, or is a bug of the preprocessing function? or it's me? In simple terms, in the older version, the cfg.trials input preserved the order of the trials provided, now is not working, and just select the trials but keep the original sequence of trials. Thanks a lot! Best Y -------------- next part -------------- An HTML attachment was scrubbed... URL: From munsif.jatoi at gmail.com Thu Apr 4 12:01:02 2013 From: munsif.jatoi at gmail.com (Munsif Jatoi) Date: Thu, 4 Apr 2013 03:01:02 -0700 Subject: [FieldTrip] Help in code Message-ID: Dear Sir/Madam, I hope you are fine. Sir, I am doing PhD in EEG Source localization using FEM. I was using the codes available at your website for implementation of head model using FEM. I have written following program in MATLAB: *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip');* *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip\utilities');* *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip\external\freesurfer');* *addpath('C:\Users\Munsif\Desktop\Kelantan Dr. Bornot\fieldtrip\external\simbio');* *mri = ft_read_mri('G:\tutorial_fieldtrip\Subject01\Subject01.mri');* * * *% reslice* *cfg = [];* *cfg.dim = mri.dim;* *mri = ft_volumereslice(cfg,mri);* * * *% segmentation* *cfg = [];* *cfg.output = {'gray','white','csf','skull','scalp'};* *segmentedmri = ft_volumesegment(cfg, mri);* * * *% mesh* *cfg=[];* *cfg.method = 'hexahedral';* *mesh = ft_prepare_mesh(cfg,segmentedmri);* * * *% simbio* *cfg = [];* *cfg.method ='simbio';* *cfg.conductivity = [0.1 0.2 0.3 0.4 0.5]; % order follows tissuelabel in vol* *vol = ft_prepare_headmodel(cfg, segmentedmri);* * * when I run this programme by using MATLAB with Fieldtrip, There were some errors stating that a file tp5084846f_e0f2_4004_9e7c_8_6fe72f5707.v which is mesh file is missing. Upon investigation, I come to know that SIMBIO which is used for FEM implementation is missing form Fieldtrip package. Therefore, it is requested in your kind honor to please guide me in this regard as I am working on Fieldtrip these days and need your urgent help. I hope you will send me positive and helpful response. -- Munsif Ali H.Jatoi, Ph D Scholar, Centre for Intelligent Signals and Imaging Research, Universiti Teknologi PETRONAS, Malaysia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.brovelli at univ-amu.fr Thu Apr 4 14:18:23 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 14:18:23 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI Message-ID: <515D6F8F.9010005@univ-amu.fr> Dear all, I used DICS and compared the quality of the beamforming using two different source spaces (3D grids): 1) MNI template space as described in http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space 2) Single subject 3D grid using anatomical MRI The number of sources in the two models is similar (approx. 3500 sources). However, the results using the MNI template are less significant. That is, the statistical analysis testing a significant increase in power post-stimulus with respect to baseline give higher p-values (in some region of interest). Questions: Does anyone know why ? Is the use of the MNI template the only (and best) way to allow statistical analysis across subjects in the source space ? thanks a lot Andrea -- From eelke.spaak at donders.ru.nl Thu Apr 4 14:18:59 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 4 Apr 2013 14:18:59 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? Message-ID: Dear FieldTrippers, I am trying to do source reconstruction, but am encountering two weird things in my pipeline related to anatomy. It could be that everything is OK, but I am worried I might have introduced a left/right flip somewhere. To read in my (dicom) MRI, I use: % read the mri fprintf('loading mri for subject %d...\n', subjects(k).id); mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); and then I mark the fiducials as follows: % align to fiducials in CTF coordsys cfg = []; cfg.coordsys = 'ctf'; cfg.method = 'interactive'; cfg.clim = [0 800]; mri = ft_volumerealign(cfg, mri); In attachment ft_volumerealign.png I show the plot that comes up. Although the position of the different slices is not what I usually expect, this should all still be fine, right? The yellow crosshair is in the right fiducial location, as evidenced by the white blob below the ear (which is always on the right hand side during MRI acquisition). After marking r, l and n (and quitting with 'q') I do: % reslice to make everything right-side up mri = ft_volumereslice([], mri); In attachment ft_sourceplot-1.png I show output of ft_sourceplot([],mri) after this step. Note that the positions of the axial/coronal/sagittal slices are not what one would typically expect. Also note (and this is problem 1) that the right hand side of the anatomy is displayed on the right hand side in the bottom (axial) slice, but on the left hand side in the top right (coronal) slice. Initially I thought this was just a benign visualisation issue (analogous to http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), but it might be a real problem after all, because of what I found next. After these steps, I proceed to do segmentation and I create a headmodel: cfg = []; cfg.coordsys = 'ctf'; mri = ft_volumesegment(cfg, mri); % make single shell model cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, mri); As outlined in the beamformingextended tutorial, I create a subject-specific source model which I inverse-warp to MNI: % load template sourcemodel (grid) in mni space template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); % warp the grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template.sourcemodel; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; sourcemodel = ft_prepare_sourcemodel(cfg); (See attachment grid-hdm-grad.png for a plot of all three geometrical objects superimposed. Looks fine to me.) Then I create a leadfield: cfg = []; cfg.grid = sourcemodel; cfg.vol = headmodel; cfg.channel = {'MEG'}; cfg.grad = data.grad; leadfield = ft_prepare_leadfield(cfg, data); The next step, which is the one which alerted me to the potential problem in the steps above, is to do an LCMV beamformer on a small time window of my ERF: % compute ERF covariance in small window cfg = []; cfg.covariance = 'yes'; cfg.covariancewindow = [1.5 1.55]; tl_right = ft_timelockanalysis(cfg, rightErf); % do beamforming cfg = []; cfg.method = 'lcmv'; cfg.grid = leadfield; cfg.vol = headmodel; cfg.lcmv.lambda = '5%'; cfg.lcmv.projectnoise = 'yes'; cfg.lcmv.keepfilter = 'yes'; sourceRight = ft_sourceanalysis(cfg, tl_right); % normalise with noise sourceRightNAI = sourceRight; sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; % copy over pos and dim from template sourceRight.pos = template.sourcemodel.pos; sourceRight.dim = template.sourcemodel.dim; sourceRightNAI.pos = template.sourcemodel.pos; sourceRightNAI.dim = template.sourcemodel.dim; % interpolate onto template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.pow'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); % plot cfg = []; cfg.funparameter = 'avg.pow'; cfg.method = 'ortho'; cfg.location = 'max'; cfg.coordsys = 'mni'; ft_sourceplot(cfg, sourceRightNAI_int); The output of the above step is shown in ft_sourceplot-2.png. Note that there clearly is a maximum in the posterior right hemisphere. Now compare this to when I just plot the sensor-level ERF for the same time interval: c2=[]; c2.layout='CTF275.lay'; c2.xlim = [1.5 1.55]; figure;ft_topoplotER(c2,rightErf); (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me as if there should be a dipole in the left hemisphere. (That's problem 2.) Now of course I know that interpreting axial gradient data by eye is difficult, but this left-side increase is present in the majority of my subjects, yet the resulting LCMV maximum always ends up in the right hemisphere. Therefore my question: am I doing something wrong in my anatomical pipeline, causing a left-right flip? An indication that this might be the case is the weird display in ft_sourceplot after my ft_volumereslice step. Or is it really possible that for many subjects, a left-sided sensor topography ends up in the right hemisphere after beamforming? (My intuitions on this are not very strong.) Apologies for the lengthy e-mail. I thought it wise to provide all possible details :) Hopefully someone can help me! Best, Eelke -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot-1.png Type: image/png Size: 89562 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_volumerealign.png Type: image/png Size: 154439 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot-2.png Type: image/png Size: 36589 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_topoplotER.png Type: image/png Size: 20860 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grid-hdm-grad.png Type: image/png Size: 49287 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Apr 4 14:38:15 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 14:38:15 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: References: Message-ID: <515D7437.3070900@donders.ru.nl> Hi Eelke, the peak is on the left, don't be fooled by what you see. Trust the numbers :) The x-coordinate that is given back is in MNI coordinates and is negative. Since in MNI space, the x-axis goes to the right, this means that you are at the left side of the brain. See also this awesome appendix of an even greater tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space (scroll down til 'We will now determine the positions on which...') :) Greetings Jörn On 4/4/2013 2:18 PM, Eelke Spaak wrote: > Dear FieldTrippers, > > I am trying to do source reconstruction, but am encountering two weird > things in my pipeline related to anatomy. It could be that everything > is OK, but I am worried I might have introduced a left/right flip > somewhere. > > To read in my (dicom) MRI, I use: > > % read the mri > fprintf('loading mri for subject %d...\n', subjects(k).id); > mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); > > and then I mark the fiducials as follows: > > % align to fiducials in CTF coordsys > cfg = []; > cfg.coordsys = 'ctf'; > cfg.method = 'interactive'; > cfg.clim = [0 800]; > mri = ft_volumerealign(cfg, mri); > > In attachment ft_volumerealign.png I show the plot that comes up. > Although the position of the different slices is not what I usually > expect, this should all still be fine, right? The yellow crosshair is > in the right fiducial location, as evidenced by the white blob below > the ear (which is always on the right hand side during MRI > acquisition). > > After marking r, l and n (and quitting with 'q') I do: > > % reslice to make everything right-side up > mri = ft_volumereslice([], mri); > > In attachment ft_sourceplot-1.png I show output of > ft_sourceplot([],mri) after this step. Note that the positions of the > axial/coronal/sagittal slices are not what one would typically expect. > Also note (and this is problem 1) that the right hand side of the > anatomy is displayed on the right hand side in the bottom (axial) > slice, but on the left hand side in the top right (coronal) slice. > Initially I thought this was just a benign visualisation issue > (analogous to http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), > but it might be a real problem after all, because of what I found > next. > > After these steps, I proceed to do segmentation and I create a headmodel: > > cfg = []; > cfg.coordsys = 'ctf'; > mri = ft_volumesegment(cfg, mri); > > % make single shell model > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, mri); > > As outlined in the beamformingextended tutorial, I create a > subject-specific source model which I inverse-warp to MNI: > > % load template sourcemodel (grid) in mni space > template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); > > % warp the grid > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > (See attachment grid-hdm-grad.png for a plot of all three geometrical > objects superimposed. Looks fine to me.) Then I create a leadfield: > > cfg = []; > cfg.grid = sourcemodel; > cfg.vol = headmodel; > cfg.channel = {'MEG'}; > cfg.grad = data.grad; > leadfield = ft_prepare_leadfield(cfg, data); > > The next step, which is the one which alerted me to the potential > problem in the steps above, is to do an LCMV beamformer on a small > time window of my ERF: > > % compute ERF covariance in small window > cfg = []; > cfg.covariance = 'yes'; > cfg.covariancewindow = [1.5 1.55]; > tl_right = ft_timelockanalysis(cfg, rightErf); > > % do beamforming > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = leadfield; > cfg.vol = headmodel; > cfg.lcmv.lambda = '5%'; > cfg.lcmv.projectnoise = 'yes'; > cfg.lcmv.keepfilter = 'yes'; > > sourceRight = ft_sourceanalysis(cfg, tl_right); > > % normalise with noise > sourceRightNAI = sourceRight; > sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; > > % copy over pos and dim from template > sourceRight.pos = template.sourcemodel.pos; > sourceRight.dim = template.sourcemodel.dim; > sourceRightNAI.pos = template.sourcemodel.pos; > sourceRightNAI.dim = template.sourcemodel.dim; > > % interpolate onto template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); > sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); > > % plot > cfg = []; > cfg.funparameter = 'avg.pow'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.coordsys = 'mni'; > ft_sourceplot(cfg, sourceRightNAI_int); > > The output of the above step is shown in ft_sourceplot-2.png. Note > that there clearly is a maximum in the posterior right hemisphere. Now > compare this to when I just plot the sensor-level ERF for the same > time interval: > > c2=[]; > c2.layout='CTF275.lay'; > c2.xlim = [1.5 1.55]; > figure;ft_topoplotER(c2,rightErf); > > (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me > as if there should be a dipole in the left hemisphere. (That's problem > 2.) > > Now of course I know that interpreting axial gradient data by eye is > difficult, but this left-side increase is present in the majority of > my subjects, yet the resulting LCMV maximum always ends up in the > right hemisphere. Therefore my question: am I doing something wrong in > my anatomical pipeline, causing a left-right flip? An indication that > this might be the case is the weird display in ft_sourceplot after my > ft_volumereslice step. Or is it really possible that for many > subjects, a left-sided sensor topography ends up in the right > hemisphere after beamforming? (My intuitions on this are not very > strong.) > > Apologies for the lengthy e-mail. I thought it wise to provide all > possible details :) Hopefully someone can help me! > > Best, > Eelke > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Thu Apr 4 14:50:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 14:50:33 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D6F8F.9010005@univ-amu.fr> References: <515D6F8F.9010005@univ-amu.fr> Message-ID: <515D7719.5040705@donders.ru.nl> Dear Andrea, > Questions: > > Does anyone know why ? I am not sure as you provide minimalistic insight into what you are exactly doing. If you use a single subject grid, the actual grid points for which you estimate source activity will be slightly different than when you base this on a template, so that might be one reason. Also you are probably doing monte carlo statistics, for which p-values will vary anyway for different runs (sidenote: check the newly implemented p-value confidecen interval, if they are overlapping, no need to worry). However, since you do not say how much the p-values differ, how many permutations you are running, what other parameters you choose etc., it's hard to judge whether this is something to worry about. > > Is the use of the MNI template the only (and best) way to allow > statistical analysis across subjects in the source space ? No, but I think the answer most suited to what you actually want to ask is yes. No, because you can use any other template,you can define any T1 as a template, e.g. of one of your subjects. Yes, however, because using the MNI template you know what coordinate (roughly) corresponds to what anatomical region. With a different template you would need to find a reliable way to determine an anatomical label. There is also a way to do everything on subject-specific space and only after source reconstruction warp back to the MNI template. This used to be the way before I started working on all this, so I am not exactly sure how this works. The only thing I know is that we recommend the way that you took. Another way would be to use a localizer task to anatomically localize the region of interest per subject, beam only activity of that region and run statistics only on that one region. Then there is no need to go to some template space. Hope this helps :) Best, Jörn On 4/4/2013 2:18 PM, Andrea Brovelli wrote: > Dear all, > > I used DICS and compared the quality of the beamforming using two > different source spaces (3D grids): > > 1) MNI template space as described in > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > 2) Single subject 3D grid using anatomical MRI > > The number of sources in the two models is similar (approx. 3500 > sources). However, the results using the MNI template are less > significant. That is, the statistical analysis testing a significant > increase in power post-stimulus with respect to baseline give higher > p-values (in some region of interest). > > Questions: > > Does anyone know why ? > > Is the use of the MNI template the only (and best) way to allow > statistical analysis across subjects in the source space ? > > thanks a lot > > Andrea > > > -- 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 Apr 4 14:53:40 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 4 Apr 2013 14:53:40 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: <515D7437.3070900@donders.ru.nl> References: <515D7437.3070900@donders.ru.nl> Message-ID: Awesome, thanks a lot Jörn! I didn't think to check the numbers, newbie mistake... :) Now all that's left is to find an easy way to flip the image, but I imagine that shouldn't be too hard. Or just label the axes, I guess. On 4 April 2013 14:38, "Jörn M. Horschig" wrote: > Hi Eelke, > > the peak is on the left, don't be fooled by what you see. Trust the numbers > :) > > The x-coordinate that is given back is in MNI coordinates and is negative. > Since in MNI space, the x-axis goes to the right, this means that you are at > the left side of the brain. > See also this awesome appendix of an even greater tutorial: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space > (scroll down til 'We will now determine the positions on which...') :) > > Greetings > Jörn > > > On 4/4/2013 2:18 PM, Eelke Spaak wrote: > > Dear FieldTrippers, > > I am trying to do source reconstruction, but am encountering two weird > things in my pipeline related to anatomy. It could be that everything > is OK, but I am worried I might have introduced a left/right flip > somewhere. > > To read in my (dicom) MRI, I use: > > % read the mri > fprintf('loading mri for subject %d...\n', subjects(k).id); > mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); > > and then I mark the fiducials as follows: > > % align to fiducials in CTF coordsys > cfg = []; > cfg.coordsys = 'ctf'; > cfg.method = 'interactive'; > cfg.clim = [0 800]; > mri = ft_volumerealign(cfg, mri); > > In attachment ft_volumerealign.png I show the plot that comes up. > Although the position of the different slices is not what I usually > expect, this should all still be fine, right? The yellow crosshair is > in the right fiducial location, as evidenced by the white blob below > the ear (which is always on the right hand side during MRI > acquisition). > > After marking r, l and n (and quitting with 'q') I do: > > % reslice to make everything right-side up > mri = ft_volumereslice([], mri); > > In attachment ft_sourceplot-1.png I show output of > ft_sourceplot([],mri) after this step. Note that the positions of the > axial/coronal/sagittal slices are not what one would typically expect. > Also note (and this is problem 1) that the right hand side of the > anatomy is displayed on the right hand side in the bottom (axial) > slice, but on the left hand side in the top right (coronal) slice. > Initially I thought this was just a benign visualisation issue > (analogous to > http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), > but it might be a real problem after all, because of what I found > next. > > After these steps, I proceed to do segmentation and I create a headmodel: > > cfg = []; > cfg.coordsys = 'ctf'; > mri = ft_volumesegment(cfg, mri); > > % make single shell model > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, mri); > > As outlined in the beamformingextended tutorial, I create a > subject-specific source model which I inverse-warp to MNI: > > % load template sourcemodel (grid) in mni space > template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); > > % warp the grid > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > (See attachment grid-hdm-grad.png for a plot of all three geometrical > objects superimposed. Looks fine to me.) Then I create a leadfield: > > cfg = []; > cfg.grid = sourcemodel; > cfg.vol = headmodel; > cfg.channel = {'MEG'}; > cfg.grad = data.grad; > leadfield = ft_prepare_leadfield(cfg, data); > > The next step, which is the one which alerted me to the potential > problem in the steps above, is to do an LCMV beamformer on a small > time window of my ERF: > > % compute ERF covariance in small window > cfg = []; > cfg.covariance = 'yes'; > cfg.covariancewindow = [1.5 1.55]; > tl_right = ft_timelockanalysis(cfg, rightErf); > > % do beamforming > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = leadfield; > cfg.vol = headmodel; > cfg.lcmv.lambda = '5%'; > cfg.lcmv.projectnoise = 'yes'; > cfg.lcmv.keepfilter = 'yes'; > > sourceRight = ft_sourceanalysis(cfg, tl_right); > > % normalise with noise > sourceRightNAI = sourceRight; > sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; > > % copy over pos and dim from template > sourceRight.pos = template.sourcemodel.pos; > sourceRight.dim = template.sourcemodel.dim; > sourceRightNAI.pos = template.sourcemodel.pos; > sourceRightNAI.dim = template.sourcemodel.dim; > > % interpolate onto template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); > sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); > > % plot > cfg = []; > cfg.funparameter = 'avg.pow'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.coordsys = 'mni'; > ft_sourceplot(cfg, sourceRightNAI_int); > > The output of the above step is shown in ft_sourceplot-2.png. Note > that there clearly is a maximum in the posterior right hemisphere. Now > compare this to when I just plot the sensor-level ERF for the same > time interval: > > c2=[]; > c2.layout='CTF275.lay'; > c2.xlim = [1.5 1.55]; > figure;ft_topoplotER(c2,rightErf); > > (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me > as if there should be a dipole in the left hemisphere. (That's problem > 2.) > > Now of course I know that interpreting axial gradient data by eye is > difficult, but this left-side increase is present in the majority of > my subjects, yet the resulting LCMV maximum always ends up in the > right hemisphere. Therefore my question: am I doing something wrong in > my anatomical pipeline, causing a left-right flip? An indication that > this might be the case is the weird display in ft_sourceplot after my > ft_volumereslice step. Or is it really possible that for many > subjects, a left-sided sensor topography ends up in the right > hemisphere after beamforming? (My intuitions on this are not very > strong.) > > Apologies for the lengthy e-mail. I thought it wise to provide all > possible details :) Hopefully someone can help me! > > Best, > Eelke > > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Thu Apr 4 15:13:34 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 15:13:34 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: References: <515D7437.3070900@donders.ru.nl> Message-ID: <515D7C7E.7010201@donders.ru.nl> We got Adobe Photoshop at our institute ;) Actually, I think it would be good to implement a cfg.flipimage option to ft_sourceplot. However, people should only use it when they know what they are doing and not just flip because it looks nicer :) Maybe we should discuss that in the next FT meeting in two weeks. Greetings, Jörn On 4/4/2013 2:53 PM, Eelke Spaak wrote: > Awesome, thanks a lot Jörn! > > I didn't think to check the numbers, newbie mistake... :) Now all > that's left is to find an easy way to flip the image, but I imagine > that shouldn't be too hard. Or just label the axes, I guess. > > On 4 April 2013 14:38, "Jörn M. Horschig" wrote: >> Hi Eelke, >> >> the peak is on the left, don't be fooled by what you see. Trust the numbers >> :) >> >> The x-coordinate that is given back is in MNI coordinates and is negative. >> Since in MNI space, the x-axis goes to the right, this means that you are at >> the left side of the brain. >> See also this awesome appendix of an even greater tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space >> (scroll down til 'We will now determine the positions on which...') :) >> >> Greetings >> Jörn >> >> >> On 4/4/2013 2:18 PM, Eelke Spaak wrote: >> >> Dear FieldTrippers, >> >> I am trying to do source reconstruction, but am encountering two weird >> things in my pipeline related to anatomy. It could be that everything >> is OK, but I am worried I might have introduced a left/right flip >> somewhere. >> >> To read in my (dicom) MRI, I use: >> >> % read the mri >> fprintf('loading mri for subject %d...\n', subjects(k).id); >> mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); >> >> and then I mark the fiducials as follows: >> >> % align to fiducials in CTF coordsys >> cfg = []; >> cfg.coordsys = 'ctf'; >> cfg.method = 'interactive'; >> cfg.clim = [0 800]; >> mri = ft_volumerealign(cfg, mri); >> >> In attachment ft_volumerealign.png I show the plot that comes up. >> Although the position of the different slices is not what I usually >> expect, this should all still be fine, right? The yellow crosshair is >> in the right fiducial location, as evidenced by the white blob below >> the ear (which is always on the right hand side during MRI >> acquisition). >> >> After marking r, l and n (and quitting with 'q') I do: >> >> % reslice to make everything right-side up >> mri = ft_volumereslice([], mri); >> >> In attachment ft_sourceplot-1.png I show output of >> ft_sourceplot([],mri) after this step. Note that the positions of the >> axial/coronal/sagittal slices are not what one would typically expect. >> Also note (and this is problem 1) that the right hand side of the >> anatomy is displayed on the right hand side in the bottom (axial) >> slice, but on the left hand side in the top right (coronal) slice. >> Initially I thought this was just a benign visualisation issue >> (analogous to >> http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), >> but it might be a real problem after all, because of what I found >> next. >> >> After these steps, I proceed to do segmentation and I create a headmodel: >> >> cfg = []; >> cfg.coordsys = 'ctf'; >> mri = ft_volumesegment(cfg, mri); >> >> % make single shell model >> cfg = []; >> cfg.method = 'singleshell'; >> headmodel = ft_prepare_headmodel(cfg, mri); >> >> As outlined in the beamformingextended tutorial, I create a >> subject-specific source model which I inverse-warp to MNI: >> >> % load template sourcemodel (grid) in mni space >> template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); >> >> % warp the grid >> cfg = []; >> cfg.grid.warpmni = 'yes'; >> cfg.grid.template = template.sourcemodel; >> cfg.grid.nonlinear = 'yes'; >> cfg.mri = mri; >> sourcemodel = ft_prepare_sourcemodel(cfg); >> >> (See attachment grid-hdm-grad.png for a plot of all three geometrical >> objects superimposed. Looks fine to me.) Then I create a leadfield: >> >> cfg = []; >> cfg.grid = sourcemodel; >> cfg.vol = headmodel; >> cfg.channel = {'MEG'}; >> cfg.grad = data.grad; >> leadfield = ft_prepare_leadfield(cfg, data); >> >> The next step, which is the one which alerted me to the potential >> problem in the steps above, is to do an LCMV beamformer on a small >> time window of my ERF: >> >> % compute ERF covariance in small window >> cfg = []; >> cfg.covariance = 'yes'; >> cfg.covariancewindow = [1.5 1.55]; >> tl_right = ft_timelockanalysis(cfg, rightErf); >> >> % do beamforming >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = leadfield; >> cfg.vol = headmodel; >> cfg.lcmv.lambda = '5%'; >> cfg.lcmv.projectnoise = 'yes'; >> cfg.lcmv.keepfilter = 'yes'; >> >> sourceRight = ft_sourceanalysis(cfg, tl_right); >> >> % normalise with noise >> sourceRightNAI = sourceRight; >> sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; >> >> % copy over pos and dim from template >> sourceRight.pos = template.sourcemodel.pos; >> sourceRight.dim = template.sourcemodel.dim; >> sourceRightNAI.pos = template.sourcemodel.pos; >> sourceRightNAI.dim = template.sourcemodel.dim; >> >> % interpolate onto template brain >> cfg = []; >> cfg.voxelcoord = 'no'; >> cfg.parameter = 'avg.pow'; >> cfg.interpmethod = 'nearest'; >> cfg.coordsys = 'mni'; >> sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); >> sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); >> >> % plot >> cfg = []; >> cfg.funparameter = 'avg.pow'; >> cfg.method = 'ortho'; >> cfg.location = 'max'; >> cfg.coordsys = 'mni'; >> ft_sourceplot(cfg, sourceRightNAI_int); >> >> The output of the above step is shown in ft_sourceplot-2.png. Note >> that there clearly is a maximum in the posterior right hemisphere. Now >> compare this to when I just plot the sensor-level ERF for the same >> time interval: >> >> c2=[]; >> c2.layout='CTF275.lay'; >> c2.xlim = [1.5 1.55]; >> figure;ft_topoplotER(c2,rightErf); >> >> (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me >> as if there should be a dipole in the left hemisphere. (That's problem >> 2.) >> >> Now of course I know that interpreting axial gradient data by eye is >> difficult, but this left-side increase is present in the majority of >> my subjects, yet the resulting LCMV maximum always ends up in the >> right hemisphere. Therefore my question: am I doing something wrong in >> my anatomical pipeline, causing a left-right flip? An indication that >> this might be the case is the weird display in ft_sourceplot after my >> ft_volumereslice step. Or is it really possible that for many >> subjects, a left-sided sensor topography ends up in the right >> hemisphere after beamforming? (My intuitions on this are not very >> strong.) >> >> Apologies for the lengthy e-mail. I thought it wise to provide all >> possible details :) Hopefully someone can help me! >> >> Best, >> Eelke >> >> >> >> _______________________________________________ >> 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 > _______________________________________________ > 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 smoratti at psi.ucm.es Thu Apr 4 15:43:58 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 4 Apr 2013 15:43:58 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D6F8F.9010005@univ-amu.fr> References: <515D6F8F.9010005@univ-amu.fr> Message-ID: <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> Dear Andrea, ¿Did you normalize the volume of the individuals after source reconstruction and before doing statistics? If not, this might explain the difference. 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 04/04/2013, a las 14:18, Andrea Brovelli escribió: > Dear all, > > I used DICS and compared the quality of the beamforming using two different source spaces (3D grids): > > 1) MNI template space as described in http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > 2) Single subject 3D grid using anatomical MRI > > The number of sources in the two models is similar (approx. 3500 sources). However, the results using the MNI template are less significant. That is, the statistical analysis testing a significant increase in power post-stimulus with respect to baseline give higher p-values (in some region of interest). > > Questions: > > Does anyone know why ? > > Is the use of the MNI template the only (and best) way to allow statistical analysis across subjects in the source space ? > > thanks a lot > > Andrea > > > > -- > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.brovelli at univ-amu.fr Thu Apr 4 16:14:16 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 16:14:16 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> References: <515D6F8F.9010005@univ-amu.fr> <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> Message-ID: <515D8AB8.3080307@univ-amu.fr> Thanks for the reply. No, I did not normalise it. In fact, I find that using the normalised template (the MNI) I get less significant result... Any idea ? Thanks Le 04/04/2013 15:43, smoratti at psi.ucm.es a écrit : > If not, this might explain the difference -- From andrea.brovelli at univ-amu.fr Thu Apr 4 16:31:29 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 16:31:29 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D7719.5040705@donders.ru.nl> References: <515D6F8F.9010005@univ-amu.fr> <515D7719.5040705@donders.ru.nl> Message-ID: <515D8EC1.5020809@univ-amu.fr> Thanks a lot Jorn, I 'll try out the different methods you suggested to understand better at which step I loose significance. Bye Andrea Le 04/04/2013 14:50, "Jörn M. Horschig" a écrit : > I am not sure as you provide minimalistic insight into what you are > exactly doing. If you use a single subject grid, the actual grid > points for which you estimate source activity will be slightly > different than when you base this on a template, so that might be one > reason. Also you are probably doing monte carlo statistics, for which > p-values will vary anyway for different runs (sidenote: check the > newly implemented p-value confidecen interval, if they are > overlapping, no need to worry). However, since you do not say how much > the p-values differ, how many permutations you are running, what other > parameters you choose etc., it's hard to judge whether this is > something to worry about. -- From andmib at gmail.com Thu Apr 4 17:38:41 2013 From: andmib at gmail.com (Andrew Brooks) Date: Thu, 4 Apr 2013 11:38:41 -0400 Subject: [FieldTrip] Where to access Siemens sequence code? Message-ID: Hello all, I am trying to setup a real-time fMRI pipeline using the fieldtrip gui_streamer and buffer. In the documentation, it suggests inserting three lines of code into the 'fSeqCheck' function in the sequence code in order for protocol information to be dumped to the E: drive. The facility I use has the Siemens idea license, which I believe allows for sequence code modification. Is there somebody who can direct me on how to edit sequence code? I attempted the manual text file creation method, but did not know where to find information on one of the parameters (lContrasts), so I left it to 5. However, doing that I get header errors when running any of the realtime fieldtrip scripts (the omri quality and the pipeline scripts). Sincerely, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From raminazodiaval at gmail.com Fri Apr 5 09:49:47 2013 From: raminazodiaval at gmail.com (Ramin Azodi) Date: Fri, 5 Apr 2013 09:49:47 +0200 Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' Message-ID: Hello, In case that I want just to calculate imaginary part of coherence instead of coherence with 'indepsamplesZcoh', what kind of operation should I do for that? can anybody lead me through the right way ? You can find my code as following, cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq1 = ft_freqanalysis(cfg, data1); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.complex = 'imag'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq2 = ft_freqanalysis(cfg, data2); cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesZcoh'; cfg.parameter = 'fourierspctrm'; cfg.computecritval = 'yes'; cfg.numrandomization = 500; cfg.design = [ones(size(freq1.fourierspctrm,1),1); 2*ones(size(freq2.fourierspctrm,1),1)]'; cfg.label = freq.label; stat = ft_freqstatistics(cfg, freq,freq1); Thanks in advanced for your consideration. Best Regards, Ramin Azodi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 5 16:34:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 05 Apr 2013 16:34:33 +0200 Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' In-Reply-To: References: Message-ID: <515EE0F9.8070507@donders.ru.nl> Hi Ramin, hope you are doing fine. For the imaginary part of coherence you need to call ft_connectivityanalysis with cfg.output = 'imag'. Afaik, z-scoring for the imaginary part is different from doing it for the plain coherence, so you should not use indepsamplesZcoh. You could have a look at Guido Nolte's paper on imaginary coherence and look it up in the methods section how he is computing it - similar but different from what I know how the z-scoring for coherence is computed. Thus, I am not sure how to best do cluster-based statistics on that (that means, I know how you could do it, but not what the best way to do it would be). Of course, you write an own statistics function, something like 'indepsamplesZicoh'... but that would be tons of work. Good luck! I hope anyone out there has other/better ideas :) Best, Jörn On 4/5/2013 9:49 AM, Ramin Azodi wrote: > Hello, > In case that I want just to calculate imaginary part of coherence > instead of coherence with 'indepsamplesZcoh', what kind of operation > should I do for that? can anybody lead me through the right way ? > You can find my code as following, > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.taper = 'hanning'; > cfg.foilim = [12 20]; > freq1 = ft_freqanalysis(cfg, data1); > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.complex = 'imag'; > cfg.taper = 'hanning'; > cfg.foilim = [12 20]; > freq2 = ft_freqanalysis(cfg, data2); > cfg = []; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesZcoh'; > cfg.parameter = 'fourierspctrm'; > cfg.computecritval = 'yes'; > cfg.numrandomization = 500; > cfg.design = [ones(size(freq1.fourierspctrm,1),1); > 2*ones(size(freq2.fourierspctrm,1),1)]'; > cfg.label = freq.label; > stat = ft_freqstatistics(cfg, freq,freq1); > > Thanks in advanced for your consideration. > Best Regards, > Ramin Azodi > > > > > > > > _______________________________________________ > 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 sabato45 at hotmail.com Fri Apr 5 23:56:12 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Fri, 5 Apr 2013 14:56:12 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Message-ID: Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,Ana -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sat Apr 6 17:19:07 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Sat, 6 Apr 2013 11:19:07 -0400 Subject: [FieldTrip] Fwd: [Eeglabnews] EEGLAB warning for users of Matlab 2013a In-Reply-To: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> References: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> Message-ID: Dear Fieldtrip, I've been having trouble with old but previously working scripts, trying to figure out what errors are based on new implementations in Fieldtrip and those that are due to file type ( ANT .cnt). However, I've been using Matlab 2013A - could this be a source of errors as well? Do the changes in Matlab 2013A have similar implications for Fieldtrip? See message below from Arnaud Delorme: Best, Raquel Sent from my iPhone Begin forwarded message: *From:* Arnaud Delorme *Date:* April 5, 2013, 4:09:57 PM EDT *To:* eeglabnews at sccn.ucsd.edu *Subject:* *[Eeglabnews] EEGLAB warning for users of Matlab 2013a* The MathWorks has implemented minor changes in Matlab 2013a with dramatic consequences as they could potentially break or corrupt the output of about 10% of EEGLAB functions. EEGLAB graphic interface or command line users (all versions) should not upgrade to this version of Matlab until the issues have been fixed in EEGLAB (probably within a month). Details of some of the non backward compatible changes implemented by the Mathworks are described below. Arno >From http://www.mathworks.com/help/matlab/release-notes.html The behavior of unique, union, intersect, setdiff, setxor, and ismember has changed. • If there are repeated elements in the input arrays, the functions unique, union, intersect, setdiff, and setxor return the index to the first occurrence of the repeated elements (or rows). • All index vectors returned by unique, union, intersect, setdiff, or setxor are column vectors. _______________________________________________ eeglabnews mailing list eeglabnews at sccn.ucsd.edu eeglabnews mailing list Web: http://www.sccn.ucsd.edu/eeglab/eeglabmail.html To unsubscribe: send an empty email to eeglabnews-unsub at sccn.ucsd.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From evaladez at psych.udel.edu Sat Apr 6 22:25:02 2013 From: evaladez at psych.udel.edu (Emilio Valadez) Date: Sat, 6 Apr 2013 16:25:02 -0400 Subject: [FieldTrip] Instantaneous phase angles/ baseline adjust for resting alpha activity Message-ID: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> Dear FieldTrippers, I have two independent questions that I hope are relatively simple: 1) How can one obtain the instantaneous phase angles for time-frequency data? I believe one workaround method to achieve this would be to use ft_freqanalysis on the raw data with cfg.output = 'fourier' to return the complex Fourier transform, and then use MATLAB's "angle" function on the complex output to compute the phase angles. But is there a more direct way to get the phase angles from FieldTrip? 2) Can FieldTrip be used to make a baseline adjustment for resting alpha-band activity or average alpha activity in time-frequency data? And if so, how? Thanks very much for your help, in advance. All the best, Emilio -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Sun Apr 7 17:04:25 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Sun, 7 Apr 2013 17:04:25 +0200 Subject: [FieldTrip] Instantaneous phase angles/ baseline adjust for resting alpha activity In-Reply-To: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> References: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> Message-ID: Dear Emilio, For (1), you can also call ft_preprocessing on raw data, with cfg.hilbert='angle' to get the instantaneous angle from the Hilbert transform. (and appropriate filter settings so that it's filtered into your frequency of interest first). For (2), does ft_freqbaseline answer your question? Cheers, Johanna 2013/4/6 Emilio Valadez > Dear FieldTrippers,**** > > ** ** > > I have two independent questions that I hope are relatively simple:**** > > ** ** > > **1) **How can one obtain the instantaneous phase angles for > time-frequency data? I believe one workaround method to achieve this would > be to use ft_freqanalysis on the raw data with cfg.output = ‘fourier’ to > return the complex Fourier transform, and then use MATLAB’s “angle” > function on the complex output to compute the phase angles. But is there a > more direct way to get the phase angles from FieldTrip?**** > > ** ** > > **2) **Can FieldTrip be used to make a baseline adjustment for > resting alpha-band activity or average alpha activity in time-frequency > data? And if so, how?**** > > ** ** > > Thanks very much for your help, in advance.**** > > ** ** > > All the best,**** > > Emilio**** > > _______________________________________________ > fieldtrip 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 Mon Apr 8 09:29:00 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 8 Apr 2013 09:29:00 +0200 Subject: [FieldTrip] Fwd: [Eeglabnews] EEGLAB warning for users of Matlab 2013a In-Reply-To: References: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> Message-ID: Dear Raquel, Thanks for the e-mail. We're aware of these potential issues, see this entry on our bugzilla to track the progress of fixing them: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2095 Best, Eelke On 6 April 2013 17:19, Raquel Bibi wrote: > Dear Fieldtrip, > I've been having trouble with old but previously working scripts, trying to > figure out what errors are based on new implementations in Fieldtrip and > those that are due to file type ( ANT .cnt). However, I've been using > Matlab 2013A - could this be a source of errors as well? Do the changes in > Matlab 2013A have similar implications for Fieldtrip? See message below > from Arnaud Delorme: > > Best, > > Raquel > > Sent from my iPhone > > Begin forwarded message: > > From: Arnaud Delorme > Date: April 5, 2013, 4:09:57 PM EDT > To: eeglabnews at sccn.ucsd.edu > Subject: [Eeglabnews] EEGLAB warning for users of Matlab 2013a > > The MathWorks has implemented minor changes in Matlab 2013a with dramatic > consequences as they could potentially break or corrupt the output of about > 10% of EEGLAB functions. > > EEGLAB graphic interface or command line users (all versions) should not > upgrade to this version of Matlab until the issues have been fixed in EEGLAB > (probably within a month). Details of some of the non backward compatible > changes implemented by the Mathworks are described below. > > Arno > > From http://www.mathworks.com/help/matlab/release-notes.html > > > The behavior of unique, union, intersect, setdiff, setxor, and ismember has > changed. > • If there are repeated elements in the input arrays, the functions > unique, union, intersect, setdiff, and setxor return the index to the first > occurrence of the repeated elements (or rows). > • All index vectors returned by unique, union, intersect, setdiff, or > setxor are column vectors. > > > _______________________________________________ > eeglabnews mailing list eeglabnews at sccn.ucsd.edu > eeglabnews mailing list > Web: http://www.sccn.ucsd.edu/eeglab/eeglabmail.html > To unsubscribe: send an empty email to eeglabnews-unsub at sccn.ucsd.edu > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From nathanweisz at mac.com Mon Apr 8 09:48:33 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Mon, 08 Apr 2013 09:48:33 +0200 Subject: [FieldTrip] postdoc position @ cimec MEG lab Message-ID: dear all, please pass this on to potentially interested people. earliest starting date will be september (slightly later date negotiable). best, nathan ERC-funded post-doc in conscious perception research Research in the Ongoing Brain Oscillations and Behaviour Lab at the Center for Mind/Brain Sciences focuses on brain activity / connectivity patterns predisposing conscious perception. Our works mostly involves MEG, intracranial EEG and combined TMS/EEG studies. https://sites.google.com/site/obobcimec/ We are currently looking for a candidate at a Postdoc level to strengthen our team. This postdoc is expected to have solid experience with at least one of the aforementioned methods and proficiency in Matlab applied to the analysis of MEG / EEG data. The Center for Mind/Brain Sciences at the University of Trento is an oustanding work-place situated in a beautiful surrounding (e.g. Dolomites, diverse lakes; see http://www.visittrentino.it/en). It offers an international and vibrant research setting with state-of-the-art neuroimaging methodologies, including a research-only MRI scanner, MEG, EEG and TMS, as well as behavioral, eye tracking and motion tracking laboratories. The University of Trento is ranked first among research universities in Italy, and the Trentino region is consistently at the top for quality of life and for the most efficient services in Italy. English is the official language of the CIMeC, where a large proportion of the faculty, post-docs and students come from a wide range of countries outside of Italy. Interested candidates are encouraged to contact me by email at nathan.weisz at unitn.it -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Tue Apr 9 02:04:20 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 08 Apr 2013 17:04:20 -0700 Subject: [FieldTrip] source analysis EEG data without MRI Message-ID: <51635B04.7090004@berkeley.edu> Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From jm.horschig at donders.ru.nl Tue Apr 9 08:37:13 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 09 Apr 2013 08:37:13 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51635B04.7090004@berkeley.edu> References: <51635B04.7090004@berkeley.edu> Message-ID: <5163B719.7010002@donders.ru.nl> Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: /% read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit))/ Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: > Hi all, > > I'd like to do source analysis (loreta and or DICS) on my EEG data. I > don't have anatomical MRIs and I don't have a measurement of the scalp > surface. So I'd like to use a template MRI or a template head model > that is located in the FieldTrip template directory. I have EGI (128 > channels) data and electrode positions (not subject specific, just the > standard file also available in FieldTrip electrode template, > GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see > any examples on the FieldTrip page of how to make a headmodel and > volume conduction model giving only this limited data. I'd be happy to > make it into a example Matlab script on the FieldTrip page after I got > it to work. Would someone be able to give me some pointers, or example > code? > > Thanks a lot! > Ingrid > -- 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 jm.horschig at donders.ru.nl Tue Apr 9 08:57:26 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 09 Apr 2013 08:57:26 +0200 Subject: [FieldTrip] Workshop on 'How cognitive neuroscience can guide therapy' Message-ID: <5163BBD6.2040403@donders.ru.nl> Dear colleagues, We are happy to announce the workshop 'How cognitive neuroscience can guide therapy'; May 16-17, 2013 at the The Royal Netherlands Academy of Arts and Sciences (The Trippenhuis, Amsterdam). For more information and registration please see: https://www.hersenenencognitie.nl/contents/1839?locale=en Best regards, Ole Jensen, Ruud Smolders, Gojko Zaric, Jörn Horschig, Mariska van Steensel, Renate van de Ven, Jaap Murre, and Benny van der Vijgh -- 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 tzvetan.popov at uni-konstanz.de Tue Apr 9 09:32:53 2013 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 9 Apr 2013 09:32:53 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5163B719.7010002@donders.ru.nl> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> Message-ID: <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); > Hi Ingrid, > > I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: > % read in the template MRI > if isunix > mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); > elseif ispc > mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); > end > > > % segment the MRI > cfg = []; > cfg.output = {'brain' 'skull' 'scalp'}; > segmentedmri = ft_volumesegment(cfg, mris); > > > % create the headmodel (BEM) > cfg = []; > %cfg.method ='openmeeg'; % TODO FIXME download openmeeg > if isunix > cfg.method ='dipoli'; % dipoli only works under linux > else > disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); > keyboard; > end > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > elec = ft_read_sens('standard_1020.elc'); > hdm = ft_convert_units(hdm, elec.unit); > > cfg = []; > cfg.grid.xgrid = -125:8:125; > cfg.grid.ygrid = -125:8:125; > cfg.grid.zgrid = -125:8:125; > cfg.grid.tight = 'yes'; > cfg.grid.unit = hdm.unit; > cfg.inwardshift = -1.5; > cfg.vol = hdm; > grid = ft_prepare_sourcemodel(cfg) > grid = ft_convert_units(grid, elec.unit); > > figure; > hold on; > ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > ft_plot_mesh(grid.pos(grid.inside, :)); > > % this step is not necessary, cause you will see that everything is already aligned > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = hdm.bnd(1); > tmp = ft_electroderealign(cfg); > elec = tmp; % I had a bug here that I couldn't assign elec directly > > %% verify location of occipital electrodes > > occ_elec = elec; > occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); > occ_idx = match_str(elec.label, occ_chan); > occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); > occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); > occ_elec.label = occ_elec.label(occ_idx, :); > figure; > ft_plot_sens(occ_elec) > hold on; > ft_plot_vol(ft_convert_units(hdm, elec.unit)) > > > Afair, that's all that is needed. Of course you need to adjust folder and file names. > > Greetings > Jörn > > On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >> Hi all, >> >> I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? >> >> Thanks a lot! >> Ingrid >> > > > -- > 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From niccol000 at yahoo.it Tue Apr 9 10:33:17 2013 From: niccol000 at yahoo.it (=?iso-8859-1?Q?Niccol=C3=B2_Pescetelli?=) Date: Tue, 9 Apr 2013 09:33:17 +0100 (BST) Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) Message-ID: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Dear all, I am new to fieldtrip and I would like to have your opinion about a bizarre error that I find trying to execute the function ft_combineplanar(). What am I trying to do is to  obtain the planar gradient from raw data. I use a neuromag306 Elekta MEG system. I tried to dig deeper into the scripts and I notice some quirks the error could derive from: 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from 840 trials to 192 trials, without any command being provided that is BEFORE the first line of ft_combineplanar(cfg, data) being executed! At the same time all data.trials becomes empty arrays 2. my data structure does not contain the fields 'grad' before ft_combineplanar(cfg, data) has been called but it does afterwards . Again this happen without any command having been given 3. The error finally occurs in line 210 of the ft_combineplanar function (indexing error) and it's due to the data.trial array being empty What do you think? Best Nic -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Tue Apr 9 11:00:18 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 09 Apr 2013 11:00:18 +0200 Subject: [FieldTrip] postdoc @ Univ Trento (Language Interaction and Computation Lab) Message-ID: <1AB8AFEC-002D-4AD5-8C35-796BFFA2A837@mac.com> POST-DOCTORAL POSITION IN USING BRAIN DATA TO SUPPORT THE DEVELOPMENT OF EMOTIONALLY PLAUSIBLE VIRTUAL AGENTS AT CIMEC/CLIC, UNIVERSITY OF TRENTO A postdoctoral position will soon become available at the CLIC laboratory of the Center for Mind / Brain Sciences, University of Trento (http://clic.cimec.unitn.it/) starting as soon as possible from June 2013. The successful candidate will join a team of computational linguists and computational neuroscientists whose research is focused on using machine learning methods to analyze recordings of neural activity (EEG, MEG and fMRI) to gain insights about conceptual knowledge and other aspects of the cognitive models of agents involved in language use and interaction. This particular position will be in the PRESTO project, a collaboration between CIMEC, Delta Informatica, the University's Computer Science Department, and Fondazione Bruno Kessler (FBK). The objective of the project is the development of training environments based on immersion in virtual reality situations in which the trainee interacts with artificial agents (avatars). The role of the postdoc in the project will be to run experiments testing the emotional plausibility of the artificial agents, and studying the interaction between emotions and decision making in the trainees. The ideal candidate for the position is a cognitive neuroscientist with a strong research curriculum in the use of fMRI and/or EEG to study emotions and interaction. Familiarity with machine learning methods to analyze such data (eg MVPA) a plus. The fellowship has a duration of 1 year with the possibility of renewal for a second year if the results of the first year are satisfactory. The Language Interaction and Computation Lab (CLIC) is a unit of the University of Trento's Centre for Mind/Brain Sciences (CIMEC) (www.cimec.unitn.it): an interdisciplinary Centre for the research in brain and cognition including neuroscientists, psychologists, (computational) linguists, computational neuroscientists, and physicists. CLIC consists of researchers from the Departments of Computer Science and Cognitive Science carrying out research on a range of topics, including concept acquisition and information extraction from very large multi-modal corpora, combining brain data and data from corpora to study cognition, and theoretical linguistics. The official call for the position can be found at: http://www.unitn.it/en/cimec/11882/study-and-job-opportunities Deadline for the application is April 30th. For additional information please contact Massimo Poesio (massimo.poesio at unitn.it), attaching your CV. From eelke.spaak at donders.ru.nl Tue Apr 9 11:50:21 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 9 Apr 2013 11:50:21 +0200 Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: Dear Nic, That is very weird. The fact that a grad seems to be created out of thin air by ft_combineplanar suggests to me that there might be an error in your script. (However, of course it could also be a bug in fieldtrip.) Could you perhaps send a functional (small) piece of data, along with a script, that reproduces the error? Your e-mail currently does not have enough information to judge what's truly going on. If your data is >1MB, please use one of the file sharing services listed here: http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers Best, Eelke On 9 April 2013 10:33, Niccolò Pescetelli wrote: > Dear all, > > I am new to fieldtrip and I would like to have your opinion about a bizarre > error that I find trying to execute the function ft_combineplanar(). What am > I trying to do is to obtain the planar gradient from raw data. I use a > neuromag306 Elekta MEG system. > I tried to dig deeper into the scripts and I notice some quirks the error > could derive from: > > 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from > 840 trials to 192 trials, without any command being provided that is BEFORE > the first line of ft_combineplanar(cfg, data) being executed! At the same > time all data.trials becomes empty arrays > > 2. my data structure does not contain the fields 'grad' before > ft_combineplanar(cfg, data) has been called but it does afterwards . Again > this happen without any command having been given > > 3. The error finally occurs in line 210 of the ft_combineplanar function > (indexing error) and it's due to the data.trial array being empty > > What do you think? > > Best > > Nic > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Tue Apr 9 12:09:03 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 9 Apr 2013 12:09:03 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: Message-ID: <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, Ana -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Tue Apr 9 12:18:40 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 9 Apr 2013 12:18:40 +0200 (CEST) Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' In-Reply-To: <515EE0F9.8070507@donders.ru.nl> References: <515EE0F9.8070507@donders.ru.nl> Message-ID: <01c501ce350b$9ca9d010$d5fd7030$@maris@psych.ru.nl> Hi Ramin and Jörn, In multiple-subject study, it is straightforward to statistically test differences in imaginary coherence using Fieldtrip. This is analogous to the statistical testing of regular coherence, which I outlined in a reply to Ana. For a single-subject study, you would have to write your own statfun. This requires some skill, but it is conceptually straightforward. Importantly, for any test statistic that you would like to use for comparing imaginary coherence, you do not(!) have to know it’s parametric reference distribution (thanks to the beauty of permutation inference (-;) Best, Eric Maris From: "Jörn M. Horschig" [mailto:jm.horschig at donders.ru.nl] Sent: vrijdag 5 april 2013 16:35 To: FieldTrip discussion list Subject: Re: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' Hi Ramin, hope you are doing fine. For the imaginary part of coherence you need to call ft_connectivityanalysis with cfg.output = 'imag'. Afaik, z-scoring for the imaginary part is different from doing it for the plain coherence, so you should not use indepsamplesZcoh. You could have a look at Guido Nolte's paper on imaginary coherence and look it up in the methods section how he is computing it - similar but different from what I know how the z-scoring for coherence is computed. Thus, I am not sure how to best do cluster-based statistics on that (that means, I know how you could do it, but not what the best way to do it would be). Of course, you write an own statistics function, something like 'indepsamplesZicoh'... but that would be tons of work. Good luck! I hope anyone out there has other/better ideas :) Best, Jörn On 4/5/2013 9:49 AM, Ramin Azodi wrote: Hello, In case that I want just to calculate imaginary part of coherence instead of coherence with 'indepsamplesZcoh', what kind of operation should I do for that? can anybody lead me through the right way ? You can find my code as following, cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq1 = ft_freqanalysis(cfg, data1); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.complex = 'imag'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq2 = ft_freqanalysis(cfg, data2); cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesZcoh'; cfg.parameter = 'fourierspctrm'; cfg.computecritval = 'yes'; cfg.numrandomization = 500; cfg.design = [ones(size(freq1.fourierspctrm,1),1); 2*ones(size(freq2.fourierspctrm,1),1)]'; cfg.label = freq.label; stat = ft_freqstatistics(cfg, freq,freq1); Thanks in advanced for your consideration. Best Regards, Ramin Azodi _______________________________________________ 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 ingenieureniso at gmail.com Tue Apr 9 16:41:28 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Tue, 9 Apr 2013 16:41:28 +0200 Subject: [FieldTrip] nearest neighbour interpolation Message-ID: Hi all, Are there any suggestions how to implement the nearest neighbour interpolation? many thanks Ahmed -------------- next part -------------- An HTML attachment was scrubbed... URL: From niccol000 at yahoo.it Tue Apr 9 16:45:56 2013 From: niccol000 at yahoo.it (=?iso-8859-1?Q?Niccol=C3=B2_Pescetelli?=) Date: Tue, 9 Apr 2013 15:45:56 +0100 (BST) Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> Thank you Eelke. I found out that the problem was before calling the combine planar function. The original script read in 5 files of raw data (which I could not upload in dropbox, due to dimensions issues). These have the .grad field, but when I appenddata() the data structure looses its grad field. I managed to artificially attach it again, but I don't understand why the function ft_appenddata() does this Any idea? I will try to send you the files in a way or the other Best Nic ________________________________ Da: Eelke Spaak A: FieldTrip discussion list Inviato: Martedì 9 Aprile 2013 11:50 Oggetto: Re: [FieldTrip] Issues with ft_combineplanar(cfg, data) Dear Nic, That is very weird. The fact that a grad seems to be created out of thin air by ft_combineplanar suggests to me that there might be an error in your script. (However, of course it could also be a bug in fieldtrip.) Could you perhaps send a functional (small) piece of data, along with a script, that reproduces the error? Your e-mail currently does not have enough information to judge what's truly going on. If your data is >1MB, please use one of the file sharing services listed here: http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers Best, Eelke On 9 April 2013 10:33, Niccolò Pescetelli wrote: > Dear all, > > I am new to fieldtrip and I would like to have your opinion about a bizarre > error that I find trying to execute the function ft_combineplanar(). What am > I trying to do is to  obtain the planar gradient from raw data. I use a > neuromag306 Elekta MEG system. > I tried to dig deeper into the scripts and I notice some quirks the error > could derive from: > > 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from > 840 trials to 192 trials, without any command being provided that is BEFORE > the first line of ft_combineplanar(cfg, data) being executed! At the same > time all data.trials becomes empty arrays > > 2. my data structure does not contain the fields 'grad' before > ft_combineplanar(cfg, data) has been called but it does afterwards . Again > this happen without any command having been given > > 3. The error finally occurs in line 210 of the ft_combineplanar function > (indexing error) and it's due to the data.trial array being empty > > What do you think? > > Best > > Nic > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 eelke.spaak at donders.ru.nl Tue Apr 9 16:58:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 9 Apr 2013 16:58:54 +0200 Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> Message-ID: Hi Nic, Good to hear the problem has been solved. If you append multiple data sets, ft_appenddata discards gradiometer information because this might be different in the different data sets. If you are certain one particular gradiometer definition is correct for the appended data, you can simply 'artificially attach it again'. Best, Eelke On 9 April 2013 16:45, Niccolò Pescetelli wrote: > Thank you Eelke. > > I found out that the problem was before calling the combine planar function. > The original script read in 5 files of raw data (which I could not upload in > dropbox, due to dimensions issues). These have the .grad field, but when I > appenddata() the data structure looses its grad field. > > I managed to artificially attach it again, but I don't understand why the > function ft_appenddata() does this > Any idea? > > I will try to send you the files in a way or the other > > Best > > Nic > > > > ________________________________ > Da: Eelke Spaak > A: FieldTrip discussion list > Inviato: Martedì 9 Aprile 2013 11:50 > Oggetto: Re: [FieldTrip] Issues with ft_combineplanar(cfg, data) > > Dear Nic, > > That is very weird. The fact that a grad seems to be created out of > thin air by ft_combineplanar suggests to me that there might be an > error in your script. (However, of course it could also be a bug in > fieldtrip.) Could you perhaps send a functional (small) piece of data, > along with a script, that reproduces the error? Your e-mail currently > does not have enough information to judge what's truly going on. If > your data is >1MB, please use one of the file sharing services listed > here: > http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers > > Best, > Eelke > > On 9 April 2013 10:33, Niccolò Pescetelli wrote: >> Dear all, >> >> I am new to fieldtrip and I would like to have your opinion about a >> bizarre >> error that I find trying to execute the function ft_combineplanar(). What >> am >> I trying to do is to obtain the planar gradient from raw data. I use a >> neuromag306 Elekta MEG system. >> I tried to dig deeper into the scripts and I notice some quirks the error >> could derive from: >> >> 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches >> from >> 840 trials to 192 trials, without any command being provided that is >> BEFORE >> the first line of ft_combineplanar(cfg, data) being executed! At the same >> time all data.trials becomes empty arrays >> >> 2. my data structure does not contain the fields 'grad' before >> ft_combineplanar(cfg, data) has been called but it does afterwards . Again >> this happen without any command having been given >> >> 3. The error finally occurs in line 210 of the ft_combineplanar function >> (indexing error) and it's due to the data.trial array being empty >> >> What do you think? >> >> Best >> >> Nic >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inieuwenhuis at berkeley.edu Tue Apr 9 18:39:26 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Tue, 09 Apr 2013 09:39:26 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> Message-ID: <5164443E.5040909@berkeley.edu> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: > Dear Ingrid, > > in addition to Jorn's approach since you don't have MR and digitized > elec position's you can load and realign the electrodes to the > standard bem. Subsequently you can calculate the lead field and > continue with your analysis pipeline. > Good luck > tzvetan > %% read electrodes > elec = ft_read_sens('/your > path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); > %% read headmodel > templateheadmodel = '/your > path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; > load(templateheadmodel); > %% electrode realign as good as possible > % i.e. translate 0 -2 1.5 > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = vol.bnd(1).pnt; > elecR = ft_electroderealign(cfg); > %% verify how the electrodes fit toghether with the brain volume > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elecR; > cfg.headshape = vol.bnd(3).pnt; > elecR = ft_electroderealign(cfg); > > >> Hi Ingrid, >> >> I just happen to done this a few weeks back, I changed things in the >> meanwhile, but I hope that the below steps are complete: >> /% read in the template MRI >> if isunix >> mri = >> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >> elseif ispc >> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >> 'external', 'spm8', 'templates', 'T1.nii')); >> end >> >> >> % segment the MRI >> cfg = []; >> cfg.output = {'brain' 'skull' 'scalp'}; >> segmentedmri = ft_volumesegment(cfg, mris); >> >> >> % create the headmodel (BEM) >> cfg = []; >> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >> if isunix >> cfg.method ='dipoli'; % dipoli only works under linux >> else >> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >> keyboard; >> end >> hdm = ft_prepare_headmodel(cfg, segmentedmri); >> >> elec = ft_read_sens('standard_1020.elc'); >> hdm = ft_convert_units(hdm, elec.unit); >> >> cfg = []; >> cfg.grid.xgrid = -125:8:125; >> cfg.grid.ygrid = -125:8:125; >> cfg.grid.zgrid = -125:8:125; >> cfg.grid.tight = 'yes'; >> cfg.grid.unit = hdm.unit; >> cfg.inwardshift = -1.5; >> cfg.vol = hdm; >> grid = ft_prepare_sourcemodel(cfg) >> grid = ft_convert_units(grid, elec.unit); >> >> figure; >> hold on; >> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, >> 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> ft_plot_mesh(grid.pos(grid.inside, :)); >> >> % this step is not necessary, cause you will see that everything is >> already aligned >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = hdm.bnd(1); >> tmp = ft_electroderealign(cfg); >> elec = tmp; % I had a bug here that I couldn't assign elec directly >> >> %% verify location of occipital electrodes >> >> occ_elec = elec; >> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >> occ_idx = match_str(elec.label, occ_chan); >> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >> occ_elec.label = occ_elec.label(occ_idx, :); >> figure; >> ft_plot_sens(occ_elec) >> hold on; >> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >> >> >> Afair, that's all that is needed. Of course you need to adjust folder >> and file names. >> >> Greetings >> Jörn >> >> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>> Hi all, >>> >>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>> I don't have anatomical MRIs and I don't have a measurement of the >>> scalp surface. So I'd like to use a template MRI or a template head >>> model that is located in the FieldTrip template directory. I have >>> EGI (128 channels) data and electrode positions (not subject >>> specific, just the standard file also available in FieldTrip >>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how >>> to start. I don't see any examples on the FieldTrip page of how to >>> make a headmodel and volume conduction model giving only this >>> limited data. I'd be happy to make it into a example Matlab script >>> on the FieldTrip page after I got it to work. Would someone be able >>> to give me some pointers, or example code? >>> >>> Thanks a lot! >>> Ingrid >>> >> >> >> -- >> 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 > > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > > ******************************************* > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sabato45 at hotmail.com Tue Apr 9 19:57:23 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Tue, 9 Apr 2013 10:57:23 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> References: , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Message-ID: Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,Ana _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From akiko.ikkai at gmail.com Wed Apr 10 00:32:44 2013 From: akiko.ikkai at gmail.com (Akiko Ikkai) Date: Tue, 9 Apr 2013 18:32:44 -0400 Subject: [FieldTrip] classification with 3 conditions? Message-ID: Hi, I have a 3 conditions, A, B, and C in my MEG data. Multivariate classification using selected sensors between conditions A and B, B and C, and A and C work beautifully with chance = 50%. I'm now curious whether I could run a classification of 3 conditions with chance = 33%. ft_freqstatistics could take more than 2 frequency datasets as inputs, but ft_statistics_crossvalidate using +dmlt/svm.m seems to require 2 datasets (because it's using a linear kernel?). Does anyone have suggestions how I might go about it...? Thanks in advance! Akiko -- Akiko Ikkai, Ph.D. Postdoctoral Fellow Department of Psychological and Brain Sciences Johns Hopkins University Ames Hall, 3400 N. Charles St. Baltimore, MD 21218 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Wed Apr 10 01:29:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Tue, 09 Apr 2013 16:29:31 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5164443E.5040909@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu> Message-ID: <5164A45B.1060502@berkeley.edu> Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using thestandard_bem.mat . (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? *So my question is:* a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: > Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on > the wiki. > Have a great day, > Ingrid > > On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >> Dear Ingrid, >> >> in addition to Jorn's approach since you don't have MR and digitized >> elec position's you can load and realign the electrodes to the >> standard bem. Subsequently you can calculate the lead field and >> continue with your analysis pipeline. >> Good luck >> tzvetan >> %% read electrodes >> elec = ft_read_sens('/your >> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >> %% read headmodel >> templateheadmodel = '/your >> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >> load(templateheadmodel); >> %% electrode realign as good as possible >> % i.e. translate 0 -2 1.5 >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = vol.bnd(1).pnt; >> elecR = ft_electroderealign(cfg); >> %% verify how the electrodes fit toghether with the brain volume >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elecR; >> cfg.headshape = vol.bnd(3).pnt; >> elecR = ft_electroderealign(cfg); >> >> >>> Hi Ingrid, >>> >>> I just happen to done this a few weeks back, I changed things in the >>> meanwhile, but I hope that the below steps are complete: >>> /% read in the template MRI >>> if isunix >>> mri = >>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>> elseif ispc >>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>> 'external', 'spm8', 'templates', 'T1.nii')); >>> end >>> >>> >>> % segment the MRI >>> cfg = []; >>> cfg.output = {'brain' 'skull' 'scalp'}; >>> segmentedmri = ft_volumesegment(cfg, mris); >>> >>> >>> % create the headmodel (BEM) >>> cfg = []; >>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>> if isunix >>> cfg.method ='dipoli'; % dipoli only works under linux >>> else >>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>> keyboard; >>> end >>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> elec = ft_read_sens('standard_1020.elc'); >>> hdm = ft_convert_units(hdm, elec.unit); >>> >>> cfg = []; >>> cfg.grid.xgrid = -125:8:125; >>> cfg.grid.ygrid = -125:8:125; >>> cfg.grid.zgrid = -125:8:125; >>> cfg.grid.tight = 'yes'; >>> cfg.grid.unit = hdm.unit; >>> cfg.inwardshift = -1.5; >>> cfg.vol = hdm; >>> grid = ft_prepare_sourcemodel(cfg) >>> grid = ft_convert_units(grid, elec.unit); >>> >>> figure; >>> hold on; >>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>> ft_plot_mesh(grid.pos(grid.inside, :)); >>> >>> % this step is not necessary, cause you will see that everything is >>> already aligned >>> cfg = []; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = hdm.bnd(1); >>> tmp = ft_electroderealign(cfg); >>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>> >>> %% verify location of occipital electrodes >>> >>> occ_elec = elec; >>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >>> occ_idx = match_str(elec.label, occ_chan); >>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>> occ_elec.label = occ_elec.label(occ_idx, :); >>> figure; >>> ft_plot_sens(occ_elec) >>> hold on; >>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>> >>> >>> Afair, that's all that is needed. Of course you need to adjust >>> folder and file names. >>> >>> Greetings >>> Jörn >>> >>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>> Hi all, >>>> >>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>> I don't have anatomical MRIs and I don't have a measurement of the >>>> scalp surface. So I'd like to use a template MRI or a template head >>>> model that is located in the FieldTrip template directory. I have >>>> EGI (128 channels) data and electrode positions (not subject >>>> specific, just the standard file also available in FieldTrip >>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>> how to start. I don't see any examples on the FieldTrip page of how >>>> to make a headmodel and volume conduction model giving only this >>>> limited data. I'd be happy to make it into a example Matlab script >>>> on the FieldTrip page after I got it to work. Would someone be able >>>> to give me some pointers, or example code? >>>> >>>> Thanks a lot! >>>> Ingrid >>>> >>> >>> >>> -- >>> 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 >> >> ******************************************* >> Tzvetan Popov >> Clinical Psychology >> University of Konstanz >> Box 23 >> 78457 Konstanz, GERMANY >> Phone: 0049-7531-883086 >> Fax: 0049-7531-884601 >> Email: tzvetan.popov at uni-konstanz.de >> >> ******************************************* >> >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: afterbemcp.png Type: image/png Size: 64338 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol3.png Type: image/png Size: 46492 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol.png Type: image/png Size: 47348 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol2.png Type: image/png Size: 31169 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Wed Apr 10 09:06:57 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 10 Apr 2013 09:06:57 +0200 Subject: [FieldTrip] nearest neighbour interpolation In-Reply-To: References: Message-ID: <51650F90.1070900@donders.ru.nl> Dear Ahmed, I am not sure I understood your question. Please have a look here: http://fieldtrip.fcdonders.nl/reference/ft_channelrepair http://fieldtrip.fcdonders.nl/reference/ft_prepare_neighbours http://fieldtrip.fcdonders.nl/faq/how_does_ft_prepare_neighbours_work http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described?s[]=ft&s[]=channelrepair For example code for ft_prepare_neighbours, see the cluster-based permutation test tutorials, e.g.: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock#permutation_test Greetings Jörn On 4/9/2013 4:41 PM, ingenieur eniso wrote: > Hi all, > > Are there any suggestions how to implement the nearest neighbour > interpolation? > > many thanks > > Ahmed > > > _______________________________________________ > 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 e.maris at psych.ru.nl Wed Apr 10 09:21:28 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Wed, 10 Apr 2013 09:21:28 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Message-ID: <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris, thank you for your response. I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I have two conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulation across trials to find out whether condition 1 is different from condition 2 independently of their different number of trials. If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic. I really appreciate your help. Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, Ana _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From irina.simanova at mpi.nl Wed Apr 10 10:07:09 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Wed, 10 Apr 2013 10:07:09 +0200 Subject: [FieldTrip] classification with 3 conditions? In-Reply-To: References: Message-ID: Dear Akiko, you can use DML functions for multiclass classification: dml.one_against_one or dml.one_against_rest one_against_rest builds one SVM per class, trained to distinguish the trials in a single class from the trials in all remaining classes. Classification of a test trial is done according to the maximum output among all SVMs. one_against_one builds one SVM for each pair of classes (a pairwise comparison). Classification of a test trial is done according to the maximum voting , where each SVM votes for one class. You can see for yourself which method is better for your research question/data. You call it like this: cfg.mva = dml.one_against_rest('mva', {dml.standardizer() dml.svm()}) or cfg.mva = dml.one_against_one('mva', {dml.standardizer() dml.svm()}) best, Irina On Apr 10, 2013, at 12:32 AM 4/10/13, Akiko Ikkai wrote: > Hi, > > I have a 3 conditions, A, B, and C in my MEG data. Multivariate classification using selected sensors between conditions A and B, B and C, and A and C work beautifully with chance = 50%. I'm now curious whether I could run a classification of 3 conditions with chance = 33%. > > ft_freqstatistics could take more than 2 frequency datasets as inputs, but ft_statistics_crossvalidate using +dmlt/svm.m seems to require 2 datasets (because it's using a linear kernel?). > > Does anyone have suggestions how I might go about it...? > Thanks in advance! Akiko > > -- > Akiko Ikkai, Ph.D. > Postdoctoral Fellow > Department of Psychological and Brain Sciences > Johns Hopkins University > Ames Hall, 3400 N. Charles St. > Baltimore, MD 21218 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Wed Apr 10 11:36:48 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 10 Apr 2013 11:36:48 +0200 Subject: [FieldTrip] Bug in ft_freqcomparison.m? In-Reply-To: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> References: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> Message-ID: Hi Alex, Thanks for looking into this function. You’re right that ft_freqcomparison initializes the output structure ‘ freq’ (line 87) using the first input structure. This could indeed be problematic when the two input structures are dissimilarly sized. In fact, having a size difference in the powspctrm fields between the two input structure is an exclusion criterion for using this function in the first place, e.g. because it may result in comparing frequency powers of different channels, trials, or subjects. For that reason, a check was built in at lines 92 and 115, which ensures that the input structures have identical matrix size. Although not intuitive clear maybe from a reader’s perspective, this is thus not an issue and it will not affect your data. Also please note that ft_freqcomparison has become outdated with the arrival of ft_math. Technically, this function can do the same, but with more flexibility and better bookkeeping. Best wishes, Arjen 2013/3/13 Alexander Maye > Hi All, > > I just spotted something that could be a bug in ft_freqcomparison.m > (fieldtrip-20130312 and previous versions). Don't now if this is the place > for > report, but if this really is an issue everyone using this function may be > interested. > > The problem is in line 87 where freq = varargin{1}; is initialized to the > *first* freq argument, that according to the doc is used as the norm. So > the > output (powspctrm) has the dimension of the norm, not the second freq > argument, that one wants to become normalized. Strange, hmm? Then, in the > following for-loops the index variable runs over the size of the *second* > freq > argument, updating trials in the powspctrm with the size of the *first* > freq > argument, which seems simply wrong. > > Maybe this is an ingenious programming trick, but initializing freq = > varargin{2}; on line 87 would make more sense from my point of view. > > Best, > > ALEX. > > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen > Rechts; Gerichtsstand: Hamburg > > Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander > Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Wed Apr 10 15:38:16 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 10 Apr 2013 13:38:16 +0000 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5164A45B.1060502@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>,<5164A45B.1060502@berkeley.edu> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> Hi Ingrid, I had a similar issue a few weeks ago, where my lower most electrodes started floating after electrode realign using the ft_electroderealign function. I used the ft_prepare_vol_sens as, [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and brought the electrodes on to the skin. Hope this helps...! Regards Imali From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis [inieuwenhuis at berkeley.edu] Sent: Wednesday, 10 April 2013 9:29 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] source analysis EEG data without MRI Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using the standard_bem.mat. (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? So my question is: a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: % read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit)) Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingenieureniso at gmail.com Wed Apr 10 17:43:55 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Wed, 10 Apr 2013 17:43:55 +0200 Subject: [FieldTrip] nearest neighbour interpolation In-Reply-To: <51650F90.1070900@donders.ru.nl> References: <51650F90.1070900@donders.ru.nl> Message-ID: Dear Jörn, thank you very much for help. yes, this is what i'm looking. All the best Ahmed 2013/4/10 "Jörn M. Horschig" > Dear Ahmed, > > I am not sure I understood your question. Please have a look here: > http://fieldtrip.fcdonders.nl/reference/ft_channelrepair > > http://fieldtrip.fcdonders.nl/reference/ft_prepare_neighbours > http://fieldtrip.fcdonders.nl/faq/how_does_ft_prepare_neighbours_work > > http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described?s > []=ft&s[]=channelrepair > > For example code for ft_prepare_neighbours, see the cluster-based > permutation test tutorials, e.g.: > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock#permutation_test > > Greetings > Jörn > > > > On 4/9/2013 4:41 PM, ingenieur eniso wrote: > > Hi all, > > Are there any suggestions how to implement the nearest neighbour > interpolation? > > many thanks > > Ahmed > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 Lilla.Magyari at mpi.nl Wed Apr 10 18:05:02 2013 From: Lilla.Magyari at mpi.nl (Magyari, Lilla) Date: Wed, 10 Apr 2013 18:05:02 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> Message-ID: <51658DAE.9080207@mpi.nl> hi Ingrid and Imali, I think it is a really good question what to do in Ingrid's case. I do not know the "right" answer, but I would like to share my thoughts about it. The ft_prepare_vol_sens is indeed projects the electrode positions closer to the headsurface as Imali wrote. But this function called automatically when you create your leadfield, so you do not have to do it separately (unless you want to visualize the corrected electrode positions). However, I have been advised to rely on this projection carefully if electrode positions are far from the skin and specially, if the inaccuracies (distance from the skin) are not equally distributed across the electrodes, because that can cause a spatial bias. Therefore, my question would be: why are those electrodes so low? Are those positions reflect the actual positions of the electrodes during the measurement? If yes, I would not change their positions, I would rather try to extend my headmodel e.g. by using another template. (or another (but quite suboptimal) possibility is maybe to exclude those electrodes (and the data) from the analysis if they are anyway far from the brain.) If the position of the electrodes should be higher up on the head, then instead of relying on projection, I would try first to scale the electrodes to fit them into the headsurface with the ft_electroderealign function. I looked to the standard_bem file in the template directory, and I also load in the standard_1020.elc, and those electrodes perfectly fit the vol. So, it seems that the extension of the standard bem headsurface is suitable for the area which is covered by the those template electrodes. And I do not know if the electrode set you use should cover a larger surface of the head, or if it should be just adjusted to the given headsurface. Lilla IMALI THANUJA HETTIARACHCHI wrote: > Hi Ingrid, > > I had a similar issue a few weeks ago, where my lower most electrodes > started floating after electrode realign using the ft_electroderealign > function. > > I used the ft_prepare_vol_sens as, > [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and > brought the electrodes on to the skin. > > Hope this helps...! > > Regards > Imali > > > *From:* fieldtrip-bounces at science.ru.nl > [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis > [inieuwenhuis at berkeley.edu] > *Sent:* Wednesday, 10 April 2013 9:29 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > A follow up on this and some new issues: > > 1) I first tried Jörn's approach by creating my own BEM, always fun to > make it yourself ;) However, I did not succeed since: > a) the dipoli method does not work on Windows > b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe > has stopped working" I've emailed their buglist > c) bemcp did run, but the result was not ok (see attachement). I also > got the warning "% Warning: Matrix is singular, close to singular or > badly scaled. Results may be inaccurate." several times, so that might > be the problem. > d) and asa gave the following error: % Error using ft_prepare_headmodel > (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel > > And away went my determination to do it myself, so I continued using > thestandard_bem.mat > . > (I did not know this existed, I've added this link to note in the > headmodel tutorial > to > make it easier to find, thanks Tzvetan for pointing this out!). > > 2) This worked and after some fiddling to get the electrodes aligned it > looks okay (see attached). > However, as you can see in the figures, I have several very low > electrodes, that are lower than the skin mesh. So I was wondering if > this is a problem? Since for accurate calculation of how the currents > flow from these low electrodes, I assume one needs the skin to go till > there? What happens when I have electrodes floating in thin air? > *So my question is:* > a) will this cause great inaccuracies? > b) if so, how can I extend the skin to go lower? The template MRI only > goes that far to the bottom... Trick anyone? > > Thanks again, > Ingrid > > > On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >> the wiki. >> Have a great day, >> Ingrid >> >> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>> Dear Ingrid, >>> >>> in addition to Jorn's approach since you don't have MR and digitized >>> elec position's you can load and realign the electrodes to the >>> standard bem. Subsequently you can calculate the lead field and >>> continue with your analysis pipeline. >>> Good luck >>> tzvetan >>> %% read electrodes >>> elec = ft_read_sens('/your >>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>> %% read headmodel >>> templateheadmodel = '/your >>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>> load(templateheadmodel); >>> %% electrode realign as good as possible >>> % i.e. translate 0 -2 1.5 >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = vol.bnd(1).pnt; >>> elecR = ft_electroderealign(cfg); >>> %% verify how the electrodes fit toghether with the brain volume >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elecR; >>> cfg.headshape = vol.bnd(3).pnt; >>> elecR = ft_electroderealign(cfg); >>> >>> >>>> Hi Ingrid, >>>> >>>> I just happen to done this a few weeks back, I changed things in the >>>> meanwhile, but I hope that the below steps are complete: >>>> /% read in the template MRI >>>> if isunix >>>> mri = >>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>> elseif ispc >>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>> 'spm8', 'templates', 'T1.nii')); >>>> end >>>> >>>> >>>> % segment the MRI >>>> cfg = []; >>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>> segmentedmri = ft_volumesegment(cfg, mris); >>>> >>>> >>>> % create the headmodel (BEM) >>>> cfg = []; >>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>> if isunix >>>> cfg.method ='dipoli'; % dipoli only works under linux >>>> else >>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>> keyboard; >>>> end >>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> elec = ft_read_sens('standard_1020.elc'); >>>> hdm = ft_convert_units(hdm, elec.unit); >>>> >>>> cfg = []; >>>> cfg.grid.xgrid = -125:8:125; >>>> cfg.grid.ygrid = -125:8:125; >>>> cfg.grid.zgrid = -125:8:125; >>>> cfg.grid.tight = 'yes'; >>>> cfg.grid.unit = hdm.unit; >>>> cfg.inwardshift = -1.5; >>>> cfg.vol = hdm; >>>> grid = ft_prepare_sourcemodel(cfg) >>>> grid = ft_convert_units(grid, elec.unit); >>>> >>>> figure; >>>> hold on; >>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>> >>>> % this step is not necessary, cause you will see that everything is >>>> already aligned >>>> cfg = []; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = hdm.bnd(1); >>>> tmp = ft_electroderealign(cfg); >>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>> >>>> %% verify location of occipital electrodes >>>> >>>> occ_elec = elec; >>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >>>> occ_idx = match_str(elec.label, occ_chan); >>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>> figure; >>>> ft_plot_sens(occ_elec) >>>> hold on; >>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>> >>>> >>>> Afair, that's all that is needed. Of course you need to adjust >>>> folder and file names. >>>> >>>> Greetings >>>> Jörn >>>> >>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>> Hi all, >>>>> >>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>> model that is located in the FieldTrip template directory. I have >>>>> EGI (128 channels) data and electrode positions (not subject >>>>> specific, just the standard file also available in FieldTrip >>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>> to make a headmodel and volume conduction model giving only this >>>>> limited data. I'd be happy to make it into a example Matlab script >>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>> to give me some pointers, or example code? >>>>> >>>>> Thanks a lot! >>>>> Ingrid >>>>> >>>> >>>> >>>> -- >>>> 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 >>> >>> ******************************************* >>> Tzvetan Popov >>> Clinical Psychology >>> University of Konstanz >>> Box 23 >>> 78457 Konstanz, GERMANY >>> Phone: 0049-7531-883086 >>> Fax: 0049-7531-884601 >>> Email: tzvetan.popov at uni-konstanz.de >>> >>> ******************************************* >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inieuwenhuis at berkeley.edu Wed Apr 10 19:17:04 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 10:17:04 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51658DAE.9080207@mpi.nl> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> Message-ID: <51659E90.4020805@berkeley.edu> Hi Lilla and Imali, Thanks for your replies. In my case, the problem is not the aligning. My nasion electrode is on the nasion, and Cz is on Cz, everything is where it should be. The EGI 128 electrode net really has these low electrodes, which are there specifically to make source analysis better by capturing more of the electric field. So I would have the best solution if I'd leave them there. However, in the model as derived from the MNI template, the skin part does not go down low enough. I looked at the picture after ft_prepare_vol_sens (see attachement, black is before, red is after), and indeed, this is not good. The low electrodes are squeezed up, and this will make source analysis worse. So I should indeed remove these electrodes (which is a pity), or find a better MNI template. *So my question is:* Does anyone know of a template in MNI space that extends more down? This template comes from SPM8, is there a version that extends lower? Or could I extend the skin roughly downwards with some triangular magic? I'm also a bit confused about the statement on this wiki page: http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem under "revision information" header "skin" is says: "This skin surface is not used in the BEM model itself for computational reasons, but can be used for visualization." But this does not seem to be the case, since my electrode positions are modified based on till where the skin goes. So the skin surface does significantly influence the source analysis. Anyway, thanks for all the help, and worse case, I just get rid of the low fellows. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 9:05 AM, Magyari, Lilla wrote: > hi Ingrid and Imali, > > > I think it is a really good question what to do in Ingrid's case. I do > not know the "right" answer, but I would like to share my thoughts > about it. > > The ft_prepare_vol_sens is indeed projects the electrode positions > closer to the headsurface as Imali wrote. But this function called > automatically when you create your leadfield, so you do not have to do > it separately (unless you want to visualize the corrected electrode > positions). > > However, I have been advised to rely on this projection carefully if > electrode positions are far from the skin and specially, if the > inaccuracies (distance from the skin) are not equally distributed > across the electrodes, because that can cause a spatial bias. > > Therefore, my question would be: why are those electrodes so low? Are > those positions reflect the actual positions of the electrodes during > the measurement? If yes, I would not change their positions, I would > rather try to extend my headmodel e.g. by using another template. (or > another (but quite suboptimal) possibility is maybe to exclude those > electrodes (and the data) from the analysis if they are anyway far > from the brain.) > > If the position of the electrodes should be higher up on the head, > then instead of relying on projection, I would try first to scale the > electrodes to fit them into the headsurface with the > ft_electroderealign function. > > I looked to the standard_bem file in the template directory, and I > also load in the standard_1020.elc, and those electrodes perfectly fit > the vol. So, it seems that the extension of the standard bem > headsurface is suitable for the area which is covered by the those > template electrodes. And I do not know if the electrode set you use > should cover a larger surface of the head, or if it should be just > adjusted to the given headsurface. > > Lilla > > > > > IMALI THANUJA HETTIARACHCHI wrote: >> Hi Ingrid, >> >> I had a similar issue a few weeks ago, where my lower most electrodes >> started floating after electrode realign using the ft_electroderealign >> function. >> >> I used the ft_prepare_vol_sens as, >> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and >> brought the electrodes on to the skin. >> >> Hope this helps...! >> >> Regards >> Imali >> >> >> *From:* fieldtrip-bounces at science.ru.nl >> [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis >> [inieuwenhuis at berkeley.edu] >> *Sent:* Wednesday, 10 April 2013 9:29 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> A follow up on this and some new issues: >> >> 1) I first tried Jörn's approach by creating my own BEM, always fun to >> make it yourself ;) However, I did not succeed since: >> a) the dipoli method does not work on Windows >> b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe >> has stopped working" I've emailed their buglist >> c) bemcp did run, but the result was not ok (see attachement). I also >> got the warning "% Warning: Matrix is singular, close to singular or >> badly scaled. Results may be inaccurate." several times, so that might >> be the problem. >> d) and asa gave the following error: % Error using ft_prepare_headmodel >> (line 201) % You must supply a valid cfg.hdmfile for use with ASA >> headmodel >> >> And away went my determination to do it myself, so I continued using >> thestandard_bem.mat >> . >> (I did not know this existed, I've added this link to note in the >> headmodel tutorial >> to >> make it easier to find, thanks Tzvetan for pointing this out!). >> >> 2) This worked and after some fiddling to get the electrodes aligned it >> looks okay (see attached). >> However, as you can see in the figures, I have several very low >> electrodes, that are lower than the skin mesh. So I was wondering if >> this is a problem? Since for accurate calculation of how the currents >> flow from these low electrodes, I assume one needs the skin to go till >> there? What happens when I have electrodes floating in thin air? >> *So my question is:* >> a) will this cause great inaccuracies? >> b) if so, how can I extend the skin to go lower? The template MRI only >> goes that far to the bottom... Trick anyone? >> >> Thanks again, >> Ingrid >> >> >> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >>> the wiki. >>> Have a great day, >>> Ingrid >>> >>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>> Dear Ingrid, >>>> >>>> in addition to Jorn's approach since you don't have MR and digitized >>>> elec position's you can load and realign the electrodes to the >>>> standard bem. Subsequently you can calculate the lead field and >>>> continue with your analysis pipeline. >>>> Good luck >>>> tzvetan >>>> %% read electrodes >>>> elec = ft_read_sens('/your >>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>> %% read headmodel >>>> templateheadmodel = '/your >>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>> load(templateheadmodel); >>>> %% electrode realign as good as possible >>>> % i.e. translate 0 -2 1.5 >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = vol.bnd(1).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> %% verify how the electrodes fit toghether with the brain volume >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elecR; >>>> cfg.headshape = vol.bnd(3).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> >>>> >>>>> Hi Ingrid, >>>>> >>>>> I just happen to done this a few weeks back, I changed things in the >>>>> meanwhile, but I hope that the below steps are complete: >>>>> /% read in the template MRI >>>>> if isunix >>>>> mri = >>>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>>> >>>>> elseif ispc >>>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>>> 'spm8', 'templates', 'T1.nii')); >>>>> end >>>>> >>>>> >>>>> % segment the MRI >>>>> cfg = []; >>>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>>> segmentedmri = ft_volumesegment(cfg, mris); >>>>> >>>>> >>>>> % create the headmodel (BEM) >>>>> cfg = []; >>>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>>> if isunix >>>>> cfg.method ='dipoli'; % dipoli only works under linux >>>>> else >>>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>>> keyboard; >>>>> end >>>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>>> >>>>> elec = ft_read_sens('standard_1020.elc'); >>>>> hdm = ft_convert_units(hdm, elec.unit); >>>>> >>>>> cfg = []; >>>>> cfg.grid.xgrid = -125:8:125; >>>>> cfg.grid.ygrid = -125:8:125; >>>>> cfg.grid.zgrid = -125:8:125; >>>>> cfg.grid.tight = 'yes'; >>>>> cfg.grid.unit = hdm.unit; >>>>> cfg.inwardshift = -1.5; >>>>> cfg.vol = hdm; >>>>> grid = ft_prepare_sourcemodel(cfg) >>>>> grid = ft_convert_units(grid, elec.unit); >>>>> >>>>> figure; >>>>> hold on; >>>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>>> >>>>> % this step is not necessary, cause you will see that everything is >>>>> already aligned >>>>> cfg = []; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elec; >>>>> cfg.headshape = hdm.bnd(1); >>>>> tmp = ft_electroderealign(cfg); >>>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>>> >>>>> %% verify location of occipital electrodes >>>>> >>>>> occ_elec = elec; >>>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>>> elec.label); >>>>> occ_idx = match_str(elec.label, occ_chan); >>>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>>> figure; >>>>> ft_plot_sens(occ_elec) >>>>> hold on; >>>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>>> >>>>> >>>>> Afair, that's all that is needed. Of course you need to adjust >>>>> folder and file names. >>>>> >>>>> Greetings >>>>> Jörn >>>>> >>>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>>> Hi all, >>>>>> >>>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>>> model that is located in the FieldTrip template directory. I have >>>>>> EGI (128 channels) data and electrode positions (not subject >>>>>> specific, just the standard file also available in FieldTrip >>>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>>> to make a headmodel and volume conduction model giving only this >>>>>> limited data. I'd be happy to make it into a example Matlab script >>>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>>> to give me some pointers, or example code? >>>>>> >>>>>> Thanks a lot! >>>>>> Ingrid >>>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>> >>>> ******************************************* >>>> Tzvetan Popov >>>> Clinical Psychology >>>> University of Konstanz >>>> Box 23 >>>> 78457 Konstanz, GERMANY >>>> Phone: 0049-7531-883086 >>>> Fax: 0049-7531-884601 >>>> Email: tzvetan.popov at uni-konstanz.de >>>> >>>> ******************************************* >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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: after_preparevolsens.png Type: image/png Size: 33666 bytes Desc: not available URL: From inieuwenhuis at berkeley.edu Wed Apr 10 20:21:59 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 11:21:59 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51659E90.4020805@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> Message-ID: <5165ADC7.6020906@berkeley.edu> Hi all, Just had a brain wave, I'll share it for people with similar situation that might be interested in this thread. I think I should just get a random structural MRI that extends lower (includes ears and bit below), optimally of a subject with a head similar to the MNI template. Make a BEM model (hmm, have to fix these errors I mentioned earlier then, well, should be doable on linux using dipoli). Then use ft_electroderealign to align the electrodes to this MRI, do the source analysis for all subjects using this model, and subsequently use ft_volumenormalise to normalize to MNI template if I want to use any atlas functionality. If anyone did this already using FieldTrip and has a pre-made BEM (just like the standard_bem), would be really nice if you're willing to share :) If not, I'll make my own, and people with low electrodes and no structural MRI and or no linux access can email me if they want to use it. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: > Hi Lilla and Imali, > > Thanks for your replies. In my case, the problem is not the aligning. > My nasion electrode is on the nasion, and Cz is on Cz, everything is > where it should be. The EGI 128 electrode net really has these low > electrodes, which are there specifically to make source analysis > better by capturing more of the electric field. So I would have the > best solution if I'd leave them there. However, in the model as > derived from the MNI template, the skin part does not go down low enough. > > I looked at the picture after ft_prepare_vol_sens (see attachement, > black is before, red is after), and indeed, this is not good. The low > electrodes are squeezed up, and this will make source analysis worse. > So I should indeed remove these electrodes (which is a pity), or find > a better MNI template. > > *So my question is:* > Does anyone know of a template in MNI space that extends more down? > This template comes from SPM8, is there a version that extends lower? > Or could I extend the skin roughly downwards with some triangular magic? > > I'm also a bit confused about the statement on this wiki page: > http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem > under "revision information" header "skin" is says: "This skin surface > is not used in the BEM model itself for computational reasons, but can > be used for visualization." > But this does not seem to be the case, since my electrode positions > are modified based on till where the skin goes. So the skin surface > does significantly influence the source analysis. > > Anyway, thanks for all the help, and worse case, I just get rid of the > low fellows. > > Cheers, > Ingrid > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >> hi Ingrid and Imali, >> >> >> I think it is a really good question what to do in Ingrid's case. I >> do not know the "right" answer, but I would like to share my thoughts >> about it. >> >> The ft_prepare_vol_sens is indeed projects the electrode positions >> closer to the headsurface as Imali wrote. But this function called >> automatically when you create your leadfield, so you do not have to >> do it separately (unless you want to visualize the corrected >> electrode positions). >> >> However, I have been advised to rely on this projection carefully if >> electrode positions are far from the skin and specially, if the >> inaccuracies (distance from the skin) are not equally distributed >> across the electrodes, because that can cause a spatial bias. >> >> Therefore, my question would be: why are those electrodes so low? Are >> those positions reflect the actual positions of the electrodes during >> the measurement? If yes, I would not change their positions, I would >> rather try to extend my headmodel e.g. by using another template. (or >> another (but quite suboptimal) possibility is maybe to exclude those >> electrodes (and the data) from the analysis if they are anyway far >> from the brain.) >> >> If the position of the electrodes should be higher up on the head, >> then instead of relying on projection, I would try first to scale the >> electrodes to fit them into the headsurface with the >> ft_electroderealign function. >> >> I looked to the standard_bem file in the template directory, and I >> also load in the standard_1020.elc, and those electrodes perfectly >> fit the vol. So, it seems that the extension of the standard bem >> headsurface is suitable for the area which is covered by the those >> template electrodes. And I do not know if the electrode set you use >> should cover a larger surface of the head, or if it should be just >> adjusted to the given headsurface. >> >> Lilla >> >> >> >> >> IMALI THANUJA HETTIARACHCHI wrote: >>> Hi Ingrid, >>> >>> I had a similar issue a few weeks ago, where my lower most electrodes >>> started floating after electrode realign using the ft_electroderealign >>> function. >>> >>> I used the ft_prepare_vol_sens as, >>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and >>> brought the electrodes on to the skin. >>> >>> Hope this helps...! >>> >>> Regards >>> Imali >>> >>> >>> *From:* fieldtrip-bounces at science.ru.nl >>> [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis >>> [inieuwenhuis at berkeley.edu] >>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> A follow up on this and some new issues: >>> >>> 1) I first tried Jörn's approach by creating my own BEM, always fun to >>> make it yourself ;) However, I did not succeed since: >>> a) the dipoli method does not work on Windows >>> b) I downloaded the openmeeg toolbox, but got an error >>> "om_minverser.exe >>> has stopped working" I've emailed their buglist >>> c) bemcp did run, but the result was not ok (see attachement). I also >>> got the warning "% Warning: Matrix is singular, close to singular or >>> badly scaled. Results may be inaccurate." several times, so that might >>> be the problem. >>> d) and asa gave the following error: % Error using ft_prepare_headmodel >>> (line 201) % You must supply a valid cfg.hdmfile for use with ASA >>> headmodel >>> >>> And away went my determination to do it myself, so I continued using >>> thestandard_bem.mat >>> . >>> >>> (I did not know this existed, I've added this link to note in the >>> headmodel tutorial >>> to >>> make it easier to find, thanks Tzvetan for pointing this out!). >>> >>> 2) This worked and after some fiddling to get the electrodes aligned it >>> looks okay (see attached). >>> However, as you can see in the figures, I have several very low >>> electrodes, that are lower than the skin mesh. So I was wondering if >>> this is a problem? Since for accurate calculation of how the currents >>> flow from these low electrodes, I assume one needs the skin to go till >>> there? What happens when I have electrodes floating in thin air? >>> *So my question is:* >>> a) will this cause great inaccuracies? >>> b) if so, how can I extend the skin to go lower? The template MRI only >>> goes that far to the bottom... Trick anyone? >>> >>> Thanks again, >>> Ingrid >>> >>> >>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >>>> the wiki. >>>> Have a great day, >>>> Ingrid >>>> >>>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>>> Dear Ingrid, >>>>> >>>>> in addition to Jorn's approach since you don't have MR and digitized >>>>> elec position's you can load and realign the electrodes to the >>>>> standard bem. Subsequently you can calculate the lead field and >>>>> continue with your analysis pipeline. >>>>> Good luck >>>>> tzvetan >>>>> %% read electrodes >>>>> elec = ft_read_sens('/your >>>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>>> %% read headmodel >>>>> templateheadmodel = '/your >>>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>>> load(templateheadmodel); >>>>> %% electrode realign as good as possible >>>>> % i.e. translate 0 -2 1.5 >>>>> cfg=[]; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elec; >>>>> cfg.headshape = vol.bnd(1).pnt; >>>>> elecR = ft_electroderealign(cfg); >>>>> %% verify how the electrodes fit toghether with the brain volume >>>>> cfg=[]; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elecR; >>>>> cfg.headshape = vol.bnd(3).pnt; >>>>> elecR = ft_electroderealign(cfg); >>>>> >>>>> >>>>>> Hi Ingrid, >>>>>> >>>>>> I just happen to done this a few weeks back, I changed things in the >>>>>> meanwhile, but I hope that the below steps are complete: >>>>>> /% read in the template MRI >>>>>> if isunix >>>>>> mri = >>>>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>>>> >>>>>> elseif ispc >>>>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>>>> 'spm8', 'templates', 'T1.nii')); >>>>>> end >>>>>> >>>>>> >>>>>> % segment the MRI >>>>>> cfg = []; >>>>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>>>> segmentedmri = ft_volumesegment(cfg, mris); >>>>>> >>>>>> >>>>>> % create the headmodel (BEM) >>>>>> cfg = []; >>>>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>>>> if isunix >>>>>> cfg.method ='dipoli'; % dipoli only works under linux >>>>>> else >>>>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>>>> keyboard; >>>>>> end >>>>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>>>> >>>>>> elec = ft_read_sens('standard_1020.elc'); >>>>>> hdm = ft_convert_units(hdm, elec.unit); >>>>>> >>>>>> cfg = []; >>>>>> cfg.grid.xgrid = -125:8:125; >>>>>> cfg.grid.ygrid = -125:8:125; >>>>>> cfg.grid.zgrid = -125:8:125; >>>>>> cfg.grid.tight = 'yes'; >>>>>> cfg.grid.unit = hdm.unit; >>>>>> cfg.inwardshift = -1.5; >>>>>> cfg.vol = hdm; >>>>>> grid = ft_prepare_sourcemodel(cfg) >>>>>> grid = ft_convert_units(grid, elec.unit); >>>>>> >>>>>> figure; >>>>>> hold on; >>>>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>>>> >>>>>> % this step is not necessary, cause you will see that everything is >>>>>> already aligned >>>>>> cfg = []; >>>>>> cfg.method = 'interactive'; >>>>>> cfg.elec = elec; >>>>>> cfg.headshape = hdm.bnd(1); >>>>>> tmp = ft_electroderealign(cfg); >>>>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>>>> >>>>>> %% verify location of occipital electrodes >>>>>> >>>>>> occ_elec = elec; >>>>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>>>> elec.label); >>>>>> occ_idx = match_str(elec.label, occ_chan); >>>>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>>>> figure; >>>>>> ft_plot_sens(occ_elec) >>>>>> hold on; >>>>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>>>> >>>>>> >>>>>> Afair, that's all that is needed. Of course you need to adjust >>>>>> folder and file names. >>>>>> >>>>>> Greetings >>>>>> Jörn >>>>>> >>>>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>>>> model that is located in the FieldTrip template directory. I have >>>>>>> EGI (128 channels) data and electrode positions (not subject >>>>>>> specific, just the standard file also available in FieldTrip >>>>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>>>> to make a headmodel and volume conduction model giving only this >>>>>>> limited data. I'd be happy to make it into a example Matlab script >>>>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>>>> to give me some pointers, or example code? >>>>>>> >>>>>>> Thanks a lot! >>>>>>> Ingrid >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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 >>>>> >>>>> ******************************************* >>>>> Tzvetan Popov >>>>> Clinical Psychology >>>>> University of Konstanz >>>>> Box 23 >>>>> 78457 Konstanz, GERMANY >>>>> Phone: 0049-7531-883086 >>>>> Fax: 0049-7531-884601 >>>>> Email: tzvetan.popov at uni-konstanz.de >>>>> >>>>> ******************************************* >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 ith at deakin.edu.au Thu Apr 11 03:14:23 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 11 Apr 2013 01:14:23 +0000 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5165ADC7.6020906@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> Hi Ingrid, I had similar issues with creating my own BEM as I too did not have the individual MRI's nor the digitized electrode positions. I created a BEM using the Curry (Neuroscan) software and imported in .mat format to use with Fieldtrip. However these are also based on the MNI template. I am not sure whether this extends lower enough for your situation. I am attaching here a picture of my head model showing the skull and cortex with my registered electrodes. If you are happy with it, I am more than happy to share it with you. Please let me know. Regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ingrid Nieuwenhuis Sent: Thursday, 11 April 2013 4:22 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] source analysis EEG data without MRI Hi all, Just had a brain wave, I'll share it for people with similar situation that might be interested in this thread. I think I should just get a random structural MRI that extends lower (includes ears and bit below), optimally of a subject with a head similar to the MNI template. Make a BEM model (hmm, have to fix these errors I mentioned earlier then, well, should be doable on linux using dipoli). Then use ft_electroderealign to align the electrodes to this MRI, do the source analysis for all subjects using this model, and subsequently use ft_volumenormalise to normalize to MNI template if I want to use any atlas functionality. If anyone did this already using FieldTrip and has a pre-made BEM (just like the standard_bem), would be really nice if you're willing to share :) If not, I'll make my own, and people with low electrodes and no structural MRI and or no linux access can email me if they want to use it. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: Hi Lilla and Imali, Thanks for your replies. In my case, the problem is not the aligning. My nasion electrode is on the nasion, and Cz is on Cz, everything is where it should be. The EGI 128 electrode net really has these low electrodes, which are there specifically to make source analysis better by capturing more of the electric field. So I would have the best solution if I'd leave them there. However, in the model as derived from the MNI template, the skin part does not go down low enough. I looked at the picture after ft_prepare_vol_sens (see attachement, black is before, red is after), and indeed, this is not good. The low electrodes are squeezed up, and this will make source analysis worse. So I should indeed remove these electrodes (which is a pity), or find a better MNI template. So my question is: Does anyone know of a template in MNI space that extends more down? This template comes from SPM8, is there a version that extends lower? Or could I extend the skin roughly downwards with some triangular magic? I'm also a bit confused about the statement on this wiki page: http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem under "revision information" header "skin" is says: "This skin surface is not used in the BEM model itself for computational reasons, but can be used for visualization." But this does not seem to be the case, since my electrode positions are modified based on till where the skin goes. So the skin surface does significantly influence the source analysis. Anyway, thanks for all the help, and worse case, I just get rid of the low fellows. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 9:05 AM, Magyari, Lilla wrote: hi Ingrid and Imali, I think it is a really good question what to do in Ingrid's case. I do not know the "right" answer, but I would like to share my thoughts about it. The ft_prepare_vol_sens is indeed projects the electrode positions closer to the headsurface as Imali wrote. But this function called automatically when you create your leadfield, so you do not have to do it separately (unless you want to visualize the corrected electrode positions). However, I have been advised to rely on this projection carefully if electrode positions are far from the skin and specially, if the inaccuracies (distance from the skin) are not equally distributed across the electrodes, because that can cause a spatial bias. Therefore, my question would be: why are those electrodes so low? Are those positions reflect the actual positions of the electrodes during the measurement? If yes, I would not change their positions, I would rather try to extend my headmodel e.g. by using another template. (or another (but quite suboptimal) possibility is maybe to exclude those electrodes (and the data) from the analysis if they are anyway far from the brain.) If the position of the electrodes should be higher up on the head, then instead of relying on projection, I would try first to scale the electrodes to fit them into the headsurface with the ft_electroderealign function. I looked to the standard_bem file in the template directory, and I also load in the standard_1020.elc, and those electrodes perfectly fit the vol. So, it seems that the extension of the standard bem headsurface is suitable for the area which is covered by the those template electrodes. And I do not know if the electrode set you use should cover a larger surface of the head, or if it should be just adjusted to the given headsurface. Lilla IMALI THANUJA HETTIARACHCHI wrote: Hi Ingrid, I had a similar issue a few weeks ago, where my lower most electrodes started floating after electrode realign using the ft_electroderealign function. I used the ft_prepare_vol_sens as, [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and brought the electrodes on to the skin. Hope this helps...! Regards Imali *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis [inieuwenhuis at berkeley.edu] *Sent:* Wednesday, 10 April 2013 9:29 AM *To:* fieldtrip at science.ru.nl *Subject:* Re: [FieldTrip] source analysis EEG data without MRI Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using thestandard_bem.mat . (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? *So my question is:* a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: /% read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit))/ Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: curry_vol.jpg Type: image/jpeg Size: 15832 bytes Desc: curry_vol.jpg URL: From inieuwenhuis at berkeley.edu Thu Apr 11 05:44:40 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 20:44:40 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> Message-ID: <516631A8.1030006@berkeley.edu> Hi Imali, Tzvetan shared the bem model made from the tutorial MRI with me, that one extends to low enough, so I'm good! Thanks a lot though! Cheers, Ingird -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: > > Hi Ingrid, > > I had similar issues with creating my own BEM as I too did not have > the individual MRI's nor the digitized electrode positions. > > I created a BEM using the Curry (Neuroscan) software and imported in > .mat format to use with Fieldtrip. However these are also based on the > MNI template. > > I am not sure whether this extends lower enough for your situation. I > am attaching here a picture of my head model showing the skull and > cortex with my registered electrodes. If you are happy with it, I am > more than happy to share it with you. > > Please let me know. > > Regards > > Imali > > *From:*fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid Nieuwenhuis > *Sent:* Thursday, 11 April 2013 4:22 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > Just had a brain wave, I'll share it for people with similar situation > that might be interested in this thread. I think I should just get a > random structural MRI that extends lower (includes ears and bit > below), optimally of a subject with a head similar to the MNI > template. Make a BEM model (hmm, have to fix these errors I mentioned > earlier then, well, should be doable on linux using dipoli). Then use > ft_electroderealign to align the electrodes to this MRI, do the source > analysis for all subjects using this model, and subsequently use > ft_volumenormalise to normalize to MNI template if I want to use any > atlas functionality. > > If anyone did this already using FieldTrip and has a pre-made BEM > (just like the standard_bem), would be really nice if you're willing > to share :) > If not, I'll make my own, and people with low electrodes and no > structural MRI and or no linux access can email me if they want to use it. > > Cheers, > Ingrid > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: > > Hi Lilla and Imali, > > Thanks for your replies. In my case, the problem is not the > aligning. My nasion electrode is on the nasion, and Cz is on Cz, > everything is where it should be. The EGI 128 electrode net really > has these low electrodes, which are there specifically to make > source analysis better by capturing more of the electric field. So > I would have the best solution if I'd leave them there. However, > in the model as derived from the MNI template, the skin part does > not go down low enough. > > I looked at the picture after ft_prepare_vol_sens (see > attachement, black is before, red is after), and indeed, this is > not good. The low electrodes are squeezed up, and this will make > source analysis worse. So I should indeed remove these electrodes > (which is a pity), or find a better MNI template. > > *So my question is:* > Does anyone know of a template in MNI space that extends more > down? This template comes from SPM8, is there a version that > extends lower? Or could I extend the skin roughly downwards with > some triangular magic? > > I'm also a bit confused about the statement on this wiki page: > http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem > > under "revision information" header "skin" is says: "This skin > surface is not used in the BEM model itself for computational > reasons, but can be used for visualization." > But this does not seem to be the case, since my electrode > positions are modified based on till where the skin goes. So the > skin surface does significantly influence the source analysis. > > Anyway, thanks for all the help, and worse case, I just get rid of > the low fellows. > > Cheers, > Ingrid > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > On 4/10/2013 9:05 AM, Magyari, Lilla wrote: > > hi Ingrid and Imali, > > > I think it is a really good question what to do in Ingrid's > case. I do not know the "right" answer, but I would like to > share my thoughts about it. > > The ft_prepare_vol_sens is indeed projects the electrode > positions closer to the headsurface as Imali wrote. But this > function called automatically when you create your leadfield, > so you do not have to do it separately (unless you want to > visualize the corrected electrode positions). > > However, I have been advised to rely on this projection > carefully if electrode positions are far from the skin and > specially, if the inaccuracies (distance from the skin) are > not equally distributed across the electrodes, because that > can cause a spatial bias. > > Therefore, my question would be: why are those electrodes so > low? Are those positions reflect the actual positions of the > electrodes during the measurement? If yes, I would not change > their positions, I would rather try to extend my headmodel > e.g. by using another template. (or another (but quite > suboptimal) possibility is maybe to exclude those electrodes > (and the data) from the analysis if they are anyway far from > the brain.) > > If the position of the electrodes should be higher up on the > head, then instead of relying on projection, I would try first > to scale the electrodes to fit them into the headsurface with > the ft_electroderealign function. > > I looked to the standard_bem file in the template directory, > and I also load in the standard_1020.elc, and those electrodes > perfectly fit the vol. So, it seems that the extension of the > standard bem headsurface is suitable for the area which is > covered by the those template electrodes. And I do not know if > the electrode set you use should cover a larger surface of the > head, or if it should be just adjusted to the given headsurface. > > Lilla > > > > > IMALI THANUJA HETTIARACHCHI wrote: > > Hi Ingrid, > > I had a similar issue a few weeks ago, where my lower most > electrodes > started floating after electrode realign using the > ft_electroderealign > function. > > I used the ft_prepare_vol_sens as, > [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the > trick and > brought the electrodes on to the skin. > > Hope this helps...! > > Regards > Imali > > > *From:* fieldtrip-bounces at science.ru.nl > > [fieldtrip-bounces at science.ru.nl > ] on behalf of Ingrid > Nieuwenhuis > [inieuwenhuis at berkeley.edu ] > *Sent:* Wednesday, 10 April 2013 9:29 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > A follow up on this and some new issues: > > 1) I first tried Jörn's approach by creating my own BEM, > always fun to > make it yourself ;) However, I did not succeed since: > a) the dipoli method does not work on Windows > b) I downloaded the openmeeg toolbox, but got an error > "om_minverser.exe > has stopped working" I've emailed their buglist > c) bemcp did run, but the result was not ok (see attachement). > I also > got the warning "% Warning: Matrix is singular, close to > singular or > badly scaled. Results may be inaccurate." several times, so > that might > be the problem. > d) and asa gave the following error: % Error using > ft_prepare_headmodel > (line 201) % You must supply a valid cfg.hdmfile for use with > ASA headmodel > > And away went my determination to do it myself, so I continued > using > thestandard_bem.mat > > . > > (I did not know this existed, I've added this link to note in the > headmodel tutorial > > > to > make it easier to find, thanks Tzvetan for pointing this out!). > > 2) This worked and after some fiddling to get the electrodes > aligned it > looks okay (see attached). > However, as you can see in the figures, I have several very low > electrodes, that are lower than the skin mesh. So I was > wondering if > this is a problem? Since for accurate calculation of how the > currents > flow from these low electrodes, I assume one needs the skin to > go till > there? What happens when I have electrodes floating in thin air? > *So my question is:* > a) will this cause great inaccuracies? > b) if so, how can I extend the skin to go lower? The template > MRI only > goes that far to the bottom... Trick anyone? > > Thanks again, > Ingrid > > > On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: > > Thanks Jörn and Tzvetan for the scripts! I'll try it out and > put it on > the wiki. > Have a great day, > Ingrid > > On 4/9/2013 12:32 AM, Tzvetan Popov wrote: > > Dear Ingrid, > > in addition to Jorn's approach since you don't have MR and > digitized > elec position's you can load and realign the electrodes to the > standard bem. Subsequently you can calculate the lead field and > continue with your analysis pipeline. > Good luck > tzvetan > %% read electrodes > elec = ft_read_sens('/your > path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); > > %% read headmodel > templateheadmodel = '/your > path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; > load(templateheadmodel); > %% electrode realign as good as possible > % i.e. translate 0 -2 1.5 > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = vol.bnd(1).pnt; > elecR = ft_electroderealign(cfg); > %% verify how the electrodes fit toghether with the brain volume > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elecR; > cfg.headshape = vol.bnd(3).pnt; > elecR = ft_electroderealign(cfg); > > > > Hi Ingrid, > > I just happen to done this a few weeks back, I changed things > in the > meanwhile, but I hope that the below steps are complete: > /% read in the template MRI > if isunix > mri = > ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); > > elseif ispc > mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', > 'external', > 'spm8', 'templates', 'T1.nii')); > end > > > % segment the MRI > cfg = []; > cfg.output = {'brain' 'skull' 'scalp'}; > segmentedmri = ft_volumesegment(cfg, mris); > > > % create the headmodel (BEM) > cfg = []; > %cfg.method ='openmeeg'; % TODO FIXME download openmeeg > if isunix > cfg.method ='dipoli'; % dipoli only works under linux > else > disp('TODO FIXME stick to dipoli for now or download > openmeeg\n'); > keyboard; > end > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > elec = ft_read_sens('standard_1020.elc'); > hdm = ft_convert_units(hdm, elec.unit); > > cfg = []; > cfg.grid.xgrid = -125:8:125; > cfg.grid.ygrid = -125:8:125; > cfg.grid.zgrid = -125:8:125; > cfg.grid.tight = 'yes'; > cfg.grid.unit = hdm.unit; > cfg.inwardshift = -1.5; > cfg.vol = hdm; > grid = ft_prepare_sourcemodel(cfg) > grid = ft_convert_units(grid, elec.unit); > > figure; > hold on; > ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', > 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > ft_plot_mesh(grid.pos(grid.inside, :)); > > % this step is not necessary, cause you will see that > everything is > already aligned > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = hdm.bnd(1); > tmp = ft_electroderealign(cfg); > elec = tmp; % I had a bug here that I couldn't assign elec > directly > > %% verify location of occipital electrodes > > occ_elec = elec; > occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, > elec.label); > occ_idx = match_str(elec.label, occ_chan); > occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); > occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); > occ_elec.label = occ_elec.label(occ_idx, :); > figure; > ft_plot_sens(occ_elec) > hold on; > ft_plot_vol(ft_convert_units(hdm, elec.unit))/ > > > Afair, that's all that is needed. Of course you need to adjust > folder and file names. > > Greetings > Jörn > > On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: > > Hi all, > > I'd like to do source analysis (loreta and or DICS) on my EEG > data. > I don't have anatomical MRIs and I don't have a measurement of > the > scalp surface. So I'd like to use a template MRI or a template > head > model that is located in the FieldTrip template directory. I have > EGI (128 channels) data and electrode positions (not subject > specific, just the standard file also available in FieldTrip > electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck > how to start. I don't see any examples on the FieldTrip page > of how > to make a headmodel and volume conduction model giving only this > limited data. I'd be happy to make it into a example Matlab > script > on the FieldTrip page after I got it to work. Would someone be > able > to give me some pointers, or example code? > > Thanks a lot! > Ingrid > > > > -- > 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 > > > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > > > > ******************************************* > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 sabato45 at hotmail.com Thu Apr 11 06:07:39 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Wed, 10 Apr 2013 21:07:39 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> References: , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Message-ID: Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions?Thanks again,Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Thu Apr 11 12:09:26 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Thu, 11 Apr 2013 12:09:26 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Message-ID: <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> If I were a reviewer, I would object against such a procedure (because you are mixing up units-of-observation; see Maris, Psychophysiology, 2012). But I know people have done in the early days of fMRI analysis (concatenating the data of the multiple subjects; called a level-1 analysis in that community), but this has sparked a lot of criticisms. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: donderdag 11 april 2013 6:08 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions? Thanks again, Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris, thank you for your response. I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I have two conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulation across trials to find out whether condition 1 is different from condition 2 independently of their different number of trials. If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic. I really appreciate your help. Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolai at mersebak.dk Thu Apr 11 14:37:18 2013 From: nicolai at mersebak.dk (Nicolai Mersebak) Date: Thu, 11 Apr 2013 14:37:18 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip Message-ID: Dear all, I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. The purpose of the ICA algorithm is to remove EOG artifacts. Best, Nicolai -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Apr 11 15:21:03 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 11 Apr 2013 07:21:03 -0600 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: References: Message-ID: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> Nicolai, I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Don On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: > Dear all, > > I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. > > The purpose of the ICA algorithm is to remove EOG artifacts. > > Best, > > Nicolai > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From smoratti at psi.ucm.es Thu Apr 11 15:47:07 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 11 Apr 2013 15:47:07 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> Message-ID: <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> I think if you specify "runica" it does the same as EEGLAB. 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 11/04/2013, a las 15:21, Rojas, Don escribió: > Nicolai, > > I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > > Don > > On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: > >> Dear all, >> >> I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. >> >> The purpose of the ICA algorithm is to remove EOG artifacts. >> >> Best, >> >> Nicolai >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 sabato45 at hotmail.com Thu Apr 11 17:45:31 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Thu, 11 Apr 2013 08:45:31 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> References: , , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , , , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl>, , <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> Message-ID: Thanks for you answer and for sending along the paper. What would be the correct approach then in this case? It may be really simple, but I just don't know what to do with one p-value for every single subject. From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Thu, 11 Apr 2013 12:09:26 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence If I were a reviewer, I would object against such a procedure (because you are mixing up units-of-observation; see Maris, Psychophysiology, 2012). But I know people have done in the early days of fMRI analysis (concatenating the data of the multiple subjects; called a level-1 analysis in that community), but this has sparked a lot of criticisms. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: donderdag 11 april 2013 6:08 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions?Thanks again,Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Thu Apr 11 20:30:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Thu, 11 Apr 2013 11:30:31 -0700 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? Message-ID: <51670147.4080803@berkeley.edu> Hi all, When I follow the code according to the example matlab script "Create MNI-aligned grids in individual head-space" something goes all wrong with the units. I've followed the code (pasted below, from the wiki), but when I make the figure with the template head model and dipole grid, it's wrong (see attached ..._problem.png). The dipole grid is tiny in the bottom of the head model. The black area is the dipole grid, not good. template_grid = xgrid: [1x41 double] ygrid: [1x41 double] zgrid: [1x41 double] dim: [41 41 41] pos: [68921x3 double] unit: 'mm' inside: [1x68910 double] outside: [758 759 760 761 799 800 801 802 843 884 925] cfg: [1x1 struct] It's a problem with the units, because the template grid has 'mm' in the unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos field by 10, the grid is not tight (see attached ..._multiplied10.png). It looks like the unit problem messed up the determination of what's inside and outside. As you can see in the template_grid, there are only a few grid point outside, which is clearly not correct (maybe inside/outside was determined on wrong units?). So, it looks like a bug to me, or am I doing something wrong? I'm using the newest FT version. Thanks, Ingrid %%% CODE FROM WIKI %%% template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', filesep,'templates', filesep,'T1.nii']); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): this is needed % for the inside/outside detection of voxels. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates % the source units are in cm % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol); ft_plot_mesh(template_grid); -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- A non-text attachment was scrubbed... Name: templatehead_dipolegrid_problem.png Type: image/png Size: 19636 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: templatehead_dipolegrid_multiplied10.png Type: image/png Size: 9051 bytes Desc: not available URL: From nicolai at mersebak.dk Thu Apr 11 20:41:49 2013 From: nicolai at mersebak.dk (Nicolai Mersebak) Date: Thu, 11 Apr 2013 20:41:49 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> Message-ID: <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> Thank you for the responds. @Don, sorry for my choice of word. I differently meant some of the routines and not the whole package! Maybe I wasn't clear enough. I don't mean the usually ICA algorithms (e.g runica), where you manually reject ICA components after running the algorithm. There are some plugins in EEGLAB, where the artifact removal of EOG is automatic using ICA. Most often you are using it, when you have multiple subjects and don't have time to go through all subjects manually. So my question is if someone has tried to use an automatic artifact removal algorithm based on ICA in fieldtrip? An example is the FASTER plugin in EEGLAB - http://sccn.ucsd.edu/wiki/EEGLAB_Plugins. Best, Nicolai Den 11/04/2013 kl. 15.47 skrev smoratti at psi.ucm.es: > > I think if you specify "runica" it does the same as EEGLAB. > > 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 11/04/2013, a las 15:21, Rojas, Don escribió: > >> Nicolai, >> >> I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts >> >> Don >> >> On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: >> >>> Dear all, >>> >>> I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. >>> >>> The purpose of the ICA algorithm is to remove EOG artifacts. >>> >>> Best, >>> >>> Nicolai >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 Don.Rojas at ucdenver.edu Thu Apr 11 21:28:13 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 11 Apr 2013 13:28:13 -0600 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> Message-ID: No worries - I'm not a developer. I meant to include a smiley to imply my cheekiness, but left that out. I'm afraid I'm not familiar enough with the eeglab software, and in particular the plugin you mention, to address your question about ica-based automated artifact removal, but fieldtrip does have some automated artifact rejection routines that I do not use and can't comment on intelligently. See here in the wiki: http://fieldtrip.fcdonders.nl/tutorial/automatic_artifact_rejection Best, Don On Apr 11, 2013, at 12:41 PM, Nicolai Mersebak > wrote: Thank you for the responds. @Don, sorry for my choice of word. I differently meant some of the routines and not the whole package! Maybe I wasn't clear enough. I don't mean the usually ICA algorithms (e.g runica), where you manually reject ICA components after running the algorithm. There are some plugins in EEGLAB, where the artifact removal of EOG is automatic using ICA. Most often you are using it, when you have multiple subjects and don't have time to go through all subjects manually. So my question is if someone has tried to use an automatic artifact removal algorithm based on ICA in fieldtrip? An example is the FASTER plugin in EEGLAB - http://sccn.ucsd.edu/wiki/EEGLAB_Plugins. Best, Nicolai Den 11/04/2013 kl. 15.47 skrev smoratti at psi.ucm.es: I think if you specify "runica" it does the same as EEGLAB. 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 11/04/2013, a las 15:21, Rojas, Don escribió: Nicolai, I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Don On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak > wrote: Dear all, I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. The purpose of the ICA algorithm is to remove EOG artifacts. Best, Nicolai _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ricardoojm at gmail.com Thu Apr 11 21:40:37 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Thu, 11 Apr 2013 16:40:37 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi, I had to re-install ubuntu in order to provide more space for the analysis (since I was having the problem with the temporary files, which might have been too large for my ubuntu partition). But now the problem I have with the "ft_prepare_headmodel" is even weirder than before. The program now is complaining that there is no dipoli for my system: cfg = []; cfg.method ='dipoli'; vol = ft_prepare_headmodel(cfg, segmentedmri); ??? Error using ==> ft_headmodel_dipoli at 138 there is no dipoli executable for your platform Error in ==> ft_prepare_headmodel at 226 vol = ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); I am running this script in a 2010b matlab version, installed in ubuntu 12.04. It should be working fine, right? Thanks in advance, Ricardo On 28 March 2013 14:39, Ricardo Moura wrote: > Hi Jörn, > thank you very much for your response! > I checked the segmentation and everything seems to be ok (as far as I can > say... No error messages were shown during the processing and I checked the > generated objects and plots). > > But I had a strange error while preparing the head model. Somehow the > command cannot find the dipoli files, even thought they are really where > they should be. And the second message > ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue > of what it means. > > And I am running this command on a ubuntu 12.04 32-bit. > > Do you have any idea of how I can solve it? > > Thanks once again,Best, > Ricardo > > using the executable > "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" > /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: > /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: > /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: > not found > Warning: an error ocurred while running dipoli > > In ft_headmodel_dipoli at 201 > In ft_prepare_headmodel at 226 > > Error using fread > Invalid file identifier. Use fopen to generate a valid file identifier. > Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > > In ft_headmodel_dipoli at 209 > In ft_prepare_headmodel at 226 > > > On 27 March 2013 13:10, Ricardo Moura wrote: > >> Dear all >> I am creating a BEM model for eeg, following the appropriate tutorial, >> but I have a problem when preparing the headmodel. The output I have from >> the ft_prepare_headmodel command does not contain the "mat", and so, when I >> try to generate the leadfield, it returns an error message due to non >> existent "mat". I saw that other users had similar problem, but I haven't >> found a solution though. So, what is wrong with my script? >> >> Thanks a lot in advance! >> Best, >> Ricardo >> >> >> >> >> load standard_mri.mat >> mri_orig=mri; >> disp(mri) >> >> % Segmenting the data >> cfg = []; >> cfg.output= {'scalp','skull','brain'}; >> segmentedmri = ft_volumesegment(cfg, mri_orig); >> disp(segmentedmri) >> save segmentedmri segmentedmri >> >> % MESH >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.numvertices = [3000 2000 1000]; >> bnd=ft_prepare_mesh(cfg,segmentedmri); >> disp(bnd(1)) >> >> % Head Model = variavel vol >> cfg = []; >> cfg.method ='bem_dipoli'; %dipoli singlesphere >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> disp(vol) >> bnd: [1x3 struct] >> cond: [0.3300 0.0041 0.3300] >> skin_surface: 1 >> source: 3 >> type: 'dipoli' >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdien07 at mac.com Fri Apr 12 05:46:47 2013 From: jdien07 at mac.com (Joseph Dien) Date: Thu, 11 Apr 2013 23:46:47 -0400 Subject: [FieldTrip] =?windows-1252?q?Faculty_Research_Assistant_=96_Maryl?= =?windows-1252?q?and_Neuroimaging_Center?= Message-ID: <59162179-C399-4872-90A3-F28AD66DADB7@mac.com> The Neuroscience and Cognitive Sciences Program (NACS) at the University of Maryland College Park is seeking a full-time post baccalaureate faculty research assistant for the Maryland Neuroimaging Center (MNC). The MNC FRA is expected to learn to operate a Siemens 3T MRI machine, to assist on research projects using the MRI machine, assist the MR Physicist as needed in ongoing use and maintenance of the MRI machine and assist as needed with the efforts of the center. The university is establishing a fully-equipped brain imaging center around a new Siemens 3T Trio MRI system. In the future, the MNC will include MEG, and high density EEG facilities. This is a full-time, contractual and benefits eligible position. Salary and benefits are competitive. Start date is late spring, early summer 2013. For best consideration, please electronically submit a resume, cover letter with a description of education, any research experience and computer expertise, and three references by May 17, 2013 to jcgorski at umd.edu with “FRA Search” as the subject line. The Maryland Neuroimaging Center (MNC) is the home for neuroimaging research at the University of Maryland. Housed in a spacious new facility in the Gudelsky Building, adjacent to the main College Park campus, the center has been designed to foster collaboration among neuroscientists, psychologists, cognitive scientists, engineers, and physicists. The MNC is an initiative of the University's interdepartmental Neuroscience and Cognitive Science (NACS) Program, www.nacs.umd.edu. General Description: To assist the MR Physicist as needed in the ongoing use and maintenance of the MRI machine. Primary duties and responsibilities include: Perform research MRI scanning protocols, archive and network-transfer research data. Develop and maintain databases. Coordinate and assist with scheduling. Work with MR Physicist to develop QA/QC procedures. Scan research subjects and phantoms in various MRI scanning environments to include QA/QC. Coordinate and manage scheduling of the scanner in conjunction with MR Physicist and MNC staff. Keep the scanners and control areas supplied and neat. Oversee and maintain the highest standard of safety in the MRI environment for research subjects, UMD staff and equipment. Archive study data and transfer in various modalities. Test and maintain emergency equipment and supplies. Resolve scan and other equipment malfunction issues expeditiously. Order supplies and equipment as necessary. Additional special projects as assigned. Qualifications: College degree required. Applicants must have a strong science background and a B.S. degree, preferably in biomedical sciences, engineering, psychology or neuroscience. Experience with diverse computer environments and other electronic equipment is desirable, as well as basic familiarity with computer programming and/or operating systems (e.g. Linux). Knowledge of MRI scanners/equipment is desirable, preferably the Siemens 3T trio system. We are seeking an individual with experience working in an academic environment, preferably in human subject research. Experience with software/hardware used in human research, including psychophysiology, EEG, MEG is a strong asset. This position is ideal for a recent graduate looking to gain research experience before pursuing long term career options and/or further education. The newly hired person will be trained by current MNC staff on use and maintenance of the scanner. Applicant must demonstrate technical inclination, basic troubleshooting skills, and willingness to learn, and possess a positive, team-oriented attitude. This position requires an individual that is extremely reliable and responsible yet flexible. Must be able to take initiative to implement positive changes, solve problems, and work independently. Strong verbal and written communication skills are required. The University of Maryland is an equal opportunity/affirmative action employer. Women and minorities are encouraged to apply. -------------------------------------------------------------------------------- Joseph Dien, Senior Research Scientist University of Maryland E-mail: jdien07 at mac.com Phone: 301-226-8848 Fax: 301-226-8811 http://joedien.com// -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Fri Apr 12 08:06:32 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Diego Lozano Soldevilla) Date: Fri, 12 Apr 2013 08:06:32 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: <51670147.4080803@berkeley.edu> References: <51670147.4080803@berkeley.edu> Message-ID: Hi Ingrid, I had similar problem with MEG and changing the units with ft_convert_units solved the issue: vol = ft_convert_units(vol,'cm') If not, please file a bug with a piece of data and I'll have a look, best, Diego On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > Hi all, > > When I follow the code according to the example matlab script "Create > MNI-aligned grids in individual head-space" something goes all wrong with > the units. > > I've followed the code (pasted below, from the wiki), but when I make the > figure with the template head model and dipole grid, it's wrong (see > attached ..._problem.png). The dipole grid is tiny in the bottom of the > head model. The black area is the dipole grid, not good. > template_grid = > xgrid: [1x41 double] > ygrid: [1x41 double] > zgrid: [1x41 double] > dim: [41 41 41] > pos: [68921x3 double] > unit: 'mm' > inside: [1x68910 double] > outside: [758 759 760 761 799 800 801 802 843 884 925] > cfg: [1x1 struct] > > It's a problem with the units, because the template grid has 'mm' in the > unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the > numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos > field by 10, the grid is not tight (see attached ..._multiplied10.png). It > looks like the unit problem messed up the determination of what's inside > and outside. As you can see in the template_grid, there are only a few grid > point outside, which is clearly not correct (maybe inside/outside was > determined on wrong units?). > > So, it looks like a bug to me, or am I doing something wrong? I'm using > the newest FT version. > > Thanks, > Ingrid > > %%% CODE FROM WIKI %%% > template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', > filesep,'templates', filesep,'T1.nii']); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol); > ft_plot_mesh(template_grid); > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.tewoerd at fcdonders.ru.nl Fri Apr 12 10:14:43 2013 From: e.tewoerd at fcdonders.ru.nl (Erik te Woerd) Date: Fri, 12 Apr 2013 10:14:43 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? Message-ID: Hi Ingrid, I also encountered this problem when following the tutorial, but was able to solve it in the way Diego suggests it below. While following the tutorial, all variables should be returned with corresponding units, but in ft_prepare_headmodel this doesn't work. I reported it already to bugzilla and it's being looked after... Best, Erik 2013/4/12 Diego Lozano Soldevilla > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > >> Hi all, >> >> When I follow the code according to the example matlab script "Create >> MNI-aligned grids in individual head-space" something goes all wrong with >> the units. >> >> I've followed the code (pasted below, from the wiki), but when I make the >> figure with the template head model and dipole grid, it's wrong (see >> attached ..._problem.png). The dipole grid is tiny in the bottom of the >> head model. The black area is the dipole grid, not good. >> template_grid = >> xgrid: [1x41 double] >> ygrid: [1x41 double] >> zgrid: [1x41 double] >> dim: [41 41 41] >> pos: [68921x3 double] >> unit: 'mm' >> inside: [1x68910 double] >> outside: [758 759 760 761 799 800 801 802 843 884 925] >> cfg: [1x1 struct] >> >> It's a problem with the units, because the template grid has 'mm' in the >> unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the >> numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos >> field by 10, the grid is not tight (see attached ..._multiplied10.png). It >> looks like the unit problem messed up the determination of what's inside >> and outside. As you can see in the template_grid, there are only a few grid >> point outside, which is clearly not correct (maybe inside/outside was >> determined on wrong units?). >> >> So, it looks like a bug to me, or am I doing something wrong? I'm using >> the newest FT version. >> >> Thanks, >> Ingrid >> >> %%% CODE FROM WIKI %%% >> template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', >> filesep,'templates', filesep,'T1.nii']); >> template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the >> coordinate system >> >> % segment the template brain and construct a volume conduction model >> (i.e. head model): this is needed >> % for the inside/outside detection of voxels. >> cfg = []; >> template_seg = ft_volumesegment(cfg, template); >> >> cfg = []; >> cfg.method = 'singleshell'; >> template_vol = ft_prepare_headmodel(cfg, template_seg); >> >> % construct the dipole grid in the template brain coordinates >> % the source units are in cm >> % the negative inwardshift means an outward shift of the brain surface >> for inside/outside detection >> cfg = []; >> cfg.grid.xgrid = -20:1:20; >> cfg.grid.ygrid = -20:1:20; >> cfg.grid.zgrid = -20:1:20; >> cfg.grid.unit = 'cm'; >> cfg.grid.tight = 'yes'; >> cfg.inwardshift = -1.5; >> cfg.vol = template_vol; >> template_grid = ft_prepare_sourcemodel(cfg); >> >> % make a figure with the template head model and dipole grid >> figure >> hold on >> ft_plot_vol(template_vol); >> ft_plot_mesh(template_grid); >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 Lilla.Magyari at mpi.nl Fri Apr 12 14:54:16 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 12 Apr 2013 14:54:16 +0200 (CEST) Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <51149.131.174.45.70.1365771256.squirrel@131.174.45.70> hi Ricardo, The dipoli method works on Mac and Linux. I guess it should work also on Ubuntu, but I do not know if ever anyone tested it. It seems to me from the error message that the problem is that the code does not return the right path for the file with the binary code of this method. The path is important, because different executable file is called depending on the operation system. The operation system is identified by the mexext matlab command in the script of ft_headmodel_dipoli. What do you get when you type in mexext in your matlab command line? Lilla > Hi, > > I had to re-install ubuntu in order to provide more space for the analysis > (since I was having the problem with the temporary files, which might have > been too large for my ubuntu partition). > But now the problem I have with the "ft_prepare_headmodel" is even weirder > than before. The program now is complaining that there is no dipoli for my > system: > > > cfg = []; > cfg.method ='dipoli'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > > ??? Error using ==> ft_headmodel_dipoli at 138 > there is no dipoli executable for your platform > > Error in ==> ft_prepare_headmodel at 226 > vol > ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); > > > I am running this script in a 2010b matlab version, installed in ubuntu > 12.04. It should be working fine, right? > > Thanks in advance, > Ricardo > > > On 28 March 2013 14:39, Ricardo Moura wrote: > >> Hi Jörn, >> thank you very much for your response! >> I checked the segmentation and everything seems to be ok (as far as I >> can >> say... No error messages were shown during the processing and I checked >> the >> generated objects and plots). >> >> But I had a strange error while preparing the head model. Somehow the >> command cannot find the dipoli files, even thought they are really where >> they should be. And the second message >> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no >> clue >> of what it means. >> >> And I am running this command on a ubuntu 12.04 32-bit. >> >> Do you have any idea of how I can solve it? >> >> Thanks once again,Best, >> Ricardo >> >> using the executable >> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >> not found >> Warning: an error ocurred while running dipoli >> > In ft_headmodel_dipoli at 201 >> In ft_prepare_headmodel at 226 >> >> Error using fread >> Invalid file identifier. Use fopen to generate a valid file identifier. >> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >> found. >> > In ft_headmodel_dipoli at 209 >> In ft_prepare_headmodel at 226 >> >> >> On 27 March 2013 13:10, Ricardo Moura wrote: >> >>> Dear all >>> I am creating a BEM model for eeg, following the appropriate tutorial, >>> but I have a problem when preparing the headmodel. The output I have >>> from >>> the ft_prepare_headmodel command does not contain the "mat", and so, >>> when I >>> try to generate the leadfield, it returns an error message due to non >>> existent "mat". I saw that other users had similar problem, but I >>> haven't >>> found a solution though. So, what is wrong with my script? >>> >>> Thanks a lot in advance! >>> Best, >>> Ricardo >>> >>> >>> >>> >>> load standard_mri.mat >>> mri_orig=mri; >>> disp(mri) >>> >>> % Segmenting the data >>> cfg = []; >>> cfg.output= {'scalp','skull','brain'}; >>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>> disp(segmentedmri) >>> save segmentedmri segmentedmri >>> >>> % MESH >>> cfg=[]; >>> cfg.tissue={'brain','skull','scalp'}; >>> cfg.numvertices = [3000 2000 1000]; >>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>> disp(bnd(1)) >>> >>> % Head Model = variavel vol >>> cfg = []; >>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> >>> >> disp(vol) >>> bnd: [1x3 struct] >>> cond: [0.3300 0.0041 0.3300] >>> skin_surface: 1 >>> source: 3 >>> type: 'dipoli' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Lilla.Magyari at mpi.nl Fri Apr 12 17:03:11 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 12 Apr 2013 17:03:11 +0200 (CEST) Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <516631A8.1030006@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> Message-ID: <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> hi Ingrid, I would like to comment on this because I have been discussing this with Robert, and we thought that for the lower electrodes, it is still not optimal when only the skin is extended which is more conductive then the skull. I have attached two images for illustration. The FT segmentation will produce the segmentation in origskull.jpg. This is fine when the electrodes do not extend lower than the skull. When the electrodes are lower, a segmentation like the one in extendedskull.jpg is probably more useful. I created this extended skull based on the skin segmentation with the imerode function of the matlab image processing toolbox (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). Best, Lilla > Hi Imali, > > Tzvetan shared the bem model made from the tutorial MRI with me, that > one extends to low enough, so I'm good! Thanks a lot though! > > Cheers, > Ingird > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >> >> Hi Ingrid, >> >> I had similar issues with creating my own BEM as I too did not have >> the individual MRI's nor the digitized electrode positions. >> >> I created a BEM using the Curry (Neuroscan) software and imported in >> .mat format to use with Fieldtrip. However these are also based on the >> MNI template. >> >> I am not sure whether this extends lower enough for your situation. I >> am attaching here a picture of my head model showing the skull and >> cortex with my registered electrodes. If you are happy with it, I am >> more than happy to share it with you. >> >> Please let me know. >> >> Regards >> >> Imali >> >> *From:*fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >> Nieuwenhuis >> *Sent:* Thursday, 11 April 2013 4:22 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> Just had a brain wave, I'll share it for people with similar situation >> that might be interested in this thread. I think I should just get a >> random structural MRI that extends lower (includes ears and bit >> below), optimally of a subject with a head similar to the MNI >> template. Make a BEM model (hmm, have to fix these errors I mentioned >> earlier then, well, should be doable on linux using dipoli). Then use >> ft_electroderealign to align the electrodes to this MRI, do the source >> analysis for all subjects using this model, and subsequently use >> ft_volumenormalise to normalize to MNI template if I want to use any >> atlas functionality. >> >> If anyone did this already using FieldTrip and has a pre-made BEM >> (just like the standard_bem), would be really nice if you're willing >> to share :) >> If not, I'll make my own, and people with low electrodes and no >> structural MRI and or no linux access can email me if they want to use >> it. >> >> Cheers, >> Ingrid >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >> >> Hi Lilla and Imali, >> >> Thanks for your replies. In my case, the problem is not the >> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >> everything is where it should be. The EGI 128 electrode net really >> has these low electrodes, which are there specifically to make >> source analysis better by capturing more of the electric field. So >> I would have the best solution if I'd leave them there. However, >> in the model as derived from the MNI template, the skin part does >> not go down low enough. >> >> I looked at the picture after ft_prepare_vol_sens (see >> attachement, black is before, red is after), and indeed, this is >> not good. The low electrodes are squeezed up, and this will make >> source analysis worse. So I should indeed remove these electrodes >> (which is a pity), or find a better MNI template. >> >> *So my question is:* >> Does anyone know of a template in MNI space that extends more >> down? This template comes from SPM8, is there a version that >> extends lower? Or could I extend the skin roughly downwards with >> some triangular magic? >> >> I'm also a bit confused about the statement on this wiki page: >> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >> >> under "revision information" header "skin" is says: "This skin >> surface is not used in the BEM model itself for computational >> reasons, but can be used for visualization." >> But this does not seem to be the case, since my electrode >> positions are modified based on till where the skin goes. So the >> skin surface does significantly influence the source analysis. >> >> Anyway, thanks for all the help, and worse case, I just get rid of >> the low fellows. >> >> Cheers, >> Ingrid >> >> >> -- >> >> Ingrid Nieuwenhuis PhD >> >> Postdoctoral Fellow >> >> Sleep and Neuroimaging Laboratory >> >> Department of Psychology >> >> University of California, Berkeley >> >> California 94720-1650 >> >> Tolman Hall, room 5305 >> >> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >> >> hi Ingrid and Imali, >> >> >> I think it is a really good question what to do in Ingrid's >> case. I do not know the "right" answer, but I would like to >> share my thoughts about it. >> >> The ft_prepare_vol_sens is indeed projects the electrode >> positions closer to the headsurface as Imali wrote. But this >> function called automatically when you create your leadfield, >> so you do not have to do it separately (unless you want to >> visualize the corrected electrode positions). >> >> However, I have been advised to rely on this projection >> carefully if electrode positions are far from the skin and >> specially, if the inaccuracies (distance from the skin) are >> not equally distributed across the electrodes, because that >> can cause a spatial bias. >> >> Therefore, my question would be: why are those electrodes so >> low? Are those positions reflect the actual positions of the >> electrodes during the measurement? If yes, I would not change >> their positions, I would rather try to extend my headmodel >> e.g. by using another template. (or another (but quite >> suboptimal) possibility is maybe to exclude those electrodes >> (and the data) from the analysis if they are anyway far from >> the brain.) >> >> If the position of the electrodes should be higher up on the >> head, then instead of relying on projection, I would try first >> to scale the electrodes to fit them into the headsurface with >> the ft_electroderealign function. >> >> I looked to the standard_bem file in the template directory, >> and I also load in the standard_1020.elc, and those electrodes >> perfectly fit the vol. So, it seems that the extension of the >> standard bem headsurface is suitable for the area which is >> covered by the those template electrodes. And I do not know if >> the electrode set you use should cover a larger surface of the >> head, or if it should be just adjusted to the given headsurface. >> >> Lilla >> >> >> >> >> IMALI THANUJA HETTIARACHCHI wrote: >> >> Hi Ingrid, >> >> I had a similar issue a few weeks ago, where my lower most >> electrodes >> started floating after electrode realign using the >> ft_electroderealign >> function. >> >> I used the ft_prepare_vol_sens as, >> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >> trick and >> brought the electrodes on to the skin. >> >> Hope this helps...! >> >> Regards >> Imali >> >> >> *From:* fieldtrip-bounces at science.ru.nl >> >> [fieldtrip-bounces at science.ru.nl >> ] on behalf of Ingrid >> Nieuwenhuis >> [inieuwenhuis at berkeley.edu ] >> *Sent:* Wednesday, 10 April 2013 9:29 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> A follow up on this and some new issues: >> >> 1) I first tried Jörn's approach by creating my own BEM, >> always fun to >> make it yourself ;) However, I did not succeed since: >> a) the dipoli method does not work on Windows >> b) I downloaded the openmeeg toolbox, but got an error >> "om_minverser.exe >> has stopped working" I've emailed their buglist >> c) bemcp did run, but the result was not ok (see attachement). >> I also >> got the warning "% Warning: Matrix is singular, close to >> singular or >> badly scaled. Results may be inaccurate." several times, so >> that might >> be the problem. >> d) and asa gave the following error: % Error using >> ft_prepare_headmodel >> (line 201) % You must supply a valid cfg.hdmfile for use with >> ASA headmodel >> >> And away went my determination to do it myself, so I continued >> using >> thestandard_bem.mat >> >> . >> >> (I did not know this existed, I've added this link to note in >> the >> headmodel tutorial >> >> >> to >> make it easier to find, thanks Tzvetan for pointing this out!). >> >> 2) This worked and after some fiddling to get the electrodes >> aligned it >> looks okay (see attached). >> However, as you can see in the figures, I have several very low >> electrodes, that are lower than the skin mesh. So I was >> wondering if >> this is a problem? Since for accurate calculation of how the >> currents >> flow from these low electrodes, I assume one needs the skin to >> go till >> there? What happens when I have electrodes floating in thin air? >> *So my question is:* >> a) will this cause great inaccuracies? >> b) if so, how can I extend the skin to go lower? The template >> MRI only >> goes that far to the bottom... Trick anyone? >> >> Thanks again, >> Ingrid >> >> >> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >> >> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >> put it on >> the wiki. >> Have a great day, >> Ingrid >> >> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >> >> Dear Ingrid, >> >> in addition to Jorn's approach since you don't have MR and >> digitized >> elec position's you can load and realign the electrodes to the >> standard bem. Subsequently you can calculate the lead field and >> continue with your analysis pipeline. >> Good luck >> tzvetan >> %% read electrodes >> elec = ft_read_sens('/your >> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >> >> %% read headmodel >> templateheadmodel = '/your >> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >> load(templateheadmodel); >> %% electrode realign as good as possible >> % i.e. translate 0 -2 1.5 >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = vol.bnd(1).pnt; >> elecR = ft_electroderealign(cfg); >> %% verify how the electrodes fit toghether with the brain volume >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elecR; >> cfg.headshape = vol.bnd(3).pnt; >> elecR = ft_electroderealign(cfg); >> >> >> >> Hi Ingrid, >> >> I just happen to done this a few weeks back, I changed things >> in the >> meanwhile, but I hope that the below steps are complete: >> /% read in the template MRI >> if isunix >> mri = >> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >> >> elseif ispc >> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >> 'external', >> 'spm8', 'templates', 'T1.nii')); >> end >> >> >> % segment the MRI >> cfg = []; >> cfg.output = {'brain' 'skull' 'scalp'}; >> segmentedmri = ft_volumesegment(cfg, mris); >> >> >> % create the headmodel (BEM) >> cfg = []; >> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >> if isunix >> cfg.method ='dipoli'; % dipoli only works under linux >> else >> disp('TODO FIXME stick to dipoli for now or download >> openmeeg\n'); >> keyboard; >> end >> hdm = ft_prepare_headmodel(cfg, segmentedmri); >> >> elec = ft_read_sens('standard_1020.elc'); >> hdm = ft_convert_units(hdm, elec.unit); >> >> cfg = []; >> cfg.grid.xgrid = -125:8:125; >> cfg.grid.ygrid = -125:8:125; >> cfg.grid.zgrid = -125:8:125; >> cfg.grid.tight = 'yes'; >> cfg.grid.unit = hdm.unit; >> cfg.inwardshift = -1.5; >> cfg.vol = hdm; >> grid = ft_prepare_sourcemodel(cfg) >> grid = ft_convert_units(grid, elec.unit); >> >> figure; >> hold on; >> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> ft_plot_mesh(grid.pos(grid.inside, :)); >> >> % this step is not necessary, cause you will see that >> everything is >> already aligned >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = hdm.bnd(1); >> tmp = ft_electroderealign(cfg); >> elec = tmp; % I had a bug here that I couldn't assign elec >> directly >> >> %% verify location of occipital electrodes >> >> occ_elec = elec; >> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >> elec.label); >> occ_idx = match_str(elec.label, occ_chan); >> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >> occ_elec.label = occ_elec.label(occ_idx, :); >> figure; >> ft_plot_sens(occ_elec) >> hold on; >> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >> >> >> Afair, that's all that is needed. Of course you need to adjust >> folder and file names. >> >> Greetings >> Jörn >> >> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >> >> Hi all, >> >> I'd like to do source analysis (loreta and or DICS) on my EEG >> data. >> I don't have anatomical MRIs and I don't have a measurement of >> the >> scalp surface. So I'd like to use a template MRI or a template >> head >> model that is located in the FieldTrip template directory. I >> have >> EGI (128 channels) data and electrode positions (not subject >> specific, just the standard file also available in FieldTrip >> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >> how to start. I don't see any examples on the FieldTrip page >> of how >> to make a headmodel and volume conduction model giving only this >> limited data. I'd be happy to make it into a example Matlab >> script >> on the FieldTrip page after I got it to work. Would someone be >> able >> to give me some pointers, or example code? >> >> Thanks a lot! >> Ingrid >> >> >> >> -- >> 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 >> >> >> ******************************************* >> Tzvetan Popov >> Clinical Psychology >> University of Konstanz >> Box 23 >> 78457 Konstanz, GERMANY >> Phone: 0049-7531-883086 >> Fax: 0049-7531-884601 >> Email: tzvetan.popov at uni-konstanz.de >> >> >> >> ******************************************* >> >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- A non-text attachment was scrubbed... Name: origskull.jpg Type: image/jpeg Size: 67045 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: extendedskull.jpg Type: image/jpeg Size: 69863 bytes Desc: not available URL: From ricardoojm at gmail.com Fri Apr 12 18:39:10 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Fri, 12 Apr 2013 13:39:10 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Lilla, Thank you very much for your reply. It returns "mexglx", which is expected for a linux system, right? I tried to change the path by my self in the ft_headmodel_dipoli but it didnt work. Do you know how can I change it properly? Best wishes Ricardo On 11 April 2013 16:40, Ricardo Moura wrote: > Hi, > > I had to re-install ubuntu in order to provide more space for the analysis > (since I was having the problem with the temporary files, which might have > been too large for my ubuntu partition). > But now the problem I have with the "ft_prepare_headmodel" is even > weirder than before. The program now is complaining that there is no dipoli > for my system: > > > cfg = []; > cfg.method ='dipoli'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > > ??? Error using ==> ft_headmodel_dipoli at 138 > there is no dipoli executable for your platform > > Error in ==> ft_prepare_headmodel at 226 > vol = > ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); > > > I am running this script in a 2010b matlab version, installed in ubuntu > 12.04. It should be working fine, right? > > Thanks in advance, > Ricardo > > > On 28 March 2013 14:39, Ricardo Moura wrote: > >> Hi Jörn, >> thank you very much for your response! >> I checked the segmentation and everything seems to be ok (as far as I can >> say... No error messages were shown during the processing and I checked the >> generated objects and plots). >> >> But I had a strange error while preparing the head model. Somehow the >> command cannot find the dipoli files, even thought they are really where >> they should be. And the second message >> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue >> of what it means. >> >> And I am running this command on a ubuntu 12.04 32-bit. >> >> Do you have any idea of how I can solve it? >> >> Thanks once again,Best, >> Ricardo >> >> using the executable >> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >> not found >> Warning: an error ocurred while running dipoli >> > In ft_headmodel_dipoli at 201 >> In ft_prepare_headmodel at 226 >> >> Error using fread >> Invalid file identifier. Use fopen to generate a valid file identifier. >> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >> found. >> > In ft_headmodel_dipoli at 209 >> In ft_prepare_headmodel at 226 >> >> >> On 27 March 2013 13:10, Ricardo Moura wrote: >> >>> Dear all >>> I am creating a BEM model for eeg, following the appropriate tutorial, >>> but I have a problem when preparing the headmodel. The output I have from >>> the ft_prepare_headmodel command does not contain the "mat", and so, when I >>> try to generate the leadfield, it returns an error message due to non >>> existent "mat". I saw that other users had similar problem, but I haven't >>> found a solution though. So, what is wrong with my script? >>> >>> Thanks a lot in advance! >>> Best, >>> Ricardo >>> >>> >>> >>> >>> load standard_mri.mat >>> mri_orig=mri; >>> disp(mri) >>> >>> % Segmenting the data >>> cfg = []; >>> cfg.output= {'scalp','skull','brain'}; >>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>> disp(segmentedmri) >>> save segmentedmri segmentedmri >>> >>> % MESH >>> cfg=[]; >>> cfg.tissue={'brain','skull','scalp'}; >>> cfg.numvertices = [3000 2000 1000]; >>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>> disp(bnd(1)) >>> >>> % Head Model = variavel vol >>> cfg = []; >>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> >>> >> disp(vol) >>> bnd: [1x3 struct] >>> cond: [0.3300 0.0041 0.3300] >>> skin_surface: 1 >>> source: 3 >>> type: 'dipoli' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Fri Apr 12 19:51:34 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Fri, 12 Apr 2013 10:51:34 -0700 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: References: Message-ID: <516849A6.2080604@berkeley.edu> Thanks both, I do agree it's a bug then, because the units are known to the functions and they should not behave like this. The units should be converted automatically, or an error should appear telling the user to convert units to match. Anyway, a bugs already filed and a work around is possible, so all good. By the way, I also found a way around my self that might be useful for others to know. There are templates in FieldTrip now (great all this pre-made stuff). So I just did below, and voila :) Thanks, Ingrid %%% my work around %%% load('standard_sourcemodel3d7point5mm') % read the single subject anatomical MRI mri = ft_read_mri(['D:\FT_DATA\Subject01', filesep, 'Subject01.mri']); % create the subject specific grid, using the template grid that has just been loaded cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.sourceunits = 'mm'; grid = ft_prepare_sourcemodel(cfg); On 4/12/2013 1:14 AM, Erik te Woerd wrote: > Hi Ingrid, > > I also encountered this problem when following the tutorial, but was > able to solve it in the way Diego suggests it below. While following > the tutorial, all variables should be returned with corresponding > units, but in ft_prepare_headmodel this doesn't work. > I reported it already to bugzilla and it's being looked after... > > Best, > > Erik > > > 2013/4/12 Diego Lozano Soldevilla > > > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis > > wrote: > > Hi all, > > When I follow the code according to the example matlab script > "Create MNI-aligned grids in individual head-space" something > goes all wrong with the units. > > I've followed the code (pasted below, from the wiki), but when > I make the figure with the template head model and dipole > grid, it's wrong (see attached ..._problem.png). The dipole > grid is tiny in the bottom of the head model. The black area > is the dipole grid, not good. > template_grid = > xgrid: [1x41 double] > ygrid: [1x41 double] > zgrid: [1x41 double] > dim: [41 41 41] > pos: [68921x3 double] > unit: 'mm' > inside: [1x68910 double] > outside: [758 759 760 761 799 800 801 802 843 884 925] > cfg: [1x1 struct] > > It's a problem with the units, because the template grid has > 'mm' in the unit field, but when I look in the xgrid, ygrid, > zgrid and pos fields the numbers are clearly cm not mm. > However, when I multiply my xyzgrid and pos field by 10, the > grid is not tight (see attached ..._multiplied10.png). It > looks like the unit problem messed up the determination of > what's inside and outside. As you can see in the > template_grid, there are only a few grid point outside, which > is clearly not correct (maybe inside/outside was determined on > wrong units?). > > So, it looks like a bug to me, or am I doing something wrong? > I'm using the newest FT version. > > Thanks, > Ingrid > > %%% CODE FROM WIKI %%% > template = ft_read_mri([cur_path_FT 'external', > filesep, 'spm8', filesep,'templates', filesep,'T1.nii']); > template.coordsys = 'spm'; % so that FieldTrip knows how to > interpret the coordinate system > > % segment the template brain and construct a volume conduction > model (i.e. head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain > surface for inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol); > ft_plot_mesh(template_grid); > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Fri Apr 12 20:08:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Fri, 12 Apr 2013 11:08:31 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> Message-ID: <51684D9F.8020207@berkeley.edu> Hi Lilla, Yeah, the skull, I was thinking about that too. So if I understand the pics you sent, the skull is now extended as if it's massive just under the skin. I don't know enough about the volume conduction model and the exact effect of the skull/skin in it to really know what would be better: Not extended skull or massive extended skull. But here's my 2 cents: In my case, the low electrodes are mostly on the cheek and low in the neck. As you can see on the pic I attached to this email, the neck bone does not extend that low, and the cheek doesn't really have bone. So, I'm not sure the extended massive-bone one would be better. Best would be of course to segment the real bone from the MRI, but I have no clue how the segmentation magic takes place, probably is not trivial. Currently it only finds the not extended skull. And making the rest of the bone, if you could segment it, into a mesh is not possible I think, so it has to be sort of massive (meshable). So indeed, to extend or not to extend, that's the question. Probably depends on the location of the low electrodes. I think in my case I would tend to lean towards choosing not to extend. Thanks, Ingrid On 4/12/2013 8:03 AM, Lilla.Magyari at mpi.nl wrote: > hi Ingrid, > > I would like to comment on this because I have been discussing this with > Robert, and we thought that for the lower electrodes, it is still not > optimal when only the skin is extended which is more conductive then the > skull. I have attached two images for illustration. The FT segmentation > will produce the segmentation in origskull.jpg. This is fine when the > electrodes do not extend lower than the skull. When the electrodes are > lower, a segmentation like the one in extendedskull.jpg is probably more > useful. > > I created this extended skull based on the skin segmentation with the > imerode function of the matlab image processing toolbox > (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). > > Best, > Lilla > > > >> Hi Imali, >> >> Tzvetan shared the bem model made from the tutorial MRI with me, that >> one extends to low enough, so I'm good! Thanks a lot though! >> >> Cheers, >> Ingird >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >>> Hi Ingrid, >>> >>> I had similar issues with creating my own BEM as I too did not have >>> the individual MRI's nor the digitized electrode positions. >>> >>> I created a BEM using the Curry (Neuroscan) software and imported in >>> .mat format to use with Fieldtrip. However these are also based on the >>> MNI template. >>> >>> I am not sure whether this extends lower enough for your situation. I >>> am attaching here a picture of my head model showing the skull and >>> cortex with my registered electrodes. If you are happy with it, I am >>> more than happy to share it with you. >>> >>> Please let me know. >>> >>> Regards >>> >>> Imali >>> >>> *From:*fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >>> Nieuwenhuis >>> *Sent:* Thursday, 11 April 2013 4:22 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> Just had a brain wave, I'll share it for people with similar situation >>> that might be interested in this thread. I think I should just get a >>> random structural MRI that extends lower (includes ears and bit >>> below), optimally of a subject with a head similar to the MNI >>> template. Make a BEM model (hmm, have to fix these errors I mentioned >>> earlier then, well, should be doable on linux using dipoli). Then use >>> ft_electroderealign to align the electrodes to this MRI, do the source >>> analysis for all subjects using this model, and subsequently use >>> ft_volumenormalise to normalize to MNI template if I want to use any >>> atlas functionality. >>> >>> If anyone did this already using FieldTrip and has a pre-made BEM >>> (just like the standard_bem), would be really nice if you're willing >>> to share :) >>> If not, I'll make my own, and people with low electrodes and no >>> structural MRI and or no linux access can email me if they want to use >>> it. >>> >>> Cheers, >>> Ingrid >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >>> >>> Hi Lilla and Imali, >>> >>> Thanks for your replies. In my case, the problem is not the >>> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >>> everything is where it should be. The EGI 128 electrode net really >>> has these low electrodes, which are there specifically to make >>> source analysis better by capturing more of the electric field. So >>> I would have the best solution if I'd leave them there. However, >>> in the model as derived from the MNI template, the skin part does >>> not go down low enough. >>> >>> I looked at the picture after ft_prepare_vol_sens (see >>> attachement, black is before, red is after), and indeed, this is >>> not good. The low electrodes are squeezed up, and this will make >>> source analysis worse. So I should indeed remove these electrodes >>> (which is a pity), or find a better MNI template. >>> >>> *So my question is:* >>> Does anyone know of a template in MNI space that extends more >>> down? This template comes from SPM8, is there a version that >>> extends lower? Or could I extend the skin roughly downwards with >>> some triangular magic? >>> >>> I'm also a bit confused about the statement on this wiki page: >>> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >>> >>> under "revision information" header "skin" is says: "This skin >>> surface is not used in the BEM model itself for computational >>> reasons, but can be used for visualization." >>> But this does not seem to be the case, since my electrode >>> positions are modified based on till where the skin goes. So the >>> skin surface does significantly influence the source analysis. >>> >>> Anyway, thanks for all the help, and worse case, I just get rid of >>> the low fellows. >>> >>> Cheers, >>> Ingrid >>> >>> >>> -- >>> >>> Ingrid Nieuwenhuis PhD >>> >>> Postdoctoral Fellow >>> >>> Sleep and Neuroimaging Laboratory >>> >>> Department of Psychology >>> >>> University of California, Berkeley >>> >>> California 94720-1650 >>> >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >>> >>> hi Ingrid and Imali, >>> >>> >>> I think it is a really good question what to do in Ingrid's >>> case. I do not know the "right" answer, but I would like to >>> share my thoughts about it. >>> >>> The ft_prepare_vol_sens is indeed projects the electrode >>> positions closer to the headsurface as Imali wrote. But this >>> function called automatically when you create your leadfield, >>> so you do not have to do it separately (unless you want to >>> visualize the corrected electrode positions). >>> >>> However, I have been advised to rely on this projection >>> carefully if electrode positions are far from the skin and >>> specially, if the inaccuracies (distance from the skin) are >>> not equally distributed across the electrodes, because that >>> can cause a spatial bias. >>> >>> Therefore, my question would be: why are those electrodes so >>> low? Are those positions reflect the actual positions of the >>> electrodes during the measurement? If yes, I would not change >>> their positions, I would rather try to extend my headmodel >>> e.g. by using another template. (or another (but quite >>> suboptimal) possibility is maybe to exclude those electrodes >>> (and the data) from the analysis if they are anyway far from >>> the brain.) >>> >>> If the position of the electrodes should be higher up on the >>> head, then instead of relying on projection, I would try first >>> to scale the electrodes to fit them into the headsurface with >>> the ft_electroderealign function. >>> >>> I looked to the standard_bem file in the template directory, >>> and I also load in the standard_1020.elc, and those electrodes >>> perfectly fit the vol. So, it seems that the extension of the >>> standard bem headsurface is suitable for the area which is >>> covered by the those template electrodes. And I do not know if >>> the electrode set you use should cover a larger surface of the >>> head, or if it should be just adjusted to the given headsurface. >>> >>> Lilla >>> >>> >>> >>> >>> IMALI THANUJA HETTIARACHCHI wrote: >>> >>> Hi Ingrid, >>> >>> I had a similar issue a few weeks ago, where my lower most >>> electrodes >>> started floating after electrode realign using the >>> ft_electroderealign >>> function. >>> >>> I used the ft_prepare_vol_sens as, >>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >>> trick and >>> brought the electrodes on to the skin. >>> >>> Hope this helps...! >>> >>> Regards >>> Imali >>> >>> >>> *From:* fieldtrip-bounces at science.ru.nl >>> >>> [fieldtrip-bounces at science.ru.nl >>> ] on behalf of Ingrid >>> Nieuwenhuis >>> [inieuwenhuis at berkeley.edu ] >>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> A follow up on this and some new issues: >>> >>> 1) I first tried Jörn's approach by creating my own BEM, >>> always fun to >>> make it yourself ;) However, I did not succeed since: >>> a) the dipoli method does not work on Windows >>> b) I downloaded the openmeeg toolbox, but got an error >>> "om_minverser.exe >>> has stopped working" I've emailed their buglist >>> c) bemcp did run, but the result was not ok (see attachement). >>> I also >>> got the warning "% Warning: Matrix is singular, close to >>> singular or >>> badly scaled. Results may be inaccurate." several times, so >>> that might >>> be the problem. >>> d) and asa gave the following error: % Error using >>> ft_prepare_headmodel >>> (line 201) % You must supply a valid cfg.hdmfile for use with >>> ASA headmodel >>> >>> And away went my determination to do it myself, so I continued >>> using >>> thestandard_bem.mat >>> >>> . >>> >>> (I did not know this existed, I've added this link to note in >>> the >>> headmodel tutorial >>> >>> >>> to >>> make it easier to find, thanks Tzvetan for pointing this out!). >>> >>> 2) This worked and after some fiddling to get the electrodes >>> aligned it >>> looks okay (see attached). >>> However, as you can see in the figures, I have several very low >>> electrodes, that are lower than the skin mesh. So I was >>> wondering if >>> this is a problem? Since for accurate calculation of how the >>> currents >>> flow from these low electrodes, I assume one needs the skin to >>> go till >>> there? What happens when I have electrodes floating in thin air? >>> *So my question is:* >>> a) will this cause great inaccuracies? >>> b) if so, how can I extend the skin to go lower? The template >>> MRI only >>> goes that far to the bottom... Trick anyone? >>> >>> Thanks again, >>> Ingrid >>> >>> >>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>> >>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >>> put it on >>> the wiki. >>> Have a great day, >>> Ingrid >>> >>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>> >>> Dear Ingrid, >>> >>> in addition to Jorn's approach since you don't have MR and >>> digitized >>> elec position's you can load and realign the electrodes to the >>> standard bem. Subsequently you can calculate the lead field and >>> continue with your analysis pipeline. >>> Good luck >>> tzvetan >>> %% read electrodes >>> elec = ft_read_sens('/your >>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>> >>> %% read headmodel >>> templateheadmodel = '/your >>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>> load(templateheadmodel); >>> %% electrode realign as good as possible >>> % i.e. translate 0 -2 1.5 >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = vol.bnd(1).pnt; >>> elecR = ft_electroderealign(cfg); >>> %% verify how the electrodes fit toghether with the brain volume >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elecR; >>> cfg.headshape = vol.bnd(3).pnt; >>> elecR = ft_electroderealign(cfg); >>> >>> >>> >>> Hi Ingrid, >>> >>> I just happen to done this a few weeks back, I changed things >>> in the >>> meanwhile, but I hope that the below steps are complete: >>> /% read in the template MRI >>> if isunix >>> mri = >>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>> >>> elseif ispc >>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>> 'external', >>> 'spm8', 'templates', 'T1.nii')); >>> end >>> >>> >>> % segment the MRI >>> cfg = []; >>> cfg.output = {'brain' 'skull' 'scalp'}; >>> segmentedmri = ft_volumesegment(cfg, mris); >>> >>> >>> % create the headmodel (BEM) >>> cfg = []; >>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>> if isunix >>> cfg.method ='dipoli'; % dipoli only works under linux >>> else >>> disp('TODO FIXME stick to dipoli for now or download >>> openmeeg\n'); >>> keyboard; >>> end >>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> elec = ft_read_sens('standard_1020.elc'); >>> hdm = ft_convert_units(hdm, elec.unit); >>> >>> cfg = []; >>> cfg.grid.xgrid = -125:8:125; >>> cfg.grid.ygrid = -125:8:125; >>> cfg.grid.zgrid = -125:8:125; >>> cfg.grid.tight = 'yes'; >>> cfg.grid.unit = hdm.unit; >>> cfg.inwardshift = -1.5; >>> cfg.vol = hdm; >>> grid = ft_prepare_sourcemodel(cfg) >>> grid = ft_convert_units(grid, elec.unit); >>> >>> figure; >>> hold on; >>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>> ft_plot_mesh(grid.pos(grid.inside, :)); >>> >>> % this step is not necessary, cause you will see that >>> everything is >>> already aligned >>> cfg = []; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = hdm.bnd(1); >>> tmp = ft_electroderealign(cfg); >>> elec = tmp; % I had a bug here that I couldn't assign elec >>> directly >>> >>> %% verify location of occipital electrodes >>> >>> occ_elec = elec; >>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>> elec.label); >>> occ_idx = match_str(elec.label, occ_chan); >>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>> occ_elec.label = occ_elec.label(occ_idx, :); >>> figure; >>> ft_plot_sens(occ_elec) >>> hold on; >>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>> >>> >>> Afair, that's all that is needed. Of course you need to adjust >>> folder and file names. >>> >>> Greetings >>> Jörn >>> >>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>> >>> Hi all, >>> >>> I'd like to do source analysis (loreta and or DICS) on my EEG >>> data. >>> I don't have anatomical MRIs and I don't have a measurement of >>> the >>> scalp surface. So I'd like to use a template MRI or a template >>> head >>> model that is located in the FieldTrip template directory. I >>> have >>> EGI (128 channels) data and electrode positions (not subject >>> specific, just the standard file also available in FieldTrip >>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>> how to start. I don't see any examples on the FieldTrip page >>> of how >>> to make a headmodel and volume conduction model giving only this >>> limited data. I'd be happy to make it into a example Matlab >>> script >>> on the FieldTrip page after I got it to work. Would someone be >>> able >>> to give me some pointers, or example code? >>> >>> Thanks a lot! >>> Ingrid >>> >>> >>> >>> -- >>> 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 >>> >>> >>> ******************************************* >>> Tzvetan Popov >>> Clinical Psychology >>> University of Konstanz >>> Box 23 >>> 78457 Konstanz, GERMANY >>> Phone: 0049-7531-883086 >>> Fax: 0049-7531-884601 >>> Email: tzvetan.popov at uni-konstanz.de >>> >>> >>> >>> ******************************************* >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sb10063654e-001.jpg Type: image/jpeg Size: 64547 bytes Desc: not available URL: From polomacnenad at gmail.com Fri Apr 12 21:16:27 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 12 Apr 2013 21:16:27 +0200 Subject: [FieldTrip] ft_read_sens on brain vision eeg data Message-ID: Dear all, I would like to read sensors locations with ft_read_sens and it doesn't work. I have eeg data recorded with Brain Vision Recorder. It seems that that ft_read_sens doesn't recognize this file format. Please help! Thank you in advance! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Apr 15 12:13:28 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 15 Apr 2013 12:13:28 +0200 (CEST) Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <49931.131.174.45.70.1366020808.squirrel@131.174.45.70> hi Ricardo, I'd change forward/ft_headmodel_dipoli.m in line 134 from this: case {'mexglnx86' 'mexa64'} to this: case {'mexglnx86' 'mexa64' 'mexglx'} Please, try this first, and if it is still not working, it is possible that you should compile it yourself. If that still doesn't work out, please, send a message to the bugzilla. http://bugzilla.fcdonders.nl/ And if you could run it, please, also give us a feedback about it. Thanks. Best, Lilla > Hi Lilla, > Thank you very much for your reply. > It returns "mexglx", which is expected for a linux system, right? > I tried to change the path by my self in the ft_headmodel_dipoli but it > didnt work. Do you know how can I change it properly? > > Best wishes > Ricardo > > > On 11 April 2013 16:40, Ricardo Moura wrote: > >> Hi, >> >> I had to re-install ubuntu in order to provide more space for the >> analysis >> (since I was having the problem with the temporary files, which might >> have >> been too large for my ubuntu partition). >> But now the problem I have with the "ft_prepare_headmodel" is even >> weirder than before. The program now is complaining that there is no >> dipoli >> for my system: >> >> >> cfg = []; >> cfg.method ='dipoli'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> ??? Error using ==> ft_headmodel_dipoli at 138 >> there is no dipoli executable for your platform >> >> Error in ==> ft_prepare_headmodel at 226 >> vol > >> ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); >> >> >> I am running this script in a 2010b matlab version, installed in ubuntu >> 12.04. It should be working fine, right? >> >> Thanks in advance, >> Ricardo >> >> >> On 28 March 2013 14:39, Ricardo Moura wrote: >> >>> Hi Jörn, >>> thank you very much for your response! >>> I checked the segmentation and everything seems to be ok (as far as I >>> can >>> say... No error messages were shown during the processing and I checked >>> the >>> generated objects and plots). >>> >>> But I had a strange error while preparing the head model. Somehow the >>> command cannot find the dipoli files, even thought they are really >>> where >>> they should be. And the second message >>> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no >>> clue >>> of what it means. >>> >>> And I am running this command on a ubuntu 12.04 32-bit. >>> >>> Do you have any idea of how I can solve it? >>> >>> Thanks once again,Best, >>> Ricardo >>> >>> using the executable >>> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >>> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >>> not found >>> Warning: an error ocurred while running dipoli >>> > In ft_headmodel_dipoli at 201 >>> In ft_prepare_headmodel at 226 >>> >>> Error using fread >>> Invalid file identifier. Use fopen to generate a valid file >>> identifier. >>> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >>> found. >>> > In ft_headmodel_dipoli at 209 >>> In ft_prepare_headmodel at 226 >>> >>> >>> On 27 March 2013 13:10, Ricardo Moura wrote: >>> >>>> Dear all >>>> I am creating a BEM model for eeg, following the appropriate tutorial, >>>> but I have a problem when preparing the headmodel. The output I have >>>> from >>>> the ft_prepare_headmodel command does not contain the "mat", and so, >>>> when I >>>> try to generate the leadfield, it returns an error message due to non >>>> existent "mat". I saw that other users had similar problem, but I >>>> haven't >>>> found a solution though. So, what is wrong with my script? >>>> >>>> Thanks a lot in advance! >>>> Best, >>>> Ricardo >>>> >>>> >>>> >>>> >>>> load standard_mri.mat >>>> mri_orig=mri; >>>> disp(mri) >>>> >>>> % Segmenting the data >>>> cfg = []; >>>> cfg.output= {'scalp','skull','brain'}; >>>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>>> disp(segmentedmri) >>>> save segmentedmri segmentedmri >>>> >>>> % MESH >>>> cfg=[]; >>>> cfg.tissue={'brain','skull','scalp'}; >>>> cfg.numvertices = [3000 2000 1000]; >>>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>>> disp(bnd(1)) >>>> >>>> % Head Model = variavel vol >>>> cfg = []; >>>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> >>>> >> disp(vol) >>>> bnd: [1x3 struct] >>>> cond: [0.3300 0.0041 0.3300] >>>> skin_surface: 1 >>>> source: 3 >>>> type: 'dipoli' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> >>> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Lilla.Magyari at mpi.nl Mon Apr 15 13:05:36 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 15 Apr 2013 13:05:36 +0200 (CEST) Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51684D9F.8020207@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> <51684D9F.8020207@berkeley.edu> Message-ID: <50252.131.174.45.70.1366023936.squirrel@131.174.45.70> hi Ingrid, FieldTrip segments the skull by a rough estimation: when it finds the brain surface, it extends it with using an image processing function of matlab. We have found this good enough for the BEM model, but in your case, maybe it is not satisfactory. But you can overlay the segmentation with the anatomy of the mri image with ft_sourceplot and check it at the coordinates of your electrodes and you can see then whether your skull segmentation should be extended or corrected. If you use the tutorial data, you can download the mri and the already made segmentation. I do not know exactly how other software are doing the segmentation of the skull, but you can find a plot of the brain, skull and scalp surfaces using FieldTrip and FreeSurfer on this page, http://fieldtrip.fcdonders.nl/development/replicate_functionality_of_mne_software#anatomical_processingeeg when you scroll a bit down . None of them seems to exactly fit to your need, but maybe there are other software (or FS has also a different algorithm?) which segments the skull and bone more precisely. Otherwise, it is also OK to correct the segmentation manually. Unfortunately, FieldTrip doesn't have an editing function for the segmentation yet. Therefore, I was suggesting to work with the matlab image processing toolbox functions. I hope this helps. Best, Lilla > Hi Lilla, > > Yeah, the skull, I was thinking about that too. So if I understand the > pics you sent, the skull is now extended as if it's massive just under > the skin. I don't know enough about the volume conduction model and the > exact effect of the skull/skin in it to really know what would be > better: Not extended skull or massive extended skull. But here's my 2 > cents: > > In my case, the low electrodes are mostly on the cheek and low in the > neck. As you can see on the pic I attached to this email, the neck bone > does not extend that low, and the cheek doesn't really have bone. So, > I'm not sure the extended massive-bone one would be better. Best would > be of course to segment the real bone from the MRI, but I have no clue > how the segmentation magic takes place, probably is not trivial. > Currently it only finds the not extended skull. And making the rest of > the bone, if you could segment it, into a mesh is not possible I think, > so it has to be sort of massive (meshable). So indeed, to extend or not > to extend, that's the question. Probably depends on the location of the > low electrodes. I think in my case I would tend to lean towards choosing > not to extend. > > Thanks, > Ingrid > > > On 4/12/2013 8:03 AM, Lilla.Magyari at mpi.nl wrote: >> hi Ingrid, >> >> I would like to comment on this because I have been discussing this with >> Robert, and we thought that for the lower electrodes, it is still not >> optimal when only the skin is extended which is more conductive then the >> skull. I have attached two images for illustration. The FT segmentation >> will produce the segmentation in origskull.jpg. This is fine when the >> electrodes do not extend lower than the skull. When the electrodes are >> lower, a segmentation like the one in extendedskull.jpg is probably more >> useful. >> >> I created this extended skull based on the skin segmentation with the >> imerode function of the matlab image processing toolbox >> (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). >> >> Best, >> Lilla >> >> >> >>> Hi Imali, >>> >>> Tzvetan shared the bem model made from the tutorial MRI with me, that >>> one extends to low enough, so I'm good! Thanks a lot though! >>> >>> Cheers, >>> Ingird >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >>>> Hi Ingrid, >>>> >>>> I had similar issues with creating my own BEM as I too did not have >>>> the individual MRI's nor the digitized electrode positions. >>>> >>>> I created a BEM using the Curry (Neuroscan) software and imported in >>>> .mat format to use with Fieldtrip. However these are also based on the >>>> MNI template. >>>> >>>> I am not sure whether this extends lower enough for your situation. I >>>> am attaching here a picture of my head model showing the skull and >>>> cortex with my registered electrodes. If you are happy with it, I am >>>> more than happy to share it with you. >>>> >>>> Please let me know. >>>> >>>> Regards >>>> >>>> Imali >>>> >>>> *From:*fieldtrip-bounces at science.ru.nl >>>> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >>>> Nieuwenhuis >>>> *Sent:* Thursday, 11 April 2013 4:22 AM >>>> *To:* fieldtrip at science.ru.nl >>>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>>> >>>> Hi all, >>>> >>>> Just had a brain wave, I'll share it for people with similar situation >>>> that might be interested in this thread. I think I should just get a >>>> random structural MRI that extends lower (includes ears and bit >>>> below), optimally of a subject with a head similar to the MNI >>>> template. Make a BEM model (hmm, have to fix these errors I mentioned >>>> earlier then, well, should be doable on linux using dipoli). Then use >>>> ft_electroderealign to align the electrodes to this MRI, do the source >>>> analysis for all subjects using this model, and subsequently use >>>> ft_volumenormalise to normalize to MNI template if I want to use any >>>> atlas functionality. >>>> >>>> If anyone did this already using FieldTrip and has a pre-made BEM >>>> (just like the standard_bem), would be really nice if you're willing >>>> to share :) >>>> If not, I'll make my own, and people with low electrodes and no >>>> structural MRI and or no linux access can email me if they want to use >>>> it. >>>> >>>> Cheers, >>>> Ingrid >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Hi Lilla and Imali, >>>> >>>> Thanks for your replies. In my case, the problem is not the >>>> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >>>> everything is where it should be. The EGI 128 electrode net >>>> really >>>> has these low electrodes, which are there specifically to make >>>> source analysis better by capturing more of the electric field. >>>> So >>>> I would have the best solution if I'd leave them there. However, >>>> in the model as derived from the MNI template, the skin part does >>>> not go down low enough. >>>> >>>> I looked at the picture after ft_prepare_vol_sens (see >>>> attachement, black is before, red is after), and indeed, this is >>>> not good. The low electrodes are squeezed up, and this will make >>>> source analysis worse. So I should indeed remove these electrodes >>>> (which is a pity), or find a better MNI template. >>>> >>>> *So my question is:* >>>> Does anyone know of a template in MNI space that extends more >>>> down? This template comes from SPM8, is there a version that >>>> extends lower? Or could I extend the skin roughly downwards with >>>> some triangular magic? >>>> >>>> I'm also a bit confused about the statement on this wiki page: >>>> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >>>> >>>> under "revision information" header "skin" is says: "This skin >>>> surface is not used in the BEM model itself for computational >>>> reasons, but can be used for visualization." >>>> But this does not seem to be the case, since my electrode >>>> positions are modified based on till where the skin goes. So the >>>> skin surface does significantly influence the source analysis. >>>> >>>> Anyway, thanks for all the help, and worse case, I just get rid >>>> of >>>> the low fellows. >>>> >>>> Cheers, >>>> Ingrid >>>> >>>> >>>> -- >>>> >>>> Ingrid Nieuwenhuis PhD >>>> >>>> Postdoctoral Fellow >>>> >>>> Sleep and Neuroimaging Laboratory >>>> >>>> Department of Psychology >>>> >>>> University of California, Berkeley >>>> >>>> California 94720-1650 >>>> >>>> Tolman Hall, room 5305 >>>> >>>> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >>>> >>>> hi Ingrid and Imali, >>>> >>>> >>>> I think it is a really good question what to do in Ingrid's >>>> case. I do not know the "right" answer, but I would like to >>>> share my thoughts about it. >>>> >>>> The ft_prepare_vol_sens is indeed projects the electrode >>>> positions closer to the headsurface as Imali wrote. But this >>>> function called automatically when you create your leadfield, >>>> so you do not have to do it separately (unless you want to >>>> visualize the corrected electrode positions). >>>> >>>> However, I have been advised to rely on this projection >>>> carefully if electrode positions are far from the skin and >>>> specially, if the inaccuracies (distance from the skin) are >>>> not equally distributed across the electrodes, because that >>>> can cause a spatial bias. >>>> >>>> Therefore, my question would be: why are those electrodes so >>>> low? Are those positions reflect the actual positions of the >>>> electrodes during the measurement? If yes, I would not change >>>> their positions, I would rather try to extend my headmodel >>>> e.g. by using another template. (or another (but quite >>>> suboptimal) possibility is maybe to exclude those electrodes >>>> (and the data) from the analysis if they are anyway far from >>>> the brain.) >>>> >>>> If the position of the electrodes should be higher up on the >>>> head, then instead of relying on projection, I would try >>>> first >>>> to scale the electrodes to fit them into the headsurface with >>>> the ft_electroderealign function. >>>> >>>> I looked to the standard_bem file in the template directory, >>>> and I also load in the standard_1020.elc, and those >>>> electrodes >>>> perfectly fit the vol. So, it seems that the extension of the >>>> standard bem headsurface is suitable for the area which is >>>> covered by the those template electrodes. And I do not know >>>> if >>>> the electrode set you use should cover a larger surface of >>>> the >>>> head, or if it should be just adjusted to the given >>>> headsurface. >>>> >>>> Lilla >>>> >>>> >>>> >>>> >>>> IMALI THANUJA HETTIARACHCHI wrote: >>>> >>>> Hi Ingrid, >>>> >>>> I had a similar issue a few weeks ago, where my lower most >>>> electrodes >>>> started floating after electrode realign using the >>>> ft_electroderealign >>>> function. >>>> >>>> I used the ft_prepare_vol_sens as, >>>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >>>> trick and >>>> brought the electrodes on to the skin. >>>> >>>> Hope this helps...! >>>> >>>> Regards >>>> Imali >>>> >>>> >>>> *From:* fieldtrip-bounces at science.ru.nl >>>> >>>> [fieldtrip-bounces at science.ru.nl >>>> ] on behalf of Ingrid >>>> Nieuwenhuis >>>> [inieuwenhuis at berkeley.edu >>>> ] >>>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>>> *To:* fieldtrip at science.ru.nl >>>> >>>> *Subject:* Re: [FieldTrip] source analysis EEG data without >>>> MRI >>>> >>>> Hi all, >>>> >>>> A follow up on this and some new issues: >>>> >>>> 1) I first tried Jörn's approach by creating my own BEM, >>>> always fun to >>>> make it yourself ;) However, I did not succeed since: >>>> a) the dipoli method does not work on Windows >>>> b) I downloaded the openmeeg toolbox, but got an error >>>> "om_minverser.exe >>>> has stopped working" I've emailed their buglist >>>> c) bemcp did run, but the result was not ok (see >>>> attachement). >>>> I also >>>> got the warning "% Warning: Matrix is singular, close to >>>> singular or >>>> badly scaled. Results may be inaccurate." several times, so >>>> that might >>>> be the problem. >>>> d) and asa gave the following error: % Error using >>>> ft_prepare_headmodel >>>> (line 201) % You must supply a valid cfg.hdmfile for use with >>>> ASA headmodel >>>> >>>> And away went my determination to do it myself, so I >>>> continued >>>> using >>>> thestandard_bem.mat >>>> >>>> . >>>> >>>> (I did not know this existed, I've added this link to note in >>>> the >>>> headmodel tutorial >>>> >>>> >>>> to >>>> make it easier to find, thanks Tzvetan for pointing this >>>> out!). >>>> >>>> 2) This worked and after some fiddling to get the electrodes >>>> aligned it >>>> looks okay (see attached). >>>> However, as you can see in the figures, I have several very >>>> low >>>> electrodes, that are lower than the skin mesh. So I was >>>> wondering if >>>> this is a problem? Since for accurate calculation of how the >>>> currents >>>> flow from these low electrodes, I assume one needs the skin >>>> to >>>> go till >>>> there? What happens when I have electrodes floating in thin >>>> air? >>>> *So my question is:* >>>> a) will this cause great inaccuracies? >>>> b) if so, how can I extend the skin to go lower? The template >>>> MRI only >>>> goes that far to the bottom... Trick anyone? >>>> >>>> Thanks again, >>>> Ingrid >>>> >>>> >>>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >>>> put it on >>>> the wiki. >>>> Have a great day, >>>> Ingrid >>>> >>>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>> >>>> Dear Ingrid, >>>> >>>> in addition to Jorn's approach since you don't have MR and >>>> digitized >>>> elec position's you can load and realign the electrodes to >>>> the >>>> standard bem. Subsequently you can calculate the lead field >>>> and >>>> continue with your analysis pipeline. >>>> Good luck >>>> tzvetan >>>> %% read electrodes >>>> elec = ft_read_sens('/your >>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>> >>>> %% read headmodel >>>> templateheadmodel = '/your >>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>> load(templateheadmodel); >>>> %% electrode realign as good as possible >>>> % i.e. translate 0 -2 1.5 >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = vol.bnd(1).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> %% verify how the electrodes fit toghether with the brain >>>> volume >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elecR; >>>> cfg.headshape = vol.bnd(3).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> >>>> >>>> >>>> Hi Ingrid, >>>> >>>> I just happen to done this a few weeks back, I changed things >>>> in the >>>> meanwhile, but I hope that the below steps are complete: >>>> /% read in the template MRI >>>> if isunix >>>> mri = >>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>> >>>> elseif ispc >>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>>> 'external', >>>> 'spm8', 'templates', 'T1.nii')); >>>> end >>>> >>>> >>>> % segment the MRI >>>> cfg = []; >>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>> segmentedmri = ft_volumesegment(cfg, mris); >>>> >>>> >>>> % create the headmodel (BEM) >>>> cfg = []; >>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>> if isunix >>>> cfg.method ='dipoli'; % dipoli only works under linux >>>> else >>>> disp('TODO FIXME stick to dipoli for now or download >>>> openmeeg\n'); >>>> keyboard; >>>> end >>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> elec = ft_read_sens('standard_1020.elc'); >>>> hdm = ft_convert_units(hdm, elec.unit); >>>> >>>> cfg = []; >>>> cfg.grid.xgrid = -125:8:125; >>>> cfg.grid.ygrid = -125:8:125; >>>> cfg.grid.zgrid = -125:8:125; >>>> cfg.grid.tight = 'yes'; >>>> cfg.grid.unit = hdm.unit; >>>> cfg.inwardshift = -1.5; >>>> cfg.vol = hdm; >>>> grid = ft_prepare_sourcemodel(cfg) >>>> grid = ft_convert_units(grid, elec.unit); >>>> >>>> figure; >>>> hold on; >>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], >>>> 'facealpha', >>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>> >>>> % this step is not necessary, cause you will see that >>>> everything is >>>> already aligned >>>> cfg = []; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = hdm.bnd(1); >>>> tmp = ft_electroderealign(cfg); >>>> elec = tmp; % I had a bug here that I couldn't assign elec >>>> directly >>>> >>>> %% verify location of occipital electrodes >>>> >>>> occ_elec = elec; >>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>> elec.label); >>>> occ_idx = match_str(elec.label, occ_chan); >>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>> figure; >>>> ft_plot_sens(occ_elec) >>>> hold on; >>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>> >>>> >>>> Afair, that's all that is needed. Of course you need to >>>> adjust >>>> folder and file names. >>>> >>>> Greetings >>>> Jörn >>>> >>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Hi all, >>>> >>>> I'd like to do source analysis (loreta and or DICS) on my EEG >>>> data. >>>> I don't have anatomical MRIs and I don't have a measurement >>>> of >>>> the >>>> scalp surface. So I'd like to use a template MRI or a >>>> template >>>> head >>>> model that is located in the FieldTrip template directory. I >>>> have >>>> EGI (128 channels) data and electrode positions (not subject >>>> specific, just the standard file also available in FieldTrip >>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of >>>> stuck >>>> how to start. I don't see any examples on the FieldTrip page >>>> of how >>>> to make a headmodel and volume conduction model giving only >>>> this >>>> limited data. I'd be happy to make it into a example Matlab >>>> script >>>> on the FieldTrip page after I got it to work. Would someone >>>> be >>>> able >>>> to give me some pointers, or example code? >>>> >>>> Thanks a lot! >>>> Ingrid >>>> >>>> >>>> >>>> -- >>>> 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 >>>> >>>> >>>> ******************************************* >>>> Tzvetan Popov >>>> Clinical Psychology >>>> University of Konstanz >>>> Box 23 >>>> 78457 Konstanz, GERMANY >>>> Phone: 0049-7531-883086 >>>> Fax: 0049-7531-884601 >>>> Email: tzvetan.popov at uni-konstanz.de >>>> >>>> >>>> >>>> ******************************************* >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> fieldtrip mailing list >>>> >>>> fieldtrip at donders.ru.nl >>>> >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From h.morgan at bangor.ac.uk Tue Apr 16 17:06:32 2013 From: h.morgan at bangor.ac.uk (Helen Morgan) Date: Tue, 16 Apr 2013 16:06:32 +0100 Subject: [FieldTrip] ERP Summer School, Bangor, UK Message-ID: <516D68F8.7020808@bangor.ac.uk> School of Psychology, Bangor University, Wales, UK 1st-5th July 2013 ERP Summer School "Brainwaves and the Human Mind" This Summer School is part of the celebrations of the 50th Anniversary of the School of Psychology, Bangor University. We invite applications for a summer school on the neuroscientific investigation of the human mind. Attendees will learn how to conduct, analyse, and interpret event-related potential studies in psychological domains like memory, development, mindfulness, language, and perception and cognition. The emphasis will be on practical sessions covering the analysis of event-related potentials like the treatment of artefacts and eye movements, filtering, segmentation, averaging, baseline correction, and data measurements. Travel grants are available and will be awarded on a competitive basis to support applicants who otherwise would have financial difficulties attending. Course fee: £270 (including accommodation), £170 (no accommodation). Please contact Becca Henderson at erpsummerschool at bangor.ac.uk for information about the Summer School. -- Rhif Elusen Gofrestredig / Registered Charity No. 1141565 Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi, gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar unwaith a dilëwch y neges. Os na fwriadwyd anfon y neges atoch chi, rhaid i chi beidio â defnyddio, cadw neu ddatgelu unrhyw wybodaeth a gynhwysir ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i hanfonodd yn unig ac nid yw o anghenraid yn cynrychioli barn Prifysgol Bangor. Nid yw Prifysgol Bangor yn gwarantu bod y neges e-bost hon neu unrhyw atodiadau yn rhydd rhag firysau neu 100% yn ddiogel. Oni bai fod hyn wedi ei ddatgan yn uniongyrchol yn nhestun yr e-bost, nid bwriad y neges e-bost hon yw ffurfio contract rhwymol - mae rhestr o lofnodwyr awdurdodedig ar gael o Swyddfa Cyllid Prifysgol Bangor. www.bangor.ac.uk This email and any attachments may contain confidential material and is solely for the use of the intended recipient(s). If you have received this email in error, please notify the sender immediately and delete this email. If you are not the intended recipient(s), you must not use, retain or disclose any information contained in this email. Any views or opinions are solely those of the sender and do not necessarily represent those of Bangor University. Bangor University does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of the text of the email, this email is not intended to form a binding contract - a list of authorised signatories is available from the Bangor University Finance Office. www.bangor.ac.uk From r.oostenveld at donders.ru.nl Thu Apr 18 10:23:59 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 18 Apr 2013 10:23:59 +0200 Subject: [FieldTrip] Calculating goodness of fit In-Reply-To: <51522E38.8040309@telus.net> References: <51522E38.8040309@telus.net> Message-ID: <7CEE609D-841C-475B-A0DE-EEF87E43F2EA@donders.ru.nl> Hi Jim On 27 Mar 2013, at 0:24, Jim McKay wrote: > I am trying to figure out how to calculate the goodness of fit (gof) after a dipole fit on MEG data. The equation for gof has two input variables, the measured data vector and the model data vector from the EC dipole fit. The measured data vector is easy, but I am confused which vector to use for the model data, which is a vector of length (1:Num_sensors). If dip1 is the output from the ft_dipolefitting function, candidates are: > > dip1.Vdata - perhaps this is the measured data? > dip1.Vmodel - sounds promising? > dip1.dip.pot - or maybe this? The output from ft_dipolefitting is a bit archaic. It is on the todo list to update this data structure and make it more self-explanatory. dip1.Vdata is the Nchans*Ntime matrix with the data that was fitted (can be either EEG or MEG, so don't be comfused by the "V" in the name) dip1.Vmodel is the Nchans*Ntime matrix with the forward solution predicted by the dipole model you can subtract the two and for example visualize the resudual. The field dip.dip.pot contains the same as dip.Vmodel. You might want to take a look at ft_dipolefitting around line 500, where these fields and the gof (actually residual variance) are dealt with. best regards, Robert From cmuehl at gmail.com Thu Apr 18 13:19:58 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Thu, 18 Apr 2013 13:19:58 +0200 Subject: [FieldTrip] Deadline Extension! Workshop of Affective Brain-Computer Interfaces at ACII2013 Message-ID: ** Submission deadline extension until 28th of April** 3rd Workshop on Affective Brain-Computer Interfaces (aBCI) Workshop at ACII 2013 (September 2-5), Geneva, Switzerland, September 2, 2013 http://hmi.ewi.utwente.nl/abci2013 http://www.acii2013.org During the last decade, brain computer interface (BCI) research has developed into a major research field establishing methodological frameworks, guidelines and a core community of established researchers. Besides proving valuable as a communication channel that bypasses impeded muscular pathways, the novel technology also spurred the investigation of applications for able-bodied users, foremost in the fields of entertainment, health and lifestyle. Affective BCI systems allowing users to control computer games, support relaxation training, or trigger your alarm clock during a shallow sleep stage have been proposed, implemented, and sold. Moreover, the affordable hardware and software tools also encouraged artists to play with the idea of a direct access to people’s most private information: their affective and cognitive states. From these explorations followed a number of interesting installations, suggesting novel ways of human-computer as well as human-human interaction: neurotechnology-based systems that encourage affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. The third workshop on affective brain-computer interfaces will explore the advantages and limitations of using neuro-physiological signals as a modality for the automatic recognition of affective and cognitive states, and the possibilities of using this information about the user state in applications for domains like health, arts, and entertainment. The goal is to bring researchers, artists, and practitioners together to present state-of-the-art progress and their visions, and thus to spur the development of guidelines and frameworks for affective BCI. Topics of interest include, but are not limited to: • affective/cognitive state induction and data collection for affective BCI • detection of mental state via BCI and other modalities • innovative concepts for adaptive interfaces and affective BCI • demos of affective BCI systems and artworks Submission Instructions * The papers should feature original empirical work, theoretical work, or a well defendable but arguable position of the authors. * Papers will be published in the proceedings of ACII 2013 by IEEE. Papers should be limited to 6 pages. * Further details about the submission instructions and format can be found on the website of ACII 2013. * For further information, contact abci at ewi.utwente.nl Important Dates: April 28, 2013: Submission of manuscripts May 27, 2013: Acceptance/Rejection notification June 17, 2013: Submission of camera-ready papers and presenting author’s registration September 2, 2013: Date of the Workshop Programme Chairs: * Brendan Allison, University of California, San Diego, USA * Guilliaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland, * Christian Mühl, INRIA Bordeaux - Sud-Ouest, France * Anton Nijholt, Universiteit Twente, the Netherlands Programme Committee: * Egon L. van den Broek, TNO Technical Sciences, Delft, The Netherlands * Anne-Marie Brouwer, TNO Perceptual and Cognitive Systems, Soesterberg, the Netherlands * Stephen Fairclough, John Moores University, Liverpool, UK * Didier Grandjean, Swiss Center for Affective Sciences, Geneva, Switzerland * Hayrettin Gürkök, University of Twente, Enschede, the Netherlands * Jonghwa Kim, University of Augsburg, Germany * Brent Lance, Army Research Laboratory/TNB, Aberdeen Proving Ground, USA, * Fabien Lotte, INRIA Bordeaux - Sud-Ouest, France * Winfried Menninghaus, Freie Universität Berlin, Germany * Gary Garcia Molina, Philips Research North America, Briarcliff, USA * Christopher Honey, Princeton University, USA * Ioannis Patras, Queen Mary University, London, UK * Mannes Poel, University of Twente, Enschede, the Netherlands * Olga Sourina, NanYang Technological University, Singapore * Ed Tan, Universiteit van Amsterdam, the Netherlands * Aleksander Valjamae, University of Graz, Austria * Thorsten Zander, Technische Universität Berlin, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Apr 19 08:53:43 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 19 Apr 2013 08:53:43 +0200 Subject: [FieldTrip] ft_read_sens on brain vision eeg data In-Reply-To: References: Message-ID: <606401BD-7553-4E6B-BD93-CF13D162C7A3@donders.ru.nl> Hi Nenad, The Brain Vision Recorder software writes EEG data into three files, that are usually called *.vhdr, *.vmrk and *.dat. Sometime the latter one is caller *.eeg, and also *.seg might happen (after processing the data in Brain Vision Analyzer). But none of the three files contains electrode positions, therefore ft_read_sens won't work on them. EEG electrode positions are usually recorded with a Polhemus electromagnetic tracking device. Sometimes an optical tracker (e.g. Optotrak), acoustic tracker (Zebris) or camera-based system is used. However, there is not a single unique file format for the Polhemus recordings. Depending on the company from which you purchased the Polhemus tracker (usually an EEG system integration company, like ANT), you will get different software with it that writes teh position to different file formats. The ft_read_sens function understands some of the formats, but probably not all. Usually the files that are written by the software that comes with the Polhemus are in ascii, so you can edit (and convert) them with a text editor. So rather than looking at the EEG amplifier with software, you should look at the electrode position recording device+software that you have been using. best regards, Robert PS it might be tha On 12 Apr 2013, at 21:16, Nenad Polomac wrote: > Dear all, > > I would like to read sensors locations with ft_read_sens and it doesn't work. I have eeg data recorded with Brain Vision Recorder. It seems that that ft_read_sens doesn't recognize this file format. > Please help! > > Thank you in advance! > > Nenad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From haiteng.jiang at gmail.com Fri Apr 19 10:25:33 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 19 Apr 2013 10:25:33 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge Message-ID: Hi FTer, I am doing Cluster-based permutation statistic after beamforming on two condition over subjects following the tutorial http://fieldtrip.fcdonders.nl/example/source_statistics, but I get something funny. In my case , I would expect decreased activity in the visual and posterior area. The effect is quite strong, which is showed in the grand average difference (log ratio to reduce inter subject variability). However , from the statistic , the identified areas go to the temporal area , which doesn't make sense at all . Please see the below and attached pictures. I understand cluster-based permutation test doesn't necessary pick the peak difference, but in general it should find main different area. Any comment would be greatly appreciated. Average: [image: Inline images 2] Statistic: [image: Inline images 1] Best, Haiteng -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: statistic.jpg Type: image/jpeg Size: 128261 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grandaverage.jpg Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grandaverage.jpg Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: statistic.jpg Type: image/jpeg Size: 128261 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Fri Apr 19 11:35:44 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 19 Apr 2013 11:35:44 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge In-Reply-To: References: Message-ID: <51710FF0.5040904@donders.ru.nl> Dear Haiteng, I think in the example the design matrix is wrongly computed. If you compare the single and the group-level example, it is described exactly the same, which does not make much sense. Afaik it should be this instead (analogue to freq statisics on group level): /subj = numel(sourceA.trial); design = zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; / Let me know if this makes things better (not in today, working from home, so better reply to this lis). Best, Jörn On 4/19/2013 10:25 AM, Haiteng Jiang wrote: > Hi FTer, > I am doing Cluster-based permutation statistic after > beamforming on two condition over subjects following the tutorial > http://fieldtrip.fcdonders.nl/example/source_statistics, but I get > something funny. > In my case , I would expect decreased activity in the visual and > posterior area. The effect is quite strong, which is showed in the > grand average difference (log ratio to reduce inter subject > variability). However , from the statistic , the identified areas > go to the temporal area , which doesn't make sense at all . Please > see the below and attached pictures. I understand cluster-based > permutation test doesn't necessary pick the peak difference, but in > general it should find main different area. Any comment would be > greatly appreciated. > > Average: > > Inline images 2 > > > > Statistic: > Inline images 1 > Best, > Haiteng > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 128261 bytes Desc: not available URL: From litvak.vladimir at gmail.com Sat Apr 20 05:46:38 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sat, 20 Apr 2013 04:46:38 +0100 Subject: [FieldTrip] Statistical Parametric Mapping for MEG/EEG 2013 course - final reminder Message-ID: Dear colleagues, There are still a few places left for the May SPM for M/EEG course in London. This is the first course where SPM12b will be taught. The course program will also include a new extended demo of a group analysis of multimodal MEG-EEG dataset in SPM. Please see below for further details. With best wishes, Vladimir Litvak on behalf of the course faculty --------------------------------------------------------------------------------------------------------- Dear colleagues, We are happy to advertise the 2013 Statistical Parametric Mapping for MEG/EEG course presented by the Wellcome Trust Centre for Neuroimaging. The course will take place on Monday 13th May –Wednesday 15th May 2013 at the Wellcome Trust Centre for Neuroimaging in London. This course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course will cover (1) data pre-processing, (2) statistical analysis of sensor-space maps using GLMs and Random Field theory, (3) source reconstruction and (4) Dynamic Causal Modelling for EEG/MEG. The course will be followed by the long-established three-day course on ‘SPM for fMRI’ so it is possible to attend both courses. The course is suitable for beginners and more advanced users. We advise students to gain at least minimal familiarity with the methodology, for example, from reading the paper available at http://www.hindawi.com/journals/cin/2011/852961/ and other introductory articles listed at the SPM website or by following data analysis examples in the SPM manual. Video lectures from the 2012 course are available at http://www.fil.ion.ucl.ac.uk/spm/course/video/#MEEG For the practical part of the course please bring a laptop that can run Matlab (7.4 or later, no toolboxes are required) and is powerful enough to analyse your data (64-bit OS is highly recommended). The detailed schedule and booking forms can be found at http://www.ion.ucl.ac.uk/articles/events/SPM . For further details and registration please contact Jean Reynolds (jean.reynolds at ucl.ac.uk). With best wishes, Vladimir Litvak Ph.D. Lecturer Wellcome Trust Centre for Neuroimaging -------------------------------------------------------------------------------------------------- SPM (http://www.fil.ion.ucl.ac.uk/spm/) is free and open source software written in MATLAB (The MathWorks, Inc.). In addition to standard M/EEG pre-processing, we presently offer three main analysis tools: (i) statistical analysis of scalp-maps, time-frequency images and volumetric 3D source reconstruction images based on the general linear model, with correction for multiple comparisons using random field theory; (ii) Bayesian M/EEG source reconstruction, including support for group studies, simultaneous EEG and MEG, and fMRI priors; (iii) Dynamic Causal Modelling (DCM), an approach combining neural modelling with data analysis for which there are several variants dealing with evoked responses, steady state responses (power spectra and cross-spectra), induced responses and phase coupling. SPM is integrated with the FieldTrip toolbox (http://fieldtrip.fcdonders.nl/), making it possible for users to combine a variety of standard analysis methods with new schemes implemented in SPM and build custom analysis tools using powerful graphical user interface (GUI) and batching tools. -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Sat Apr 20 08:08:27 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Sat, 20 Apr 2013 08:08:27 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge Message-ID: > > Hi Jorn, > Thanks for your response . It is Within subjects experiments design. The result remains same because the design doesn't change . They are only just different expression on the source statistic comparing to sensor statistic on group level on FT tutorial. In my data, the cluster randomization picks something funny and doesn't make sense while the difference plots is more informative and more consistent with the topos. Technically speaking - the cluster randomization does not test for location , but only if there is a difference or not - thus the clusters should be interpreted with caution. Therefore , I think about trying another statistic method as well although cluster randomization is wildly used within donders institute . Do you have any suggestion? Best, Haiteng On 19 April 2013 11:35, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > > Today's Topics: > > 1. Re: Source statistic doesn't match grand average difference > at all and prior knowledge (J?rn M. Horschig) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 19 Apr 2013 11:35:44 +0200 > From: "J?rn M. Horschig" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Source statistic doesn't match grand average > difference at all and prior knowledge > Message-ID: <51710FF0.5040904 at donders.ru.nl> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Dear Haiteng, > > I think in the example the design matrix is wrongly computed. If you > compare the single and the group-level example, it is described exactly > the same, which does not make much sense. Afaik it should be this > instead (analogue to freq statisics on group level): > > /subj = numel(sourceA.trial); > design = zeros(2,2*subj); > for i = 1:subj > design(1,i) = i; > end > for i = 1:subj > design(1,subj+i) = i; > end > design(2,1:subj) = 1; > design(2,subj+1:2*subj) = 2; > / > Let me know if this makes things better (not in today, working from > home, so better reply to this lis). > > Best, > J?rn > > On 4/19/2013 10:25 AM, Haiteng Jiang wrote: > > Hi FTer, > > I am doing Cluster-based permutation statistic after > > beamforming on two condition over subjects following the tutorial > > http://fieldtrip.fcdonders.nl/example/source_statistics, but I get > > something funny. > > In my case , I would expect decreased activity in the visual and > > posterior area. The effect is quite strong, which is showed in the > > grand average difference (log ratio to reduce inter subject > > variability). However , from the statistic , the identified areas > > go to the temporal area , which doesn't make sense at all . Please > > see the below and attached pictures. I understand cluster-based > > permutation test doesn't necessary pick the peak difference, but in > > general it should find main different area. Any comment would be > > greatly appreciated. > > > > Average: > > > > Inline images 2 > > > > > > > > Statistic: > > Inline images 1 > > Best, > > Haiteng > > > > -- > > Haiteng Jiang > > PhD candidate > > Neuronal Oscillations Group > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > > > Visiting address > > Room 2.32 > > Donders Centre for Cognitive Neuroimaging > > Kapittelweg 29 > > 6525 EN Nijmegen > > the Netherlands > > > > Tel.: +31 (0)243668291 > > Web: https://sites.google.com/site/haitengjiang/ > > > > > > _______________________________________________ > > 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: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: not available > Type: image/jpeg > Size: 119056 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment.jpe > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: not available > Type: image/jpeg > Size: 128261 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment-0001.jpe > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 29, Issue 36 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sun Apr 21 04:11:11 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sun, 21 Apr 2013 10:11:11 +0800 Subject: [FieldTrip] Dose have some method that used to determine it in which brain regions (BA areas)? Message-ID: Dear all, I use the 'DICS' ,and got the cortical position of the power.(x,y,z) Dose have some method that used to determine it in which brain regions (BA areas)? thanks best xue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sun Apr 21 04:23:02 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sun, 21 Apr 2013 10:23:02 +0800 Subject: [FieldTrip] about EEGLAB Message-ID: Dear all, I got the '.set ' file from EEGLAB and read into FieldTrip . I'm confused about the coordinate of the tool is different . Do I need to convert the coordinates of the channel ? And how do it ? best, xue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From strauss.mel at gmail.com Mon Apr 22 16:02:41 2013 From: strauss.mel at gmail.com (=?ISO-8859-1?Q?M=E9lanie_Strauss?=) Date: Mon, 22 Apr 2013 16:02:41 +0200 Subject: [FieldTrip] Help to convert FIF MEG/EEG files to EDF format Message-ID: Dear fieldtrip members, I have some difficulties to convert a MEG+EEG FIF file (Elekta neuromag) to EDF format. I used the following functions : data = ft_preprocessing(cfg) filename = 'outfile'; ft_write_data(filename, data.trial{1,1},'header',data.hdr,'dataformat','edf'); There isn't any error during the execution of the function but the converted file seems to be empty. Would anybody have any suggestion to help me? Thanks a lot, Melanie Strauss --- MD, PhD student. CEA/DSV/I2BM / NeuroSpin INSERM U992 - Cognitive Neuroimaging Unit Bât 145 - Point Courrier 156 Gif sur Yvette F-91191 FRANCE Ph: +33(0)1.69.08.22.23 <%2B33%280%29169.08.65.21> E-mail: strauss.mel at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From m_wink10 at uni-muenster.de Mon Apr 22 20:36:18 2013 From: m_wink10 at uni-muenster.de (Martin Winkels) Date: Mon, 22 Apr 2013 20:36:18 +0200 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR Message-ID: Hello Guys, I am trying to perform connectivity analysis in sensor domain (fieldtrip and matlab are up to date). Within doing that I am facing a small problem in the ICA analysis in combination with a MVAR analysis. If I execute the following code, I get an error message as follows: Error using chol Matrix must be positive definite. Error in armorf (line 40) ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); Error in ft_mvaranalysis (line 390) [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), size(tmpdata.trial{1},2), cfg.order); Error in mu_firstexample (line 90) mdata = ft_mvaranalysis(cfg, data_ma_ica); Can anybody help me with that issue? % artifact correction: ica component analysis cfg = []; cfg.method = 'runica'; cfg.runica.pca = 40; comp = ft_componentanalysis(cfg, data_ma); cfg = []; cfg.layout = 'CTF275.lay'; cfg.viewmode = 'component'; ft_databrowser(cfg, comp) %% artifact correction: ica component rejection cfg = []; cfg.component = [4]; % to be removed component(s) data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); %% compute MVAR, spectral transfer and granger % mvar cfg = []; cfg.order = 5; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis(cfg, data_ma_ica); Thank you, -- Martin Winkels B.Sc. / Ingenieur in Medizininformatik und Biomedizintechnik University of Münster phone: +49 177 6090603 mail: m_wink10 at uni-muenster.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From ricardoojm at gmail.com Tue Apr 23 02:33:02 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Mon, 22 Apr 2013 21:33:02 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Lilla, Thanks a lot. It worked perfectly. Best, Ricardo On 12 April 2013 13:39, Ricardo Moura wrote: > Hi Lilla, > Thank you very much for your reply. > It returns "mexglx", which is expected for a linux system, right? > I tried to change the path by my self in the ft_headmodel_dipoli but it > didnt work. Do you know how can I change it properly? > > Best wishes > Ricardo > > > On 11 April 2013 16:40, Ricardo Moura wrote: > >> Hi, >> >> I had to re-install ubuntu in order to provide more space for the >> analysis (since I was having the problem with the temporary files, which >> might have been too large for my ubuntu partition). >> But now the problem I have with the "ft_prepare_headmodel" is even >> weirder than before. The program now is complaining that there is no dipoli >> for my system: >> >> >> cfg = []; >> cfg.method ='dipoli'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> ??? Error using ==> ft_headmodel_dipoli at 138 >> there is no dipoli executable for your platform >> >> Error in ==> ft_prepare_headmodel at 226 >> vol = >> ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); >> >> >> I am running this script in a 2010b matlab version, installed in ubuntu >> 12.04. It should be working fine, right? >> >> Thanks in advance, >> Ricardo >> >> >> On 28 March 2013 14:39, Ricardo Moura wrote: >> >>> Hi Jörn, >>> thank you very much for your response! >>> I checked the segmentation and everything seems to be ok (as far as I >>> can say... No error messages were shown during the processing and I checked >>> the generated objects and plots). >>> >>> But I had a strange error while preparing the head model. Somehow the >>> command cannot find the dipoli files, even thought they are really where >>> they should be. And the second message >>> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue >>> of what it means. >>> >>> And I am running this command on a ubuntu 12.04 32-bit. >>> >>> Do you have any idea of how I can solve it? >>> >>> Thanks once again,Best, >>> Ricardo >>> >>> using the executable >>> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >>> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >>> not found >>> Warning: an error ocurred while running dipoli >>> > In ft_headmodel_dipoli at 201 >>> In ft_prepare_headmodel at 226 >>> >>> Error using fread >>> Invalid file identifier. Use fopen to generate a valid file identifier. >>> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >>> found. >>> > In ft_headmodel_dipoli at 209 >>> In ft_prepare_headmodel at 226 >>> >>> >>> On 27 March 2013 13:10, Ricardo Moura wrote: >>> >>>> Dear all >>>> I am creating a BEM model for eeg, following the appropriate tutorial, >>>> but I have a problem when preparing the headmodel. The output I have from >>>> the ft_prepare_headmodel command does not contain the "mat", and so, when I >>>> try to generate the leadfield, it returns an error message due to non >>>> existent "mat". I saw that other users had similar problem, but I haven't >>>> found a solution though. So, what is wrong with my script? >>>> >>>> Thanks a lot in advance! >>>> Best, >>>> Ricardo >>>> >>>> >>>> >>>> >>>> load standard_mri.mat >>>> mri_orig=mri; >>>> disp(mri) >>>> >>>> % Segmenting the data >>>> cfg = []; >>>> cfg.output= {'scalp','skull','brain'}; >>>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>>> disp(segmentedmri) >>>> save segmentedmri segmentedmri >>>> >>>> % MESH >>>> cfg=[]; >>>> cfg.tissue={'brain','skull','scalp'}; >>>> cfg.numvertices = [3000 2000 1000]; >>>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>>> disp(bnd(1)) >>>> >>>> % Head Model = variavel vol >>>> cfg = []; >>>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> >>>> >> disp(vol) >>>> bnd: [1x3 struct] >>>> cond: [0.3300 0.0041 0.3300] >>>> skin_surface: 1 >>>> source: 3 >>>> type: 'dipoli' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Tue Apr 23 09:36:16 2013 From: narayan.ps at tut.fi (Narayan P Subramaniyam) Date: Tue, 23 Apr 2013 10:36:16 +0300 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR In-Reply-To: References: Message-ID: <517639F0.30808@tut.fi> Although I am not an expert in connectivity analysis, but from a mathematical point of view it looks like the case where at least one variable in covariance matrix is a exact linear combination of other and hence it is not positive definite. This could be due to rejection of few components by ICA ? Other experts may shed more light... On 22/04/2013 21:36, Martin Winkels wrote: > Hello Guys, > > I am trying to perform connectivity analysis in sensor domain > (fieldtrip and matlab are up to date). Within doing that I am facing a > small problem in the ICA analysis in combination with a MVAR analysis. > If I execute the following code, I get an error message as follows: > > > Error using chol > Matrix must be positive definite. > > Error in armorf (line 40) > ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); > > Error in ft_mvaranalysis (line 390) > [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), > size(tmpdata.trial{1},2), cfg.order); > > Error in mu_firstexample (line 90) > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Can anybody help me with that issue? > > > % artifact correction: ica component analysis > > cfg = []; > cfg.method = 'runica'; > cfg.runica.pca = 40; > comp = ft_componentanalysis(cfg, data_ma); > > cfg = []; > cfg.layout = 'CTF275.lay'; > cfg.viewmode = 'component'; > ft_databrowser(cfg, comp) > > %% artifact correction: ica component rejection > > cfg = []; > cfg.component = [4]; % to be removed component(s) > data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); > > %% compute MVAR, spectral transfer and granger > > % mvar > cfg = []; > cfg.order = 5; > cfg.toolbox = 'bsmart'; > > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Thank you, > > -- > Martin Winkels > > B.Sc. / Ingenieur in > Medizininformatik und Biomedizintechnik > > University of Münster > > phone: +49 177 6090603 > mail: m_wink10 at uni-muenster.de > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- With Best Regards, Narayan P Subramaniyam, M.Sc. Researcher/PhD student Department of Electronics and Communications Engineering Tampere University of Technology Finn-Medi 1, 4th Floor, Room 203 Biokatu 6, FI-33520 Tampere, Finland Tel: +358 (0)40 198 1951 E-mail: narayan.ps at tut.fi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 23 09:54:39 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 23 Apr 2013 09:54:39 +0200 Subject: [FieldTrip] Dose have some method that used to determine it in which brain regions (BA areas)? In-Reply-To: References: Message-ID: <51763E3F.70001@donders.ru.nl> Dear Xue, please have a look here: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended The atlas thing is sometimes a bit buggy, meaning that sometimes labels are not shown. It depends a bit on the type of atlas and the coordinate system. The method + atlas proposed in the tutorial should work. Best, Jörn On 4/21/2013 4:11 AM, ?? wrote: > Dear all, > I use the 'DICS' ,and got the cortical position of the power.(x,y,z) > Dose have some method that used to determine it in which brain regions > (BA areas)? > thanks > best > xue. > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Tue Apr 23 09:59:58 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 23 Apr 2013 09:59:58 +0200 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR In-Reply-To: References: Message-ID: <51763F7E.4000304@donders.ru.nl> Hi Martin, that error most likely occurs because the rank of your datamatrix is not full. This can e.g. be the case for EEG data where you include the reference channel (or common average rereferenced) or when you used ft_channelrepair or, in your case, when you removed an ICA component, therefore reducing the rank of your data. I am not sure what the best solution for this is, because there are several, e.g. you could do your MVar analysis on ICA data directly, do it on a subset of channels so that the datamatrix is rank sufficient again or just refrain from doing the mvar analysis. Best, Jörn On 4/22/2013 8:36 PM, Martin Winkels wrote: > Hello Guys, > > I am trying to perform connectivity analysis in sensor domain > (fieldtrip and matlab are up to date). Within doing that I am facing a > small problem in the ICA analysis in combination with a MVAR analysis. > If I execute the following code, I get an error message as follows: > > > Error using chol > Matrix must be positive definite. > > Error in armorf (line 40) > ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); > > Error in ft_mvaranalysis (line 390) > [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), > size(tmpdata.trial{1},2), cfg.order); > > Error in mu_firstexample (line 90) > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Can anybody help me with that issue? > > > % artifact correction: ica component analysis > > cfg = []; > cfg.method = 'runica'; > cfg.runica.pca = 40; > comp = ft_componentanalysis(cfg, data_ma); > > cfg = []; > cfg.layout = 'CTF275.lay'; > cfg.viewmode = 'component'; > ft_databrowser(cfg, comp) > > %% artifact correction: ica component rejection > > cfg = []; > cfg.component = [4]; % to be removed component(s) > data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); > > %% compute MVAR, spectral transfer and granger > > % mvar > cfg = []; > cfg.order = 5; > cfg.toolbox = 'bsmart'; > > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Thank you, > > -- > Martin Winkels > > B.Sc. / Ingenieur in > Medizininformatik und Biomedizintechnik > > University of Münster > > phone: +49 177 6090603 > mail: m_wink10 at uni-muenster.de > > > > > _______________________________________________ > 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 b.osuagwu.1 at research.gla.ac.uk Tue Apr 23 11:17:27 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Tue, 23 Apr 2013 10:17:27 +0100 Subject: [FieldTrip] ICA and covariance matrix for CSP Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> Hi Everyone, I want to ask a general mathematical question relating to ICA and common spatial pattern. Hopefully someone will help me out. I have noticed that after using ICA to remove artifact in my signal, I can no longer compute the covariance matrices needed for common spatial pattern without matlab giving me warning regarding the accuracy of the estimated matrix. Indeed the estimated matrix is not accurate. This does not happen if I use only a small subset of my channels after removing noise with ICA. If I do not use ICA at all the warning disappears. I want to ask if anybody knows why ICA causes this issue and how I can fix it. Thanks a lot. Bethel Osuagwu From zriouil.imane at gmail.com Tue Apr 23 16:09:10 2013 From: zriouil.imane at gmail.com (z.imane) Date: Tue, 23 Apr 2013 16:09:10 +0200 Subject: [FieldTrip] (no subject) Message-ID: hi, * * i'm started to use FielTrip, and i want to read data from .plx extension. with data.plx contain LFP and spike data * * when I execute the following function: data=ft_read_header('data.plx') I have the error message: ??? Error using ==> ft_read_header at 1550 * *different sampling rates in continuous data not supported * * * * and when I execute: data=ft_read_spike('data.plx') * * Error in ==> ft_read_spike at 180 * *nchan = length(hdr.ChannelHeader); * * * * Please suggestions thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Tue Apr 23 17:16:28 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Tue, 23 Apr 2013 17:16:28 +0200 Subject: [FieldTrip] ICA and covariance matrix for CSP In-Reply-To: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> References: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> Message-ID: Hi Bethel, Removing a component with ICA will reduce the rank (number linear independent components) of your data. The covariance matrix itself probably can be computed, but I suspect the warning you are getting is when you are computing the inverse. The inverse of a rank-deficient matrix cannot be computed (and so the warnings you get are expected). Regularisation (e.g. adding some 'noise' to the diagonal of the covariance matrix, roughly equal to the amount of estimated sensor noise) prior to inversion is the common way around this problem. In FieldTrip, this is cfg.lambda when calling ft_sourceanalysis, which you can set to a percentage, for example '5%' is common, of the trace of the covariance matrix. Best, Johanna 2013/4/23 Bethel Osuagwu > Hi Everyone, > > I want to ask a general mathematical question relating to ICA and common > spatial pattern. Hopefully someone will help me out. > > I have noticed that after using ICA to remove artifact in my signal, I can > no longer compute the covariance matrices needed for common spatial pattern > without matlab giving me warning regarding the accuracy of the estimated > matrix. Indeed the estimated matrix is not accurate. This does not happen > if I use only a small subset of my channels after removing noise with ICA. > If I do not use ICA at all the warning disappears. > > I want to ask if anybody knows why ICA causes this issue and how I can fix > it. > > Thanks a lot. > Bethel Osuagwu > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coppolar at mail.nih.gov Tue Apr 23 20:53:08 2013 From: coppolar at mail.nih.gov (Coppola, Richard (NIH/NIMH) [E]) Date: Tue, 23 Apr 2013 18:53:08 +0000 Subject: [FieldTrip] Post-doc postion possibility at NIMH Message-ID: <94A0A015317F894DA3A7A53C578E81E90A7450@MLBXV06.nih.gov> We anticipate an opportunity for a post-doctoral fellow to join the research team of the Experimental Therapeutics and Pathophysiology Branch of the NIMH Intramural Research Program, led by Dr Zarate. This group has been involved with the groundbreaking studies examining neural plasticity in antidepressant action with MEG and other imaging modalities (see Cornwell B et al: Biol Psychiatry, 2012; Neuropsychopharmacology, 2010, etc). The fellow would be heavily involved in the planning and analyses of the MEG studies of the Branch in collaboration with the NIMH MEG Core Facility staff and Dr. Coppola. The fellow would have access to the unique large data set already collected as well as opportunity for future studies. The candidate should be a recent or expected Ph.D., and have an appropriate background in Neuroscience, neuroimaging methods, and applied statistics along with specific experience in advanced MEG and/or fMRI analysis. Substantial skills in statistics, programming and scientific writing will be essential. Please email with the subject line ETPB-PostDoc, a cover letter, CV, and names of references to Drs Zarate and Coppola. Dr. Zarate's current research focus is on developing novel medications for treatment-resistant depression and bipolar disorder. His areas of expertise include biological and pharmacological aspects of mood disorders in adults. Dr. Zarate's group conducts proof-of-concept studies utilizing novel compounds and biomarkers (magnetoencephalography [MEG] and polysomnography [PSG], positron emission tomography, functional MRI and magnetic resonance spectroscopy [MRS]) to identify potentially relevant drug targets and biosignatures of treatment response. A multidisciplinary translational research team conducts the research in the ETPB. In addition, the Branch provides training to develop the next generation of clinical translational researchers. Carlos A. Zarate, Jr., M.D. Chief Experimental Therapeutics & Pathophysiology Branch & Section Neurobiology and Treatment of Mood Disorders Division of Intramural Research Program National Institute of Mental Health 10 Center Drive, CRC, Unit 7 SE, Rm. 7-3465 Bethesda, MD 20892-1282 zaratec at mail.nih.gov http://intramural.nimh.nih.gov/research/pi/pi_zarate_c.html The MEG Core provides a state of the art facility supporting the (CTF) Omega 2000 275-channel MEG system for the use of PI's of the Intramural Research Programs of NIMH and NINDS Dr. Richard Coppola Dir. NIMH MEG Core Facility Bldg 10 Room 3C119 Bethesda, MD 20892 coppolar at mail.nih.gov http://kurage.nimh.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Korey.Kam at med.nyu.edu Wed Apr 24 01:18:19 2013 From: Korey.Kam at med.nyu.edu (Kam, Korey) Date: Tue, 23 Apr 2013 23:18:19 +0000 Subject: [FieldTrip] Import of Spike2 data (.smr) Message-ID: Hello everyone, As a potential user of FT, I am interested in performing spike train and spike-LFP analyses. My data files are in .smr (Spike2 file format). Therefore, my question is the following: Is there a function to import .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no avail. Thanks and this really is a great community, Korey -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Wed Apr 24 07:39:20 2013 From: inieuwenhuis at berkeley.edu (Ingrid Lyda Catharina Nieuwenhuis) Date: Tue, 23 Apr 2013 22:39:20 -0700 Subject: [FieldTrip] using sloreta in FieldTrip Message-ID: Hi all, Does anyone has experience with using FieldTrip for looking at sources generated using the Loreta-key program? I've generated sLoreta files and read them into FieldTrip using loreta2fieldtrip as described on the FieldTrip wiki . Note, I first got an "Invalid precision" error from fread due to line 89: activity = fread(fid, [voxnumber 1], 'float = >single'); But after I changed this line to: activity = fread(fid, [voxnumber 1]); it worked. But now I'd like to plot this on an anatomical MRI since without anatomy it looks hard to interpret (see attached). The source should be in MNI space (see info on loreta-key page), so I tried using the T1.nii template from SPM (that's in MNI space, correct?: %read in template MRI (MNI) template = ft_read_mri('C:\Users\Ingrid\Documents\MATLAB\FieldTrip\external\spm8\templates\T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % interpolate cfg = []; cfg.parameter = 'avg.pow'; [interp] = ft_sourceinterpolate(cfg, GA_source, template); %sourceplot cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.coordsys = 'mni'; ft_sourceplot(cfg,interp); But that doesn't work (see capture2). I'm a bit lost now... Anyone any ideas? Maybe I should use the "mni152" template. since that is what the loreta website says it's based on. Anyone know where to get that template in a format FieldTrip can read? So in short: 1) has anyone done this before and has tips / code to share? 2) is the T1.nii template from SPM in MNI space? 3) do you think the mni152 is different from T1.nii, and would work? if so anyone know where to get it in format FieldTrip can read? 4) am I missing something in steps explaining why my source does not match the anatomy? Thanks! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture.PNG Type: image/png Size: 48260 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture2.PNG Type: image/png Size: 94462 bytes Desc: not available URL: From wljj09 at gmail.com Wed Apr 24 09:28:05 2013 From: wljj09 at gmail.com (Jing Wang) Date: Wed, 24 Apr 2013 15:28:05 +0800 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: Dear Korey, As far as I know, you can not import .smr file into FT directly. My experience is to use third sofeware such as Neuroexplore to transform .smr to .nex format, which could be imported directly. Best Jing 2013/4/24 Kam, Korey > Hello everyone, > > As a potential user of FT, I am interested in performing spike train and > spike-LFP analyses. My data files are in .smr (Spike2 file format). > > Therefore, my question is the following: Is there a function to import > .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no > avail. > > Thanks and this really is a great community, > > Korey > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Wed Apr 24 09:31:58 2013 From: zriouil.imane at gmail.com (z.imane) Date: Wed, 24 Apr 2013 09:31:58 +0200 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: hi, have you read the contents of your file. smr by using the function " FT_READ_SPIKE"? thanks 2013/4/24 Jing Wang > Dear Korey, > > As far as I know, you can not import .smr file into FT directly. My > experience is to use third sofeware such as Neuroexplore to transform .smr > to .nex format, which could be imported directly. > > Best > > Jing > > > 2013/4/24 Kam, Korey > >> Hello everyone, >> >> As a potential user of FT, I am interested in performing spike train and >> spike-LFP analyses. My data files are in .smr (Spike2 file format). >> >> Therefore, my question is the following: Is there a function to import >> .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no >> avail. >> >> Thanks and this really is a great community, >> >> Korey >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Zriouil Imane -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonas at obleser.de Wed Apr 24 11:23:20 2013 From: jonas at obleser.de (Jonas Obleser) Date: Wed, 24 Apr 2013 11:23:20 +0200 Subject: [FieldTrip] Postdoctoral posititon in auditory cognition/auditory neuroscience, Max Planck Institute, Leipzig Message-ID: <752383FF-BD27-4536-BDE8-DA390D3BE71B@obleser.de> -- Apologies for cross-postings -- The Max Planck Institute for Human Cognitive and Brain Sciences (MPI–CBS) in Leipzig and the Max Planck Research Group “Auditory Cognition” (headed by Jonas Obleser) are now offering a Postdoctoral researcher Position, for initially 2 years, preferably starting by October 2013. Successful candidates will have a PhD in cognitive neuroscience, psychology, or natural sciences. Prior experience with either fMRI or EEG/MEG methods is expected, and an interest in further applying and combining both domains in their research is highly desirable. Candidates with a background and/or interest in advanced fMRI methods are particularly encouraged to apply. The successful candidate will share our enthusiasm in problems of auditory cognition and auditory neuroscience, and ideally has already demonstrated this by contributing to the field. However, researchers with a background in visual or other neuroscience are also encouraged to apply. He or she should have a solid methods background and strong methods interest, hands-on experience in problems of data and statistical analysis, and the interest to co-supervise the PhD and Master students in the group. The position offered does not include any teaching obligations. Starting date is flexible. Salary is dependent on experience and based on MPI stipends or equivalent salary according to German Public service regulations. The research will be conducted at the MPI–CBS in Leipzig, Germany, an internationally leading centre for cognitive and imaging neuroscience equipped with a 7.0 T MRI scanner, three 3.0 T MRI scanners, a 306 channels MEG system, a TMS system and several EEG suites. All facilities are supported by experienced IT and physics staff. Our institute (just 190 km, or 70 minutes by train, south of Berlin) offers a very international environment, with English being the language spoken in the laboratory. It offers a friendly and generous environment of researchers with diverse backgrounds and with an excellent infrastructure. In order to increase the proportion of female staff members, applications from female scientists are particularly encouraged. Preference will be given to disabled persons with the same qualification. Applications should be kindly sent to personal at cbs.mpg.de using the application code “PD 03/2013” in the subject. Please send your application as a single pdf attachment, with the file name containing your surname. It should enclose a cover letter (max. 2 pages) that also specifies your future research interests; a CV; up to three representative reprints; and contact details of 2 personal references. This call remains open until the position is filled. For further details please contact Dr Jonas Obleser, Max Planck Institute for Human Cognitive and Brain Sciences, Leipzig, Germany, obleser at cbs.mpg.de http://www.cbs.mpg.de http://www.cbs.mpg.de/groups/misc/mprg-ac http://obleserlab.com From b.osuagwu.1 at research.gla.ac.uk Wed Apr 24 11:31:04 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Wed, 24 Apr 2013 10:31:04 +0100 Subject: [FieldTrip] ICA and covariance matrix for CSP In-Reply-To: References: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk>, Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202571@CMS07.campus.gla.ac.uk> Thank you Johanna for that explanation. I guess I should try out the regularization then! Thanks Bethel ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] On Behalf Of Johanna Zumer [johanna.zumer at donders.ru.nl] Sent: 23 April 2013 16:16 To: FieldTrip discussion list Subject: Re: [FieldTrip] ICA and covariance matrix for CSP Hi Bethel, Removing a component with ICA will reduce the rank (number linear independent components) of your data. The covariance matrix itself probably can be computed, but I suspect the warning you are getting is when you are computing the inverse. The inverse of a rank-deficient matrix cannot be computed (and so the warnings you get are expected). Regularisation (e.g. adding some 'noise' to the diagonal of the covariance matrix, roughly equal to the amount of estimated sensor noise) prior to inversion is the common way around this problem. In FieldTrip, this is cfg.lambda when calling ft_sourceanalysis, which you can set to a percentage, for example '5%' is common, of the trace of the covariance matrix. Best, Johanna 2013/4/23 Bethel Osuagwu > Hi Everyone, I want to ask a general mathematical question relating to ICA and common spatial pattern. Hopefully someone will help me out. I have noticed that after using ICA to remove artifact in my signal, I can no longer compute the covariance matrices needed for common spatial pattern without matlab giving me warning regarding the accuracy of the estimated matrix. Indeed the estimated matrix is not accurate. This does not happen if I use only a small subset of my channels after removing noise with ICA. If I do not use ICA at all the warning disappears. I want to ask if anybody knows why ICA causes this issue and how I can fix it. Thanks a lot. Bethel Osuagwu _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From litvak.vladimir at gmail.com Wed Apr 24 11:47:12 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 24 Apr 2013 10:47:12 +0100 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: Dear Korey, FT_READ_SPIKE function does not have anything to do with Spike2 software. It is a function for reading spike data from many formats. You could read .smr files created by Spike2 v. 5 and earlier directly into Fieldtrip using ft_preprocessing. This requires Neuroshare library that you can get from http://neuroshare.sourceforge.net/. For v. 6 and later you can export the data into .mat file from Spike 2 and those mat files can be converted into Fieldtrip. The settings should be something like the attached. Best, Vladimir On Wed, Apr 24, 2013 at 12:18 AM, Kam, Korey wrote: > Hello everyone, > > As a potential user of FT, I am interested in performing spike train and > spike-LFP analyses. My data files are in .smr (Spike2 file format). > > Therefore, my question is the following: Is there a function to import > .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no > avail. > > Thanks and this really is a great community, > > Korey > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nishiokov at gmail.com Wed Apr 24 17:26:24 2013 From: nishiokov at gmail.com (Yoshiyuki Nishio) Date: Wed, 24 Apr 2013 11:26:24 -0400 Subject: [FieldTrip] ft_databrowser with cfg.selectmode='markpeakevent'/'marktroughevent' Message-ID: Dear FieldTrippers, When I tried to identify time-points of interest on ft_databrowser with cfg.selectmode='markpeakevent' or 'marktroughevent', I got the error message below: *Attempt to reference field of non-structure array.* *Error in ft_databrowser>select_range_cb (line 960)* * if any(intersect(begsel:endsel, [opt.event.sample]))* *Error in ft_select_range>evalCallback (line 325)* * feval(funhandle, funargs{:}, val, cmenulab);* *Error in ft_select_range (line 159)* * evalCallback(callback, userData.range); * *Error using waitfor* *Error while evaluating figure WindowButtonDownFcn* * * Here's the script: cfg.viewmode = 'vertical'; cfg.blocksize = 2; cfg.continuous = 'yes'; cfg.channel = 'EEG RMFP_06-REF'; cfg.selectmode = 'marktroughevent'; cfg.trl = 'all'; cfg = ft_databrowser(cfg, data); The error never happens on the 'markaritifact' mode. Can you help me find the problem? Thanks a lot, Yoshi -------------- next part -------------- An HTML attachment was scrubbed... URL: From isabella.premoli at gmail.com Thu Apr 25 13:42:33 2013 From: isabella.premoli at gmail.com (isabella premoli) Date: Thu, 25 Apr 2013 13:42:33 +0200 Subject: [FieldTrip] Problem in importing BVA file Message-ID: Hi! I have a problem in reading .dat Brain Vision files with fieldtrip. The export parameters used in Brain Vision are: *** Generic Data Export *** File name parameter: $n_$h File extension: .dat Write header file: yes Write marker file: yes Format: ASCII Orientation: MULTIPLEXED Line Delimiter: CRLF (PC style) Add channel names: no Overwrite default decimal symbol: yes Decimal symbol: . Export all channels: yes The code in fieldtrip to read the data is: cfg= []; cfg.dataset= sprintf('%s.dat',read_data_name); cfg.trialdef.eventtype= 'Stimulus'; cfg.trialdef.eventvalue= {cond1;cond2;cond3;cond4}'; cfg.trialdef.poststim= 0.5; cfg.trialdef.prestim= 0.3; cfg = ft_definetrial(cfg); cfg.channel = {'all'}; cfg.continuous = 'no'; trl = cfg.trl; The problem is that for some subjects is working and for others not. The files are exported exactly in the same way and they undergo exactly the same steps in the Brain Vision analyzer. The error I encounter is: Error using str2num (line 33) Requires string or character array input. Error in read_brainvision_eeg (line 112) dat(line,:) = str2num(str); Error in ft_read_data (line 340) dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample, chanindx); Error in ft_preprocessing (line 503) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) Do you have any ideas on how I can fix this? Any help would be much appreciated. Cheers, Isabella -- Isabella Premoli, PhD student Department of Neurology, Tübingen University Hospital, Hoppe-Seyler-Str. 3, D-72076 Tübingen -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayelet.landau at gmail.com Thu Apr 25 14:16:36 2013 From: ayelet.landau at gmail.com (Ayelet Landau) Date: Thu, 25 Apr 2013 14:16:36 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: References: <51670147.4080803@berkeley.edu> Message-ID: Hi all, Barbara Händel and I have spent some time checking how deep this unit problem goes. I don't know if the bug control made it to this issue as of yet, but it occurs to us that this can be very easily controlled if one were to add a cfg.unit to ft_plot_mesh and ft_plot_vol. evidently, the defaults for grid and the defaults for volume seem to be different (cm for the first mm for the latter and others). When you run the two plotting commands there is no way to propagate a "common scaling" since those are separate commands. Adding the units and having a single (common) unit for the output which is plotted would deal with this problem. greetings from Frankfurt, Ayelet and Barbara On Fri, Apr 12, 2013 at 8:06 AM, Diego Lozano Soldevilla < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > >> Hi all, >> >> When I follow the code according to the example matlab script "Create >> MNI-aligned grids in individual head-space" something goes all wrong with >> the units. >> >> I've followed the code (pasted below, from the wiki), but when I make the >> figure with the template head model and dipole grid, it's wrong (see >> attached ..._problem.png). The dipole grid is tiny in the bottom of the >> head model. The black area is the dipole grid, not good. >> template_grid = >> xgrid: [1x41 double] >> ygrid: [1x41 double] >> zgrid: [1x41 double] >> dim: [41 41 41] >> pos: [68921x3 double] >> unit: 'mm' >> inside: [1x68910 double] >> outside: [758 759 760 761 799 800 801 802 843 884 925] >> cfg: [1x1 struct] >> >> It's a problem with the units, because the template grid has 'mm' in the >> unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the >> numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos >> field by 10, the grid is not tight (see attached ..._multiplied10.png). It >> looks like the unit problem messed up the determination of what's inside >> and outside. As you can see in the template_grid, there are only a few grid >> point outside, which is clearly not correct (maybe inside/outside was >> determined on wrong units?). >> >> So, it looks like a bug to me, or am I doing something wrong? I'm using >> the newest FT version. >> >> Thanks, >> Ingrid >> >> %%% CODE FROM WIKI %%% >> template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', >> filesep,'templates', filesep,'T1.nii']); >> template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the >> coordinate system >> >> % segment the template brain and construct a volume conduction model >> (i.e. head model): this is needed >> % for the inside/outside detection of voxels. >> cfg = []; >> template_seg = ft_volumesegment(cfg, template); >> >> cfg = []; >> cfg.method = 'singleshell'; >> template_vol = ft_prepare_headmodel(cfg, template_seg); >> >> % construct the dipole grid in the template brain coordinates >> % the source units are in cm >> % the negative inwardshift means an outward shift of the brain surface >> for inside/outside detection >> cfg = []; >> cfg.grid.xgrid = -20:1:20; >> cfg.grid.ygrid = -20:1:20; >> cfg.grid.zgrid = -20:1:20; >> cfg.grid.unit = 'cm'; >> cfg.grid.tight = 'yes'; >> cfg.inwardshift = -1.5; >> cfg.vol = template_vol; >> template_grid = ft_prepare_sourcemodel(cfg); >> >> % make a figure with the template head model and dipole grid >> figure >> hold on >> ft_plot_vol(template_vol); >> ft_plot_mesh(template_grid); >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Ayelet N. Landau Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Mobile: +49 (0)16 22733 110 Fax: +49 (0)69 96769 555 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Thu Apr 25 15:49:00 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Thu, 25 Apr 2013 09:49:00 -0400 Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser Message-ID: dear Fieldtrippers, i am analysing spontaneous data and have some artifacts i'd like to exlcude by visual inspection on the contiunous data. So after prepocessing the data, I use cfg=ft_databrowser(cfg,alldata) and select manually the segments with artfacts. Then i run ft_rejectartifact cleandata = ft_rejectartifact(cfg,alldata); detected 12 visual artifacts rejected 1 trials completely rejected 0 trials partially resulting 0 trials Error using ft_rejectartifact (line 478) No trials left after artifact rejection. any idea which cfg specs should i use? thanks, -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Apr 25 15:59:07 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 25 Apr 2013 15:59:07 +0200 (CEST) Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: Message-ID: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> Hi Jose, Are you analyzing continuous data? If this is the case, you should specify cfg.artfctdef.reject = 'partial' before calling ft_rejectartifact. The reason is that the default is 'complete' and if you're computing continuous data (not stimulus locked) you only have one trial and for instance nothing left after the rejection. best, Diego ----- Original Message ----- > From: "Jose Herrero" > To: "FieldTrip discussion list" > Sent: Thursday, 25 April, 2013 3:49:00 PM > Subject: [FieldTrip] using ft_rejectartifact on continuos data after > manual rejection with ft_databrowser > dear Fieldtrippers, > i am analysing spontaneous data and have some artifacts i'd like to > exlcude by visual inspection on the contiunous data. > So after prepocessing the data, I use > cfg=ft_databrowser(cfg,alldata) > and select manually the segments with artfacts. > Then i run ft_rejectartifact > cleandata = ft_rejectartifact(cfg,alldata); > detected 12 visual artifacts > rejected 1 trials completely > rejected 0 trials partially > resulting 0 trials > Error using ft_rejectartifact (line 478) > No trials left after artifact rejection. > any idea which cfg specs should i use? > thanks, > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Trigon, room 0.83 Kapittelweg 29 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands E-Mail: d.lozanosoldevilla at fcdonders.ru.nl Tel: +31-(0)24-36-66274 Web: http://www.neuosc.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From strauss.mel at gmail.com Thu Apr 25 16:05:17 2013 From: strauss.mel at gmail.com (=?ISO-8859-1?Q?M=E9lanie_Strauss?=) Date: Thu, 25 Apr 2013 16:05:17 +0200 Subject: [FieldTrip] Problem to convert files from fif to edf format Message-ID: Dear all, I have some difficulties to convert a MEG+EEG FIF file (Elekta neuromag) to EDF format. I used the following functions : cfg.dataset = DATA data = ft_preprocessing(cfg) ft_write_data(filename, data.trial{1,1},'dataformat','edf'); There is no error during the execution of the function but the converted file is empty. Has anybody any suggestion to help me? Thanks a lot, Melanie Strauss --- MD, PhD student. CEA/DSV/I2BM / NeuroSpin INSERM U992 - Cognitive Neuroimaging Unit Bât 145 - Point Courrier 156 Gif sur Yvette F-91191 FRANCE Ph: +33(0)1.69.08.22.23 <%2B33%280%29169.08.65.21> E-mail: strauss.mel at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Thu Apr 25 16:51:18 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Thu, 25 Apr 2013 10:51:18 -0400 Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> References: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: thanks so much Diego. that works just fine. it is a nice tool and, as far as i see, you can do it again if necessary [e.g. artf1=ft_databrowser(cfg,cleandata)] and artf1.artfctdef.visual.artifact will keep adding times for artifacts, correct? On Thu, Apr 25, 2013 at 9:59 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Jose, > > Are you analyzing continuous data? If this is the case, you should > specify cfg.artfctdef.reject = 'partial' before calling ft_rejectartifact. > The reason is that the default is 'complete' and if you're computing > continuous data (not stimulus locked) you only have one trial and for > instance nothing left after the rejection. > > best, > > Diego > > ------------------------------ > > *From: *"Jose Herrero" > *To: *"FieldTrip discussion list" > *Sent: *Thursday, 25 April, 2013 3:49:00 PM > *Subject: *[FieldTrip] using ft_rejectartifact on continuos data after > manual rejection with ft_databrowser > > > dear Fieldtrippers, > > i am analysing spontaneous data and have some artifacts i'd like to > exlcude by visual inspection on the contiunous data. > > So after prepocessing the data, I use > cfg=ft_databrowser(cfg,alldata) > and select manually the segments with artfacts. > > Then i run ft_rejectartifact > > cleandata = ft_rejectartifact(cfg,alldata); > detected 12 visual artifacts > rejected 1 trials completely > rejected 0 trials partially > resulting 0 trials > Error using ft_rejectartifact (line 478) > No trials left after artifact rejection. > > any idea which cfg specs should i use? > > thanks, > > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Trigon, room 0.83 > Kapittelweg 29 > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > E-Mail: d.lozanosoldevilla at fcdonders.ru.nl > Tel: +31-(0)24-36-66274 > Web: http://www.neuosc.com/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Apr 25 17:07:34 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 25 Apr 2013 17:07:34 +0200 (CEST) Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: Message-ID: <891914955.730839.1366902454784.JavaMail.root@sculptor.zimbra.ru.nl> Indeed: artf1.artfctdef.visual.artifact is a Nx2 matrix that contains the begin and the end sample that you manually select, being N the number of selected artifacts Saludos! Diego ----- Original Message ----- > From: "Jose Herrero" > To: "Diego Lozano" , > "FieldTrip discussion list" > Sent: Thursday, 25 April, 2013 4:51:18 PM > Subject: Re: [FieldTrip] using ft_rejectartifact on continuos data > after manual rejection with ft_databrowser > thanks so much Diego. that works just fine. > it is a nice tool and, as far as i see, you can do it again if > necessary > [e.g. artf1=ft_databrowser(cfg,cleandata)] and > artf1.artfctdef.visual.artifact will keep adding times for artifacts, > correct? > On Thu, Apr 25, 2013 at 9:59 AM, Lozano Soldevilla, D. (Diego) < > d.lozanosoldevilla at fcdonders.ru.nl > wrote: > > Hi Jose, > > Are you analyzing continuous data? If this is the case, you should > > specify cfg.artfctdef.reject = 'partial' before calling > > ft_rejectartifact. The reason is that the default is 'complete' and > > if > > you're computing continuous data (not stimulus locked) you only have > > one trial and for instance nothing left after the rejection. > > best, > > Diego > > > From: "Jose Herrero" < jose.herrero66 at gmail.com > > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > > Sent: Thursday, 25 April, 2013 3:49:00 PM > > > Subject: [FieldTrip] using ft_rejectartifact on continuos data > > > after > > > manual rejection with ft_databrowser > > > dear Fieldtrippers, > > > i am analysing spontaneous data and have some artifacts i'd like > > > to > > > exlcude by visual inspection on the contiunous data. > > > So after prepocessing the data, I use > > > cfg=ft_databrowser(cfg,alldata) > > > and select manually the segments with artfacts. > > > Then i run ft_rejectartifact > > > cleandata = ft_rejectartifact(cfg,alldata); > > > detected 12 visual artifacts > > > rejected 1 trials completely > > > rejected 0 trials partially > > > resulting 0 trials > > > Error using ft_rejectartifact (line 478) > > > No trials left after artifact rejection. > > > any idea which cfg specs should i use? > > > thanks, > > > -- > > > Jose L Herrero, PhD > > > Department of Psychiatry > > > Columbia University College of Physicians and Surgeons > > > Cognitive Neuroscience and Schizophrenia Program > > > Nathan S. Kline Institute for Psychiatric Research > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > > PhD Student > > Neuronal Oscillations Group > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Trigon, room 0.83 > > Kapittelweg 29 > > Radboud University Nijmegen > > NL-6525 EN Nijmegen > > The Netherlands > > E-Mail: d.lozanosoldevilla at fcdonders.ru.nl > > Tel: +31-(0)24-36-66274 > > Web: http://www.neuosc.com/ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Trigon, room 0.83 Kapittelweg 29 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands E-Mail: d.lozanosoldevilla at fcdonders.ru.nl Tel: +31-(0)24-36-66274 Web: http://www.neuosc.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From robince at gmail.com Fri Apr 26 11:11:05 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 10:11:05 +0100 Subject: [FieldTrip] filter in-memory trials data with mirroring Message-ID: Hello, Is it possible filter in-memory extracted trials data with mirroring at the edges? When I try: % filter cfg = [];cfg.lpfilter = 'yes';cfg.lpfreq = '40';cfg.lpfilttype = 'but';cfg.padtype = 'mirror';% trial length is 1.1s so mirror-pad to 1.5s (200ms each side)cfg.padding = 1.5; flt_data = ft_preprocessing(cfg, block_data); I get: Reference to non-existent field 'Fs'. Error in ft_preprocessing (line 288) padding = round(cfg.padding * data.Fs); Adding block_data.Fs = block_data.fsample; seems to work. But in the resulting data structure the time vectors no longer match the trial data, so obviously something is going wrong: >> size(block_data.time{1}) ans = 1 560 >> size(block_data.trial{1}) ans = 234 560 >> size(flt_data.trial{1}) ans = 234 560 >> size(flt_data.time{1}) ans = 1 357 Is there a correct way to do this? (Filter trials with mirrored edges) Thanks, Robin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 26 11:37:37 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 26 Apr 2013 11:37:37 +0200 Subject: [FieldTrip] filter in-memory trials data with mirroring In-Reply-To: References: Message-ID: <517A4AE1.6000507@donders.ru.nl> Hi Robin, yep, that sounds pretty much like a bug to me. Would you mind creating a bug on bugzilla for this? http://bugzilla.fcdonders.nl/ I will try to look into this next week. Thanks so far for reporting this. Best, Jörn On 4/26/2013 11:11 AM, Robin wrote: > > Hello, > > Is it possible filter in-memory extracted trials data with mirroring > at the edges? > > When I try: > > |% filter > cfg =[]; > cfg.lpfilter ='yes'; > cfg.lpfreq ='40'; > cfg.lpfilttype ='but'; > cfg.padtype ='mirror'; > % trial length is 1.1s so mirror-pad to 1.5s (200ms each side) > cfg.padding =1.5; > flt_data = ft_preprocessing(cfg, block_data);| > > I get: > > |Reference to non-existent field 'Fs'. > > Error in ft_preprocessing (line 288) > padding = round(cfg.padding * data.Fs);| > > Adding |block_data.Fs = block_data.fsample;| seems to work. But in the > resulting data structure the time vectors no longer match the trial > data, so obviously something is going wrong: > > |>> size(block_data.time{1}) > > ans = > > 1 560 > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.time{1}) > > ans = > > 1 357| > > Is there a correct way to do this? (Filter trials with mirrored edges) > > Thanks, > > Robin > > > > _______________________________________________ > 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 robince at gmail.com Fri Apr 26 11:58:56 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 10:58:56 +0100 Subject: [FieldTrip] filter in-memory trials data with mirroring In-Reply-To: <517A4AE1.6000507@donders.ru.nl> References: <517A4AE1.6000507@donders.ru.nl> Message-ID: Hi Jörn, Thanks: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2140 Cheers Robin On Fri, Apr 26, 2013 at 10:37 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Robin, > > yep, that sounds pretty much like a bug to me. Would you mind creating a > bug on bugzilla for this? > http://bugzilla.fcdonders.nl/ > I will try to look into this next week. Thanks so far for reporting this. > > Best, > Jörn > > > On 4/26/2013 11:11 AM, Robin wrote: > > Hello, > > Is it possible filter in-memory extracted trials data with mirroring at > the edges? > > When I try: > > % filter > cfg = [];cfg.lpfilter = 'yes';cfg.lpfreq = '40';cfg.lpfilttype = 'but';cfg.padtype = 'mirror';% trial length is 1.1s so mirror-pad to 1.5s (200ms each side)cfg.padding = 1.5; > flt_data = ft_preprocessing(cfg, block_data); > > I get: > > Reference to non-existent field 'Fs'. > > Error in ft_preprocessing (line 288) > padding = round(cfg.padding * data.Fs); > > Adding block_data.Fs = block_data.fsample; seems to work. But in the > resulting data structure the time vectors no longer match the trial data, > so obviously something is going wrong: > > >> size(block_data.time{1}) > > ans = > > 1 560 > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.time{1}) > > ans = > > 1 357 > > Is there a correct way to do this? (Filter trials with mirrored edges) > > Thanks, > > Robin > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 robince at gmail.com Fri Apr 26 12:19:53 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 11:19:53 +0100 Subject: [FieldTrip] not seeing expected effects of filtering Message-ID: Hello, I am having a problem with simple low-pass filtering where I am not seeing the results I would expect. I am using SVN r8075. I have a block_data structure which is the result of ft_appenddata with several runs. >> block_data block_data = hdr: [1x1 struct] label: {234x1 cell} fsample: 508.6300 trial: {1x1265 cell} time: {1x1265 cell} trialinfo: [1265x1 double] cfg: [1x1 struct] sampleinfo: [1265x2 double] >> size(block_data.trial{1}) ans = 234 560 I then run the following script to lpfilter with two different cut offs and plot the results which are attached. The output of the filter seems to be the same whatever I set lpfreq to (but it is definitely doing something). Am I do something wrong? Cheers Robin % Filtering test % filter cfg = []; cfg.lpfilter = 'yes'; cfg.lpfreq = '5'; cfg.lpfilttype = 'but'; cfg.lpfiltord = 3; flt_data_5 = ft_preprocessing(cfg, block_data); cfg = []; cfg.lpfilter = 'yes'; cfg.lpfreq = '70'; cfg.lpfilttype = 'but'; cfg.lpfiltord = 3; flt_data_70 = ft_preprocessing(cfg, block_data); %% figure subplot(131) trl = 100; chan = 200; plot(block_data.time{trl}, block_data.trial{trl}(chan,:)); title('Raw Data'); axis tight; subplot(132) plot(flt_data_5.time{trl}, flt_data_5.trial{trl}(chan,:)); title('5Hz low pass'); axis tight; subplot(133) plot(flt_data_70.time{trl}, flt_data_70.trial{trl}(chan,:)); title('70Hz low pass'); axis tight; -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: filter_problem.png Type: image/png Size: 10186 bytes Desc: not available URL: From robince at gmail.com Fri Apr 26 12:23:45 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 11:23:45 +0100 Subject: [FieldTrip] not seeing expected effects of filtering In-Reply-To: References: Message-ID: Sorry! Just noticed I had the frequencies quoted! I entered them like that without noticing as I was entering the other arguments. It's working correctly now! On Fri, Apr 26, 2013 at 11:19 AM, Robin wrote: > Hello, > > I am having a problem with simple low-pass filtering where I am not seeing > the results I would expect. I am using SVN r8075. > > I have a block_data structure which is the result of ft_appenddata with > several runs. > > >> block_data > > block_data = > > hdr: [1x1 struct] > label: {234x1 cell} > fsample: 508.6300 > trial: {1x1265 cell} > time: {1x1265 cell} > trialinfo: [1265x1 double] > cfg: [1x1 struct] > sampleinfo: [1265x2 double] > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > I then run the following script to lpfilter with two different cut offs > and plot the results which are attached. The output of the filter seems to > be the same whatever I set lpfreq to (but it is definitely doing > something). Am I do something wrong? > > Cheers > > Robin > > % Filtering test > % filter > cfg = []; > cfg.lpfilter = 'yes'; > cfg.lpfreq = '5'; > cfg.lpfilttype = 'but'; > cfg.lpfiltord = 3; > flt_data_5 = ft_preprocessing(cfg, block_data); > > > cfg = []; > cfg.lpfilter = 'yes'; > cfg.lpfreq = '70'; > cfg.lpfilttype = 'but'; > cfg.lpfiltord = 3; > flt_data_70 = ft_preprocessing(cfg, block_data); > > %% > figure > subplot(131) > trl = 100; > chan = 200; > plot(block_data.time{trl}, block_data.trial{trl}(chan,:)); > title('Raw Data'); axis tight; > subplot(132) > plot(flt_data_5.time{trl}, flt_data_5.trial{trl}(chan,:)); > title('5Hz low pass'); axis tight; > subplot(133) > plot(flt_data_70.time{trl}, flt_data_70.trial{trl}(chan,:)); > title('70Hz low pass'); axis tight; > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.noordenbos at gmail.com Fri Apr 26 15:58:40 2013 From: mark.noordenbos at gmail.com (Mark Noordenbos) Date: Fri, 26 Apr 2013 15:58:40 +0200 Subject: [FieldTrip] cluster-level statistic effect size Message-ID: Dear Fieldtrippers, When computing cluster-level statistics recent versions of Fieldtrip now also compute the SD and confidence interval of the estimated p-value for each cluster. But I was wondering if it is also possible to compute an effect size such as Cohen’s d of the observed effect. Normally, 2*t-value divided by sqrt(df) gives Cohen’s d. However, this does not work for the summed t-values in each cluster. Any suggestion how to compute an effect size for the cluster-level statistic? Best, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Fri Apr 26 16:02:06 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Fri, 26 Apr 2013 16:02:06 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From jose.herrero66 at gmail.com Fri Apr 26 16:40:59 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Fri, 26 Apr 2013 10:40:59 -0400 Subject: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact on continous data Message-ID: dear Fieldtripers, i have cleaned the continuous data manually (ft_databrowser) and then rejected artifacts (ft_rejectartifact). Now i am trying to do freq analysis on the cleaned data after segmentation (ft_redefinetrial, with cfg.length=4;cfg.overlap=0.5). I am getting the folowing warning message(see below). I don't get it if i use the original (not cleaned) continuous data. Should i be concerned? freq = ft_freqanalysis(cfg, trials); the input is raw data with 43 channels and 188 trials Warning: correcting numerical inaccuracy in the time axes > In utilities\private\warning_once at 116 In ft_datatype_raw>fixtimeaxes at 289 In ft_datatype_raw at 241 In ft_checkdata at 213 In ft_freqanalysis at 219 processing trials processing trial 188/188 nfft: 8000 samples, datalength: 8000 samples, 1 tapers thanks -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Fri Apr 26 17:18:43 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Fri, 26 Apr 2013 11:18:43 -0400 Subject: [FieldTrip] select channels using ft_connectivityanalysis and ft_connectivityplot Message-ID: Dear Fieldtripers, a quick question about ft_connectivityanalysis and ft_connectivityplot. Is there a way to select channels when the input data is not univariate? cfg.channel and cfg.partchannel do not work apperently thanks -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Fri Apr 26 17:24:17 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Fri, 26 Apr 2013 17:24:17 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From kekeliao at gmail.com Fri Apr 26 21:46:24 2013 From: kekeliao at gmail.com (liao ke) Date: Fri, 26 Apr 2013 14:46:24 -0500 Subject: [FieldTrip] design matrix for ft_freqstatistics; between subjects In-Reply-To: References: Message-ID: Hi, Kathrin, I meet similar question on comparison of ERP between two group subjects using ft_timelockstatistics and ft_timelockanalysis. One group has 12 subjects, another group has 43 subjects, and my design matrix is like design = zeros(1, 55); design(1, 1:12) = 1; design(1, 12+1:end )= 2; cfg.design = design; % design matrix cfg.ivar = 1; After I invoke ft_timelockanalysis, I use ft_timelockgrandaverage to calculate grand average with cfg.keepindividual = 'yes' . Then the following ft_timelockstatistics works well. If I use cfg.keepindividual = 'no' in ft_timelockgrandaverage , the ft_timelockstatistics has error 'the size of the design matrix does not match the number of observations in the data' in its statistics_wrapper subfunction. My question is why I should keep all trials data (cfg.keepindividual = 'yes') in ft_timelockgrandaverage ? I guess the method in ft_timelockstatistics should use subjects averaged data as sample ( average over trials data of this subject ) not use all subjects trial-based data. Am I correct? Thanks for your help. ke On Sat, Dec 1, 2012 at 9:15 AM, Kathrin Müsch wrote: > Hi Nenad, > > It's like a between trials experiment within one subject (first example of > the tutorial). Your design is correct. Remember to use independent samples > statistics because you compare two independent groups (in your case > subjects). > > cfg.statistic = 'indepsamplesT'; > cfg. design = design; > cfg.ivar = 1; > > Best, > Kathrin > > Am 01.12.2012 um 15:02 schrieb Nenad Polomac: > > > Hi everybody, > > > > I have some doubts concerning statistic in between subjects experiment. > I couldn't find explanation for this case in tutorial. > > I have two groups of subjects. And I would like to compare this two > groups for the same condition using ft_freqstatistics (cfg.correctm = > 'cluster'). I have two time frequency grand average for each group (8 > subjects in each group; cfg.keepindividual = 'yes';). I am not sure how a > design matrix for ft_freqstatistics suppose to look like > > > > I suppose: design=[1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2] > > Is this correct? > > > > Thank you in advance! > > > > Nenad > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen > Rechts; Gerichtsstand: Hamburg > > Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander > Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Fri Apr 26 22:08:36 2013 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 26 Apr 2013 22:08:36 +0200 Subject: [FieldTrip] design matrix for ft_freqstatistics; between subjects In-Reply-To: References: Message-ID: Dear Ke, A grandaverage is typically an average over subjects, not trials - seems appropriate in the case you describe. Does it make sense then? Dear Nenad, Have you taken a look at the end of [user documentation] --> [walkthrough] on the wiki? In it I've made some effort explaining the cfg.design in the statistics functions. It might need more work so if it is still unclear (or if it does help and you have a suggestion for placing a link at an appropriate place in the tutorial) it would be great to hear so I can work on making it clearer. Cheers, Stephen On 26 April 2013 21:46, liao ke wrote: > Hi, Kathrin, > > I meet similar question on comparison of ERP between two group subjects > using ft_timelockstatistics and ft_timelockanalysis. One group has 12 > subjects, another group has 43 subjects, and my design matrix is like > > design = zeros(1, 55); > design(1, 1:12) = 1; > design(1, 12+1:end )= 2; > cfg.design = design; % design matrix > cfg.ivar = 1; > > > After I invoke ft_timelockanalysis, I use ft_timelockgrandaverage to > calculate grand average with cfg.keepindividual = 'yes' . Then the following > ft_timelockstatistics works well. If I use cfg.keepindividual = 'no' in > ft_timelockgrandaverage , the ft_timelockstatistics has error 'the size of > the design matrix does not match the number of observations in the data' in > its statistics_wrapper subfunction. > > My question is why I should keep all trials data (cfg.keepindividual = > 'yes') in ft_timelockgrandaverage ? I guess the method in > ft_timelockstatistics should use subjects averaged data as sample ( average > over trials data of this subject ) not use all subjects trial-based data. Am > I correct? > > Thanks for your help. > > ke > > > On Sat, Dec 1, 2012 at 9:15 AM, Kathrin Müsch > wrote: >> >> Hi Nenad, >> >> It's like a between trials experiment within one subject (first example of >> the tutorial). Your design is correct. Remember to use independent samples >> statistics because you compare two independent groups (in your case >> subjects). >> >> cfg.statistic = 'indepsamplesT'; >> cfg. design = design; >> cfg.ivar = 1; >> >> Best, >> Kathrin >> >> Am 01.12.2012 um 15:02 schrieb Nenad Polomac: >> >> > Hi everybody, >> > >> > I have some doubts concerning statistic in between subjects experiment. >> > I couldn't find explanation for this case in tutorial. >> > I have two groups of subjects. And I would like to compare this two >> > groups for the same condition using ft_freqstatistics (cfg.correctm = >> > 'cluster'). I have two time frequency grand average for each group (8 >> > subjects in each group; cfg.keepindividual = 'yes';). I am not sure how a >> > design matrix for ft_freqstatistics suppose to look like >> > >> > I suppose: design=[1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2] >> > Is this correct? >> > >> > Thank you in advance! >> > >> > Nenad >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >> Genossenschaftsregister sowie das Unternehmensregister (EHUG): >> >> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen >> Rechts; Gerichtsstand: Hamburg >> >> Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander >> Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Sat Apr 27 13:04:21 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Sat, 27 Apr 2013 13:04:21 +0200 (CEST) Subject: [FieldTrip] cluster-level statistic effect size In-Reply-To: References: Message-ID: <002301ce4336$fc1a7390$f44f5ab0$@maris@psych.ru.nl> Dear Mark, When computing cluster-level statistics recent versions of Fieldtrip now also compute the SD and confidence interval of the estimated p-value for each cluster. But I was wondering if it is also possible to compute an effect size such as Cohen’s d of the observed effect. Normally, 2*t-value divided by sqrt(df) gives Cohen’s d. However, this does not work for the summed t-values in each cluster. Any suggestion how to compute an effect size for the cluster-level statistic? Why would you want to compute an effect size for a neuronal variable (such as an evoked response, an induced oscillation)? An effect size for a behavioral variable (such response time or accuracy), on the other hand, would definitely make sense. In cognitive neuroscience, we use neuronal variables to explain behavior; it’s not the neuronal variables that we are trying to explain. This would be more the domain of basic neuroscience. As I see it, cognitive neuroscience would be helped a lot if we could quantify the extent to which a particular neuronal variable can explain some behavioral variable. That is, we would be computing an effect size for a behavioral variable, using the neuronal variable as the explanatory (instead of to-be-explained) variable. Together with Freek van Ede and Malte Köster, I proposed a method that is able to do precisely this (Journal of Neurophysiology 108 (9), 2352-2362, http://jn.physiology.org/content/108/9/2352.short). The crucial methodological issue here is how to deal with the inherent unreliability of the measured neuronal variables. Of course, a basic neuroscientist who is trying to explain to explain the firing rate of a single neuron may very well be interested in an effect size for this firing rate which could show, for instance, that this firing rate is only very weakly determined by the presence/absence of a stimulus. Best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From lmelloni at gmail.com Mon Apr 29 02:38:57 2013 From: lmelloni at gmail.com (Lucia Melloni) Date: Sun, 28 Apr 2013 20:38:57 -0400 Subject: [FieldTrip] Only 1 and Inf as output of ft_connectivityanalysis Message-ID: Hi! I am trying to calculate coherence using ft_connectivityanalysis, but I am getting only ones and infinity as output in cohspctrm with all of my data sets. I first run ft_freqanalysis with cfg.method = 'mtmfft'; cfg.taper = 'dpss'; cfg.output = 'fourier'; cfg.foilim = [1 45]; cfg.tapsmofrq = 1; cfg.keeptrials = 'yes'; cfg.keeptapers = 'yes'; freq = ft_freqanalysis(cfg, data); Whether I do or I do not specify cfg.channel and cfg.channelcmb here does not seem to make a difference for my problem later on. The spectra look absolutely fine. I then run ft_connectivityanalysis with cfg.method = 'coh'; cfg.removemean= 'yes'; cfg.trials = 'all'; cfg.feedback = 'yes'; cfg.complex = 'abs'; coh = ft_connectivityanalysis(cfg, freq); The cohspctrm looks like this: val(:,:,1,1) = 1 Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf (etc.) I get the following warning during ft_connectivityanalysis Warning: Divide by zero. > In ft_connectivity_corr at 103 In ft_connectivityanalysis at 524 Warning: Divide by zero. > In ft_connectivity_corr at 104 In ft_connectivityanalysis at 524 The same happens if I try to calculate PLV through ft_connectivityanalysis. This is with Fieldtrip version 20130422 and 20130427, Matlab R2009a, Windows 7 (64bit). Any advice? Thanks! Lucia From joseangel.pineda at ctb.upm.es Mon Apr 29 12:31:19 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Mon, 29 Apr 2013 12:31:19 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From s.vanpelt at fcdonders.ru.nl Mon Apr 29 12:49:04 2013 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 29 Apr 2013 12:49:04 +0200 (CEST) Subject: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact on continous data In-Reply-To: Message-ID: <1824346511.946519.1367232544565.JavaMail.root@indus.zimbra.ru.nl> Dear Jose, You don't need to worry about the warning. When performing operations like redefining trials, the time axes values might change slightly (in the order of microseconds or so, don't know the exact figure), resulting in different time axes for, e.g., different channels. Nowadays, FT recognizes these time differences as being non-intended (it is very unlikely that you on purpose would want trials to start at such small different moments in time), corrects them, and outputs you the warning. So, in your case, the trials in 'trials.time' would have slightly different time values. In freq.time, these should be equal. Best, Stan ----- Oorspronkelijk bericht ----- > Van: "Jose Herrero" > Aan: "FieldTrip discussion list" > Verzonden: Vrijdag 26 april 2013 16:40:59 > Onderwerp: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact > on        continous data > dear Fieldtripers, > i have cleaned the continuous data manually (ft_databrowser) and then > rejected artifacts (ft_rejectartifact). Now i am trying to do freq > analysis on the cleaned data after segmentation (ft_redefinetrial, > with cfg.length=4;cfg.overlap=0.5). I am getting the folowing warning > message(see below). I don't get it if i use the original (not > cleaned) continuous data. Should i be concerned? > freq = ft_freqanalysis(cfg, trials); > the input is raw data with 43 channels and 188 trials > Warning: correcting numerical inaccuracy in the time axes  > > In utilities\private\warning_once at 116 >   In ft_datatype_raw>fixtimeaxes at 289 >   In ft_datatype_raw at 241 >   In ft_checkdata at 213 >   In ft_freqanalysis at 219  > processing trials > processing trial 188/188 nfft: 8000 samples, datalength: 8000 samples, > 1 tapers > thanks > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Apr 29 15:15:57 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 29 Apr 2013 15:15:57 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape In-Reply-To: References: Message-ID: José, Coregistration is a tricky thing, particularly if you start mixing results from two different software packages. I'd stick to one package, that's my recommendation, unless you really know what all individual steps are doing. Are you sure that your Aff_1 is doing what you think it is doing? E.g. does it apply to an anatomical volume with the same orientation, FOV, etc as the T1.nii? Also, I think that for any automatic registration tool you use, it is necessary to get the geometric objects in approximate alignment, which means you need to select fiducials, otherwise your algorithm will not converge to the correct solution. I usually use ft_volumerealign twice. The first time to get an approximate registration (cfg.method = 'interactive'). If you have a headsurface determined with a polhemus device, you can call ft_volumerealign a second time (with the output to the first call as the input mri), in combination with cfg.method = 'headshape', and cfg.headshape = ft_read_headshape('headshapefile.txt') Finally, I'd recommend not to re-post the same question too quickly after itself. Best wishes, Jan-Mathijs On Apr 29, 2013, at 12:31 PM, José Ángel Pineda wrote: > Dear experts, > > I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. > Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. > > So I already have one affine transformation (Aff_1) > > I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. > > Could you please give me any advice to solve this? > > Thanks > > cheers > > Jose > > > > -- > José Angel Pineda Pardo > Center of Biomedical Technology (CTB) > Parque Científico y Tecnológico de la UPM > Campus de Montegancedo > 28223 Pozuelo de Alarcón, Madrid, ES > Spam detection software, running on the system "brievenbus.science.ru.nl", has > identified this incoming email as possible spam. The original message > has been attached to this so you can view it (if it isn't spam) or label > similar future email. If you have any questions, see > postmaster at science.ru.nl for details. > > Content preview: Dear experts, I was using manual selection of the fiducials > in order to get the affine transformation of the MRI T1 image to the MEG > sensor space. Now, I have decided to use freesurfer for obtaining the head > surface and some function for performing an automatic corregistration from > head surface to fiducials (and polhemus information), in order to avoid manual > selection of the fiducials for each subject. [...] > > Content analysis details: (5.0 points, 5.0 required) > > pts rule name description > ---- ---------------------- -------------------------------------------------- > 3.9 BAYES_99 BODY: Bayesian spam probability is 99 to 100% > [score: 0.9997] > 1.6 HTML_IMAGE_ONLY_28 BODY: HTML: images with 2400-2800 bytes of words > 0.0 HTML_MESSAGE BODY: HTML included in message > -1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low > trust > [209.85.128.179 listed in list.dnswl.org] > 0.6 DC_PNG_UNO_LARGO Message contains a single large inline gif > 0.0 DC_IMAGE_SPAM_TEXT Possible Image-only spam with little text > 0.0 DC_IMAGE_SPAM_HTML Possible Image-only spam > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Mon Apr 29 15:38:36 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Mon, 29 Apr 2013 15:38:36 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape In-Reply-To: References: Message-ID: Thanks Jan, Ill try as you said. cheers Jose 2013/4/29 jan-mathijs schoffelen > José, > > Coregistration is a tricky thing, particularly if you start mixing results > from two different software packages. I'd stick to one package, that's my > recommendation, unless you really know what all individual steps are > doing. Are you sure that your Aff_1 is doing what you think it is doing? > E.g. does it apply to an anatomical volume with the same orientation, FOV, > etc as the T1.nii? > Also, I think that for any automatic registration tool you use, it is > necessary to get the geometric objects in approximate alignment, which > means you need to select fiducials, otherwise your algorithm will not > converge to the correct solution. I usually use ft_volumerealign twice. The > first time to get an approximate registration (cfg.method = 'interactive'). > If you have a headsurface determined with a polhemus device, you can call > ft_volumerealign a second time (with the output to the first call as the > input mri), in combination with cfg.method = 'headshape', and cfg.headshape > = ft_read_headshape('headshapefile.txt') > Finally, I'd recommend not to re-post the same question too quickly after > itself. > > Best wishes, > Jan-Mathijs > > > > > On Apr 29, 2013, at 12:31 PM, José Ángel Pineda wrote: > > Dear experts, > > I was using manual selection of the fiducials in order to get the affine > transformation of the MRI T1 image to the MEG sensor space. > Now, I have decided to use freesurfer for obtaining the head surface and > some function for performing an automatic corregistration from head surface > to fiducials (and polhemus information), in order to avoid manual selection > of the fiducials for each subject. > > So I already have one affine transformation (Aff_1) > > I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the > mri.transform to mri.transform*Aff_1, but when I plot the results > (ft_determine_coordsys) I got what is in the attached snapshot. > > Could you please give me any advice to solve this? > > Thanks > > cheers > > Jose > > > > > -- > José Angel Pineda Pardo > Center of Biomedical Technology (CTB) > Parque Científico y Tecnológico de la UPM > Campus de Montegancedo > 28223 Pozuelo de Alarcón, Madrid, ES > Spam detection software, running on the system "brievenbus.science.ru.nl", > has > identified this incoming email as possible spam. The original message > has been attached to this so you can view it (if it isn't spam) or label > similar future email. If you have any questions, see > postmaster at science.ru.nl for details. > > Content preview: Dear experts, I was using manual selection of the > fiducials > > in order to get the affine transformation of the MRI T1 image to the MEG > sensor space. Now, I have decided to use freesurfer for obtaining the head > surface and some function for performing an automatic corregistration > from > head surface to fiducials (and polhemus information), in order to avoid > manual > selection of the fiducials for each subject. [...] > > Content analysis details: (5.0 points, 5.0 required) > > pts rule name description > ---- ---------------------- > -------------------------------------------------- > 3.9 BAYES_99 BODY: Bayesian spam probability is 99 to 100% > [score: 0.9997] > 1.6 HTML_IMAGE_ONLY_28 BODY: HTML: images with 2400-2800 bytes of words > 0.0 HTML_MESSAGE BODY: HTML included in message > -1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, > low > trust > [209.85.128.179 listed in list.dnswl.org] > 0.6 DC_PNG_UNO_LARGO Message contains a single large inline gif > 0.0 DC_IMAGE_SPAM_TEXT Possible Image-only spam with little text > 0.0 DC_IMAGE_SPAM_HTML Possible Image-only spam > > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggonesc at upo.es Mon Apr 29 23:58:16 2013 From: ggonesc at upo.es (Gabriel Gonzalez Escamilla) Date: Mon, 29 Apr 2013 23:58:16 +0200 Subject: [FieldTrip] beggining Help Message-ID: An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Tue Apr 30 09:51:14 2013 From: zriouil.imane at gmail.com (z.imane) Date: Tue, 30 Apr 2013 09:51:14 +0200 Subject: [FieldTrip] convert dataformat for plexon.plx to plexon.nex? Message-ID: i wan't to convert my data to plexon.nex. if you need me -- Zriouil Imane -------------- next part -------------- An HTML attachment was scrubbed... URL: From mushfa.yousuf at googlemail.com Tue Apr 30 17:19:59 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Tue, 30 Apr 2013 17:19:59 +0200 Subject: [FieldTrip] Source Reconstruction using Openmeeg method Message-ID: Hello Fieldtrippers, I am doing source reconstruction using EEG channels on a fieldtrip. I have computed Forward solution i.e head model using 'Openmeeg' and lead field successfully. For the inverse solution using 'dics' method, I wrote the following syntax cfg = []; cfg.method = 'dics'; cfg.frequency = 130; cfg.elec = dataFIC12.hdr.elec; cfg.grid = grid; cfg.vol = vol; sourcePost = ft_sourceanalysis(cfg, freqPost); and I have received the following error: ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> beamformer_dics at 314 filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ==> ft_sourceanalysis at 595 dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), optarg{:}); Error in ==> newCode at 214 sourcePost = ft_sourceanalysis(cfg, freqPost); Any help would be appreciated. Regards; Mushfa Yousuf Neurozentrum, Universitätsklinikum Schleswig-Holstein, Campus Kiel (UKSH), Deutschland -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Tue Apr 30 18:23:24 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Tue, 30 Apr 2013 18:23:24 +0200 Subject: [FieldTrip] Source Reconstruction using Openmeeg method In-Reply-To: References: Message-ID: Hi Mushfa, My guess is that the channels that have you used to compute .csdspctrm are not the same as the channels in cfg.elec. If you set cfg.channel = freqPost.label, does that solve it? Cheers, Johanna 2013/4/30 Mushfa Yousuf > Hello Fieldtrippers, > > I am doing source reconstruction using EEG channels on a fieldtrip. > > I have computed Forward solution i.e head model using 'Openmeeg' and lead > field successfully. > > For the inverse solution using 'dics' method, I wrote the following syntax > > > > > > cfg = []; > cfg.method = 'dics'; > cfg.frequency = 130; > cfg.elec = dataFIC12.hdr.elec; > cfg.grid = grid; > cfg.vol = vol; > > sourcePost = ft_sourceanalysis(cfg, freqPost); > > > and I have received the following error: > > > ??? Error using ==> mtimes > Inner matrix dimensions must agree. > > Error in ==> beamformer_dics at 314 > filt = pinv(lf' * invCf * lf) * lf' * invCf; % > Gross eqn. 3, use PINV/SVD to cover rank deficient > leadfield > > Error in ==> ft_sourceanalysis at 595 > dip(i) = beamformer_dics(grid, sens, vol, [], > squeeze(Cf(i,:,:)), optarg{:}); > > Error in ==> newCode at 214 > sourcePost = ft_sourceanalysis(cfg, freqPost); > > > > > Any help would be appreciated. > > > Regards; > > > Mushfa Yousuf > > Neurozentrum, > Universitätsklinikum Schleswig-Holstein, > Campus Kiel (UKSH), Deutschland > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Apr 1 16:05:57 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 1 Apr 2013 22:05:57 +0800 Subject: [FieldTrip] How can I use DICS to get the waveforms? Message-ID: Dear all, I use DICS-beamformer to get the source,as follow: cfg = []; cfg.frequency = freqP.freq; cfg.elec = grid.cfg.elec; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = grid; cfg.vol = vol; cfg.dics.lambda = '5%';; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freqP); source = dim: [19 25 19] freq: 17.9481 cumtapcnt: 3 pos: [9025x3 double] inside: [1x4686 double] outside: [1x4339 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] source.avg pow: [1x9025 double] is it right? if I want to get the waveforms in order to do the correlation,how can I do ? thanks, best xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 2 09:32:16 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 02 Apr 2013 09:32:16 +0200 Subject: [FieldTrip] How can I use DICS to get the waveforms? In-Reply-To: References: Message-ID: <515A8980.7030503@donders.ru.nl> Dear Xiao, the DICS algorithm computes power of a certain frequency band of *one *time window (it works in the frequency domain with the cross-spectral density matrix, i.e. no time axis anymore). The source.avg.pow field contains thus the power value of this one time-frequency bin. I assume you want to get time-spectral evolution information? In that case it might be best to use the LCMV beamformer in the time-domain, extract the spatial location (voxel) of interest and apply the whatever-Fourier transform (short time, wavelet, welch, taper) on that. Please have a look at our various tutorials, for example: http://fieldtrip.fcdonders.nl/tutorial/beamformer (on DICS) http://fieldtrip.fcdonders.nl/tutorial/beamformingextended (appendix for LCMV) http://fieldtrip.fcdonders.nl/tutorial/connectivity (also includes LCMV) And here for the DICS paper: http://www.ncbi.nlm.nih.gov/pubmed/11209067 Best regards, Jörn On 4/1/2013 4:05 PM, ?? wrote: > Dear all, > I use DICS-beamformer to get the source,as follow: > cfg = []; > cfg.frequency = freqP.freq; > cfg.elec = grid.cfg.elec; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.lambda = '5%';; > cfg.dics.realfilter = 'yes'; > source = ft_sourceanalysis(cfg, freqP); > source = > > dim: [19 25 19] > freq: 17.9481 > cumtapcnt: 3 > pos: [9025x3 double] > inside: [1x4686 double] > outside: [1x4339 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > source.avg > > pow: [1x9025 double] > is it right? if I want to get the waveforms in order to do the > correlation,how can I do ? > thanks, > best > xiao > > > _______________________________________________ > 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 eelke.spaak at donders.ru.nl Tue Apr 2 09:48:30 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 2 Apr 2013 09:48:30 +0200 Subject: [FieldTrip] How can I use DICS to get the waveforms? In-Reply-To: <515A8980.7030503@donders.ru.nl> References: <515A8980.7030503@donders.ru.nl> Message-ID: Dear Xiao, In addition to Jörn's excellent tips, specifically refer to the appendix of the beamformingextended tutorial (http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space), where the steps needed to extract a waveform from a specific grid point (in this case, the peak voxel after a DICS beamformer) are explained. Best, Eelke On 2 April 2013 09:32, "Jörn M. Horschig" wrote: > Dear Xiao, > > the DICS algorithm computes power of a certain frequency band of one time > window (it works in the frequency domain with the cross-spectral density > matrix, i.e. no time axis anymore). The source.avg.pow field contains thus > the power value of this one time-frequency bin. I assume you want to get > time-spectral evolution information? In that case it might be best to use > the LCMV beamformer in the time-domain, extract the spatial location (voxel) > of interest and apply the whatever-Fourier transform (short time, wavelet, > welch, taper) on that. Please have a look at our various tutorials, for > example: > > http://fieldtrip.fcdonders.nl/tutorial/beamformer (on DICS) > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended (appendix for > LCMV) > http://fieldtrip.fcdonders.nl/tutorial/connectivity (also includes LCMV) > > And here for the DICS paper: > http://www.ncbi.nlm.nih.gov/pubmed/11209067 > > Best regards, > Jörn > > > > On 4/1/2013 4:05 PM, 陈雪 wrote: > > Dear all, > I use DICS-beamformer to get the source,as follow: > cfg = []; > cfg.frequency = freqP.freq; > cfg.elec = grid.cfg.elec; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.lambda = '5%';; > cfg.dics.realfilter = 'yes'; > source = ft_sourceanalysis(cfg, freqP); > > source = > > dim: [19 25 19] > freq: 17.9481 > cumtapcnt: 3 > pos: [9025x3 double] > inside: [1x4686 double] > outside: [1x4339 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > source.avg > > pow: [1x9025 double] > is it right? if I want to get the waveforms in order to do the > correlation,how can I do ? > > thanks, > best > xiao > > > _______________________________________________ > 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 mengtongxiao at gmail.com Wed Apr 3 10:07:27 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Wed, 3 Apr 2013 16:07:27 +0800 Subject: [FieldTrip] Help with ft_sourceanalysis ? Message-ID: Dear all, I want use ' ft_connectivityanalysis' do correlation as follow: cfg = []; cfg.method = 'lcmv'; cfg.vol = vol; cfg.grid.pos = maxpos; cfg.lcmv.fixedori='yes'; cfg.elec = data_org.hdr.elec; cfg.lcmv.keepfilter = 'yes'; source1 = ft_sourceanalysis(cfg, timelock); cfg=[]; cfg.method = 'powcorr_ortho'; stat = ft_connectivityanalysis(cfg, source1) ource1 = time: [1x102099 double] pos: [2x3 double] inside: [2x1 double] outside: [0x1 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] the error is that ??? Reference to non-existent field 'cumtapcnt'. Error in ==> ft_connectivityanalysis at 734 optarg = {'refindx', cfg.refindx, 'tapvec', data.cumtapcnt}; Is right using tne ''lcmv'' method When I do the 'powcorr_ortho'? If the method is ringht , the 'cumtapcnt'.what means and how do get it.[when I use the 'dics' method ,some error is that Reference to non-existent field 'mom'.] How should I do? thanks for your attention. best, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From K.Kalogianni at tudelft.nl Wed Apr 3 11:01:26 2013 From: K.Kalogianni at tudelft.nl (Konstantina Kalogianni) Date: Wed, 3 Apr 2013 09:01:26 +0000 Subject: [FieldTrip] FW: chop_raw cnt data into segments_&ICA Message-ID: <4DF682D3A10EAC46B462A46E16F0B0491287BC53@SRV366.tudelft.net> Dear fieldtrip users, I am new to fieldtrip and I have the following issue regarding preprocessing of EEG and ICA. I want to: 1. import my .cnt data 2. chop my file to 5 different files that correspond to each of my tasks 3. then take one part of my file that correspond to one of my tasks and filter, demean, rerefernce, resample raw data 4. ICA raw data 5. Then define epochs 6. & then proceed with the rest of the analysis One of my tasks has repetitive triggers with the code 1 So I want to take only the part of my raw data that corresponds to this task(including some ms before the first trigger and some after ) and then at a later stage epoch my data. Should I create one trial_fun that chop my data to 5 datasets corresponding to each task, then call ft_definetrial, then preprocess the data, ICA them and then call again the ft_defientrial with another trial_fun to chop my data into epochs? Is that even possible ? The way I try to do it now is : first define trial with : cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = '1' cfg.trialdef.prestim = 0.005; % in seconds cfg.trialdef.poststim = 0.01; % in seconds cfg1 = ft_definetrial(cfg); Then I call ft_preprocessing(cfg); with cfg.continuous = 'yes'; to make sure that when I ll perform ICA it will be on continuous data. and then when I run ICA it produces an expected error that I cannot run ICA on epoched data (it needs raw). So I have to epoch after the ICA, but how should I select the part that only corresponds to one of my tasks? Thank you for your time. Best, Nadia -------------- next part -------------- An HTML attachment was scrubbed... URL: From kai.hwang at gmail.com Wed Apr 3 15:32:56 2013 From: kai.hwang at gmail.com (Kai Hwang) Date: Wed, 3 Apr 2013 09:32:56 -0400 Subject: [FieldTrip] Postdoctoral position in developmental cognitive neuroscience (Pittsburgh) Message-ID: Postdoctoral Position**** Laboratory of Neurocognitive Development**** Department of Psychiatry**** University of Pittsburgh, Pennsylvania**** Principal investigator: Bea Luna, Ph.D. Applicants are invited for a funded postdoctoral position at the University of Pittsburgh investigating cognitive development using a multimodal neuroimaging approach combining fMRI, DTI, MEG, and behavioral testing. We are looking for exceptional Ph.D. researchers with prior experience in MEG/EEG methodology and neuroimaging data analyses. Inherent interest in developmental cognitive neuroscience is a plus. Potential projects will involve investigating the development of functional brain networks supporting cognitive control and/or cognitive-affect interactions during adolescence. Applicants should be willing to commit to a minimum two year appointment. Applicants will be reviewed on an on-going basis until the position is filled. Applicants should send a CV, statement of research interest and contact information of three referees to Dr. Bea Luna (lunab at upmc.edu). -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Wed Apr 3 17:14:18 2013 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Wed, 3 Apr 2013 11:14:18 -0400 Subject: [FieldTrip] preprocessing cfg.trials Message-ID: Dear Fieldstripers: I used to use the ft_preprocessing (fieldtrip-20120521) function to sort my data (eg. sort the trials in terms of response time). In a newest version I downloaded a couples of weeks ago I can't do it anymore. Question: there is another function which was implemented to do this, or is a bug of the preprocessing function? or it's me? In simple terms, in the older version, the cfg.trials input preserved the order of the trials provided, now is not working, and just select the trials but keep the original sequence of trials. Thanks a lot! Best Y -------------- next part -------------- An HTML attachment was scrubbed... URL: From munsif.jatoi at gmail.com Thu Apr 4 12:01:02 2013 From: munsif.jatoi at gmail.com (Munsif Jatoi) Date: Thu, 4 Apr 2013 03:01:02 -0700 Subject: [FieldTrip] Help in code Message-ID: Dear Sir/Madam, I hope you are fine. Sir, I am doing PhD in EEG Source localization using FEM. I was using the codes available at your website for implementation of head model using FEM. I have written following program in MATLAB: *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip');* *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip\utilities');* *addpath('C:\Users\Munsif\Desktop\Data From Laptop\fieldtrip\external\freesurfer');* *addpath('C:\Users\Munsif\Desktop\Kelantan Dr. Bornot\fieldtrip\external\simbio');* *mri = ft_read_mri('G:\tutorial_fieldtrip\Subject01\Subject01.mri');* * * *% reslice* *cfg = [];* *cfg.dim = mri.dim;* *mri = ft_volumereslice(cfg,mri);* * * *% segmentation* *cfg = [];* *cfg.output = {'gray','white','csf','skull','scalp'};* *segmentedmri = ft_volumesegment(cfg, mri);* * * *% mesh* *cfg=[];* *cfg.method = 'hexahedral';* *mesh = ft_prepare_mesh(cfg,segmentedmri);* * * *% simbio* *cfg = [];* *cfg.method ='simbio';* *cfg.conductivity = [0.1 0.2 0.3 0.4 0.5]; % order follows tissuelabel in vol* *vol = ft_prepare_headmodel(cfg, segmentedmri);* * * when I run this programme by using MATLAB with Fieldtrip, There were some errors stating that a file tp5084846f_e0f2_4004_9e7c_8_6fe72f5707.v which is mesh file is missing. Upon investigation, I come to know that SIMBIO which is used for FEM implementation is missing form Fieldtrip package. Therefore, it is requested in your kind honor to please guide me in this regard as I am working on Fieldtrip these days and need your urgent help. I hope you will send me positive and helpful response. -- Munsif Ali H.Jatoi, Ph D Scholar, Centre for Intelligent Signals and Imaging Research, Universiti Teknologi PETRONAS, Malaysia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.brovelli at univ-amu.fr Thu Apr 4 14:18:23 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 14:18:23 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI Message-ID: <515D6F8F.9010005@univ-amu.fr> Dear all, I used DICS and compared the quality of the beamforming using two different source spaces (3D grids): 1) MNI template space as described in http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space 2) Single subject 3D grid using anatomical MRI The number of sources in the two models is similar (approx. 3500 sources). However, the results using the MNI template are less significant. That is, the statistical analysis testing a significant increase in power post-stimulus with respect to baseline give higher p-values (in some region of interest). Questions: Does anyone know why ? Is the use of the MNI template the only (and best) way to allow statistical analysis across subjects in the source space ? thanks a lot Andrea -- From eelke.spaak at donders.ru.nl Thu Apr 4 14:18:59 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 4 Apr 2013 14:18:59 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? Message-ID: Dear FieldTrippers, I am trying to do source reconstruction, but am encountering two weird things in my pipeline related to anatomy. It could be that everything is OK, but I am worried I might have introduced a left/right flip somewhere. To read in my (dicom) MRI, I use: % read the mri fprintf('loading mri for subject %d...\n', subjects(k).id); mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); and then I mark the fiducials as follows: % align to fiducials in CTF coordsys cfg = []; cfg.coordsys = 'ctf'; cfg.method = 'interactive'; cfg.clim = [0 800]; mri = ft_volumerealign(cfg, mri); In attachment ft_volumerealign.png I show the plot that comes up. Although the position of the different slices is not what I usually expect, this should all still be fine, right? The yellow crosshair is in the right fiducial location, as evidenced by the white blob below the ear (which is always on the right hand side during MRI acquisition). After marking r, l and n (and quitting with 'q') I do: % reslice to make everything right-side up mri = ft_volumereslice([], mri); In attachment ft_sourceplot-1.png I show output of ft_sourceplot([],mri) after this step. Note that the positions of the axial/coronal/sagittal slices are not what one would typically expect. Also note (and this is problem 1) that the right hand side of the anatomy is displayed on the right hand side in the bottom (axial) slice, but on the left hand side in the top right (coronal) slice. Initially I thought this was just a benign visualisation issue (analogous to http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), but it might be a real problem after all, because of what I found next. After these steps, I proceed to do segmentation and I create a headmodel: cfg = []; cfg.coordsys = 'ctf'; mri = ft_volumesegment(cfg, mri); % make single shell model cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, mri); As outlined in the beamformingextended tutorial, I create a subject-specific source model which I inverse-warp to MNI: % load template sourcemodel (grid) in mni space template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); % warp the grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template.sourcemodel; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; sourcemodel = ft_prepare_sourcemodel(cfg); (See attachment grid-hdm-grad.png for a plot of all three geometrical objects superimposed. Looks fine to me.) Then I create a leadfield: cfg = []; cfg.grid = sourcemodel; cfg.vol = headmodel; cfg.channel = {'MEG'}; cfg.grad = data.grad; leadfield = ft_prepare_leadfield(cfg, data); The next step, which is the one which alerted me to the potential problem in the steps above, is to do an LCMV beamformer on a small time window of my ERF: % compute ERF covariance in small window cfg = []; cfg.covariance = 'yes'; cfg.covariancewindow = [1.5 1.55]; tl_right = ft_timelockanalysis(cfg, rightErf); % do beamforming cfg = []; cfg.method = 'lcmv'; cfg.grid = leadfield; cfg.vol = headmodel; cfg.lcmv.lambda = '5%'; cfg.lcmv.projectnoise = 'yes'; cfg.lcmv.keepfilter = 'yes'; sourceRight = ft_sourceanalysis(cfg, tl_right); % normalise with noise sourceRightNAI = sourceRight; sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; % copy over pos and dim from template sourceRight.pos = template.sourcemodel.pos; sourceRight.dim = template.sourcemodel.dim; sourceRightNAI.pos = template.sourcemodel.pos; sourceRightNAI.dim = template.sourcemodel.dim; % interpolate onto template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.pow'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); % plot cfg = []; cfg.funparameter = 'avg.pow'; cfg.method = 'ortho'; cfg.location = 'max'; cfg.coordsys = 'mni'; ft_sourceplot(cfg, sourceRightNAI_int); The output of the above step is shown in ft_sourceplot-2.png. Note that there clearly is a maximum in the posterior right hemisphere. Now compare this to when I just plot the sensor-level ERF for the same time interval: c2=[]; c2.layout='CTF275.lay'; c2.xlim = [1.5 1.55]; figure;ft_topoplotER(c2,rightErf); (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me as if there should be a dipole in the left hemisphere. (That's problem 2.) Now of course I know that interpreting axial gradient data by eye is difficult, but this left-side increase is present in the majority of my subjects, yet the resulting LCMV maximum always ends up in the right hemisphere. Therefore my question: am I doing something wrong in my anatomical pipeline, causing a left-right flip? An indication that this might be the case is the weird display in ft_sourceplot after my ft_volumereslice step. Or is it really possible that for many subjects, a left-sided sensor topography ends up in the right hemisphere after beamforming? (My intuitions on this are not very strong.) Apologies for the lengthy e-mail. I thought it wise to provide all possible details :) Hopefully someone can help me! Best, Eelke -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot-1.png Type: image/png Size: 89562 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_volumerealign.png Type: image/png Size: 154439 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot-2.png Type: image/png Size: 36589 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_topoplotER.png Type: image/png Size: 20860 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grid-hdm-grad.png Type: image/png Size: 49287 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Apr 4 14:38:15 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 14:38:15 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: References: Message-ID: <515D7437.3070900@donders.ru.nl> Hi Eelke, the peak is on the left, don't be fooled by what you see. Trust the numbers :) The x-coordinate that is given back is in MNI coordinates and is negative. Since in MNI space, the x-axis goes to the right, this means that you are at the left side of the brain. See also this awesome appendix of an even greater tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space (scroll down til 'We will now determine the positions on which...') :) Greetings Jörn On 4/4/2013 2:18 PM, Eelke Spaak wrote: > Dear FieldTrippers, > > I am trying to do source reconstruction, but am encountering two weird > things in my pipeline related to anatomy. It could be that everything > is OK, but I am worried I might have introduced a left/right flip > somewhere. > > To read in my (dicom) MRI, I use: > > % read the mri > fprintf('loading mri for subject %d...\n', subjects(k).id); > mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); > > and then I mark the fiducials as follows: > > % align to fiducials in CTF coordsys > cfg = []; > cfg.coordsys = 'ctf'; > cfg.method = 'interactive'; > cfg.clim = [0 800]; > mri = ft_volumerealign(cfg, mri); > > In attachment ft_volumerealign.png I show the plot that comes up. > Although the position of the different slices is not what I usually > expect, this should all still be fine, right? The yellow crosshair is > in the right fiducial location, as evidenced by the white blob below > the ear (which is always on the right hand side during MRI > acquisition). > > After marking r, l and n (and quitting with 'q') I do: > > % reslice to make everything right-side up > mri = ft_volumereslice([], mri); > > In attachment ft_sourceplot-1.png I show output of > ft_sourceplot([],mri) after this step. Note that the positions of the > axial/coronal/sagittal slices are not what one would typically expect. > Also note (and this is problem 1) that the right hand side of the > anatomy is displayed on the right hand side in the bottom (axial) > slice, but on the left hand side in the top right (coronal) slice. > Initially I thought this was just a benign visualisation issue > (analogous to http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), > but it might be a real problem after all, because of what I found > next. > > After these steps, I proceed to do segmentation and I create a headmodel: > > cfg = []; > cfg.coordsys = 'ctf'; > mri = ft_volumesegment(cfg, mri); > > % make single shell model > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, mri); > > As outlined in the beamformingextended tutorial, I create a > subject-specific source model which I inverse-warp to MNI: > > % load template sourcemodel (grid) in mni space > template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); > > % warp the grid > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > (See attachment grid-hdm-grad.png for a plot of all three geometrical > objects superimposed. Looks fine to me.) Then I create a leadfield: > > cfg = []; > cfg.grid = sourcemodel; > cfg.vol = headmodel; > cfg.channel = {'MEG'}; > cfg.grad = data.grad; > leadfield = ft_prepare_leadfield(cfg, data); > > The next step, which is the one which alerted me to the potential > problem in the steps above, is to do an LCMV beamformer on a small > time window of my ERF: > > % compute ERF covariance in small window > cfg = []; > cfg.covariance = 'yes'; > cfg.covariancewindow = [1.5 1.55]; > tl_right = ft_timelockanalysis(cfg, rightErf); > > % do beamforming > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = leadfield; > cfg.vol = headmodel; > cfg.lcmv.lambda = '5%'; > cfg.lcmv.projectnoise = 'yes'; > cfg.lcmv.keepfilter = 'yes'; > > sourceRight = ft_sourceanalysis(cfg, tl_right); > > % normalise with noise > sourceRightNAI = sourceRight; > sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; > > % copy over pos and dim from template > sourceRight.pos = template.sourcemodel.pos; > sourceRight.dim = template.sourcemodel.dim; > sourceRightNAI.pos = template.sourcemodel.pos; > sourceRightNAI.dim = template.sourcemodel.dim; > > % interpolate onto template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); > sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); > > % plot > cfg = []; > cfg.funparameter = 'avg.pow'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.coordsys = 'mni'; > ft_sourceplot(cfg, sourceRightNAI_int); > > The output of the above step is shown in ft_sourceplot-2.png. Note > that there clearly is a maximum in the posterior right hemisphere. Now > compare this to when I just plot the sensor-level ERF for the same > time interval: > > c2=[]; > c2.layout='CTF275.lay'; > c2.xlim = [1.5 1.55]; > figure;ft_topoplotER(c2,rightErf); > > (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me > as if there should be a dipole in the left hemisphere. (That's problem > 2.) > > Now of course I know that interpreting axial gradient data by eye is > difficult, but this left-side increase is present in the majority of > my subjects, yet the resulting LCMV maximum always ends up in the > right hemisphere. Therefore my question: am I doing something wrong in > my anatomical pipeline, causing a left-right flip? An indication that > this might be the case is the weird display in ft_sourceplot after my > ft_volumereslice step. Or is it really possible that for many > subjects, a left-sided sensor topography ends up in the right > hemisphere after beamforming? (My intuitions on this are not very > strong.) > > Apologies for the lengthy e-mail. I thought it wise to provide all > possible details :) Hopefully someone can help me! > > Best, > Eelke > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Thu Apr 4 14:50:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 14:50:33 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D6F8F.9010005@univ-amu.fr> References: <515D6F8F.9010005@univ-amu.fr> Message-ID: <515D7719.5040705@donders.ru.nl> Dear Andrea, > Questions: > > Does anyone know why ? I am not sure as you provide minimalistic insight into what you are exactly doing. If you use a single subject grid, the actual grid points for which you estimate source activity will be slightly different than when you base this on a template, so that might be one reason. Also you are probably doing monte carlo statistics, for which p-values will vary anyway for different runs (sidenote: check the newly implemented p-value confidecen interval, if they are overlapping, no need to worry). However, since you do not say how much the p-values differ, how many permutations you are running, what other parameters you choose etc., it's hard to judge whether this is something to worry about. > > Is the use of the MNI template the only (and best) way to allow > statistical analysis across subjects in the source space ? No, but I think the answer most suited to what you actually want to ask is yes. No, because you can use any other template,you can define any T1 as a template, e.g. of one of your subjects. Yes, however, because using the MNI template you know what coordinate (roughly) corresponds to what anatomical region. With a different template you would need to find a reliable way to determine an anatomical label. There is also a way to do everything on subject-specific space and only after source reconstruction warp back to the MNI template. This used to be the way before I started working on all this, so I am not exactly sure how this works. The only thing I know is that we recommend the way that you took. Another way would be to use a localizer task to anatomically localize the region of interest per subject, beam only activity of that region and run statistics only on that one region. Then there is no need to go to some template space. Hope this helps :) Best, Jörn On 4/4/2013 2:18 PM, Andrea Brovelli wrote: > Dear all, > > I used DICS and compared the quality of the beamforming using two > different source spaces (3D grids): > > 1) MNI template space as described in > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > 2) Single subject 3D grid using anatomical MRI > > The number of sources in the two models is similar (approx. 3500 > sources). However, the results using the MNI template are less > significant. That is, the statistical analysis testing a significant > increase in power post-stimulus with respect to baseline give higher > p-values (in some region of interest). > > Questions: > > Does anyone know why ? > > Is the use of the MNI template the only (and best) way to allow > statistical analysis across subjects in the source space ? > > thanks a lot > > Andrea > > > -- 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 Apr 4 14:53:40 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 4 Apr 2013 14:53:40 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: <515D7437.3070900@donders.ru.nl> References: <515D7437.3070900@donders.ru.nl> Message-ID: Awesome, thanks a lot Jörn! I didn't think to check the numbers, newbie mistake... :) Now all that's left is to find an easy way to flip the image, but I imagine that shouldn't be too hard. Or just label the axes, I guess. On 4 April 2013 14:38, "Jörn M. Horschig" wrote: > Hi Eelke, > > the peak is on the left, don't be fooled by what you see. Trust the numbers > :) > > The x-coordinate that is given back is in MNI coordinates and is negative. > Since in MNI space, the x-axis goes to the right, this means that you are at > the left side of the brain. > See also this awesome appendix of an even greater tutorial: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space > (scroll down til 'We will now determine the positions on which...') :) > > Greetings > Jörn > > > On 4/4/2013 2:18 PM, Eelke Spaak wrote: > > Dear FieldTrippers, > > I am trying to do source reconstruction, but am encountering two weird > things in my pipeline related to anatomy. It could be that everything > is OK, but I am worried I might have introduced a left/right flip > somewhere. > > To read in my (dicom) MRI, I use: > > % read the mri > fprintf('loading mri for subject %d...\n', subjects(k).id); > mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); > > and then I mark the fiducials as follows: > > % align to fiducials in CTF coordsys > cfg = []; > cfg.coordsys = 'ctf'; > cfg.method = 'interactive'; > cfg.clim = [0 800]; > mri = ft_volumerealign(cfg, mri); > > In attachment ft_volumerealign.png I show the plot that comes up. > Although the position of the different slices is not what I usually > expect, this should all still be fine, right? The yellow crosshair is > in the right fiducial location, as evidenced by the white blob below > the ear (which is always on the right hand side during MRI > acquisition). > > After marking r, l and n (and quitting with 'q') I do: > > % reslice to make everything right-side up > mri = ft_volumereslice([], mri); > > In attachment ft_sourceplot-1.png I show output of > ft_sourceplot([],mri) after this step. Note that the positions of the > axial/coronal/sagittal slices are not what one would typically expect. > Also note (and this is problem 1) that the right hand side of the > anatomy is displayed on the right hand side in the bottom (axial) > slice, but on the left hand side in the top right (coronal) slice. > Initially I thought this was just a benign visualisation issue > (analogous to > http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), > but it might be a real problem after all, because of what I found > next. > > After these steps, I proceed to do segmentation and I create a headmodel: > > cfg = []; > cfg.coordsys = 'ctf'; > mri = ft_volumesegment(cfg, mri); > > % make single shell model > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, mri); > > As outlined in the beamformingextended tutorial, I create a > subject-specific source model which I inverse-warp to MNI: > > % load template sourcemodel (grid) in mni space > template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); > > % warp the grid > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > (See attachment grid-hdm-grad.png for a plot of all three geometrical > objects superimposed. Looks fine to me.) Then I create a leadfield: > > cfg = []; > cfg.grid = sourcemodel; > cfg.vol = headmodel; > cfg.channel = {'MEG'}; > cfg.grad = data.grad; > leadfield = ft_prepare_leadfield(cfg, data); > > The next step, which is the one which alerted me to the potential > problem in the steps above, is to do an LCMV beamformer on a small > time window of my ERF: > > % compute ERF covariance in small window > cfg = []; > cfg.covariance = 'yes'; > cfg.covariancewindow = [1.5 1.55]; > tl_right = ft_timelockanalysis(cfg, rightErf); > > % do beamforming > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = leadfield; > cfg.vol = headmodel; > cfg.lcmv.lambda = '5%'; > cfg.lcmv.projectnoise = 'yes'; > cfg.lcmv.keepfilter = 'yes'; > > sourceRight = ft_sourceanalysis(cfg, tl_right); > > % normalise with noise > sourceRightNAI = sourceRight; > sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; > > % copy over pos and dim from template > sourceRight.pos = template.sourcemodel.pos; > sourceRight.dim = template.sourcemodel.dim; > sourceRightNAI.pos = template.sourcemodel.pos; > sourceRightNAI.dim = template.sourcemodel.dim; > > % interpolate onto template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); > sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); > > % plot > cfg = []; > cfg.funparameter = 'avg.pow'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.coordsys = 'mni'; > ft_sourceplot(cfg, sourceRightNAI_int); > > The output of the above step is shown in ft_sourceplot-2.png. Note > that there clearly is a maximum in the posterior right hemisphere. Now > compare this to when I just plot the sensor-level ERF for the same > time interval: > > c2=[]; > c2.layout='CTF275.lay'; > c2.xlim = [1.5 1.55]; > figure;ft_topoplotER(c2,rightErf); > > (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me > as if there should be a dipole in the left hemisphere. (That's problem > 2.) > > Now of course I know that interpreting axial gradient data by eye is > difficult, but this left-side increase is present in the majority of > my subjects, yet the resulting LCMV maximum always ends up in the > right hemisphere. Therefore my question: am I doing something wrong in > my anatomical pipeline, causing a left-right flip? An indication that > this might be the case is the weird display in ft_sourceplot after my > ft_volumereslice step. Or is it really possible that for many > subjects, a left-sided sensor topography ends up in the right > hemisphere after beamforming? (My intuitions on this are not very > strong.) > > Apologies for the lengthy e-mail. I thought it wise to provide all > possible details :) Hopefully someone can help me! > > Best, > Eelke > > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Thu Apr 4 15:13:34 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 04 Apr 2013 15:13:34 +0200 Subject: [FieldTrip] Is there an error in my anatomical pipeline? In-Reply-To: References: <515D7437.3070900@donders.ru.nl> Message-ID: <515D7C7E.7010201@donders.ru.nl> We got Adobe Photoshop at our institute ;) Actually, I think it would be good to implement a cfg.flipimage option to ft_sourceplot. However, people should only use it when they know what they are doing and not just flip because it looks nicer :) Maybe we should discuss that in the next FT meeting in two weeks. Greetings, Jörn On 4/4/2013 2:53 PM, Eelke Spaak wrote: > Awesome, thanks a lot Jörn! > > I didn't think to check the numbers, newbie mistake... :) Now all > that's left is to find an easy way to flip the image, but I imagine > that shouldn't be too hard. Or just label the axes, I guess. > > On 4 April 2013 14:38, "Jörn M. Horschig" wrote: >> Hi Eelke, >> >> the peak is on the left, don't be fooled by what you see. Trust the numbers >> :) >> >> The x-coordinate that is given back is in MNI coordinates and is negative. >> Since in MNI space, the x-axis goes to the right, this means that you are at >> the left side of the brain. >> See also this awesome appendix of an even greater tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#appendixcomputation_of_virtual_meg_channels_in_source-space >> (scroll down til 'We will now determine the positions on which...') :) >> >> Greetings >> Jörn >> >> >> On 4/4/2013 2:18 PM, Eelke Spaak wrote: >> >> Dear FieldTrippers, >> >> I am trying to do source reconstruction, but am encountering two weird >> things in my pipeline related to anatomy. It could be that everything >> is OK, but I am worried I might have introduced a left/right flip >> somewhere. >> >> To read in my (dicom) MRI, I use: >> >> % read the mri >> fprintf('loading mri for subject %d...\n', subjects(k).id); >> mri = ft_read_mri(fetchDicomFilename(subjects(k).id)); >> >> and then I mark the fiducials as follows: >> >> % align to fiducials in CTF coordsys >> cfg = []; >> cfg.coordsys = 'ctf'; >> cfg.method = 'interactive'; >> cfg.clim = [0 800]; >> mri = ft_volumerealign(cfg, mri); >> >> In attachment ft_volumerealign.png I show the plot that comes up. >> Although the position of the different slices is not what I usually >> expect, this should all still be fine, right? The yellow crosshair is >> in the right fiducial location, as evidenced by the white blob below >> the ear (which is always on the right hand side during MRI >> acquisition). >> >> After marking r, l and n (and quitting with 'q') I do: >> >> % reslice to make everything right-side up >> mri = ft_volumereslice([], mri); >> >> In attachment ft_sourceplot-1.png I show output of >> ft_sourceplot([],mri) after this step. Note that the positions of the >> axial/coronal/sagittal slices are not what one would typically expect. >> Also note (and this is problem 1) that the right hand side of the >> anatomy is displayed on the right hand side in the bottom (axial) >> slice, but on the left hand side in the top right (coronal) slice. >> Initially I thought this was just a benign visualisation issue >> (analogous to >> http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem), >> but it might be a real problem after all, because of what I found >> next. >> >> After these steps, I proceed to do segmentation and I create a headmodel: >> >> cfg = []; >> cfg.coordsys = 'ctf'; >> mri = ft_volumesegment(cfg, mri); >> >> % make single shell model >> cfg = []; >> cfg.method = 'singleshell'; >> headmodel = ft_prepare_headmodel(cfg, mri); >> >> As outlined in the beamformingextended tutorial, I create a >> subject-specific source model which I inverse-warp to MNI: >> >> % load template sourcemodel (grid) in mni space >> template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm'); >> >> % warp the grid >> cfg = []; >> cfg.grid.warpmni = 'yes'; >> cfg.grid.template = template.sourcemodel; >> cfg.grid.nonlinear = 'yes'; >> cfg.mri = mri; >> sourcemodel = ft_prepare_sourcemodel(cfg); >> >> (See attachment grid-hdm-grad.png for a plot of all three geometrical >> objects superimposed. Looks fine to me.) Then I create a leadfield: >> >> cfg = []; >> cfg.grid = sourcemodel; >> cfg.vol = headmodel; >> cfg.channel = {'MEG'}; >> cfg.grad = data.grad; >> leadfield = ft_prepare_leadfield(cfg, data); >> >> The next step, which is the one which alerted me to the potential >> problem in the steps above, is to do an LCMV beamformer on a small >> time window of my ERF: >> >> % compute ERF covariance in small window >> cfg = []; >> cfg.covariance = 'yes'; >> cfg.covariancewindow = [1.5 1.55]; >> tl_right = ft_timelockanalysis(cfg, rightErf); >> >> % do beamforming >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = leadfield; >> cfg.vol = headmodel; >> cfg.lcmv.lambda = '5%'; >> cfg.lcmv.projectnoise = 'yes'; >> cfg.lcmv.keepfilter = 'yes'; >> >> sourceRight = ft_sourceanalysis(cfg, tl_right); >> >> % normalise with noise >> sourceRightNAI = sourceRight; >> sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise; >> >> % copy over pos and dim from template >> sourceRight.pos = template.sourcemodel.pos; >> sourceRight.dim = template.sourcemodel.dim; >> sourceRightNAI.pos = template.sourcemodel.pos; >> sourceRightNAI.dim = template.sourcemodel.dim; >> >> % interpolate onto template brain >> cfg = []; >> cfg.voxelcoord = 'no'; >> cfg.parameter = 'avg.pow'; >> cfg.interpmethod = 'nearest'; >> cfg.coordsys = 'mni'; >> sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri); >> sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri); >> >> % plot >> cfg = []; >> cfg.funparameter = 'avg.pow'; >> cfg.method = 'ortho'; >> cfg.location = 'max'; >> cfg.coordsys = 'mni'; >> ft_sourceplot(cfg, sourceRightNAI_int); >> >> The output of the above step is shown in ft_sourceplot-2.png. Note >> that there clearly is a maximum in the posterior right hemisphere. Now >> compare this to when I just plot the sensor-level ERF for the same >> time interval: >> >> c2=[]; >> c2.layout='CTF275.lay'; >> c2.xlim = [1.5 1.55]; >> figure;ft_topoplotER(c2,rightErf); >> >> (See attachment ft_topoplotER.png.) The sensor-level ERF looks to me >> as if there should be a dipole in the left hemisphere. (That's problem >> 2.) >> >> Now of course I know that interpreting axial gradient data by eye is >> difficult, but this left-side increase is present in the majority of >> my subjects, yet the resulting LCMV maximum always ends up in the >> right hemisphere. Therefore my question: am I doing something wrong in >> my anatomical pipeline, causing a left-right flip? An indication that >> this might be the case is the weird display in ft_sourceplot after my >> ft_volumereslice step. Or is it really possible that for many >> subjects, a left-sided sensor topography ends up in the right >> hemisphere after beamforming? (My intuitions on this are not very >> strong.) >> >> Apologies for the lengthy e-mail. I thought it wise to provide all >> possible details :) Hopefully someone can help me! >> >> Best, >> Eelke >> >> >> >> _______________________________________________ >> 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 > _______________________________________________ > 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 smoratti at psi.ucm.es Thu Apr 4 15:43:58 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 4 Apr 2013 15:43:58 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D6F8F.9010005@univ-amu.fr> References: <515D6F8F.9010005@univ-amu.fr> Message-ID: <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> Dear Andrea, ¿Did you normalize the volume of the individuals after source reconstruction and before doing statistics? If not, this might explain the difference. 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 04/04/2013, a las 14:18, Andrea Brovelli escribió: > Dear all, > > I used DICS and compared the quality of the beamforming using two different source spaces (3D grids): > > 1) MNI template space as described in http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > 2) Single subject 3D grid using anatomical MRI > > The number of sources in the two models is similar (approx. 3500 sources). However, the results using the MNI template are less significant. That is, the statistical analysis testing a significant increase in power post-stimulus with respect to baseline give higher p-values (in some region of interest). > > Questions: > > Does anyone know why ? > > Is the use of the MNI template the only (and best) way to allow statistical analysis across subjects in the source space ? > > thanks a lot > > Andrea > > > > -- > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.brovelli at univ-amu.fr Thu Apr 4 16:14:16 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 16:14:16 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> References: <515D6F8F.9010005@univ-amu.fr> <6E6ACD03-A7AE-48E2-8D6F-3813D8A44437@psi.ucm.es> Message-ID: <515D8AB8.3080307@univ-amu.fr> Thanks for the reply. No, I did not normalise it. In fact, I find that using the normalised template (the MNI) I get less significant result... Any idea ? Thanks Le 04/04/2013 15:43, smoratti at psi.ucm.es a écrit : > If not, this might explain the difference -- From andrea.brovelli at univ-amu.fr Thu Apr 4 16:31:29 2013 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Thu, 04 Apr 2013 16:31:29 +0200 Subject: [FieldTrip] Quality of beamforming on MNI template vs single-subject MRI In-Reply-To: <515D7719.5040705@donders.ru.nl> References: <515D6F8F.9010005@univ-amu.fr> <515D7719.5040705@donders.ru.nl> Message-ID: <515D8EC1.5020809@univ-amu.fr> Thanks a lot Jorn, I 'll try out the different methods you suggested to understand better at which step I loose significance. Bye Andrea Le 04/04/2013 14:50, "Jörn M. Horschig" a écrit : > I am not sure as you provide minimalistic insight into what you are > exactly doing. If you use a single subject grid, the actual grid > points for which you estimate source activity will be slightly > different than when you base this on a template, so that might be one > reason. Also you are probably doing monte carlo statistics, for which > p-values will vary anyway for different runs (sidenote: check the > newly implemented p-value confidecen interval, if they are > overlapping, no need to worry). However, since you do not say how much > the p-values differ, how many permutations you are running, what other > parameters you choose etc., it's hard to judge whether this is > something to worry about. -- From andmib at gmail.com Thu Apr 4 17:38:41 2013 From: andmib at gmail.com (Andrew Brooks) Date: Thu, 4 Apr 2013 11:38:41 -0400 Subject: [FieldTrip] Where to access Siemens sequence code? Message-ID: Hello all, I am trying to setup a real-time fMRI pipeline using the fieldtrip gui_streamer and buffer. In the documentation, it suggests inserting three lines of code into the 'fSeqCheck' function in the sequence code in order for protocol information to be dumped to the E: drive. The facility I use has the Siemens idea license, which I believe allows for sequence code modification. Is there somebody who can direct me on how to edit sequence code? I attempted the manual text file creation method, but did not know where to find information on one of the parameters (lContrasts), so I left it to 5. However, doing that I get header errors when running any of the realtime fieldtrip scripts (the omri quality and the pipeline scripts). Sincerely, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From raminazodiaval at gmail.com Fri Apr 5 09:49:47 2013 From: raminazodiaval at gmail.com (Ramin Azodi) Date: Fri, 5 Apr 2013 09:49:47 +0200 Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' Message-ID: Hello, In case that I want just to calculate imaginary part of coherence instead of coherence with 'indepsamplesZcoh', what kind of operation should I do for that? can anybody lead me through the right way ? You can find my code as following, cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq1 = ft_freqanalysis(cfg, data1); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.complex = 'imag'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq2 = ft_freqanalysis(cfg, data2); cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesZcoh'; cfg.parameter = 'fourierspctrm'; cfg.computecritval = 'yes'; cfg.numrandomization = 500; cfg.design = [ones(size(freq1.fourierspctrm,1),1); 2*ones(size(freq2.fourierspctrm,1),1)]'; cfg.label = freq.label; stat = ft_freqstatistics(cfg, freq,freq1); Thanks in advanced for your consideration. Best Regards, Ramin Azodi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 5 16:34:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 05 Apr 2013 16:34:33 +0200 Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' In-Reply-To: References: Message-ID: <515EE0F9.8070507@donders.ru.nl> Hi Ramin, hope you are doing fine. For the imaginary part of coherence you need to call ft_connectivityanalysis with cfg.output = 'imag'. Afaik, z-scoring for the imaginary part is different from doing it for the plain coherence, so you should not use indepsamplesZcoh. You could have a look at Guido Nolte's paper on imaginary coherence and look it up in the methods section how he is computing it - similar but different from what I know how the z-scoring for coherence is computed. Thus, I am not sure how to best do cluster-based statistics on that (that means, I know how you could do it, but not what the best way to do it would be). Of course, you write an own statistics function, something like 'indepsamplesZicoh'... but that would be tons of work. Good luck! I hope anyone out there has other/better ideas :) Best, Jörn On 4/5/2013 9:49 AM, Ramin Azodi wrote: > Hello, > In case that I want just to calculate imaginary part of coherence > instead of coherence with 'indepsamplesZcoh', what kind of operation > should I do for that? can anybody lead me through the right way ? > You can find my code as following, > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.taper = 'hanning'; > cfg.foilim = [12 20]; > freq1 = ft_freqanalysis(cfg, data1); > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.complex = 'imag'; > cfg.taper = 'hanning'; > cfg.foilim = [12 20]; > freq2 = ft_freqanalysis(cfg, data2); > cfg = []; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesZcoh'; > cfg.parameter = 'fourierspctrm'; > cfg.computecritval = 'yes'; > cfg.numrandomization = 500; > cfg.design = [ones(size(freq1.fourierspctrm,1),1); > 2*ones(size(freq2.fourierspctrm,1),1)]'; > cfg.label = freq.label; > stat = ft_freqstatistics(cfg, freq,freq1); > > Thanks in advanced for your consideration. > Best Regards, > Ramin Azodi > > > > > > > > _______________________________________________ > 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 sabato45 at hotmail.com Fri Apr 5 23:56:12 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Fri, 5 Apr 2013 14:56:12 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Message-ID: Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,Ana -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sat Apr 6 17:19:07 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Sat, 6 Apr 2013 11:19:07 -0400 Subject: [FieldTrip] Fwd: [Eeglabnews] EEGLAB warning for users of Matlab 2013a In-Reply-To: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> References: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> Message-ID: Dear Fieldtrip, I've been having trouble with old but previously working scripts, trying to figure out what errors are based on new implementations in Fieldtrip and those that are due to file type ( ANT .cnt). However, I've been using Matlab 2013A - could this be a source of errors as well? Do the changes in Matlab 2013A have similar implications for Fieldtrip? See message below from Arnaud Delorme: Best, Raquel Sent from my iPhone Begin forwarded message: *From:* Arnaud Delorme *Date:* April 5, 2013, 4:09:57 PM EDT *To:* eeglabnews at sccn.ucsd.edu *Subject:* *[Eeglabnews] EEGLAB warning for users of Matlab 2013a* The MathWorks has implemented minor changes in Matlab 2013a with dramatic consequences as they could potentially break or corrupt the output of about 10% of EEGLAB functions. EEGLAB graphic interface or command line users (all versions) should not upgrade to this version of Matlab until the issues have been fixed in EEGLAB (probably within a month). Details of some of the non backward compatible changes implemented by the Mathworks are described below. Arno >From http://www.mathworks.com/help/matlab/release-notes.html The behavior of unique, union, intersect, setdiff, setxor, and ismember has changed. • If there are repeated elements in the input arrays, the functions unique, union, intersect, setdiff, and setxor return the index to the first occurrence of the repeated elements (or rows). • All index vectors returned by unique, union, intersect, setdiff, or setxor are column vectors. _______________________________________________ eeglabnews mailing list eeglabnews at sccn.ucsd.edu eeglabnews mailing list Web: http://www.sccn.ucsd.edu/eeglab/eeglabmail.html To unsubscribe: send an empty email to eeglabnews-unsub at sccn.ucsd.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From evaladez at psych.udel.edu Sat Apr 6 22:25:02 2013 From: evaladez at psych.udel.edu (Emilio Valadez) Date: Sat, 6 Apr 2013 16:25:02 -0400 Subject: [FieldTrip] Instantaneous phase angles/ baseline adjust for resting alpha activity Message-ID: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> Dear FieldTrippers, I have two independent questions that I hope are relatively simple: 1) How can one obtain the instantaneous phase angles for time-frequency data? I believe one workaround method to achieve this would be to use ft_freqanalysis on the raw data with cfg.output = 'fourier' to return the complex Fourier transform, and then use MATLAB's "angle" function on the complex output to compute the phase angles. But is there a more direct way to get the phase angles from FieldTrip? 2) Can FieldTrip be used to make a baseline adjustment for resting alpha-band activity or average alpha activity in time-frequency data? And if so, how? Thanks very much for your help, in advance. All the best, Emilio -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Sun Apr 7 17:04:25 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Sun, 7 Apr 2013 17:04:25 +0200 Subject: [FieldTrip] Instantaneous phase angles/ baseline adjust for resting alpha activity In-Reply-To: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> References: <10DBEA48DAE8BB4F8F588B1254C0D92E01B8763DFEF1@razor.psych.udel.edu> Message-ID: Dear Emilio, For (1), you can also call ft_preprocessing on raw data, with cfg.hilbert='angle' to get the instantaneous angle from the Hilbert transform. (and appropriate filter settings so that it's filtered into your frequency of interest first). For (2), does ft_freqbaseline answer your question? Cheers, Johanna 2013/4/6 Emilio Valadez > Dear FieldTrippers,**** > > ** ** > > I have two independent questions that I hope are relatively simple:**** > > ** ** > > **1) **How can one obtain the instantaneous phase angles for > time-frequency data? I believe one workaround method to achieve this would > be to use ft_freqanalysis on the raw data with cfg.output = ‘fourier’ to > return the complex Fourier transform, and then use MATLAB’s “angle” > function on the complex output to compute the phase angles. But is there a > more direct way to get the phase angles from FieldTrip?**** > > ** ** > > **2) **Can FieldTrip be used to make a baseline adjustment for > resting alpha-band activity or average alpha activity in time-frequency > data? And if so, how?**** > > ** ** > > Thanks very much for your help, in advance.**** > > ** ** > > All the best,**** > > Emilio**** > > _______________________________________________ > fieldtrip 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 Mon Apr 8 09:29:00 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 8 Apr 2013 09:29:00 +0200 Subject: [FieldTrip] Fwd: [Eeglabnews] EEGLAB warning for users of Matlab 2013a In-Reply-To: References: <24D82642-0EE9-4665-B227-46727D656295@ucsd.edu> Message-ID: Dear Raquel, Thanks for the e-mail. We're aware of these potential issues, see this entry on our bugzilla to track the progress of fixing them: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2095 Best, Eelke On 6 April 2013 17:19, Raquel Bibi wrote: > Dear Fieldtrip, > I've been having trouble with old but previously working scripts, trying to > figure out what errors are based on new implementations in Fieldtrip and > those that are due to file type ( ANT .cnt). However, I've been using > Matlab 2013A - could this be a source of errors as well? Do the changes in > Matlab 2013A have similar implications for Fieldtrip? See message below > from Arnaud Delorme: > > Best, > > Raquel > > Sent from my iPhone > > Begin forwarded message: > > From: Arnaud Delorme > Date: April 5, 2013, 4:09:57 PM EDT > To: eeglabnews at sccn.ucsd.edu > Subject: [Eeglabnews] EEGLAB warning for users of Matlab 2013a > > The MathWorks has implemented minor changes in Matlab 2013a with dramatic > consequences as they could potentially break or corrupt the output of about > 10% of EEGLAB functions. > > EEGLAB graphic interface or command line users (all versions) should not > upgrade to this version of Matlab until the issues have been fixed in EEGLAB > (probably within a month). Details of some of the non backward compatible > changes implemented by the Mathworks are described below. > > Arno > > From http://www.mathworks.com/help/matlab/release-notes.html > > > The behavior of unique, union, intersect, setdiff, setxor, and ismember has > changed. > • If there are repeated elements in the input arrays, the functions > unique, union, intersect, setdiff, and setxor return the index to the first > occurrence of the repeated elements (or rows). > • All index vectors returned by unique, union, intersect, setdiff, or > setxor are column vectors. > > > _______________________________________________ > eeglabnews mailing list eeglabnews at sccn.ucsd.edu > eeglabnews mailing list > Web: http://www.sccn.ucsd.edu/eeglab/eeglabmail.html > To unsubscribe: send an empty email to eeglabnews-unsub at sccn.ucsd.edu > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From nathanweisz at mac.com Mon Apr 8 09:48:33 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Mon, 08 Apr 2013 09:48:33 +0200 Subject: [FieldTrip] postdoc position @ cimec MEG lab Message-ID: dear all, please pass this on to potentially interested people. earliest starting date will be september (slightly later date negotiable). best, nathan ERC-funded post-doc in conscious perception research Research in the Ongoing Brain Oscillations and Behaviour Lab at the Center for Mind/Brain Sciences focuses on brain activity / connectivity patterns predisposing conscious perception. Our works mostly involves MEG, intracranial EEG and combined TMS/EEG studies. https://sites.google.com/site/obobcimec/ We are currently looking for a candidate at a Postdoc level to strengthen our team. This postdoc is expected to have solid experience with at least one of the aforementioned methods and proficiency in Matlab applied to the analysis of MEG / EEG data. The Center for Mind/Brain Sciences at the University of Trento is an oustanding work-place situated in a beautiful surrounding (e.g. Dolomites, diverse lakes; see http://www.visittrentino.it/en). It offers an international and vibrant research setting with state-of-the-art neuroimaging methodologies, including a research-only MRI scanner, MEG, EEG and TMS, as well as behavioral, eye tracking and motion tracking laboratories. The University of Trento is ranked first among research universities in Italy, and the Trentino region is consistently at the top for quality of life and for the most efficient services in Italy. English is the official language of the CIMeC, where a large proportion of the faculty, post-docs and students come from a wide range of countries outside of Italy. Interested candidates are encouraged to contact me by email at nathan.weisz at unitn.it -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Tue Apr 9 02:04:20 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 08 Apr 2013 17:04:20 -0700 Subject: [FieldTrip] source analysis EEG data without MRI Message-ID: <51635B04.7090004@berkeley.edu> Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From jm.horschig at donders.ru.nl Tue Apr 9 08:37:13 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 09 Apr 2013 08:37:13 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51635B04.7090004@berkeley.edu> References: <51635B04.7090004@berkeley.edu> Message-ID: <5163B719.7010002@donders.ru.nl> Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: /% read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit))/ Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: > Hi all, > > I'd like to do source analysis (loreta and or DICS) on my EEG data. I > don't have anatomical MRIs and I don't have a measurement of the scalp > surface. So I'd like to use a template MRI or a template head model > that is located in the FieldTrip template directory. I have EGI (128 > channels) data and electrode positions (not subject specific, just the > standard file also available in FieldTrip electrode template, > GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see > any examples on the FieldTrip page of how to make a headmodel and > volume conduction model giving only this limited data. I'd be happy to > make it into a example Matlab script on the FieldTrip page after I got > it to work. Would someone be able to give me some pointers, or example > code? > > Thanks a lot! > Ingrid > -- 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 jm.horschig at donders.ru.nl Tue Apr 9 08:57:26 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 09 Apr 2013 08:57:26 +0200 Subject: [FieldTrip] Workshop on 'How cognitive neuroscience can guide therapy' Message-ID: <5163BBD6.2040403@donders.ru.nl> Dear colleagues, We are happy to announce the workshop 'How cognitive neuroscience can guide therapy'; May 16-17, 2013 at the The Royal Netherlands Academy of Arts and Sciences (The Trippenhuis, Amsterdam). For more information and registration please see: https://www.hersenenencognitie.nl/contents/1839?locale=en Best regards, Ole Jensen, Ruud Smolders, Gojko Zaric, Jörn Horschig, Mariska van Steensel, Renate van de Ven, Jaap Murre, and Benny van der Vijgh -- 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 tzvetan.popov at uni-konstanz.de Tue Apr 9 09:32:53 2013 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 9 Apr 2013 09:32:53 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5163B719.7010002@donders.ru.nl> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> Message-ID: <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); > Hi Ingrid, > > I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: > % read in the template MRI > if isunix > mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); > elseif ispc > mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); > end > > > % segment the MRI > cfg = []; > cfg.output = {'brain' 'skull' 'scalp'}; > segmentedmri = ft_volumesegment(cfg, mris); > > > % create the headmodel (BEM) > cfg = []; > %cfg.method ='openmeeg'; % TODO FIXME download openmeeg > if isunix > cfg.method ='dipoli'; % dipoli only works under linux > else > disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); > keyboard; > end > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > elec = ft_read_sens('standard_1020.elc'); > hdm = ft_convert_units(hdm, elec.unit); > > cfg = []; > cfg.grid.xgrid = -125:8:125; > cfg.grid.ygrid = -125:8:125; > cfg.grid.zgrid = -125:8:125; > cfg.grid.tight = 'yes'; > cfg.grid.unit = hdm.unit; > cfg.inwardshift = -1.5; > cfg.vol = hdm; > grid = ft_prepare_sourcemodel(cfg) > grid = ft_convert_units(grid, elec.unit); > > figure; > hold on; > ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > ft_plot_mesh(grid.pos(grid.inside, :)); > > % this step is not necessary, cause you will see that everything is already aligned > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = hdm.bnd(1); > tmp = ft_electroderealign(cfg); > elec = tmp; % I had a bug here that I couldn't assign elec directly > > %% verify location of occipital electrodes > > occ_elec = elec; > occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); > occ_idx = match_str(elec.label, occ_chan); > occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); > occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); > occ_elec.label = occ_elec.label(occ_idx, :); > figure; > ft_plot_sens(occ_elec) > hold on; > ft_plot_vol(ft_convert_units(hdm, elec.unit)) > > > Afair, that's all that is needed. Of course you need to adjust folder and file names. > > Greetings > Jörn > > On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >> Hi all, >> >> I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? >> >> Thanks a lot! >> Ingrid >> > > > -- > 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From niccol000 at yahoo.it Tue Apr 9 10:33:17 2013 From: niccol000 at yahoo.it (=?iso-8859-1?Q?Niccol=C3=B2_Pescetelli?=) Date: Tue, 9 Apr 2013 09:33:17 +0100 (BST) Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) Message-ID: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Dear all, I am new to fieldtrip and I would like to have your opinion about a bizarre error that I find trying to execute the function ft_combineplanar(). What am I trying to do is to  obtain the planar gradient from raw data. I use a neuromag306 Elekta MEG system. I tried to dig deeper into the scripts and I notice some quirks the error could derive from: 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from 840 trials to 192 trials, without any command being provided that is BEFORE the first line of ft_combineplanar(cfg, data) being executed! At the same time all data.trials becomes empty arrays 2. my data structure does not contain the fields 'grad' before ft_combineplanar(cfg, data) has been called but it does afterwards . Again this happen without any command having been given 3. The error finally occurs in line 210 of the ft_combineplanar function (indexing error) and it's due to the data.trial array being empty What do you think? Best Nic -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Tue Apr 9 11:00:18 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 09 Apr 2013 11:00:18 +0200 Subject: [FieldTrip] postdoc @ Univ Trento (Language Interaction and Computation Lab) Message-ID: <1AB8AFEC-002D-4AD5-8C35-796BFFA2A837@mac.com> POST-DOCTORAL POSITION IN USING BRAIN DATA TO SUPPORT THE DEVELOPMENT OF EMOTIONALLY PLAUSIBLE VIRTUAL AGENTS AT CIMEC/CLIC, UNIVERSITY OF TRENTO A postdoctoral position will soon become available at the CLIC laboratory of the Center for Mind / Brain Sciences, University of Trento (http://clic.cimec.unitn.it/) starting as soon as possible from June 2013. The successful candidate will join a team of computational linguists and computational neuroscientists whose research is focused on using machine learning methods to analyze recordings of neural activity (EEG, MEG and fMRI) to gain insights about conceptual knowledge and other aspects of the cognitive models of agents involved in language use and interaction. This particular position will be in the PRESTO project, a collaboration between CIMEC, Delta Informatica, the University's Computer Science Department, and Fondazione Bruno Kessler (FBK). The objective of the project is the development of training environments based on immersion in virtual reality situations in which the trainee interacts with artificial agents (avatars). The role of the postdoc in the project will be to run experiments testing the emotional plausibility of the artificial agents, and studying the interaction between emotions and decision making in the trainees. The ideal candidate for the position is a cognitive neuroscientist with a strong research curriculum in the use of fMRI and/or EEG to study emotions and interaction. Familiarity with machine learning methods to analyze such data (eg MVPA) a plus. The fellowship has a duration of 1 year with the possibility of renewal for a second year if the results of the first year are satisfactory. The Language Interaction and Computation Lab (CLIC) is a unit of the University of Trento's Centre for Mind/Brain Sciences (CIMEC) (www.cimec.unitn.it): an interdisciplinary Centre for the research in brain and cognition including neuroscientists, psychologists, (computational) linguists, computational neuroscientists, and physicists. CLIC consists of researchers from the Departments of Computer Science and Cognitive Science carrying out research on a range of topics, including concept acquisition and information extraction from very large multi-modal corpora, combining brain data and data from corpora to study cognition, and theoretical linguistics. The official call for the position can be found at: http://www.unitn.it/en/cimec/11882/study-and-job-opportunities Deadline for the application is April 30th. For additional information please contact Massimo Poesio (massimo.poesio at unitn.it), attaching your CV. From eelke.spaak at donders.ru.nl Tue Apr 9 11:50:21 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 9 Apr 2013 11:50:21 +0200 Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: Dear Nic, That is very weird. The fact that a grad seems to be created out of thin air by ft_combineplanar suggests to me that there might be an error in your script. (However, of course it could also be a bug in fieldtrip.) Could you perhaps send a functional (small) piece of data, along with a script, that reproduces the error? Your e-mail currently does not have enough information to judge what's truly going on. If your data is >1MB, please use one of the file sharing services listed here: http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers Best, Eelke On 9 April 2013 10:33, Niccolò Pescetelli wrote: > Dear all, > > I am new to fieldtrip and I would like to have your opinion about a bizarre > error that I find trying to execute the function ft_combineplanar(). What am > I trying to do is to obtain the planar gradient from raw data. I use a > neuromag306 Elekta MEG system. > I tried to dig deeper into the scripts and I notice some quirks the error > could derive from: > > 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from > 840 trials to 192 trials, without any command being provided that is BEFORE > the first line of ft_combineplanar(cfg, data) being executed! At the same > time all data.trials becomes empty arrays > > 2. my data structure does not contain the fields 'grad' before > ft_combineplanar(cfg, data) has been called but it does afterwards . Again > this happen without any command having been given > > 3. The error finally occurs in line 210 of the ft_combineplanar function > (indexing error) and it's due to the data.trial array being empty > > What do you think? > > Best > > Nic > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Tue Apr 9 12:09:03 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 9 Apr 2013 12:09:03 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: Message-ID: <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, Ana -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Tue Apr 9 12:18:40 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 9 Apr 2013 12:18:40 +0200 (CEST) Subject: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' In-Reply-To: <515EE0F9.8070507@donders.ru.nl> References: <515EE0F9.8070507@donders.ru.nl> Message-ID: <01c501ce350b$9ca9d010$d5fd7030$@maris@psych.ru.nl> Hi Ramin and Jörn, In multiple-subject study, it is straightforward to statistically test differences in imaginary coherence using Fieldtrip. This is analogous to the statistical testing of regular coherence, which I outlined in a reply to Ana. For a single-subject study, you would have to write your own statfun. This requires some skill, but it is conceptually straightforward. Importantly, for any test statistic that you would like to use for comparing imaginary coherence, you do not(!) have to know it’s parametric reference distribution (thanks to the beauty of permutation inference (-;) Best, Eric Maris From: "Jörn M. Horschig" [mailto:jm.horschig at donders.ru.nl] Sent: vrijdag 5 april 2013 16:35 To: FieldTrip discussion list Subject: Re: [FieldTrip] Imaginary part of coherence, 'indepsamplesZcoh' Hi Ramin, hope you are doing fine. For the imaginary part of coherence you need to call ft_connectivityanalysis with cfg.output = 'imag'. Afaik, z-scoring for the imaginary part is different from doing it for the plain coherence, so you should not use indepsamplesZcoh. You could have a look at Guido Nolte's paper on imaginary coherence and look it up in the methods section how he is computing it - similar but different from what I know how the z-scoring for coherence is computed. Thus, I am not sure how to best do cluster-based statistics on that (that means, I know how you could do it, but not what the best way to do it would be). Of course, you write an own statistics function, something like 'indepsamplesZicoh'... but that would be tons of work. Good luck! I hope anyone out there has other/better ideas :) Best, Jörn On 4/5/2013 9:49 AM, Ramin Azodi wrote: Hello, In case that I want just to calculate imaginary part of coherence instead of coherence with 'indepsamplesZcoh', what kind of operation should I do for that? can anybody lead me through the right way ? You can find my code as following, cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq1 = ft_freqanalysis(cfg, data1); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.complex = 'imag'; cfg.taper = 'hanning'; cfg.foilim = [12 20]; freq2 = ft_freqanalysis(cfg, data2); cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesZcoh'; cfg.parameter = 'fourierspctrm'; cfg.computecritval = 'yes'; cfg.numrandomization = 500; cfg.design = [ones(size(freq1.fourierspctrm,1),1); 2*ones(size(freq2.fourierspctrm,1),1)]'; cfg.label = freq.label; stat = ft_freqstatistics(cfg, freq,freq1); Thanks in advanced for your consideration. Best Regards, Ramin Azodi _______________________________________________ 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 ingenieureniso at gmail.com Tue Apr 9 16:41:28 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Tue, 9 Apr 2013 16:41:28 +0200 Subject: [FieldTrip] nearest neighbour interpolation Message-ID: Hi all, Are there any suggestions how to implement the nearest neighbour interpolation? many thanks Ahmed -------------- next part -------------- An HTML attachment was scrubbed... URL: From niccol000 at yahoo.it Tue Apr 9 16:45:56 2013 From: niccol000 at yahoo.it (=?iso-8859-1?Q?Niccol=C3=B2_Pescetelli?=) Date: Tue, 9 Apr 2013 15:45:56 +0100 (BST) Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> Thank you Eelke. I found out that the problem was before calling the combine planar function. The original script read in 5 files of raw data (which I could not upload in dropbox, due to dimensions issues). These have the .grad field, but when I appenddata() the data structure looses its grad field. I managed to artificially attach it again, but I don't understand why the function ft_appenddata() does this Any idea? I will try to send you the files in a way or the other Best Nic ________________________________ Da: Eelke Spaak A: FieldTrip discussion list Inviato: Martedì 9 Aprile 2013 11:50 Oggetto: Re: [FieldTrip] Issues with ft_combineplanar(cfg, data) Dear Nic, That is very weird. The fact that a grad seems to be created out of thin air by ft_combineplanar suggests to me that there might be an error in your script. (However, of course it could also be a bug in fieldtrip.) Could you perhaps send a functional (small) piece of data, along with a script, that reproduces the error? Your e-mail currently does not have enough information to judge what's truly going on. If your data is >1MB, please use one of the file sharing services listed here: http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers Best, Eelke On 9 April 2013 10:33, Niccolò Pescetelli wrote: > Dear all, > > I am new to fieldtrip and I would like to have your opinion about a bizarre > error that I find trying to execute the function ft_combineplanar(). What am > I trying to do is to  obtain the planar gradient from raw data. I use a > neuromag306 Elekta MEG system. > I tried to dig deeper into the scripts and I notice some quirks the error > could derive from: > > 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches from > 840 trials to 192 trials, without any command being provided that is BEFORE > the first line of ft_combineplanar(cfg, data) being executed! At the same > time all data.trials becomes empty arrays > > 2. my data structure does not contain the fields 'grad' before > ft_combineplanar(cfg, data) has been called but it does afterwards . Again > this happen without any command having been given > > 3. The error finally occurs in line 210 of the ft_combineplanar function > (indexing error) and it's due to the data.trial array being empty > > What do you think? > > Best > > Nic > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 eelke.spaak at donders.ru.nl Tue Apr 9 16:58:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 9 Apr 2013 16:58:54 +0200 Subject: [FieldTrip] Issues with ft_combineplanar(cfg, data) In-Reply-To: <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> References: <1365496397.55225.YahooMailNeo@web28805.mail.ir2.yahoo.com> <1365518756.88547.YahooMailNeo@web28804.mail.ir2.yahoo.com> Message-ID: Hi Nic, Good to hear the problem has been solved. If you append multiple data sets, ft_appenddata discards gradiometer information because this might be different in the different data sets. If you are certain one particular gradiometer definition is correct for the appended data, you can simply 'artificially attach it again'. Best, Eelke On 9 April 2013 16:45, Niccolò Pescetelli wrote: > Thank you Eelke. > > I found out that the problem was before calling the combine planar function. > The original script read in 5 files of raw data (which I could not upload in > dropbox, due to dimensions issues). These have the .grad field, but when I > appenddata() the data structure looses its grad field. > > I managed to artificially attach it again, but I don't understand why the > function ft_appenddata() does this > Any idea? > > I will try to send you the files in a way or the other > > Best > > Nic > > > > ________________________________ > Da: Eelke Spaak > A: FieldTrip discussion list > Inviato: Martedì 9 Aprile 2013 11:50 > Oggetto: Re: [FieldTrip] Issues with ft_combineplanar(cfg, data) > > Dear Nic, > > That is very weird. The fact that a grad seems to be created out of > thin air by ft_combineplanar suggests to me that there might be an > error in your script. (However, of course it could also be a bug in > fieldtrip.) Could you perhaps send a functional (small) piece of data, > along with a script, that reproduces the error? Your e-mail currently > does not have enough information to judge what's truly going on. If > your data is >1MB, please use one of the file sharing services listed > here: > http://fieldtrip.fcdonders.nl/faq/how_should_i_send_example_data_to_the_developers > > Best, > Eelke > > On 9 April 2013 10:33, Niccolò Pescetelli wrote: >> Dear all, >> >> I am new to fieldtrip and I would like to have your opinion about a >> bizarre >> error that I find trying to execute the function ft_combineplanar(). What >> am >> I trying to do is to obtain the planar gradient from raw data. I use a >> neuromag306 Elekta MEG system. >> I tried to dig deeper into the scripts and I notice some quirks the error >> could derive from: >> >> 1. as soon as I call ft_combineplanar(cfg, data) , data.trials switches >> from >> 840 trials to 192 trials, without any command being provided that is >> BEFORE >> the first line of ft_combineplanar(cfg, data) being executed! At the same >> time all data.trials becomes empty arrays >> >> 2. my data structure does not contain the fields 'grad' before >> ft_combineplanar(cfg, data) has been called but it does afterwards . Again >> this happen without any command having been given >> >> 3. The error finally occurs in line 210 of the ft_combineplanar function >> (indexing error) and it's due to the data.trial array being empty >> >> What do you think? >> >> Best >> >> Nic >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inieuwenhuis at berkeley.edu Tue Apr 9 18:39:26 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Tue, 09 Apr 2013 09:39:26 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> Message-ID: <5164443E.5040909@berkeley.edu> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: > Dear Ingrid, > > in addition to Jorn's approach since you don't have MR and digitized > elec position's you can load and realign the electrodes to the > standard bem. Subsequently you can calculate the lead field and > continue with your analysis pipeline. > Good luck > tzvetan > %% read electrodes > elec = ft_read_sens('/your > path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); > %% read headmodel > templateheadmodel = '/your > path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; > load(templateheadmodel); > %% electrode realign as good as possible > % i.e. translate 0 -2 1.5 > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = vol.bnd(1).pnt; > elecR = ft_electroderealign(cfg); > %% verify how the electrodes fit toghether with the brain volume > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elecR; > cfg.headshape = vol.bnd(3).pnt; > elecR = ft_electroderealign(cfg); > > >> Hi Ingrid, >> >> I just happen to done this a few weeks back, I changed things in the >> meanwhile, but I hope that the below steps are complete: >> /% read in the template MRI >> if isunix >> mri = >> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >> elseif ispc >> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >> 'external', 'spm8', 'templates', 'T1.nii')); >> end >> >> >> % segment the MRI >> cfg = []; >> cfg.output = {'brain' 'skull' 'scalp'}; >> segmentedmri = ft_volumesegment(cfg, mris); >> >> >> % create the headmodel (BEM) >> cfg = []; >> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >> if isunix >> cfg.method ='dipoli'; % dipoli only works under linux >> else >> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >> keyboard; >> end >> hdm = ft_prepare_headmodel(cfg, segmentedmri); >> >> elec = ft_read_sens('standard_1020.elc'); >> hdm = ft_convert_units(hdm, elec.unit); >> >> cfg = []; >> cfg.grid.xgrid = -125:8:125; >> cfg.grid.ygrid = -125:8:125; >> cfg.grid.zgrid = -125:8:125; >> cfg.grid.tight = 'yes'; >> cfg.grid.unit = hdm.unit; >> cfg.inwardshift = -1.5; >> cfg.vol = hdm; >> grid = ft_prepare_sourcemodel(cfg) >> grid = ft_convert_units(grid, elec.unit); >> >> figure; >> hold on; >> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, >> 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> ft_plot_mesh(grid.pos(grid.inside, :)); >> >> % this step is not necessary, cause you will see that everything is >> already aligned >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = hdm.bnd(1); >> tmp = ft_electroderealign(cfg); >> elec = tmp; % I had a bug here that I couldn't assign elec directly >> >> %% verify location of occipital electrodes >> >> occ_elec = elec; >> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >> occ_idx = match_str(elec.label, occ_chan); >> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >> occ_elec.label = occ_elec.label(occ_idx, :); >> figure; >> ft_plot_sens(occ_elec) >> hold on; >> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >> >> >> Afair, that's all that is needed. Of course you need to adjust folder >> and file names. >> >> Greetings >> Jörn >> >> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>> Hi all, >>> >>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>> I don't have anatomical MRIs and I don't have a measurement of the >>> scalp surface. So I'd like to use a template MRI or a template head >>> model that is located in the FieldTrip template directory. I have >>> EGI (128 channels) data and electrode positions (not subject >>> specific, just the standard file also available in FieldTrip >>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how >>> to start. I don't see any examples on the FieldTrip page of how to >>> make a headmodel and volume conduction model giving only this >>> limited data. I'd be happy to make it into a example Matlab script >>> on the FieldTrip page after I got it to work. Would someone be able >>> to give me some pointers, or example code? >>> >>> Thanks a lot! >>> Ingrid >>> >> >> >> -- >> 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 > > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > > ******************************************* > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sabato45 at hotmail.com Tue Apr 9 19:57:23 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Tue, 9 Apr 2013 10:57:23 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> References: , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Message-ID: Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,Ana _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From akiko.ikkai at gmail.com Wed Apr 10 00:32:44 2013 From: akiko.ikkai at gmail.com (Akiko Ikkai) Date: Tue, 9 Apr 2013 18:32:44 -0400 Subject: [FieldTrip] classification with 3 conditions? Message-ID: Hi, I have a 3 conditions, A, B, and C in my MEG data. Multivariate classification using selected sensors between conditions A and B, B and C, and A and C work beautifully with chance = 50%. I'm now curious whether I could run a classification of 3 conditions with chance = 33%. ft_freqstatistics could take more than 2 frequency datasets as inputs, but ft_statistics_crossvalidate using +dmlt/svm.m seems to require 2 datasets (because it's using a linear kernel?). Does anyone have suggestions how I might go about it...? Thanks in advance! Akiko -- Akiko Ikkai, Ph.D. Postdoctoral Fellow Department of Psychological and Brain Sciences Johns Hopkins University Ames Hall, 3400 N. Charles St. Baltimore, MD 21218 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Wed Apr 10 01:29:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Tue, 09 Apr 2013 16:29:31 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5164443E.5040909@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu> Message-ID: <5164A45B.1060502@berkeley.edu> Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using thestandard_bem.mat . (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? *So my question is:* a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: > Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on > the wiki. > Have a great day, > Ingrid > > On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >> Dear Ingrid, >> >> in addition to Jorn's approach since you don't have MR and digitized >> elec position's you can load and realign the electrodes to the >> standard bem. Subsequently you can calculate the lead field and >> continue with your analysis pipeline. >> Good luck >> tzvetan >> %% read electrodes >> elec = ft_read_sens('/your >> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >> %% read headmodel >> templateheadmodel = '/your >> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >> load(templateheadmodel); >> %% electrode realign as good as possible >> % i.e. translate 0 -2 1.5 >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = vol.bnd(1).pnt; >> elecR = ft_electroderealign(cfg); >> %% verify how the electrodes fit toghether with the brain volume >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elecR; >> cfg.headshape = vol.bnd(3).pnt; >> elecR = ft_electroderealign(cfg); >> >> >>> Hi Ingrid, >>> >>> I just happen to done this a few weeks back, I changed things in the >>> meanwhile, but I hope that the below steps are complete: >>> /% read in the template MRI >>> if isunix >>> mri = >>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>> elseif ispc >>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>> 'external', 'spm8', 'templates', 'T1.nii')); >>> end >>> >>> >>> % segment the MRI >>> cfg = []; >>> cfg.output = {'brain' 'skull' 'scalp'}; >>> segmentedmri = ft_volumesegment(cfg, mris); >>> >>> >>> % create the headmodel (BEM) >>> cfg = []; >>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>> if isunix >>> cfg.method ='dipoli'; % dipoli only works under linux >>> else >>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>> keyboard; >>> end >>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> elec = ft_read_sens('standard_1020.elc'); >>> hdm = ft_convert_units(hdm, elec.unit); >>> >>> cfg = []; >>> cfg.grid.xgrid = -125:8:125; >>> cfg.grid.ygrid = -125:8:125; >>> cfg.grid.zgrid = -125:8:125; >>> cfg.grid.tight = 'yes'; >>> cfg.grid.unit = hdm.unit; >>> cfg.inwardshift = -1.5; >>> cfg.vol = hdm; >>> grid = ft_prepare_sourcemodel(cfg) >>> grid = ft_convert_units(grid, elec.unit); >>> >>> figure; >>> hold on; >>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>> ft_plot_mesh(grid.pos(grid.inside, :)); >>> >>> % this step is not necessary, cause you will see that everything is >>> already aligned >>> cfg = []; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = hdm.bnd(1); >>> tmp = ft_electroderealign(cfg); >>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>> >>> %% verify location of occipital electrodes >>> >>> occ_elec = elec; >>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >>> occ_idx = match_str(elec.label, occ_chan); >>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>> occ_elec.label = occ_elec.label(occ_idx, :); >>> figure; >>> ft_plot_sens(occ_elec) >>> hold on; >>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>> >>> >>> Afair, that's all that is needed. Of course you need to adjust >>> folder and file names. >>> >>> Greetings >>> Jörn >>> >>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>> Hi all, >>>> >>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>> I don't have anatomical MRIs and I don't have a measurement of the >>>> scalp surface. So I'd like to use a template MRI or a template head >>>> model that is located in the FieldTrip template directory. I have >>>> EGI (128 channels) data and electrode positions (not subject >>>> specific, just the standard file also available in FieldTrip >>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>> how to start. I don't see any examples on the FieldTrip page of how >>>> to make a headmodel and volume conduction model giving only this >>>> limited data. I'd be happy to make it into a example Matlab script >>>> on the FieldTrip page after I got it to work. Would someone be able >>>> to give me some pointers, or example code? >>>> >>>> Thanks a lot! >>>> Ingrid >>>> >>> >>> >>> -- >>> 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 >> >> ******************************************* >> Tzvetan Popov >> Clinical Psychology >> University of Konstanz >> Box 23 >> 78457 Konstanz, GERMANY >> Phone: 0049-7531-883086 >> Fax: 0049-7531-884601 >> Email: tzvetan.popov at uni-konstanz.de >> >> ******************************************* >> >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: afterbemcp.png Type: image/png Size: 64338 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol3.png Type: image/png Size: 46492 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol.png Type: image/png Size: 47348 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aligned_elecR_vol2.png Type: image/png Size: 31169 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Wed Apr 10 09:06:57 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 10 Apr 2013 09:06:57 +0200 Subject: [FieldTrip] nearest neighbour interpolation In-Reply-To: References: Message-ID: <51650F90.1070900@donders.ru.nl> Dear Ahmed, I am not sure I understood your question. Please have a look here: http://fieldtrip.fcdonders.nl/reference/ft_channelrepair http://fieldtrip.fcdonders.nl/reference/ft_prepare_neighbours http://fieldtrip.fcdonders.nl/faq/how_does_ft_prepare_neighbours_work http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described?s[]=ft&s[]=channelrepair For example code for ft_prepare_neighbours, see the cluster-based permutation test tutorials, e.g.: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock#permutation_test Greetings Jörn On 4/9/2013 4:41 PM, ingenieur eniso wrote: > Hi all, > > Are there any suggestions how to implement the nearest neighbour > interpolation? > > many thanks > > Ahmed > > > _______________________________________________ > 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 e.maris at psych.ru.nl Wed Apr 10 09:21:28 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Wed, 10 Apr 2013 09:21:28 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl> Message-ID: <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris, thank you for your response. I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I have two conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulation across trials to find out whether condition 1 is different from condition 2 independently of their different number of trials. If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic. I really appreciate your help. Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, Ana _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From irina.simanova at mpi.nl Wed Apr 10 10:07:09 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Wed, 10 Apr 2013 10:07:09 +0200 Subject: [FieldTrip] classification with 3 conditions? In-Reply-To: References: Message-ID: Dear Akiko, you can use DML functions for multiclass classification: dml.one_against_one or dml.one_against_rest one_against_rest builds one SVM per class, trained to distinguish the trials in a single class from the trials in all remaining classes. Classification of a test trial is done according to the maximum output among all SVMs. one_against_one builds one SVM for each pair of classes (a pairwise comparison). Classification of a test trial is done according to the maximum voting , where each SVM votes for one class. You can see for yourself which method is better for your research question/data. You call it like this: cfg.mva = dml.one_against_rest('mva', {dml.standardizer() dml.svm()}) or cfg.mva = dml.one_against_one('mva', {dml.standardizer() dml.svm()}) best, Irina On Apr 10, 2013, at 12:32 AM 4/10/13, Akiko Ikkai wrote: > Hi, > > I have a 3 conditions, A, B, and C in my MEG data. Multivariate classification using selected sensors between conditions A and B, B and C, and A and C work beautifully with chance = 50%. I'm now curious whether I could run a classification of 3 conditions with chance = 33%. > > ft_freqstatistics could take more than 2 frequency datasets as inputs, but ft_statistics_crossvalidate using +dmlt/svm.m seems to require 2 datasets (because it's using a linear kernel?). > > Does anyone have suggestions how I might go about it...? > Thanks in advance! Akiko > > -- > Akiko Ikkai, Ph.D. > Postdoctoral Fellow > Department of Psychological and Brain Sciences > Johns Hopkins University > Ames Hall, 3400 N. Charles St. > Baltimore, MD 21218 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Wed Apr 10 11:36:48 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 10 Apr 2013 11:36:48 +0200 Subject: [FieldTrip] Bug in ft_freqcomparison.m? In-Reply-To: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> References: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> Message-ID: Hi Alex, Thanks for looking into this function. You’re right that ft_freqcomparison initializes the output structure ‘ freq’ (line 87) using the first input structure. This could indeed be problematic when the two input structures are dissimilarly sized. In fact, having a size difference in the powspctrm fields between the two input structure is an exclusion criterion for using this function in the first place, e.g. because it may result in comparing frequency powers of different channels, trials, or subjects. For that reason, a check was built in at lines 92 and 115, which ensures that the input structures have identical matrix size. Although not intuitive clear maybe from a reader’s perspective, this is thus not an issue and it will not affect your data. Also please note that ft_freqcomparison has become outdated with the arrival of ft_math. Technically, this function can do the same, but with more flexibility and better bookkeeping. Best wishes, Arjen 2013/3/13 Alexander Maye > Hi All, > > I just spotted something that could be a bug in ft_freqcomparison.m > (fieldtrip-20130312 and previous versions). Don't now if this is the place > for > report, but if this really is an issue everyone using this function may be > interested. > > The problem is in line 87 where freq = varargin{1}; is initialized to the > *first* freq argument, that according to the doc is used as the norm. So > the > output (powspctrm) has the dimension of the norm, not the second freq > argument, that one wants to become normalized. Strange, hmm? Then, in the > following for-loops the index variable runs over the size of the *second* > freq > argument, updating trials in the powspctrm with the size of the *first* > freq > argument, which seems simply wrong. > > Maybe this is an ingenious programming trick, but initializing freq = > varargin{2}; on line 87 would make more sense from my point of view. > > Best, > > ALEX. > > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen > Rechts; Gerichtsstand: Hamburg > > Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander > Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Wed Apr 10 15:38:16 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 10 Apr 2013 13:38:16 +0000 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5164A45B.1060502@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>,<5164A45B.1060502@berkeley.edu> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> Hi Ingrid, I had a similar issue a few weeks ago, where my lower most electrodes started floating after electrode realign using the ft_electroderealign function. I used the ft_prepare_vol_sens as, [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and brought the electrodes on to the skin. Hope this helps...! Regards Imali From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis [inieuwenhuis at berkeley.edu] Sent: Wednesday, 10 April 2013 9:29 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] source analysis EEG data without MRI Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using the standard_bem.mat. (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? So my question is: a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: % read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit)) Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingenieureniso at gmail.com Wed Apr 10 17:43:55 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Wed, 10 Apr 2013 17:43:55 +0200 Subject: [FieldTrip] nearest neighbour interpolation In-Reply-To: <51650F90.1070900@donders.ru.nl> References: <51650F90.1070900@donders.ru.nl> Message-ID: Dear Jörn, thank you very much for help. yes, this is what i'm looking. All the best Ahmed 2013/4/10 "Jörn M. Horschig" > Dear Ahmed, > > I am not sure I understood your question. Please have a look here: > http://fieldtrip.fcdonders.nl/reference/ft_channelrepair > > http://fieldtrip.fcdonders.nl/reference/ft_prepare_neighbours > http://fieldtrip.fcdonders.nl/faq/how_does_ft_prepare_neighbours_work > > http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described?s > []=ft&s[]=channelrepair > > For example code for ft_prepare_neighbours, see the cluster-based > permutation test tutorials, e.g.: > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock#permutation_test > > Greetings > Jörn > > > > On 4/9/2013 4:41 PM, ingenieur eniso wrote: > > Hi all, > > Are there any suggestions how to implement the nearest neighbour > interpolation? > > many thanks > > Ahmed > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 Lilla.Magyari at mpi.nl Wed Apr 10 18:05:02 2013 From: Lilla.Magyari at mpi.nl (Magyari, Lilla) Date: Wed, 10 Apr 2013 18:05:02 +0200 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> Message-ID: <51658DAE.9080207@mpi.nl> hi Ingrid and Imali, I think it is a really good question what to do in Ingrid's case. I do not know the "right" answer, but I would like to share my thoughts about it. The ft_prepare_vol_sens is indeed projects the electrode positions closer to the headsurface as Imali wrote. But this function called automatically when you create your leadfield, so you do not have to do it separately (unless you want to visualize the corrected electrode positions). However, I have been advised to rely on this projection carefully if electrode positions are far from the skin and specially, if the inaccuracies (distance from the skin) are not equally distributed across the electrodes, because that can cause a spatial bias. Therefore, my question would be: why are those electrodes so low? Are those positions reflect the actual positions of the electrodes during the measurement? If yes, I would not change their positions, I would rather try to extend my headmodel e.g. by using another template. (or another (but quite suboptimal) possibility is maybe to exclude those electrodes (and the data) from the analysis if they are anyway far from the brain.) If the position of the electrodes should be higher up on the head, then instead of relying on projection, I would try first to scale the electrodes to fit them into the headsurface with the ft_electroderealign function. I looked to the standard_bem file in the template directory, and I also load in the standard_1020.elc, and those electrodes perfectly fit the vol. So, it seems that the extension of the standard bem headsurface is suitable for the area which is covered by the those template electrodes. And I do not know if the electrode set you use should cover a larger surface of the head, or if it should be just adjusted to the given headsurface. Lilla IMALI THANUJA HETTIARACHCHI wrote: > Hi Ingrid, > > I had a similar issue a few weeks ago, where my lower most electrodes > started floating after electrode realign using the ft_electroderealign > function. > > I used the ft_prepare_vol_sens as, > [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and > brought the electrodes on to the skin. > > Hope this helps...! > > Regards > Imali > > > *From:* fieldtrip-bounces at science.ru.nl > [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis > [inieuwenhuis at berkeley.edu] > *Sent:* Wednesday, 10 April 2013 9:29 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > A follow up on this and some new issues: > > 1) I first tried Jörn's approach by creating my own BEM, always fun to > make it yourself ;) However, I did not succeed since: > a) the dipoli method does not work on Windows > b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe > has stopped working" I've emailed their buglist > c) bemcp did run, but the result was not ok (see attachement). I also > got the warning "% Warning: Matrix is singular, close to singular or > badly scaled. Results may be inaccurate." several times, so that might > be the problem. > d) and asa gave the following error: % Error using ft_prepare_headmodel > (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel > > And away went my determination to do it myself, so I continued using > thestandard_bem.mat > . > (I did not know this existed, I've added this link to note in the > headmodel tutorial > to > make it easier to find, thanks Tzvetan for pointing this out!). > > 2) This worked and after some fiddling to get the electrodes aligned it > looks okay (see attached). > However, as you can see in the figures, I have several very low > electrodes, that are lower than the skin mesh. So I was wondering if > this is a problem? Since for accurate calculation of how the currents > flow from these low electrodes, I assume one needs the skin to go till > there? What happens when I have electrodes floating in thin air? > *So my question is:* > a) will this cause great inaccuracies? > b) if so, how can I extend the skin to go lower? The template MRI only > goes that far to the bottom... Trick anyone? > > Thanks again, > Ingrid > > > On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >> the wiki. >> Have a great day, >> Ingrid >> >> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>> Dear Ingrid, >>> >>> in addition to Jorn's approach since you don't have MR and digitized >>> elec position's you can load and realign the electrodes to the >>> standard bem. Subsequently you can calculate the lead field and >>> continue with your analysis pipeline. >>> Good luck >>> tzvetan >>> %% read electrodes >>> elec = ft_read_sens('/your >>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>> %% read headmodel >>> templateheadmodel = '/your >>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>> load(templateheadmodel); >>> %% electrode realign as good as possible >>> % i.e. translate 0 -2 1.5 >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = vol.bnd(1).pnt; >>> elecR = ft_electroderealign(cfg); >>> %% verify how the electrodes fit toghether with the brain volume >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elecR; >>> cfg.headshape = vol.bnd(3).pnt; >>> elecR = ft_electroderealign(cfg); >>> >>> >>>> Hi Ingrid, >>>> >>>> I just happen to done this a few weeks back, I changed things in the >>>> meanwhile, but I hope that the below steps are complete: >>>> /% read in the template MRI >>>> if isunix >>>> mri = >>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>> elseif ispc >>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>> 'spm8', 'templates', 'T1.nii')); >>>> end >>>> >>>> >>>> % segment the MRI >>>> cfg = []; >>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>> segmentedmri = ft_volumesegment(cfg, mris); >>>> >>>> >>>> % create the headmodel (BEM) >>>> cfg = []; >>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>> if isunix >>>> cfg.method ='dipoli'; % dipoli only works under linux >>>> else >>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>> keyboard; >>>> end >>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> elec = ft_read_sens('standard_1020.elc'); >>>> hdm = ft_convert_units(hdm, elec.unit); >>>> >>>> cfg = []; >>>> cfg.grid.xgrid = -125:8:125; >>>> cfg.grid.ygrid = -125:8:125; >>>> cfg.grid.zgrid = -125:8:125; >>>> cfg.grid.tight = 'yes'; >>>> cfg.grid.unit = hdm.unit; >>>> cfg.inwardshift = -1.5; >>>> cfg.vol = hdm; >>>> grid = ft_prepare_sourcemodel(cfg) >>>> grid = ft_convert_units(grid, elec.unit); >>>> >>>> figure; >>>> hold on; >>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>> >>>> % this step is not necessary, cause you will see that everything is >>>> already aligned >>>> cfg = []; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = hdm.bnd(1); >>>> tmp = ft_electroderealign(cfg); >>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>> >>>> %% verify location of occipital electrodes >>>> >>>> occ_elec = elec; >>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); >>>> occ_idx = match_str(elec.label, occ_chan); >>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>> figure; >>>> ft_plot_sens(occ_elec) >>>> hold on; >>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>> >>>> >>>> Afair, that's all that is needed. Of course you need to adjust >>>> folder and file names. >>>> >>>> Greetings >>>> Jörn >>>> >>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>> Hi all, >>>>> >>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>> model that is located in the FieldTrip template directory. I have >>>>> EGI (128 channels) data and electrode positions (not subject >>>>> specific, just the standard file also available in FieldTrip >>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>> to make a headmodel and volume conduction model giving only this >>>>> limited data. I'd be happy to make it into a example Matlab script >>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>> to give me some pointers, or example code? >>>>> >>>>> Thanks a lot! >>>>> Ingrid >>>>> >>>> >>>> >>>> -- >>>> 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 >>> >>> ******************************************* >>> Tzvetan Popov >>> Clinical Psychology >>> University of Konstanz >>> Box 23 >>> 78457 Konstanz, GERMANY >>> Phone: 0049-7531-883086 >>> Fax: 0049-7531-884601 >>> Email: tzvetan.popov at uni-konstanz.de >>> >>> ******************************************* >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inieuwenhuis at berkeley.edu Wed Apr 10 19:17:04 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 10:17:04 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51658DAE.9080207@mpi.nl> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> Message-ID: <51659E90.4020805@berkeley.edu> Hi Lilla and Imali, Thanks for your replies. In my case, the problem is not the aligning. My nasion electrode is on the nasion, and Cz is on Cz, everything is where it should be. The EGI 128 electrode net really has these low electrodes, which are there specifically to make source analysis better by capturing more of the electric field. So I would have the best solution if I'd leave them there. However, in the model as derived from the MNI template, the skin part does not go down low enough. I looked at the picture after ft_prepare_vol_sens (see attachement, black is before, red is after), and indeed, this is not good. The low electrodes are squeezed up, and this will make source analysis worse. So I should indeed remove these electrodes (which is a pity), or find a better MNI template. *So my question is:* Does anyone know of a template in MNI space that extends more down? This template comes from SPM8, is there a version that extends lower? Or could I extend the skin roughly downwards with some triangular magic? I'm also a bit confused about the statement on this wiki page: http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem under "revision information" header "skin" is says: "This skin surface is not used in the BEM model itself for computational reasons, but can be used for visualization." But this does not seem to be the case, since my electrode positions are modified based on till where the skin goes. So the skin surface does significantly influence the source analysis. Anyway, thanks for all the help, and worse case, I just get rid of the low fellows. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 9:05 AM, Magyari, Lilla wrote: > hi Ingrid and Imali, > > > I think it is a really good question what to do in Ingrid's case. I do > not know the "right" answer, but I would like to share my thoughts > about it. > > The ft_prepare_vol_sens is indeed projects the electrode positions > closer to the headsurface as Imali wrote. But this function called > automatically when you create your leadfield, so you do not have to do > it separately (unless you want to visualize the corrected electrode > positions). > > However, I have been advised to rely on this projection carefully if > electrode positions are far from the skin and specially, if the > inaccuracies (distance from the skin) are not equally distributed > across the electrodes, because that can cause a spatial bias. > > Therefore, my question would be: why are those electrodes so low? Are > those positions reflect the actual positions of the electrodes during > the measurement? If yes, I would not change their positions, I would > rather try to extend my headmodel e.g. by using another template. (or > another (but quite suboptimal) possibility is maybe to exclude those > electrodes (and the data) from the analysis if they are anyway far > from the brain.) > > If the position of the electrodes should be higher up on the head, > then instead of relying on projection, I would try first to scale the > electrodes to fit them into the headsurface with the > ft_electroderealign function. > > I looked to the standard_bem file in the template directory, and I > also load in the standard_1020.elc, and those electrodes perfectly fit > the vol. So, it seems that the extension of the standard bem > headsurface is suitable for the area which is covered by the those > template electrodes. And I do not know if the electrode set you use > should cover a larger surface of the head, or if it should be just > adjusted to the given headsurface. > > Lilla > > > > > IMALI THANUJA HETTIARACHCHI wrote: >> Hi Ingrid, >> >> I had a similar issue a few weeks ago, where my lower most electrodes >> started floating after electrode realign using the ft_electroderealign >> function. >> >> I used the ft_prepare_vol_sens as, >> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and >> brought the electrodes on to the skin. >> >> Hope this helps...! >> >> Regards >> Imali >> >> >> *From:* fieldtrip-bounces at science.ru.nl >> [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis >> [inieuwenhuis at berkeley.edu] >> *Sent:* Wednesday, 10 April 2013 9:29 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> A follow up on this and some new issues: >> >> 1) I first tried Jörn's approach by creating my own BEM, always fun to >> make it yourself ;) However, I did not succeed since: >> a) the dipoli method does not work on Windows >> b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe >> has stopped working" I've emailed their buglist >> c) bemcp did run, but the result was not ok (see attachement). I also >> got the warning "% Warning: Matrix is singular, close to singular or >> badly scaled. Results may be inaccurate." several times, so that might >> be the problem. >> d) and asa gave the following error: % Error using ft_prepare_headmodel >> (line 201) % You must supply a valid cfg.hdmfile for use with ASA >> headmodel >> >> And away went my determination to do it myself, so I continued using >> thestandard_bem.mat >> . >> (I did not know this existed, I've added this link to note in the >> headmodel tutorial >> to >> make it easier to find, thanks Tzvetan for pointing this out!). >> >> 2) This worked and after some fiddling to get the electrodes aligned it >> looks okay (see attached). >> However, as you can see in the figures, I have several very low >> electrodes, that are lower than the skin mesh. So I was wondering if >> this is a problem? Since for accurate calculation of how the currents >> flow from these low electrodes, I assume one needs the skin to go till >> there? What happens when I have electrodes floating in thin air? >> *So my question is:* >> a) will this cause great inaccuracies? >> b) if so, how can I extend the skin to go lower? The template MRI only >> goes that far to the bottom... Trick anyone? >> >> Thanks again, >> Ingrid >> >> >> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >>> the wiki. >>> Have a great day, >>> Ingrid >>> >>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>> Dear Ingrid, >>>> >>>> in addition to Jorn's approach since you don't have MR and digitized >>>> elec position's you can load and realign the electrodes to the >>>> standard bem. Subsequently you can calculate the lead field and >>>> continue with your analysis pipeline. >>>> Good luck >>>> tzvetan >>>> %% read electrodes >>>> elec = ft_read_sens('/your >>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>> %% read headmodel >>>> templateheadmodel = '/your >>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>> load(templateheadmodel); >>>> %% electrode realign as good as possible >>>> % i.e. translate 0 -2 1.5 >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = vol.bnd(1).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> %% verify how the electrodes fit toghether with the brain volume >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elecR; >>>> cfg.headshape = vol.bnd(3).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> >>>> >>>>> Hi Ingrid, >>>>> >>>>> I just happen to done this a few weeks back, I changed things in the >>>>> meanwhile, but I hope that the below steps are complete: >>>>> /% read in the template MRI >>>>> if isunix >>>>> mri = >>>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>>> >>>>> elseif ispc >>>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>>> 'spm8', 'templates', 'T1.nii')); >>>>> end >>>>> >>>>> >>>>> % segment the MRI >>>>> cfg = []; >>>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>>> segmentedmri = ft_volumesegment(cfg, mris); >>>>> >>>>> >>>>> % create the headmodel (BEM) >>>>> cfg = []; >>>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>>> if isunix >>>>> cfg.method ='dipoli'; % dipoli only works under linux >>>>> else >>>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>>> keyboard; >>>>> end >>>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>>> >>>>> elec = ft_read_sens('standard_1020.elc'); >>>>> hdm = ft_convert_units(hdm, elec.unit); >>>>> >>>>> cfg = []; >>>>> cfg.grid.xgrid = -125:8:125; >>>>> cfg.grid.ygrid = -125:8:125; >>>>> cfg.grid.zgrid = -125:8:125; >>>>> cfg.grid.tight = 'yes'; >>>>> cfg.grid.unit = hdm.unit; >>>>> cfg.inwardshift = -1.5; >>>>> cfg.vol = hdm; >>>>> grid = ft_prepare_sourcemodel(cfg) >>>>> grid = ft_convert_units(grid, elec.unit); >>>>> >>>>> figure; >>>>> hold on; >>>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>>> >>>>> % this step is not necessary, cause you will see that everything is >>>>> already aligned >>>>> cfg = []; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elec; >>>>> cfg.headshape = hdm.bnd(1); >>>>> tmp = ft_electroderealign(cfg); >>>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>>> >>>>> %% verify location of occipital electrodes >>>>> >>>>> occ_elec = elec; >>>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>>> elec.label); >>>>> occ_idx = match_str(elec.label, occ_chan); >>>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>>> figure; >>>>> ft_plot_sens(occ_elec) >>>>> hold on; >>>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>>> >>>>> >>>>> Afair, that's all that is needed. Of course you need to adjust >>>>> folder and file names. >>>>> >>>>> Greetings >>>>> Jörn >>>>> >>>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>>> Hi all, >>>>>> >>>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>>> model that is located in the FieldTrip template directory. I have >>>>>> EGI (128 channels) data and electrode positions (not subject >>>>>> specific, just the standard file also available in FieldTrip >>>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>>> to make a headmodel and volume conduction model giving only this >>>>>> limited data. I'd be happy to make it into a example Matlab script >>>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>>> to give me some pointers, or example code? >>>>>> >>>>>> Thanks a lot! >>>>>> Ingrid >>>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>> >>>> ******************************************* >>>> Tzvetan Popov >>>> Clinical Psychology >>>> University of Konstanz >>>> Box 23 >>>> 78457 Konstanz, GERMANY >>>> Phone: 0049-7531-883086 >>>> Fax: 0049-7531-884601 >>>> Email: tzvetan.popov at uni-konstanz.de >>>> >>>> ******************************************* >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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: after_preparevolsens.png Type: image/png Size: 33666 bytes Desc: not available URL: From inieuwenhuis at berkeley.edu Wed Apr 10 20:21:59 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 11:21:59 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51659E90.4020805@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> Message-ID: <5165ADC7.6020906@berkeley.edu> Hi all, Just had a brain wave, I'll share it for people with similar situation that might be interested in this thread. I think I should just get a random structural MRI that extends lower (includes ears and bit below), optimally of a subject with a head similar to the MNI template. Make a BEM model (hmm, have to fix these errors I mentioned earlier then, well, should be doable on linux using dipoli). Then use ft_electroderealign to align the electrodes to this MRI, do the source analysis for all subjects using this model, and subsequently use ft_volumenormalise to normalize to MNI template if I want to use any atlas functionality. If anyone did this already using FieldTrip and has a pre-made BEM (just like the standard_bem), would be really nice if you're willing to share :) If not, I'll make my own, and people with low electrodes and no structural MRI and or no linux access can email me if they want to use it. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: > Hi Lilla and Imali, > > Thanks for your replies. In my case, the problem is not the aligning. > My nasion electrode is on the nasion, and Cz is on Cz, everything is > where it should be. The EGI 128 electrode net really has these low > electrodes, which are there specifically to make source analysis > better by capturing more of the electric field. So I would have the > best solution if I'd leave them there. However, in the model as > derived from the MNI template, the skin part does not go down low enough. > > I looked at the picture after ft_prepare_vol_sens (see attachement, > black is before, red is after), and indeed, this is not good. The low > electrodes are squeezed up, and this will make source analysis worse. > So I should indeed remove these electrodes (which is a pity), or find > a better MNI template. > > *So my question is:* > Does anyone know of a template in MNI space that extends more down? > This template comes from SPM8, is there a version that extends lower? > Or could I extend the skin roughly downwards with some triangular magic? > > I'm also a bit confused about the statement on this wiki page: > http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem > under "revision information" header "skin" is says: "This skin surface > is not used in the BEM model itself for computational reasons, but can > be used for visualization." > But this does not seem to be the case, since my electrode positions > are modified based on till where the skin goes. So the skin surface > does significantly influence the source analysis. > > Anyway, thanks for all the help, and worse case, I just get rid of the > low fellows. > > Cheers, > Ingrid > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >> hi Ingrid and Imali, >> >> >> I think it is a really good question what to do in Ingrid's case. I >> do not know the "right" answer, but I would like to share my thoughts >> about it. >> >> The ft_prepare_vol_sens is indeed projects the electrode positions >> closer to the headsurface as Imali wrote. But this function called >> automatically when you create your leadfield, so you do not have to >> do it separately (unless you want to visualize the corrected >> electrode positions). >> >> However, I have been advised to rely on this projection carefully if >> electrode positions are far from the skin and specially, if the >> inaccuracies (distance from the skin) are not equally distributed >> across the electrodes, because that can cause a spatial bias. >> >> Therefore, my question would be: why are those electrodes so low? Are >> those positions reflect the actual positions of the electrodes during >> the measurement? If yes, I would not change their positions, I would >> rather try to extend my headmodel e.g. by using another template. (or >> another (but quite suboptimal) possibility is maybe to exclude those >> electrodes (and the data) from the analysis if they are anyway far >> from the brain.) >> >> If the position of the electrodes should be higher up on the head, >> then instead of relying on projection, I would try first to scale the >> electrodes to fit them into the headsurface with the >> ft_electroderealign function. >> >> I looked to the standard_bem file in the template directory, and I >> also load in the standard_1020.elc, and those electrodes perfectly >> fit the vol. So, it seems that the extension of the standard bem >> headsurface is suitable for the area which is covered by the those >> template electrodes. And I do not know if the electrode set you use >> should cover a larger surface of the head, or if it should be just >> adjusted to the given headsurface. >> >> Lilla >> >> >> >> >> IMALI THANUJA HETTIARACHCHI wrote: >>> Hi Ingrid, >>> >>> I had a similar issue a few weeks ago, where my lower most electrodes >>> started floating after electrode realign using the ft_electroderealign >>> function. >>> >>> I used the ft_prepare_vol_sens as, >>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and >>> brought the electrodes on to the skin. >>> >>> Hope this helps...! >>> >>> Regards >>> Imali >>> >>> >>> *From:* fieldtrip-bounces at science.ru.nl >>> [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis >>> [inieuwenhuis at berkeley.edu] >>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> A follow up on this and some new issues: >>> >>> 1) I first tried Jörn's approach by creating my own BEM, always fun to >>> make it yourself ;) However, I did not succeed since: >>> a) the dipoli method does not work on Windows >>> b) I downloaded the openmeeg toolbox, but got an error >>> "om_minverser.exe >>> has stopped working" I've emailed their buglist >>> c) bemcp did run, but the result was not ok (see attachement). I also >>> got the warning "% Warning: Matrix is singular, close to singular or >>> badly scaled. Results may be inaccurate." several times, so that might >>> be the problem. >>> d) and asa gave the following error: % Error using ft_prepare_headmodel >>> (line 201) % You must supply a valid cfg.hdmfile for use with ASA >>> headmodel >>> >>> And away went my determination to do it myself, so I continued using >>> thestandard_bem.mat >>> . >>> >>> (I did not know this existed, I've added this link to note in the >>> headmodel tutorial >>> to >>> make it easier to find, thanks Tzvetan for pointing this out!). >>> >>> 2) This worked and after some fiddling to get the electrodes aligned it >>> looks okay (see attached). >>> However, as you can see in the figures, I have several very low >>> electrodes, that are lower than the skin mesh. So I was wondering if >>> this is a problem? Since for accurate calculation of how the currents >>> flow from these low electrodes, I assume one needs the skin to go till >>> there? What happens when I have electrodes floating in thin air? >>> *So my question is:* >>> a) will this cause great inaccuracies? >>> b) if so, how can I extend the skin to go lower? The template MRI only >>> goes that far to the bottom... Trick anyone? >>> >>> Thanks again, >>> Ingrid >>> >>> >>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on >>>> the wiki. >>>> Have a great day, >>>> Ingrid >>>> >>>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>>> Dear Ingrid, >>>>> >>>>> in addition to Jorn's approach since you don't have MR and digitized >>>>> elec position's you can load and realign the electrodes to the >>>>> standard bem. Subsequently you can calculate the lead field and >>>>> continue with your analysis pipeline. >>>>> Good luck >>>>> tzvetan >>>>> %% read electrodes >>>>> elec = ft_read_sens('/your >>>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>>> %% read headmodel >>>>> templateheadmodel = '/your >>>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>>> load(templateheadmodel); >>>>> %% electrode realign as good as possible >>>>> % i.e. translate 0 -2 1.5 >>>>> cfg=[]; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elec; >>>>> cfg.headshape = vol.bnd(1).pnt; >>>>> elecR = ft_electroderealign(cfg); >>>>> %% verify how the electrodes fit toghether with the brain volume >>>>> cfg=[]; >>>>> cfg.method = 'interactive'; >>>>> cfg.elec = elecR; >>>>> cfg.headshape = vol.bnd(3).pnt; >>>>> elecR = ft_electroderealign(cfg); >>>>> >>>>> >>>>>> Hi Ingrid, >>>>>> >>>>>> I just happen to done this a few weeks back, I changed things in the >>>>>> meanwhile, but I hope that the below steps are complete: >>>>>> /% read in the template MRI >>>>>> if isunix >>>>>> mri = >>>>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>>>> >>>>>> elseif ispc >>>>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', >>>>>> 'spm8', 'templates', 'T1.nii')); >>>>>> end >>>>>> >>>>>> >>>>>> % segment the MRI >>>>>> cfg = []; >>>>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>>>> segmentedmri = ft_volumesegment(cfg, mris); >>>>>> >>>>>> >>>>>> % create the headmodel (BEM) >>>>>> cfg = []; >>>>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>>>> if isunix >>>>>> cfg.method ='dipoli'; % dipoli only works under linux >>>>>> else >>>>>> disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); >>>>>> keyboard; >>>>>> end >>>>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>>>> >>>>>> elec = ft_read_sens('standard_1020.elc'); >>>>>> hdm = ft_convert_units(hdm, elec.unit); >>>>>> >>>>>> cfg = []; >>>>>> cfg.grid.xgrid = -125:8:125; >>>>>> cfg.grid.ygrid = -125:8:125; >>>>>> cfg.grid.zgrid = -125:8:125; >>>>>> cfg.grid.tight = 'yes'; >>>>>> cfg.grid.unit = hdm.unit; >>>>>> cfg.inwardshift = -1.5; >>>>>> cfg.vol = hdm; >>>>>> grid = ft_prepare_sourcemodel(cfg) >>>>>> grid = ft_convert_units(grid, elec.unit); >>>>>> >>>>>> figure; >>>>>> hold on; >>>>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>>>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>>>> >>>>>> % this step is not necessary, cause you will see that everything is >>>>>> already aligned >>>>>> cfg = []; >>>>>> cfg.method = 'interactive'; >>>>>> cfg.elec = elec; >>>>>> cfg.headshape = hdm.bnd(1); >>>>>> tmp = ft_electroderealign(cfg); >>>>>> elec = tmp; % I had a bug here that I couldn't assign elec directly >>>>>> >>>>>> %% verify location of occipital electrodes >>>>>> >>>>>> occ_elec = elec; >>>>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>>>> elec.label); >>>>>> occ_idx = match_str(elec.label, occ_chan); >>>>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>>>> figure; >>>>>> ft_plot_sens(occ_elec) >>>>>> hold on; >>>>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>>>> >>>>>> >>>>>> Afair, that's all that is needed. Of course you need to adjust >>>>>> folder and file names. >>>>>> >>>>>> Greetings >>>>>> Jörn >>>>>> >>>>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> I'd like to do source analysis (loreta and or DICS) on my EEG data. >>>>>>> I don't have anatomical MRIs and I don't have a measurement of the >>>>>>> scalp surface. So I'd like to use a template MRI or a template head >>>>>>> model that is located in the FieldTrip template directory. I have >>>>>>> EGI (128 channels) data and electrode positions (not subject >>>>>>> specific, just the standard file also available in FieldTrip >>>>>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>>>>>> how to start. I don't see any examples on the FieldTrip page of how >>>>>>> to make a headmodel and volume conduction model giving only this >>>>>>> limited data. I'd be happy to make it into a example Matlab script >>>>>>> on the FieldTrip page after I got it to work. Would someone be able >>>>>>> to give me some pointers, or example code? >>>>>>> >>>>>>> Thanks a lot! >>>>>>> Ingrid >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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 >>>>> >>>>> ******************************************* >>>>> Tzvetan Popov >>>>> Clinical Psychology >>>>> University of Konstanz >>>>> Box 23 >>>>> 78457 Konstanz, GERMANY >>>>> Phone: 0049-7531-883086 >>>>> Fax: 0049-7531-884601 >>>>> Email: tzvetan.popov at uni-konstanz.de >>>>> >>>>> ******************************************* >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 ith at deakin.edu.au Thu Apr 11 03:14:23 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 11 Apr 2013 01:14:23 +0000 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5165ADC7.6020906@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> Hi Ingrid, I had similar issues with creating my own BEM as I too did not have the individual MRI's nor the digitized electrode positions. I created a BEM using the Curry (Neuroscan) software and imported in .mat format to use with Fieldtrip. However these are also based on the MNI template. I am not sure whether this extends lower enough for your situation. I am attaching here a picture of my head model showing the skull and cortex with my registered electrodes. If you are happy with it, I am more than happy to share it with you. Please let me know. Regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ingrid Nieuwenhuis Sent: Thursday, 11 April 2013 4:22 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] source analysis EEG data without MRI Hi all, Just had a brain wave, I'll share it for people with similar situation that might be interested in this thread. I think I should just get a random structural MRI that extends lower (includes ears and bit below), optimally of a subject with a head similar to the MNI template. Make a BEM model (hmm, have to fix these errors I mentioned earlier then, well, should be doable on linux using dipoli). Then use ft_electroderealign to align the electrodes to this MRI, do the source analysis for all subjects using this model, and subsequently use ft_volumenormalise to normalize to MNI template if I want to use any atlas functionality. If anyone did this already using FieldTrip and has a pre-made BEM (just like the standard_bem), would be really nice if you're willing to share :) If not, I'll make my own, and people with low electrodes and no structural MRI and or no linux access can email me if they want to use it. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: Hi Lilla and Imali, Thanks for your replies. In my case, the problem is not the aligning. My nasion electrode is on the nasion, and Cz is on Cz, everything is where it should be. The EGI 128 electrode net really has these low electrodes, which are there specifically to make source analysis better by capturing more of the electric field. So I would have the best solution if I'd leave them there. However, in the model as derived from the MNI template, the skin part does not go down low enough. I looked at the picture after ft_prepare_vol_sens (see attachement, black is before, red is after), and indeed, this is not good. The low electrodes are squeezed up, and this will make source analysis worse. So I should indeed remove these electrodes (which is a pity), or find a better MNI template. So my question is: Does anyone know of a template in MNI space that extends more down? This template comes from SPM8, is there a version that extends lower? Or could I extend the skin roughly downwards with some triangular magic? I'm also a bit confused about the statement on this wiki page: http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem under "revision information" header "skin" is says: "This skin surface is not used in the BEM model itself for computational reasons, but can be used for visualization." But this does not seem to be the case, since my electrode positions are modified based on till where the skin goes. So the skin surface does significantly influence the source analysis. Anyway, thanks for all the help, and worse case, I just get rid of the low fellows. Cheers, Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 9:05 AM, Magyari, Lilla wrote: hi Ingrid and Imali, I think it is a really good question what to do in Ingrid's case. I do not know the "right" answer, but I would like to share my thoughts about it. The ft_prepare_vol_sens is indeed projects the electrode positions closer to the headsurface as Imali wrote. But this function called automatically when you create your leadfield, so you do not have to do it separately (unless you want to visualize the corrected electrode positions). However, I have been advised to rely on this projection carefully if electrode positions are far from the skin and specially, if the inaccuracies (distance from the skin) are not equally distributed across the electrodes, because that can cause a spatial bias. Therefore, my question would be: why are those electrodes so low? Are those positions reflect the actual positions of the electrodes during the measurement? If yes, I would not change their positions, I would rather try to extend my headmodel e.g. by using another template. (or another (but quite suboptimal) possibility is maybe to exclude those electrodes (and the data) from the analysis if they are anyway far from the brain.) If the position of the electrodes should be higher up on the head, then instead of relying on projection, I would try first to scale the electrodes to fit them into the headsurface with the ft_electroderealign function. I looked to the standard_bem file in the template directory, and I also load in the standard_1020.elc, and those electrodes perfectly fit the vol. So, it seems that the extension of the standard bem headsurface is suitable for the area which is covered by the those template electrodes. And I do not know if the electrode set you use should cover a larger surface of the head, or if it should be just adjusted to the given headsurface. Lilla IMALI THANUJA HETTIARACHCHI wrote: Hi Ingrid, I had a similar issue a few weeks ago, where my lower most electrodes started floating after electrode realign using the ft_electroderealign function. I used the ft_prepare_vol_sens as, [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and brought the electrodes on to the skin. Hope this helps...! Regards Imali *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis [inieuwenhuis at berkeley.edu] *Sent:* Wednesday, 10 April 2013 9:29 AM *To:* fieldtrip at science.ru.nl *Subject:* Re: [FieldTrip] source analysis EEG data without MRI Hi all, A follow up on this and some new issues: 1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since: a) the dipoli method does not work on Windows b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem. d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel And away went my determination to do it myself, so I continued using thestandard_bem.mat . (I did not know this existed, I've added this link to note in the headmodel tutorial to make it easier to find, thanks Tzvetan for pointing this out!). 2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached). However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air? *So my question is:* a) will this cause great inaccuracies? b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone? Thanks again, Ingrid On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki. Have a great day, Ingrid On 4/9/2013 12:32 AM, Tzvetan Popov wrote: Dear Ingrid, in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and continue with your analysis pipeline. Good luck tzvetan %% read electrodes elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); %% read headmodel templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; load(templateheadmodel); %% electrode realign as good as possible % i.e. translate 0 -2 1.5 cfg=[]; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1).pnt; elecR = ft_electroderealign(cfg); %% verify how the electrodes fit toghether with the brain volume cfg=[]; cfg.method = 'interactive'; cfg.elec = elecR; cfg.headshape = vol.bnd(3).pnt; elecR = ft_electroderealign(cfg); Hi Ingrid, I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete: /% read in the template MRI if isunix mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); elseif ispc mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii')); end % segment the MRI cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; segmentedmri = ft_volumesegment(cfg, mris); % create the headmodel (BEM) cfg = []; %cfg.method ='openmeeg'; % TODO FIXME download openmeeg if isunix cfg.method ='dipoli'; % dipoli only works under linux else disp('TODO FIXME stick to dipoli for now or download openmeeg\n'); keyboard; end hdm = ft_prepare_headmodel(cfg, segmentedmri); elec = ft_read_sens('standard_1020.elc'); hdm = ft_convert_units(hdm, elec.unit); cfg = []; cfg.grid.xgrid = -125:8:125; cfg.grid.ygrid = -125:8:125; cfg.grid.zgrid = -125:8:125; cfg.grid.tight = 'yes'; cfg.grid.unit = hdm.unit; cfg.inwardshift = -1.5; cfg.vol = hdm; grid = ft_prepare_sourcemodel(cfg) grid = ft_convert_units(grid, elec.unit); figure; hold on; ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); ft_plot_mesh(grid.pos(grid.inside, :)); % this step is not necessary, cause you will see that everything is already aligned cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = hdm.bnd(1); tmp = ft_electroderealign(cfg); elec = tmp; % I had a bug here that I couldn't assign elec directly %% verify location of occipital electrodes occ_elec = elec; occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label); occ_idx = match_str(elec.label, occ_chan); occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); occ_elec.label = occ_elec.label(occ_idx, :); figure; ft_plot_sens(occ_elec) hold on; ft_plot_vol(ft_convert_units(hdm, elec.unit))/ Afair, that's all that is needed. Of course you need to adjust folder and file names. Greetings Jörn On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: Hi all, I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code? Thanks a lot! Ingrid -- 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 ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: curry_vol.jpg Type: image/jpeg Size: 15832 bytes Desc: curry_vol.jpg URL: From inieuwenhuis at berkeley.edu Thu Apr 11 05:44:40 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 10 Apr 2013 20:44:40 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> Message-ID: <516631A8.1030006@berkeley.edu> Hi Imali, Tzvetan shared the bem model made from the tutorial MRI with me, that one extends to low enough, so I'm good! Thanks a lot though! Cheers, Ingird -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: > > Hi Ingrid, > > I had similar issues with creating my own BEM as I too did not have > the individual MRI's nor the digitized electrode positions. > > I created a BEM using the Curry (Neuroscan) software and imported in > .mat format to use with Fieldtrip. However these are also based on the > MNI template. > > I am not sure whether this extends lower enough for your situation. I > am attaching here a picture of my head model showing the skull and > cortex with my registered electrodes. If you are happy with it, I am > more than happy to share it with you. > > Please let me know. > > Regards > > Imali > > *From:*fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid Nieuwenhuis > *Sent:* Thursday, 11 April 2013 4:22 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > Just had a brain wave, I'll share it for people with similar situation > that might be interested in this thread. I think I should just get a > random structural MRI that extends lower (includes ears and bit > below), optimally of a subject with a head similar to the MNI > template. Make a BEM model (hmm, have to fix these errors I mentioned > earlier then, well, should be doable on linux using dipoli). Then use > ft_electroderealign to align the electrodes to this MRI, do the source > analysis for all subjects using this model, and subsequently use > ft_volumenormalise to normalize to MNI template if I want to use any > atlas functionality. > > If anyone did this already using FieldTrip and has a pre-made BEM > (just like the standard_bem), would be really nice if you're willing > to share :) > If not, I'll make my own, and people with low electrodes and no > structural MRI and or no linux access can email me if they want to use it. > > Cheers, > Ingrid > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: > > Hi Lilla and Imali, > > Thanks for your replies. In my case, the problem is not the > aligning. My nasion electrode is on the nasion, and Cz is on Cz, > everything is where it should be. The EGI 128 electrode net really > has these low electrodes, which are there specifically to make > source analysis better by capturing more of the electric field. So > I would have the best solution if I'd leave them there. However, > in the model as derived from the MNI template, the skin part does > not go down low enough. > > I looked at the picture after ft_prepare_vol_sens (see > attachement, black is before, red is after), and indeed, this is > not good. The low electrodes are squeezed up, and this will make > source analysis worse. So I should indeed remove these electrodes > (which is a pity), or find a better MNI template. > > *So my question is:* > Does anyone know of a template in MNI space that extends more > down? This template comes from SPM8, is there a version that > extends lower? Or could I extend the skin roughly downwards with > some triangular magic? > > I'm also a bit confused about the statement on this wiki page: > http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem > > under "revision information" header "skin" is says: "This skin > surface is not used in the BEM model itself for computational > reasons, but can be used for visualization." > But this does not seem to be the case, since my electrode > positions are modified based on till where the skin goes. So the > skin surface does significantly influence the source analysis. > > Anyway, thanks for all the help, and worse case, I just get rid of > the low fellows. > > Cheers, > Ingrid > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > On 4/10/2013 9:05 AM, Magyari, Lilla wrote: > > hi Ingrid and Imali, > > > I think it is a really good question what to do in Ingrid's > case. I do not know the "right" answer, but I would like to > share my thoughts about it. > > The ft_prepare_vol_sens is indeed projects the electrode > positions closer to the headsurface as Imali wrote. But this > function called automatically when you create your leadfield, > so you do not have to do it separately (unless you want to > visualize the corrected electrode positions). > > However, I have been advised to rely on this projection > carefully if electrode positions are far from the skin and > specially, if the inaccuracies (distance from the skin) are > not equally distributed across the electrodes, because that > can cause a spatial bias. > > Therefore, my question would be: why are those electrodes so > low? Are those positions reflect the actual positions of the > electrodes during the measurement? If yes, I would not change > their positions, I would rather try to extend my headmodel > e.g. by using another template. (or another (but quite > suboptimal) possibility is maybe to exclude those electrodes > (and the data) from the analysis if they are anyway far from > the brain.) > > If the position of the electrodes should be higher up on the > head, then instead of relying on projection, I would try first > to scale the electrodes to fit them into the headsurface with > the ft_electroderealign function. > > I looked to the standard_bem file in the template directory, > and I also load in the standard_1020.elc, and those electrodes > perfectly fit the vol. So, it seems that the extension of the > standard bem headsurface is suitable for the area which is > covered by the those template electrodes. And I do not know if > the electrode set you use should cover a larger surface of the > head, or if it should be just adjusted to the given headsurface. > > Lilla > > > > > IMALI THANUJA HETTIARACHCHI wrote: > > Hi Ingrid, > > I had a similar issue a few weeks ago, where my lower most > electrodes > started floating after electrode realign using the > ft_electroderealign > function. > > I used the ft_prepare_vol_sens as, > [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the > trick and > brought the electrodes on to the skin. > > Hope this helps...! > > Regards > Imali > > > *From:* fieldtrip-bounces at science.ru.nl > > [fieldtrip-bounces at science.ru.nl > ] on behalf of Ingrid > Nieuwenhuis > [inieuwenhuis at berkeley.edu ] > *Sent:* Wednesday, 10 April 2013 9:29 AM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] source analysis EEG data without MRI > > Hi all, > > A follow up on this and some new issues: > > 1) I first tried Jörn's approach by creating my own BEM, > always fun to > make it yourself ;) However, I did not succeed since: > a) the dipoli method does not work on Windows > b) I downloaded the openmeeg toolbox, but got an error > "om_minverser.exe > has stopped working" I've emailed their buglist > c) bemcp did run, but the result was not ok (see attachement). > I also > got the warning "% Warning: Matrix is singular, close to > singular or > badly scaled. Results may be inaccurate." several times, so > that might > be the problem. > d) and asa gave the following error: % Error using > ft_prepare_headmodel > (line 201) % You must supply a valid cfg.hdmfile for use with > ASA headmodel > > And away went my determination to do it myself, so I continued > using > thestandard_bem.mat > > . > > (I did not know this existed, I've added this link to note in the > headmodel tutorial > > > to > make it easier to find, thanks Tzvetan for pointing this out!). > > 2) This worked and after some fiddling to get the electrodes > aligned it > looks okay (see attached). > However, as you can see in the figures, I have several very low > electrodes, that are lower than the skin mesh. So I was > wondering if > this is a problem? Since for accurate calculation of how the > currents > flow from these low electrodes, I assume one needs the skin to > go till > there? What happens when I have electrodes floating in thin air? > *So my question is:* > a) will this cause great inaccuracies? > b) if so, how can I extend the skin to go lower? The template > MRI only > goes that far to the bottom... Trick anyone? > > Thanks again, > Ingrid > > > On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: > > Thanks Jörn and Tzvetan for the scripts! I'll try it out and > put it on > the wiki. > Have a great day, > Ingrid > > On 4/9/2013 12:32 AM, Tzvetan Popov wrote: > > Dear Ingrid, > > in addition to Jorn's approach since you don't have MR and > digitized > elec position's you can load and realign the electrodes to the > standard bem. Subsequently you can calculate the lead field and > continue with your analysis pipeline. > Good luck > tzvetan > %% read electrodes > elec = ft_read_sens('/your > path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); > > %% read headmodel > templateheadmodel = '/your > path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; > load(templateheadmodel); > %% electrode realign as good as possible > % i.e. translate 0 -2 1.5 > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = vol.bnd(1).pnt; > elecR = ft_electroderealign(cfg); > %% verify how the electrodes fit toghether with the brain volume > cfg=[]; > cfg.method = 'interactive'; > cfg.elec = elecR; > cfg.headshape = vol.bnd(3).pnt; > elecR = ft_electroderealign(cfg); > > > > Hi Ingrid, > > I just happen to done this a few weeks back, I changed things > in the > meanwhile, but I hope that the below steps are complete: > /% read in the template MRI > if isunix > mri = > ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); > > elseif ispc > mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', > 'external', > 'spm8', 'templates', 'T1.nii')); > end > > > % segment the MRI > cfg = []; > cfg.output = {'brain' 'skull' 'scalp'}; > segmentedmri = ft_volumesegment(cfg, mris); > > > % create the headmodel (BEM) > cfg = []; > %cfg.method ='openmeeg'; % TODO FIXME download openmeeg > if isunix > cfg.method ='dipoli'; % dipoli only works under linux > else > disp('TODO FIXME stick to dipoli for now or download > openmeeg\n'); > keyboard; > end > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > elec = ft_read_sens('standard_1020.elc'); > hdm = ft_convert_units(hdm, elec.unit); > > cfg = []; > cfg.grid.xgrid = -125:8:125; > cfg.grid.ygrid = -125:8:125; > cfg.grid.zgrid = -125:8:125; > cfg.grid.tight = 'yes'; > cfg.grid.unit = hdm.unit; > cfg.inwardshift = -1.5; > cfg.vol = hdm; > grid = ft_prepare_sourcemodel(cfg) > grid = ft_convert_units(grid, elec.unit); > > figure; > hold on; > ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', > 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > ft_plot_mesh(grid.pos(grid.inside, :)); > > % this step is not necessary, cause you will see that > everything is > already aligned > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = hdm.bnd(1); > tmp = ft_electroderealign(cfg); > elec = tmp; % I had a bug here that I couldn't assign elec > directly > > %% verify location of occipital electrodes > > occ_elec = elec; > occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, > elec.label); > occ_idx = match_str(elec.label, occ_chan); > occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); > occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); > occ_elec.label = occ_elec.label(occ_idx, :); > figure; > ft_plot_sens(occ_elec) > hold on; > ft_plot_vol(ft_convert_units(hdm, elec.unit))/ > > > Afair, that's all that is needed. Of course you need to adjust > folder and file names. > > Greetings > Jörn > > On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: > > Hi all, > > I'd like to do source analysis (loreta and or DICS) on my EEG > data. > I don't have anatomical MRIs and I don't have a measurement of > the > scalp surface. So I'd like to use a template MRI or a template > head > model that is located in the FieldTrip template directory. I have > EGI (128 channels) data and electrode positions (not subject > specific, just the standard file also available in FieldTrip > electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck > how to start. I don't see any examples on the FieldTrip page > of how > to make a headmodel and volume conduction model giving only this > limited data. I'd be happy to make it into a example Matlab > script > on the FieldTrip page after I got it to work. Would someone be > able > to give me some pointers, or example code? > > Thanks a lot! > Ingrid > > > > -- > 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 > > > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > > > > ******************************************* > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 sabato45 at hotmail.com Thu Apr 11 06:07:39 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Wed, 10 Apr 2013 21:07:39 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> References: , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Message-ID: Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions?Thanks again,Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Thu Apr 11 12:09:26 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Thu, 11 Apr 2013 12:09:26 +0200 (CEST) Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: References: , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl> Message-ID: <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> If I were a reviewer, I would object against such a procedure (because you are mixing up units-of-observation; see Maris, Psychophysiology, 2012). But I know people have done in the early days of fMRI analysis (concatenating the data of the multiple subjects; called a level-1 analysis in that community), but this has sparked a lot of criticisms. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: donderdag 11 april 2013 6:08 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions? Thanks again, Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris, thank you for your response. I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I have two conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulation across trials to find out whether condition 1 is different from condition 2 independently of their different number of trials. If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic. I really appreciate your help. Ana _____ From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody, I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help. Thanks, 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolai at mersebak.dk Thu Apr 11 14:37:18 2013 From: nicolai at mersebak.dk (Nicolai Mersebak) Date: Thu, 11 Apr 2013 14:37:18 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip Message-ID: Dear all, I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. The purpose of the ICA algorithm is to remove EOG artifacts. Best, Nicolai -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Apr 11 15:21:03 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 11 Apr 2013 07:21:03 -0600 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: References: Message-ID: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> Nicolai, I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Don On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: > Dear all, > > I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. > > The purpose of the ICA algorithm is to remove EOG artifacts. > > Best, > > Nicolai > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From smoratti at psi.ucm.es Thu Apr 11 15:47:07 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Thu, 11 Apr 2013 15:47:07 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> Message-ID: <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> I think if you specify "runica" it does the same as EEGLAB. 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 11/04/2013, a las 15:21, Rojas, Don escribió: > Nicolai, > > I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > > Don > > On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: > >> Dear all, >> >> I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. >> >> The purpose of the ICA algorithm is to remove EOG artifacts. >> >> Best, >> >> Nicolai >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 sabato45 at hotmail.com Thu Apr 11 17:45:31 2013 From: sabato45 at hotmail.com (Ana Navarro Cebrian) Date: Thu, 11 Apr 2013 08:45:31 -0700 Subject: [FieldTrip] Nonparametric statistical testing of phase coherence In-Reply-To: <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> References: , , , <01b601ce350a$44b48770$ce1d9650$@maris@psych.ru.nl>, , , , <001501ce35bc$066d4030$1347c090$@maris@psych.ru.nl>, , <007101ce369c$a8109460$f831bd20$@maris@psych.ru.nl> Message-ID: Thanks for you answer and for sending along the paper. What would be the correct approach then in this case? It may be really simple, but I just don't know what to do with one p-value for every single subject. From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Thu, 11 Apr 2013 12:09:26 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence If I were a reviewer, I would object against such a procedure (because you are mixing up units-of-observation; see Maris, Psychophysiology, 2012). But I know people have done in the early days of fMRI analysis (concatenating the data of the multiple subjects; called a level-1 analysis in that community), but this has sparked a lot of criticisms. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: donderdag 11 april 2013 6:08 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Thank you, Eric. Would then make sense to add all the trials (from all subjects) from condition1 in one set, and all the trials (from all subjects) from condition2 in a second set, and run this Montecarlo simulation (the same way I was talking about to compare) those two conditions?Thanks again,Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Wed, 10 Apr 2013 09:21:28 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, Yes, this is correct. Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: dinsdag 9 april 2013 19:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherence Hi Maris,thank you for your response.I think my question wasn't clear. Let me rephrase it. I'd like to apply the montecarlo approach that you explain in Maris et al., because I havetwo conditions (errors vs correct responses) with a huge difference in the number of trials. In this case, I understand that I have to apply the montercarlo simulationacross trials to find out whether condition 1 is different from condition 2 independently of their different number of trials.If that's correct, my question is, do I get a p-value from this procedure? If so, after performing the same analysis for each subject independently, I'll end up with a p-value for each subject. Is that correct? I'm sorry if I'm not understanding something basic.I really appreciate your help.Ana From: e.maris at psych.ru.nl To: fieldtrip at science.ru.nl Date: Tue, 9 Apr 2013 12:09:03 +0200 Subject: Re: [FieldTrip] Nonparametric statistical testing of phase coherenceHi Ana, To compare coherence between conditions across subjects (instead of trials), you need a different statfun: depsamplesT (for a within-subjects design; subjects have participated in all conditions) or indepsamplesT (for a between-subjects design; subjects have participated in only one condition). Typically, this type of test is performed using power as the dependent variable, but exactly the same test is used for comparing coherence in a multiple-subject study. However, you will have to specify the cfg.parameter field when calling ft_freqstatistics such that it points to the data field that contains your coherence data (importantly, for a given reference channel). Good luck, Eric Maris From: Ana Navarro Cebrian [mailto:sabato45 at hotmail.com] Sent: vrijdag 5 april 2013 23:56 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Nonparametric statistical testing of phase coherence Hello everybody,I'd like to use the test proposed in Maris et al., 2007 (that I believe is implemented in statistics_montecarlo.m?). I'm calculating the difference in phase coherence between two conditions. The problem is that one condition has much less trials than the other, so I imagine the Montecarlo simulation would need to be across trials, in which case, I'd end up with a p-value for each individual subject, right? I'm not sure then how to apply this across subjects. The Maris et al. paper is very clear, but it only explains single subject analysis. I hope that makes any sense. I appreciate any help.Thanks,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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Thu Apr 11 20:30:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Thu, 11 Apr 2013 11:30:31 -0700 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? Message-ID: <51670147.4080803@berkeley.edu> Hi all, When I follow the code according to the example matlab script "Create MNI-aligned grids in individual head-space" something goes all wrong with the units. I've followed the code (pasted below, from the wiki), but when I make the figure with the template head model and dipole grid, it's wrong (see attached ..._problem.png). The dipole grid is tiny in the bottom of the head model. The black area is the dipole grid, not good. template_grid = xgrid: [1x41 double] ygrid: [1x41 double] zgrid: [1x41 double] dim: [41 41 41] pos: [68921x3 double] unit: 'mm' inside: [1x68910 double] outside: [758 759 760 761 799 800 801 802 843 884 925] cfg: [1x1 struct] It's a problem with the units, because the template grid has 'mm' in the unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos field by 10, the grid is not tight (see attached ..._multiplied10.png). It looks like the unit problem messed up the determination of what's inside and outside. As you can see in the template_grid, there are only a few grid point outside, which is clearly not correct (maybe inside/outside was determined on wrong units?). So, it looks like a bug to me, or am I doing something wrong? I'm using the newest FT version. Thanks, Ingrid %%% CODE FROM WIKI %%% template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', filesep,'templates', filesep,'T1.nii']); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): this is needed % for the inside/outside detection of voxels. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates % the source units are in cm % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol); ft_plot_mesh(template_grid); -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- A non-text attachment was scrubbed... Name: templatehead_dipolegrid_problem.png Type: image/png Size: 19636 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: templatehead_dipolegrid_multiplied10.png Type: image/png Size: 9051 bytes Desc: not available URL: From nicolai at mersebak.dk Thu Apr 11 20:41:49 2013 From: nicolai at mersebak.dk (Nicolai Mersebak) Date: Thu, 11 Apr 2013 20:41:49 +0200 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> Message-ID: <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> Thank you for the responds. @Don, sorry for my choice of word. I differently meant some of the routines and not the whole package! Maybe I wasn't clear enough. I don't mean the usually ICA algorithms (e.g runica), where you manually reject ICA components after running the algorithm. There are some plugins in EEGLAB, where the artifact removal of EOG is automatic using ICA. Most often you are using it, when you have multiple subjects and don't have time to go through all subjects manually. So my question is if someone has tried to use an automatic artifact removal algorithm based on ICA in fieldtrip? An example is the FASTER plugin in EEGLAB - http://sccn.ucsd.edu/wiki/EEGLAB_Plugins. Best, Nicolai Den 11/04/2013 kl. 15.47 skrev smoratti at psi.ucm.es: > > I think if you specify "runica" it does the same as EEGLAB. > > 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 11/04/2013, a las 15:21, Rojas, Don escribió: > >> Nicolai, >> >> I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts >> >> Don >> >> On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak wrote: >> >>> Dear all, >>> >>> I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. >>> >>> The purpose of the ICA algorithm is to remove EOG artifacts. >>> >>> Best, >>> >>> Nicolai >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 Don.Rojas at ucdenver.edu Thu Apr 11 21:28:13 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 11 Apr 2013 13:28:13 -0600 Subject: [FieldTrip] Automatic ICA algorithm in fieldtrip In-Reply-To: <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> References: <1DC8FA25-4701-4BB9-BD4A-9D17CF6C322A@ucdenver.edu> <930BE79C-B4DE-4217-9014-DEB485EFB302@psi.ucm.es> <2B0C9EBB-98DD-4D83-A9FB-9985FC8BD8CE@mersebak.dk> Message-ID: No worries - I'm not a developer. I meant to include a smiley to imply my cheekiness, but left that out. I'm afraid I'm not familiar enough with the eeglab software, and in particular the plugin you mention, to address your question about ica-based automated artifact removal, but fieldtrip does have some automated artifact rejection routines that I do not use and can't comment on intelligently. See here in the wiki: http://fieldtrip.fcdonders.nl/tutorial/automatic_artifact_rejection Best, Don On Apr 11, 2013, at 12:41 PM, Nicolai Mersebak > wrote: Thank you for the responds. @Don, sorry for my choice of word. I differently meant some of the routines and not the whole package! Maybe I wasn't clear enough. I don't mean the usually ICA algorithms (e.g runica), where you manually reject ICA components after running the algorithm. There are some plugins in EEGLAB, where the artifact removal of EOG is automatic using ICA. Most often you are using it, when you have multiple subjects and don't have time to go through all subjects manually. So my question is if someone has tried to use an automatic artifact removal algorithm based on ICA in fieldtrip? An example is the FASTER plugin in EEGLAB - http://sccn.ucsd.edu/wiki/EEGLAB_Plugins. Best, Nicolai Den 11/04/2013 kl. 15.47 skrev smoratti at psi.ucm.es: I think if you specify "runica" it does the same as EEGLAB. 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 11/04/2013, a las 15:21, Rojas, Don escribió: Nicolai, I suspect the developers will disagree that "fieldtrip is the package from EEGLAB", as it is an independently developed package. There is some integration, however, and in this particular case, fieldtrip can call the some of the ica routines included in EEGLAB, as well as others (e.g., fastica). Look at the documentation for ft_componentanalysis and the example on the FieldTrip website: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Don On Apr 11, 2013, at 6:37 AM, Nicolai Mersebak > wrote: Dear all, I know that EEGLAB has some (semi)-automatic ICA algorithms, and since the ICA part in fieldtrip is the package from EEGLAB, I was wondering if fieldtrip also had implemented the automatic ICA algorithms ? I can't find any information in the help function of runica or in the mailing list. The purpose of the ICA algorithm is to remove EOG artifacts. Best, Nicolai _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ricardoojm at gmail.com Thu Apr 11 21:40:37 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Thu, 11 Apr 2013 16:40:37 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi, I had to re-install ubuntu in order to provide more space for the analysis (since I was having the problem with the temporary files, which might have been too large for my ubuntu partition). But now the problem I have with the "ft_prepare_headmodel" is even weirder than before. The program now is complaining that there is no dipoli for my system: cfg = []; cfg.method ='dipoli'; vol = ft_prepare_headmodel(cfg, segmentedmri); ??? Error using ==> ft_headmodel_dipoli at 138 there is no dipoli executable for your platform Error in ==> ft_prepare_headmodel at 226 vol = ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); I am running this script in a 2010b matlab version, installed in ubuntu 12.04. It should be working fine, right? Thanks in advance, Ricardo On 28 March 2013 14:39, Ricardo Moura wrote: > Hi Jörn, > thank you very much for your response! > I checked the segmentation and everything seems to be ok (as far as I can > say... No error messages were shown during the processing and I checked the > generated objects and plots). > > But I had a strange error while preparing the head model. Somehow the > command cannot find the dipoli files, even thought they are really where > they should be. And the second message > ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue > of what it means. > > And I am running this command on a ubuntu 12.04 32-bit. > > Do you have any idea of how I can solve it? > > Thanks once again,Best, > Ricardo > > using the executable > "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" > /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: > /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: > /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: > not found > Warning: an error ocurred while running dipoli > > In ft_headmodel_dipoli at 201 > In ft_prepare_headmodel at 226 > > Error using fread > Invalid file identifier. Use fopen to generate a valid file identifier. > Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > > In ft_headmodel_dipoli at 209 > In ft_prepare_headmodel at 226 > > > On 27 March 2013 13:10, Ricardo Moura wrote: > >> Dear all >> I am creating a BEM model for eeg, following the appropriate tutorial, >> but I have a problem when preparing the headmodel. The output I have from >> the ft_prepare_headmodel command does not contain the "mat", and so, when I >> try to generate the leadfield, it returns an error message due to non >> existent "mat". I saw that other users had similar problem, but I haven't >> found a solution though. So, what is wrong with my script? >> >> Thanks a lot in advance! >> Best, >> Ricardo >> >> >> >> >> load standard_mri.mat >> mri_orig=mri; >> disp(mri) >> >> % Segmenting the data >> cfg = []; >> cfg.output= {'scalp','skull','brain'}; >> segmentedmri = ft_volumesegment(cfg, mri_orig); >> disp(segmentedmri) >> save segmentedmri segmentedmri >> >> % MESH >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.numvertices = [3000 2000 1000]; >> bnd=ft_prepare_mesh(cfg,segmentedmri); >> disp(bnd(1)) >> >> % Head Model = variavel vol >> cfg = []; >> cfg.method ='bem_dipoli'; %dipoli singlesphere >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> disp(vol) >> bnd: [1x3 struct] >> cond: [0.3300 0.0041 0.3300] >> skin_surface: 1 >> source: 3 >> type: 'dipoli' >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdien07 at mac.com Fri Apr 12 05:46:47 2013 From: jdien07 at mac.com (Joseph Dien) Date: Thu, 11 Apr 2013 23:46:47 -0400 Subject: [FieldTrip] =?windows-1252?q?Faculty_Research_Assistant_=96_Maryl?= =?windows-1252?q?and_Neuroimaging_Center?= Message-ID: <59162179-C399-4872-90A3-F28AD66DADB7@mac.com> The Neuroscience and Cognitive Sciences Program (NACS) at the University of Maryland College Park is seeking a full-time post baccalaureate faculty research assistant for the Maryland Neuroimaging Center (MNC). The MNC FRA is expected to learn to operate a Siemens 3T MRI machine, to assist on research projects using the MRI machine, assist the MR Physicist as needed in ongoing use and maintenance of the MRI machine and assist as needed with the efforts of the center. The university is establishing a fully-equipped brain imaging center around a new Siemens 3T Trio MRI system. In the future, the MNC will include MEG, and high density EEG facilities. This is a full-time, contractual and benefits eligible position. Salary and benefits are competitive. Start date is late spring, early summer 2013. For best consideration, please electronically submit a resume, cover letter with a description of education, any research experience and computer expertise, and three references by May 17, 2013 to jcgorski at umd.edu with “FRA Search” as the subject line. The Maryland Neuroimaging Center (MNC) is the home for neuroimaging research at the University of Maryland. Housed in a spacious new facility in the Gudelsky Building, adjacent to the main College Park campus, the center has been designed to foster collaboration among neuroscientists, psychologists, cognitive scientists, engineers, and physicists. The MNC is an initiative of the University's interdepartmental Neuroscience and Cognitive Science (NACS) Program, www.nacs.umd.edu. General Description: To assist the MR Physicist as needed in the ongoing use and maintenance of the MRI machine. Primary duties and responsibilities include: Perform research MRI scanning protocols, archive and network-transfer research data. Develop and maintain databases. Coordinate and assist with scheduling. Work with MR Physicist to develop QA/QC procedures. Scan research subjects and phantoms in various MRI scanning environments to include QA/QC. Coordinate and manage scheduling of the scanner in conjunction with MR Physicist and MNC staff. Keep the scanners and control areas supplied and neat. Oversee and maintain the highest standard of safety in the MRI environment for research subjects, UMD staff and equipment. Archive study data and transfer in various modalities. Test and maintain emergency equipment and supplies. Resolve scan and other equipment malfunction issues expeditiously. Order supplies and equipment as necessary. Additional special projects as assigned. Qualifications: College degree required. Applicants must have a strong science background and a B.S. degree, preferably in biomedical sciences, engineering, psychology or neuroscience. Experience with diverse computer environments and other electronic equipment is desirable, as well as basic familiarity with computer programming and/or operating systems (e.g. Linux). Knowledge of MRI scanners/equipment is desirable, preferably the Siemens 3T trio system. We are seeking an individual with experience working in an academic environment, preferably in human subject research. Experience with software/hardware used in human research, including psychophysiology, EEG, MEG is a strong asset. This position is ideal for a recent graduate looking to gain research experience before pursuing long term career options and/or further education. The newly hired person will be trained by current MNC staff on use and maintenance of the scanner. Applicant must demonstrate technical inclination, basic troubleshooting skills, and willingness to learn, and possess a positive, team-oriented attitude. This position requires an individual that is extremely reliable and responsible yet flexible. Must be able to take initiative to implement positive changes, solve problems, and work independently. Strong verbal and written communication skills are required. The University of Maryland is an equal opportunity/affirmative action employer. Women and minorities are encouraged to apply. -------------------------------------------------------------------------------- Joseph Dien, Senior Research Scientist University of Maryland E-mail: jdien07 at mac.com Phone: 301-226-8848 Fax: 301-226-8811 http://joedien.com// -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Fri Apr 12 08:06:32 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Diego Lozano Soldevilla) Date: Fri, 12 Apr 2013 08:06:32 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: <51670147.4080803@berkeley.edu> References: <51670147.4080803@berkeley.edu> Message-ID: Hi Ingrid, I had similar problem with MEG and changing the units with ft_convert_units solved the issue: vol = ft_convert_units(vol,'cm') If not, please file a bug with a piece of data and I'll have a look, best, Diego On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > Hi all, > > When I follow the code according to the example matlab script "Create > MNI-aligned grids in individual head-space" something goes all wrong with > the units. > > I've followed the code (pasted below, from the wiki), but when I make the > figure with the template head model and dipole grid, it's wrong (see > attached ..._problem.png). The dipole grid is tiny in the bottom of the > head model. The black area is the dipole grid, not good. > template_grid = > xgrid: [1x41 double] > ygrid: [1x41 double] > zgrid: [1x41 double] > dim: [41 41 41] > pos: [68921x3 double] > unit: 'mm' > inside: [1x68910 double] > outside: [758 759 760 761 799 800 801 802 843 884 925] > cfg: [1x1 struct] > > It's a problem with the units, because the template grid has 'mm' in the > unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the > numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos > field by 10, the grid is not tight (see attached ..._multiplied10.png). It > looks like the unit problem messed up the determination of what's inside > and outside. As you can see in the template_grid, there are only a few grid > point outside, which is clearly not correct (maybe inside/outside was > determined on wrong units?). > > So, it looks like a bug to me, or am I doing something wrong? I'm using > the newest FT version. > > Thanks, > Ingrid > > %%% CODE FROM WIKI %%% > template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', > filesep,'templates', filesep,'T1.nii']); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol); > ft_plot_mesh(template_grid); > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.tewoerd at fcdonders.ru.nl Fri Apr 12 10:14:43 2013 From: e.tewoerd at fcdonders.ru.nl (Erik te Woerd) Date: Fri, 12 Apr 2013 10:14:43 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? Message-ID: Hi Ingrid, I also encountered this problem when following the tutorial, but was able to solve it in the way Diego suggests it below. While following the tutorial, all variables should be returned with corresponding units, but in ft_prepare_headmodel this doesn't work. I reported it already to bugzilla and it's being looked after... Best, Erik 2013/4/12 Diego Lozano Soldevilla > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > >> Hi all, >> >> When I follow the code according to the example matlab script "Create >> MNI-aligned grids in individual head-space" something goes all wrong with >> the units. >> >> I've followed the code (pasted below, from the wiki), but when I make the >> figure with the template head model and dipole grid, it's wrong (see >> attached ..._problem.png). The dipole grid is tiny in the bottom of the >> head model. The black area is the dipole grid, not good. >> template_grid = >> xgrid: [1x41 double] >> ygrid: [1x41 double] >> zgrid: [1x41 double] >> dim: [41 41 41] >> pos: [68921x3 double] >> unit: 'mm' >> inside: [1x68910 double] >> outside: [758 759 760 761 799 800 801 802 843 884 925] >> cfg: [1x1 struct] >> >> It's a problem with the units, because the template grid has 'mm' in the >> unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the >> numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos >> field by 10, the grid is not tight (see attached ..._multiplied10.png). It >> looks like the unit problem messed up the determination of what's inside >> and outside. As you can see in the template_grid, there are only a few grid >> point outside, which is clearly not correct (maybe inside/outside was >> determined on wrong units?). >> >> So, it looks like a bug to me, or am I doing something wrong? I'm using >> the newest FT version. >> >> Thanks, >> Ingrid >> >> %%% CODE FROM WIKI %%% >> template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', >> filesep,'templates', filesep,'T1.nii']); >> template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the >> coordinate system >> >> % segment the template brain and construct a volume conduction model >> (i.e. head model): this is needed >> % for the inside/outside detection of voxels. >> cfg = []; >> template_seg = ft_volumesegment(cfg, template); >> >> cfg = []; >> cfg.method = 'singleshell'; >> template_vol = ft_prepare_headmodel(cfg, template_seg); >> >> % construct the dipole grid in the template brain coordinates >> % the source units are in cm >> % the negative inwardshift means an outward shift of the brain surface >> for inside/outside detection >> cfg = []; >> cfg.grid.xgrid = -20:1:20; >> cfg.grid.ygrid = -20:1:20; >> cfg.grid.zgrid = -20:1:20; >> cfg.grid.unit = 'cm'; >> cfg.grid.tight = 'yes'; >> cfg.inwardshift = -1.5; >> cfg.vol = template_vol; >> template_grid = ft_prepare_sourcemodel(cfg); >> >> % make a figure with the template head model and dipole grid >> figure >> hold on >> ft_plot_vol(template_vol); >> ft_plot_mesh(template_grid); >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 Lilla.Magyari at mpi.nl Fri Apr 12 14:54:16 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 12 Apr 2013 14:54:16 +0200 (CEST) Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <51149.131.174.45.70.1365771256.squirrel@131.174.45.70> hi Ricardo, The dipoli method works on Mac and Linux. I guess it should work also on Ubuntu, but I do not know if ever anyone tested it. It seems to me from the error message that the problem is that the code does not return the right path for the file with the binary code of this method. The path is important, because different executable file is called depending on the operation system. The operation system is identified by the mexext matlab command in the script of ft_headmodel_dipoli. What do you get when you type in mexext in your matlab command line? Lilla > Hi, > > I had to re-install ubuntu in order to provide more space for the analysis > (since I was having the problem with the temporary files, which might have > been too large for my ubuntu partition). > But now the problem I have with the "ft_prepare_headmodel" is even weirder > than before. The program now is complaining that there is no dipoli for my > system: > > > cfg = []; > cfg.method ='dipoli'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > > ??? Error using ==> ft_headmodel_dipoli at 138 > there is no dipoli executable for your platform > > Error in ==> ft_prepare_headmodel at 226 > vol > ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); > > > I am running this script in a 2010b matlab version, installed in ubuntu > 12.04. It should be working fine, right? > > Thanks in advance, > Ricardo > > > On 28 March 2013 14:39, Ricardo Moura wrote: > >> Hi Jörn, >> thank you very much for your response! >> I checked the segmentation and everything seems to be ok (as far as I >> can >> say... No error messages were shown during the processing and I checked >> the >> generated objects and plots). >> >> But I had a strange error while preparing the head model. Somehow the >> command cannot find the dipoli files, even thought they are really where >> they should be. And the second message >> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no >> clue >> of what it means. >> >> And I am running this command on a ubuntu 12.04 32-bit. >> >> Do you have any idea of how I can solve it? >> >> Thanks once again,Best, >> Ricardo >> >> using the executable >> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >> not found >> Warning: an error ocurred while running dipoli >> > In ft_headmodel_dipoli at 201 >> In ft_prepare_headmodel at 226 >> >> Error using fread >> Invalid file identifier. Use fopen to generate a valid file identifier. >> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >> found. >> > In ft_headmodel_dipoli at 209 >> In ft_prepare_headmodel at 226 >> >> >> On 27 March 2013 13:10, Ricardo Moura wrote: >> >>> Dear all >>> I am creating a BEM model for eeg, following the appropriate tutorial, >>> but I have a problem when preparing the headmodel. The output I have >>> from >>> the ft_prepare_headmodel command does not contain the "mat", and so, >>> when I >>> try to generate the leadfield, it returns an error message due to non >>> existent "mat". I saw that other users had similar problem, but I >>> haven't >>> found a solution though. So, what is wrong with my script? >>> >>> Thanks a lot in advance! >>> Best, >>> Ricardo >>> >>> >>> >>> >>> load standard_mri.mat >>> mri_orig=mri; >>> disp(mri) >>> >>> % Segmenting the data >>> cfg = []; >>> cfg.output= {'scalp','skull','brain'}; >>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>> disp(segmentedmri) >>> save segmentedmri segmentedmri >>> >>> % MESH >>> cfg=[]; >>> cfg.tissue={'brain','skull','scalp'}; >>> cfg.numvertices = [3000 2000 1000]; >>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>> disp(bnd(1)) >>> >>> % Head Model = variavel vol >>> cfg = []; >>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> >>> >> disp(vol) >>> bnd: [1x3 struct] >>> cond: [0.3300 0.0041 0.3300] >>> skin_surface: 1 >>> source: 3 >>> type: 'dipoli' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Lilla.Magyari at mpi.nl Fri Apr 12 17:03:11 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 12 Apr 2013 17:03:11 +0200 (CEST) Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <516631A8.1030006@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> Message-ID: <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> hi Ingrid, I would like to comment on this because I have been discussing this with Robert, and we thought that for the lower electrodes, it is still not optimal when only the skin is extended which is more conductive then the skull. I have attached two images for illustration. The FT segmentation will produce the segmentation in origskull.jpg. This is fine when the electrodes do not extend lower than the skull. When the electrodes are lower, a segmentation like the one in extendedskull.jpg is probably more useful. I created this extended skull based on the skin segmentation with the imerode function of the matlab image processing toolbox (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). Best, Lilla > Hi Imali, > > Tzvetan shared the bem model made from the tutorial MRI with me, that > one extends to low enough, so I'm good! Thanks a lot though! > > Cheers, > Ingird > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >> >> Hi Ingrid, >> >> I had similar issues with creating my own BEM as I too did not have >> the individual MRI's nor the digitized electrode positions. >> >> I created a BEM using the Curry (Neuroscan) software and imported in >> .mat format to use with Fieldtrip. However these are also based on the >> MNI template. >> >> I am not sure whether this extends lower enough for your situation. I >> am attaching here a picture of my head model showing the skull and >> cortex with my registered electrodes. If you are happy with it, I am >> more than happy to share it with you. >> >> Please let me know. >> >> Regards >> >> Imali >> >> *From:*fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >> Nieuwenhuis >> *Sent:* Thursday, 11 April 2013 4:22 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> Just had a brain wave, I'll share it for people with similar situation >> that might be interested in this thread. I think I should just get a >> random structural MRI that extends lower (includes ears and bit >> below), optimally of a subject with a head similar to the MNI >> template. Make a BEM model (hmm, have to fix these errors I mentioned >> earlier then, well, should be doable on linux using dipoli). Then use >> ft_electroderealign to align the electrodes to this MRI, do the source >> analysis for all subjects using this model, and subsequently use >> ft_volumenormalise to normalize to MNI template if I want to use any >> atlas functionality. >> >> If anyone did this already using FieldTrip and has a pre-made BEM >> (just like the standard_bem), would be really nice if you're willing >> to share :) >> If not, I'll make my own, and people with low electrodes and no >> structural MRI and or no linux access can email me if they want to use >> it. >> >> Cheers, >> Ingrid >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >> >> Hi Lilla and Imali, >> >> Thanks for your replies. In my case, the problem is not the >> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >> everything is where it should be. The EGI 128 electrode net really >> has these low electrodes, which are there specifically to make >> source analysis better by capturing more of the electric field. So >> I would have the best solution if I'd leave them there. However, >> in the model as derived from the MNI template, the skin part does >> not go down low enough. >> >> I looked at the picture after ft_prepare_vol_sens (see >> attachement, black is before, red is after), and indeed, this is >> not good. The low electrodes are squeezed up, and this will make >> source analysis worse. So I should indeed remove these electrodes >> (which is a pity), or find a better MNI template. >> >> *So my question is:* >> Does anyone know of a template in MNI space that extends more >> down? This template comes from SPM8, is there a version that >> extends lower? Or could I extend the skin roughly downwards with >> some triangular magic? >> >> I'm also a bit confused about the statement on this wiki page: >> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >> >> under "revision information" header "skin" is says: "This skin >> surface is not used in the BEM model itself for computational >> reasons, but can be used for visualization." >> But this does not seem to be the case, since my electrode >> positions are modified based on till where the skin goes. So the >> skin surface does significantly influence the source analysis. >> >> Anyway, thanks for all the help, and worse case, I just get rid of >> the low fellows. >> >> Cheers, >> Ingrid >> >> >> -- >> >> Ingrid Nieuwenhuis PhD >> >> Postdoctoral Fellow >> >> Sleep and Neuroimaging Laboratory >> >> Department of Psychology >> >> University of California, Berkeley >> >> California 94720-1650 >> >> Tolman Hall, room 5305 >> >> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >> >> hi Ingrid and Imali, >> >> >> I think it is a really good question what to do in Ingrid's >> case. I do not know the "right" answer, but I would like to >> share my thoughts about it. >> >> The ft_prepare_vol_sens is indeed projects the electrode >> positions closer to the headsurface as Imali wrote. But this >> function called automatically when you create your leadfield, >> so you do not have to do it separately (unless you want to >> visualize the corrected electrode positions). >> >> However, I have been advised to rely on this projection >> carefully if electrode positions are far from the skin and >> specially, if the inaccuracies (distance from the skin) are >> not equally distributed across the electrodes, because that >> can cause a spatial bias. >> >> Therefore, my question would be: why are those electrodes so >> low? Are those positions reflect the actual positions of the >> electrodes during the measurement? If yes, I would not change >> their positions, I would rather try to extend my headmodel >> e.g. by using another template. (or another (but quite >> suboptimal) possibility is maybe to exclude those electrodes >> (and the data) from the analysis if they are anyway far from >> the brain.) >> >> If the position of the electrodes should be higher up on the >> head, then instead of relying on projection, I would try first >> to scale the electrodes to fit them into the headsurface with >> the ft_electroderealign function. >> >> I looked to the standard_bem file in the template directory, >> and I also load in the standard_1020.elc, and those electrodes >> perfectly fit the vol. So, it seems that the extension of the >> standard bem headsurface is suitable for the area which is >> covered by the those template electrodes. And I do not know if >> the electrode set you use should cover a larger surface of the >> head, or if it should be just adjusted to the given headsurface. >> >> Lilla >> >> >> >> >> IMALI THANUJA HETTIARACHCHI wrote: >> >> Hi Ingrid, >> >> I had a similar issue a few weeks ago, where my lower most >> electrodes >> started floating after electrode realign using the >> ft_electroderealign >> function. >> >> I used the ft_prepare_vol_sens as, >> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >> trick and >> brought the electrodes on to the skin. >> >> Hope this helps...! >> >> Regards >> Imali >> >> >> *From:* fieldtrip-bounces at science.ru.nl >> >> [fieldtrip-bounces at science.ru.nl >> ] on behalf of Ingrid >> Nieuwenhuis >> [inieuwenhuis at berkeley.edu ] >> *Sent:* Wednesday, 10 April 2013 9:29 AM >> *To:* fieldtrip at science.ru.nl >> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >> >> Hi all, >> >> A follow up on this and some new issues: >> >> 1) I first tried Jörn's approach by creating my own BEM, >> always fun to >> make it yourself ;) However, I did not succeed since: >> a) the dipoli method does not work on Windows >> b) I downloaded the openmeeg toolbox, but got an error >> "om_minverser.exe >> has stopped working" I've emailed their buglist >> c) bemcp did run, but the result was not ok (see attachement). >> I also >> got the warning "% Warning: Matrix is singular, close to >> singular or >> badly scaled. Results may be inaccurate." several times, so >> that might >> be the problem. >> d) and asa gave the following error: % Error using >> ft_prepare_headmodel >> (line 201) % You must supply a valid cfg.hdmfile for use with >> ASA headmodel >> >> And away went my determination to do it myself, so I continued >> using >> thestandard_bem.mat >> >> . >> >> (I did not know this existed, I've added this link to note in >> the >> headmodel tutorial >> >> >> to >> make it easier to find, thanks Tzvetan for pointing this out!). >> >> 2) This worked and after some fiddling to get the electrodes >> aligned it >> looks okay (see attached). >> However, as you can see in the figures, I have several very low >> electrodes, that are lower than the skin mesh. So I was >> wondering if >> this is a problem? Since for accurate calculation of how the >> currents >> flow from these low electrodes, I assume one needs the skin to >> go till >> there? What happens when I have electrodes floating in thin air? >> *So my question is:* >> a) will this cause great inaccuracies? >> b) if so, how can I extend the skin to go lower? The template >> MRI only >> goes that far to the bottom... Trick anyone? >> >> Thanks again, >> Ingrid >> >> >> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >> >> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >> put it on >> the wiki. >> Have a great day, >> Ingrid >> >> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >> >> Dear Ingrid, >> >> in addition to Jorn's approach since you don't have MR and >> digitized >> elec position's you can load and realign the electrodes to the >> standard bem. Subsequently you can calculate the lead field and >> continue with your analysis pipeline. >> Good luck >> tzvetan >> %% read electrodes >> elec = ft_read_sens('/your >> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >> >> %% read headmodel >> templateheadmodel = '/your >> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >> load(templateheadmodel); >> %% electrode realign as good as possible >> % i.e. translate 0 -2 1.5 >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = vol.bnd(1).pnt; >> elecR = ft_electroderealign(cfg); >> %% verify how the electrodes fit toghether with the brain volume >> cfg=[]; >> cfg.method = 'interactive'; >> cfg.elec = elecR; >> cfg.headshape = vol.bnd(3).pnt; >> elecR = ft_electroderealign(cfg); >> >> >> >> Hi Ingrid, >> >> I just happen to done this a few weeks back, I changed things >> in the >> meanwhile, but I hope that the below steps are complete: >> /% read in the template MRI >> if isunix >> mri = >> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >> >> elseif ispc >> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >> 'external', >> 'spm8', 'templates', 'T1.nii')); >> end >> >> >> % segment the MRI >> cfg = []; >> cfg.output = {'brain' 'skull' 'scalp'}; >> segmentedmri = ft_volumesegment(cfg, mris); >> >> >> % create the headmodel (BEM) >> cfg = []; >> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >> if isunix >> cfg.method ='dipoli'; % dipoli only works under linux >> else >> disp('TODO FIXME stick to dipoli for now or download >> openmeeg\n'); >> keyboard; >> end >> hdm = ft_prepare_headmodel(cfg, segmentedmri); >> >> elec = ft_read_sens('standard_1020.elc'); >> hdm = ft_convert_units(hdm, elec.unit); >> >> cfg = []; >> cfg.grid.xgrid = -125:8:125; >> cfg.grid.ygrid = -125:8:125; >> cfg.grid.zgrid = -125:8:125; >> cfg.grid.tight = 'yes'; >> cfg.grid.unit = hdm.unit; >> cfg.inwardshift = -1.5; >> cfg.vol = hdm; >> grid = ft_prepare_sourcemodel(cfg) >> grid = ft_convert_units(grid, elec.unit); >> >> figure; >> hold on; >> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> ft_plot_mesh(grid.pos(grid.inside, :)); >> >> % this step is not necessary, cause you will see that >> everything is >> already aligned >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = hdm.bnd(1); >> tmp = ft_electroderealign(cfg); >> elec = tmp; % I had a bug here that I couldn't assign elec >> directly >> >> %% verify location of occipital electrodes >> >> occ_elec = elec; >> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >> elec.label); >> occ_idx = match_str(elec.label, occ_chan); >> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >> occ_elec.label = occ_elec.label(occ_idx, :); >> figure; >> ft_plot_sens(occ_elec) >> hold on; >> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >> >> >> Afair, that's all that is needed. Of course you need to adjust >> folder and file names. >> >> Greetings >> Jörn >> >> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >> >> Hi all, >> >> I'd like to do source analysis (loreta and or DICS) on my EEG >> data. >> I don't have anatomical MRIs and I don't have a measurement of >> the >> scalp surface. So I'd like to use a template MRI or a template >> head >> model that is located in the FieldTrip template directory. I >> have >> EGI (128 channels) data and electrode positions (not subject >> specific, just the standard file also available in FieldTrip >> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >> how to start. I don't see any examples on the FieldTrip page >> of how >> to make a headmodel and volume conduction model giving only this >> limited data. I'd be happy to make it into a example Matlab >> script >> on the FieldTrip page after I got it to work. Would someone be >> able >> to give me some pointers, or example code? >> >> Thanks a lot! >> Ingrid >> >> >> >> -- >> 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 >> >> >> ******************************************* >> Tzvetan Popov >> Clinical Psychology >> University of Konstanz >> Box 23 >> 78457 Konstanz, GERMANY >> Phone: 0049-7531-883086 >> Fax: 0049-7531-884601 >> Email: tzvetan.popov at uni-konstanz.de >> >> >> >> ******************************************* >> >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- A non-text attachment was scrubbed... Name: origskull.jpg Type: image/jpeg Size: 67045 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: extendedskull.jpg Type: image/jpeg Size: 69863 bytes Desc: not available URL: From ricardoojm at gmail.com Fri Apr 12 18:39:10 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Fri, 12 Apr 2013 13:39:10 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Lilla, Thank you very much for your reply. It returns "mexglx", which is expected for a linux system, right? I tried to change the path by my self in the ft_headmodel_dipoli but it didnt work. Do you know how can I change it properly? Best wishes Ricardo On 11 April 2013 16:40, Ricardo Moura wrote: > Hi, > > I had to re-install ubuntu in order to provide more space for the analysis > (since I was having the problem with the temporary files, which might have > been too large for my ubuntu partition). > But now the problem I have with the "ft_prepare_headmodel" is even > weirder than before. The program now is complaining that there is no dipoli > for my system: > > > cfg = []; > cfg.method ='dipoli'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > > ??? Error using ==> ft_headmodel_dipoli at 138 > there is no dipoli executable for your platform > > Error in ==> ft_prepare_headmodel at 226 > vol = > ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); > > > I am running this script in a 2010b matlab version, installed in ubuntu > 12.04. It should be working fine, right? > > Thanks in advance, > Ricardo > > > On 28 March 2013 14:39, Ricardo Moura wrote: > >> Hi Jörn, >> thank you very much for your response! >> I checked the segmentation and everything seems to be ok (as far as I can >> say... No error messages were shown during the processing and I checked the >> generated objects and plots). >> >> But I had a strange error while preparing the head model. Somehow the >> command cannot find the dipoli files, even thought they are really where >> they should be. And the second message >> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue >> of what it means. >> >> And I am running this command on a ubuntu 12.04 32-bit. >> >> Do you have any idea of how I can solve it? >> >> Thanks once again,Best, >> Ricardo >> >> using the executable >> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >> not found >> Warning: an error ocurred while running dipoli >> > In ft_headmodel_dipoli at 201 >> In ft_prepare_headmodel at 226 >> >> Error using fread >> Invalid file identifier. Use fopen to generate a valid file identifier. >> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >> found. >> > In ft_headmodel_dipoli at 209 >> In ft_prepare_headmodel at 226 >> >> >> On 27 March 2013 13:10, Ricardo Moura wrote: >> >>> Dear all >>> I am creating a BEM model for eeg, following the appropriate tutorial, >>> but I have a problem when preparing the headmodel. The output I have from >>> the ft_prepare_headmodel command does not contain the "mat", and so, when I >>> try to generate the leadfield, it returns an error message due to non >>> existent "mat". I saw that other users had similar problem, but I haven't >>> found a solution though. So, what is wrong with my script? >>> >>> Thanks a lot in advance! >>> Best, >>> Ricardo >>> >>> >>> >>> >>> load standard_mri.mat >>> mri_orig=mri; >>> disp(mri) >>> >>> % Segmenting the data >>> cfg = []; >>> cfg.output= {'scalp','skull','brain'}; >>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>> disp(segmentedmri) >>> save segmentedmri segmentedmri >>> >>> % MESH >>> cfg=[]; >>> cfg.tissue={'brain','skull','scalp'}; >>> cfg.numvertices = [3000 2000 1000]; >>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>> disp(bnd(1)) >>> >>> % Head Model = variavel vol >>> cfg = []; >>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> >>> >> disp(vol) >>> bnd: [1x3 struct] >>> cond: [0.3300 0.0041 0.3300] >>> skin_surface: 1 >>> source: 3 >>> type: 'dipoli' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Fri Apr 12 19:51:34 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Fri, 12 Apr 2013 10:51:34 -0700 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: References: Message-ID: <516849A6.2080604@berkeley.edu> Thanks both, I do agree it's a bug then, because the units are known to the functions and they should not behave like this. The units should be converted automatically, or an error should appear telling the user to convert units to match. Anyway, a bugs already filed and a work around is possible, so all good. By the way, I also found a way around my self that might be useful for others to know. There are templates in FieldTrip now (great all this pre-made stuff). So I just did below, and voila :) Thanks, Ingrid %%% my work around %%% load('standard_sourcemodel3d7point5mm') % read the single subject anatomical MRI mri = ft_read_mri(['D:\FT_DATA\Subject01', filesep, 'Subject01.mri']); % create the subject specific grid, using the template grid that has just been loaded cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.sourceunits = 'mm'; grid = ft_prepare_sourcemodel(cfg); On 4/12/2013 1:14 AM, Erik te Woerd wrote: > Hi Ingrid, > > I also encountered this problem when following the tutorial, but was > able to solve it in the way Diego suggests it below. While following > the tutorial, all variables should be returned with corresponding > units, but in ft_prepare_headmodel this doesn't work. > I reported it already to bugzilla and it's being looked after... > > Best, > > Erik > > > 2013/4/12 Diego Lozano Soldevilla > > > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis > > wrote: > > Hi all, > > When I follow the code according to the example matlab script > "Create MNI-aligned grids in individual head-space" something > goes all wrong with the units. > > I've followed the code (pasted below, from the wiki), but when > I make the figure with the template head model and dipole > grid, it's wrong (see attached ..._problem.png). The dipole > grid is tiny in the bottom of the head model. The black area > is the dipole grid, not good. > template_grid = > xgrid: [1x41 double] > ygrid: [1x41 double] > zgrid: [1x41 double] > dim: [41 41 41] > pos: [68921x3 double] > unit: 'mm' > inside: [1x68910 double] > outside: [758 759 760 761 799 800 801 802 843 884 925] > cfg: [1x1 struct] > > It's a problem with the units, because the template grid has > 'mm' in the unit field, but when I look in the xgrid, ygrid, > zgrid and pos fields the numbers are clearly cm not mm. > However, when I multiply my xyzgrid and pos field by 10, the > grid is not tight (see attached ..._multiplied10.png). It > looks like the unit problem messed up the determination of > what's inside and outside. As you can see in the > template_grid, there are only a few grid point outside, which > is clearly not correct (maybe inside/outside was determined on > wrong units?). > > So, it looks like a bug to me, or am I doing something wrong? > I'm using the newest FT version. > > Thanks, > Ingrid > > %%% CODE FROM WIKI %%% > template = ft_read_mri([cur_path_FT 'external', > filesep, 'spm8', filesep,'templates', filesep,'T1.nii']); > template.coordsys = 'spm'; % so that FieldTrip knows how to > interpret the coordinate system > > % segment the template brain and construct a volume conduction > model (i.e. head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain > surface for inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol); > ft_plot_mesh(template_grid); > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Fri Apr 12 20:08:31 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Fri, 12 Apr 2013 11:08:31 -0700 Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> Message-ID: <51684D9F.8020207@berkeley.edu> Hi Lilla, Yeah, the skull, I was thinking about that too. So if I understand the pics you sent, the skull is now extended as if it's massive just under the skin. I don't know enough about the volume conduction model and the exact effect of the skull/skin in it to really know what would be better: Not extended skull or massive extended skull. But here's my 2 cents: In my case, the low electrodes are mostly on the cheek and low in the neck. As you can see on the pic I attached to this email, the neck bone does not extend that low, and the cheek doesn't really have bone. So, I'm not sure the extended massive-bone one would be better. Best would be of course to segment the real bone from the MRI, but I have no clue how the segmentation magic takes place, probably is not trivial. Currently it only finds the not extended skull. And making the rest of the bone, if you could segment it, into a mesh is not possible I think, so it has to be sort of massive (meshable). So indeed, to extend or not to extend, that's the question. Probably depends on the location of the low electrodes. I think in my case I would tend to lean towards choosing not to extend. Thanks, Ingrid On 4/12/2013 8:03 AM, Lilla.Magyari at mpi.nl wrote: > hi Ingrid, > > I would like to comment on this because I have been discussing this with > Robert, and we thought that for the lower electrodes, it is still not > optimal when only the skin is extended which is more conductive then the > skull. I have attached two images for illustration. The FT segmentation > will produce the segmentation in origskull.jpg. This is fine when the > electrodes do not extend lower than the skull. When the electrodes are > lower, a segmentation like the one in extendedskull.jpg is probably more > useful. > > I created this extended skull based on the skin segmentation with the > imerode function of the matlab image processing toolbox > (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). > > Best, > Lilla > > > >> Hi Imali, >> >> Tzvetan shared the bem model made from the tutorial MRI with me, that >> one extends to low enough, so I'm good! Thanks a lot though! >> >> Cheers, >> Ingird >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >>> Hi Ingrid, >>> >>> I had similar issues with creating my own BEM as I too did not have >>> the individual MRI's nor the digitized electrode positions. >>> >>> I created a BEM using the Curry (Neuroscan) software and imported in >>> .mat format to use with Fieldtrip. However these are also based on the >>> MNI template. >>> >>> I am not sure whether this extends lower enough for your situation. I >>> am attaching here a picture of my head model showing the skull and >>> cortex with my registered electrodes. If you are happy with it, I am >>> more than happy to share it with you. >>> >>> Please let me know. >>> >>> Regards >>> >>> Imali >>> >>> *From:*fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >>> Nieuwenhuis >>> *Sent:* Thursday, 11 April 2013 4:22 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> Just had a brain wave, I'll share it for people with similar situation >>> that might be interested in this thread. I think I should just get a >>> random structural MRI that extends lower (includes ears and bit >>> below), optimally of a subject with a head similar to the MNI >>> template. Make a BEM model (hmm, have to fix these errors I mentioned >>> earlier then, well, should be doable on linux using dipoli). Then use >>> ft_electroderealign to align the electrodes to this MRI, do the source >>> analysis for all subjects using this model, and subsequently use >>> ft_volumenormalise to normalize to MNI template if I want to use any >>> atlas functionality. >>> >>> If anyone did this already using FieldTrip and has a pre-made BEM >>> (just like the standard_bem), would be really nice if you're willing >>> to share :) >>> If not, I'll make my own, and people with low electrodes and no >>> structural MRI and or no linux access can email me if they want to use >>> it. >>> >>> Cheers, >>> Ingrid >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >>> >>> Hi Lilla and Imali, >>> >>> Thanks for your replies. In my case, the problem is not the >>> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >>> everything is where it should be. The EGI 128 electrode net really >>> has these low electrodes, which are there specifically to make >>> source analysis better by capturing more of the electric field. So >>> I would have the best solution if I'd leave them there. However, >>> in the model as derived from the MNI template, the skin part does >>> not go down low enough. >>> >>> I looked at the picture after ft_prepare_vol_sens (see >>> attachement, black is before, red is after), and indeed, this is >>> not good. The low electrodes are squeezed up, and this will make >>> source analysis worse. So I should indeed remove these electrodes >>> (which is a pity), or find a better MNI template. >>> >>> *So my question is:* >>> Does anyone know of a template in MNI space that extends more >>> down? This template comes from SPM8, is there a version that >>> extends lower? Or could I extend the skin roughly downwards with >>> some triangular magic? >>> >>> I'm also a bit confused about the statement on this wiki page: >>> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >>> >>> under "revision information" header "skin" is says: "This skin >>> surface is not used in the BEM model itself for computational >>> reasons, but can be used for visualization." >>> But this does not seem to be the case, since my electrode >>> positions are modified based on till where the skin goes. So the >>> skin surface does significantly influence the source analysis. >>> >>> Anyway, thanks for all the help, and worse case, I just get rid of >>> the low fellows. >>> >>> Cheers, >>> Ingrid >>> >>> >>> -- >>> >>> Ingrid Nieuwenhuis PhD >>> >>> Postdoctoral Fellow >>> >>> Sleep and Neuroimaging Laboratory >>> >>> Department of Psychology >>> >>> University of California, Berkeley >>> >>> California 94720-1650 >>> >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >>> >>> hi Ingrid and Imali, >>> >>> >>> I think it is a really good question what to do in Ingrid's >>> case. I do not know the "right" answer, but I would like to >>> share my thoughts about it. >>> >>> The ft_prepare_vol_sens is indeed projects the electrode >>> positions closer to the headsurface as Imali wrote. But this >>> function called automatically when you create your leadfield, >>> so you do not have to do it separately (unless you want to >>> visualize the corrected electrode positions). >>> >>> However, I have been advised to rely on this projection >>> carefully if electrode positions are far from the skin and >>> specially, if the inaccuracies (distance from the skin) are >>> not equally distributed across the electrodes, because that >>> can cause a spatial bias. >>> >>> Therefore, my question would be: why are those electrodes so >>> low? Are those positions reflect the actual positions of the >>> electrodes during the measurement? If yes, I would not change >>> their positions, I would rather try to extend my headmodel >>> e.g. by using another template. (or another (but quite >>> suboptimal) possibility is maybe to exclude those electrodes >>> (and the data) from the analysis if they are anyway far from >>> the brain.) >>> >>> If the position of the electrodes should be higher up on the >>> head, then instead of relying on projection, I would try first >>> to scale the electrodes to fit them into the headsurface with >>> the ft_electroderealign function. >>> >>> I looked to the standard_bem file in the template directory, >>> and I also load in the standard_1020.elc, and those electrodes >>> perfectly fit the vol. So, it seems that the extension of the >>> standard bem headsurface is suitable for the area which is >>> covered by the those template electrodes. And I do not know if >>> the electrode set you use should cover a larger surface of the >>> head, or if it should be just adjusted to the given headsurface. >>> >>> Lilla >>> >>> >>> >>> >>> IMALI THANUJA HETTIARACHCHI wrote: >>> >>> Hi Ingrid, >>> >>> I had a similar issue a few weeks ago, where my lower most >>> electrodes >>> started floating after electrode realign using the >>> ft_electroderealign >>> function. >>> >>> I used the ft_prepare_vol_sens as, >>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >>> trick and >>> brought the electrodes on to the skin. >>> >>> Hope this helps...! >>> >>> Regards >>> Imali >>> >>> >>> *From:* fieldtrip-bounces at science.ru.nl >>> >>> [fieldtrip-bounces at science.ru.nl >>> ] on behalf of Ingrid >>> Nieuwenhuis >>> [inieuwenhuis at berkeley.edu ] >>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>> *To:* fieldtrip at science.ru.nl >>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>> >>> Hi all, >>> >>> A follow up on this and some new issues: >>> >>> 1) I first tried Jörn's approach by creating my own BEM, >>> always fun to >>> make it yourself ;) However, I did not succeed since: >>> a) the dipoli method does not work on Windows >>> b) I downloaded the openmeeg toolbox, but got an error >>> "om_minverser.exe >>> has stopped working" I've emailed their buglist >>> c) bemcp did run, but the result was not ok (see attachement). >>> I also >>> got the warning "% Warning: Matrix is singular, close to >>> singular or >>> badly scaled. Results may be inaccurate." several times, so >>> that might >>> be the problem. >>> d) and asa gave the following error: % Error using >>> ft_prepare_headmodel >>> (line 201) % You must supply a valid cfg.hdmfile for use with >>> ASA headmodel >>> >>> And away went my determination to do it myself, so I continued >>> using >>> thestandard_bem.mat >>> >>> . >>> >>> (I did not know this existed, I've added this link to note in >>> the >>> headmodel tutorial >>> >>> >>> to >>> make it easier to find, thanks Tzvetan for pointing this out!). >>> >>> 2) This worked and after some fiddling to get the electrodes >>> aligned it >>> looks okay (see attached). >>> However, as you can see in the figures, I have several very low >>> electrodes, that are lower than the skin mesh. So I was >>> wondering if >>> this is a problem? Since for accurate calculation of how the >>> currents >>> flow from these low electrodes, I assume one needs the skin to >>> go till >>> there? What happens when I have electrodes floating in thin air? >>> *So my question is:* >>> a) will this cause great inaccuracies? >>> b) if so, how can I extend the skin to go lower? The template >>> MRI only >>> goes that far to the bottom... Trick anyone? >>> >>> Thanks again, >>> Ingrid >>> >>> >>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>> >>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >>> put it on >>> the wiki. >>> Have a great day, >>> Ingrid >>> >>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>> >>> Dear Ingrid, >>> >>> in addition to Jorn's approach since you don't have MR and >>> digitized >>> elec position's you can load and realign the electrodes to the >>> standard bem. Subsequently you can calculate the lead field and >>> continue with your analysis pipeline. >>> Good luck >>> tzvetan >>> %% read electrodes >>> elec = ft_read_sens('/your >>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>> >>> %% read headmodel >>> templateheadmodel = '/your >>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>> load(templateheadmodel); >>> %% electrode realign as good as possible >>> % i.e. translate 0 -2 1.5 >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = vol.bnd(1).pnt; >>> elecR = ft_electroderealign(cfg); >>> %% verify how the electrodes fit toghether with the brain volume >>> cfg=[]; >>> cfg.method = 'interactive'; >>> cfg.elec = elecR; >>> cfg.headshape = vol.bnd(3).pnt; >>> elecR = ft_electroderealign(cfg); >>> >>> >>> >>> Hi Ingrid, >>> >>> I just happen to done this a few weeks back, I changed things >>> in the >>> meanwhile, but I hope that the below steps are complete: >>> /% read in the template MRI >>> if isunix >>> mri = >>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>> >>> elseif ispc >>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>> 'external', >>> 'spm8', 'templates', 'T1.nii')); >>> end >>> >>> >>> % segment the MRI >>> cfg = []; >>> cfg.output = {'brain' 'skull' 'scalp'}; >>> segmentedmri = ft_volumesegment(cfg, mris); >>> >>> >>> % create the headmodel (BEM) >>> cfg = []; >>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>> if isunix >>> cfg.method ='dipoli'; % dipoli only works under linux >>> else >>> disp('TODO FIXME stick to dipoli for now or download >>> openmeeg\n'); >>> keyboard; >>> end >>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>> >>> elec = ft_read_sens('standard_1020.elc'); >>> hdm = ft_convert_units(hdm, elec.unit); >>> >>> cfg = []; >>> cfg.grid.xgrid = -125:8:125; >>> cfg.grid.ygrid = -125:8:125; >>> cfg.grid.zgrid = -125:8:125; >>> cfg.grid.tight = 'yes'; >>> cfg.grid.unit = hdm.unit; >>> cfg.inwardshift = -1.5; >>> cfg.vol = hdm; >>> grid = ft_prepare_sourcemodel(cfg) >>> grid = ft_convert_units(grid, elec.unit); >>> >>> figure; >>> hold on; >>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', >>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>> ft_plot_mesh(grid.pos(grid.inside, :)); >>> >>> % this step is not necessary, cause you will see that >>> everything is >>> already aligned >>> cfg = []; >>> cfg.method = 'interactive'; >>> cfg.elec = elec; >>> cfg.headshape = hdm.bnd(1); >>> tmp = ft_electroderealign(cfg); >>> elec = tmp; % I had a bug here that I couldn't assign elec >>> directly >>> >>> %% verify location of occipital electrodes >>> >>> occ_elec = elec; >>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>> elec.label); >>> occ_idx = match_str(elec.label, occ_chan); >>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>> occ_elec.label = occ_elec.label(occ_idx, :); >>> figure; >>> ft_plot_sens(occ_elec) >>> hold on; >>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>> >>> >>> Afair, that's all that is needed. Of course you need to adjust >>> folder and file names. >>> >>> Greetings >>> Jörn >>> >>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>> >>> Hi all, >>> >>> I'd like to do source analysis (loreta and or DICS) on my EEG >>> data. >>> I don't have anatomical MRIs and I don't have a measurement of >>> the >>> scalp surface. So I'd like to use a template MRI or a template >>> head >>> model that is located in the FieldTrip template directory. I >>> have >>> EGI (128 channels) data and electrode positions (not subject >>> specific, just the standard file also available in FieldTrip >>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck >>> how to start. I don't see any examples on the FieldTrip page >>> of how >>> to make a headmodel and volume conduction model giving only this >>> limited data. I'd be happy to make it into a example Matlab >>> script >>> on the FieldTrip page after I got it to work. Would someone be >>> able >>> to give me some pointers, or example code? >>> >>> Thanks a lot! >>> Ingrid >>> >>> >>> >>> -- >>> 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 >>> >>> >>> ******************************************* >>> Tzvetan Popov >>> Clinical Psychology >>> University of Konstanz >>> Box 23 >>> 78457 Konstanz, GERMANY >>> Phone: 0049-7531-883086 >>> Fax: 0049-7531-884601 >>> Email: tzvetan.popov at uni-konstanz.de >>> >>> >>> >>> ******************************************* >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sb10063654e-001.jpg Type: image/jpeg Size: 64547 bytes Desc: not available URL: From polomacnenad at gmail.com Fri Apr 12 21:16:27 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 12 Apr 2013 21:16:27 +0200 Subject: [FieldTrip] ft_read_sens on brain vision eeg data Message-ID: Dear all, I would like to read sensors locations with ft_read_sens and it doesn't work. I have eeg data recorded with Brain Vision Recorder. It seems that that ft_read_sens doesn't recognize this file format. Please help! Thank you in advance! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Apr 15 12:13:28 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 15 Apr 2013 12:13:28 +0200 (CEST) Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <49931.131.174.45.70.1366020808.squirrel@131.174.45.70> hi Ricardo, I'd change forward/ft_headmodel_dipoli.m in line 134 from this: case {'mexglnx86' 'mexa64'} to this: case {'mexglnx86' 'mexa64' 'mexglx'} Please, try this first, and if it is still not working, it is possible that you should compile it yourself. If that still doesn't work out, please, send a message to the bugzilla. http://bugzilla.fcdonders.nl/ And if you could run it, please, also give us a feedback about it. Thanks. Best, Lilla > Hi Lilla, > Thank you very much for your reply. > It returns "mexglx", which is expected for a linux system, right? > I tried to change the path by my self in the ft_headmodel_dipoli but it > didnt work. Do you know how can I change it properly? > > Best wishes > Ricardo > > > On 11 April 2013 16:40, Ricardo Moura wrote: > >> Hi, >> >> I had to re-install ubuntu in order to provide more space for the >> analysis >> (since I was having the problem with the temporary files, which might >> have >> been too large for my ubuntu partition). >> But now the problem I have with the "ft_prepare_headmodel" is even >> weirder than before. The program now is complaining that there is no >> dipoli >> for my system: >> >> >> cfg = []; >> cfg.method ='dipoli'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> ??? Error using ==> ft_headmodel_dipoli at 138 >> there is no dipoli executable for your platform >> >> Error in ==> ft_prepare_headmodel at 226 >> vol > >> ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); >> >> >> I am running this script in a 2010b matlab version, installed in ubuntu >> 12.04. It should be working fine, right? >> >> Thanks in advance, >> Ricardo >> >> >> On 28 March 2013 14:39, Ricardo Moura wrote: >> >>> Hi Jörn, >>> thank you very much for your response! >>> I checked the segmentation and everything seems to be ok (as far as I >>> can >>> say... No error messages were shown during the processing and I checked >>> the >>> generated objects and plots). >>> >>> But I had a strange error while preparing the head model. Somehow the >>> command cannot find the dipoli files, even thought they are really >>> where >>> they should be. And the second message >>> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no >>> clue >>> of what it means. >>> >>> And I am running this command on a ubuntu 12.04 32-bit. >>> >>> Do you have any idea of how I can solve it? >>> >>> Thanks once again,Best, >>> Ricardo >>> >>> using the executable >>> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >>> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >>> not found >>> Warning: an error ocurred while running dipoli >>> > In ft_headmodel_dipoli at 201 >>> In ft_prepare_headmodel at 226 >>> >>> Error using fread >>> Invalid file identifier. Use fopen to generate a valid file >>> identifier. >>> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >>> found. >>> > In ft_headmodel_dipoli at 209 >>> In ft_prepare_headmodel at 226 >>> >>> >>> On 27 March 2013 13:10, Ricardo Moura wrote: >>> >>>> Dear all >>>> I am creating a BEM model for eeg, following the appropriate tutorial, >>>> but I have a problem when preparing the headmodel. The output I have >>>> from >>>> the ft_prepare_headmodel command does not contain the "mat", and so, >>>> when I >>>> try to generate the leadfield, it returns an error message due to non >>>> existent "mat". I saw that other users had similar problem, but I >>>> haven't >>>> found a solution though. So, what is wrong with my script? >>>> >>>> Thanks a lot in advance! >>>> Best, >>>> Ricardo >>>> >>>> >>>> >>>> >>>> load standard_mri.mat >>>> mri_orig=mri; >>>> disp(mri) >>>> >>>> % Segmenting the data >>>> cfg = []; >>>> cfg.output= {'scalp','skull','brain'}; >>>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>>> disp(segmentedmri) >>>> save segmentedmri segmentedmri >>>> >>>> % MESH >>>> cfg=[]; >>>> cfg.tissue={'brain','skull','scalp'}; >>>> cfg.numvertices = [3000 2000 1000]; >>>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>>> disp(bnd(1)) >>>> >>>> % Head Model = variavel vol >>>> cfg = []; >>>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> >>>> >> disp(vol) >>>> bnd: [1x3 struct] >>>> cond: [0.3300 0.0041 0.3300] >>>> skin_surface: 1 >>>> source: 3 >>>> type: 'dipoli' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> >>> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Lilla.Magyari at mpi.nl Mon Apr 15 13:05:36 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 15 Apr 2013 13:05:36 +0200 (CEST) Subject: [FieldTrip] source analysis EEG data without MRI In-Reply-To: <51684D9F.8020207@berkeley.edu> References: <51635B04.7090004@berkeley.edu> <5163B719.7010002@donders.ru.nl> <43CC12AA-D78E-4374-A201-FD4F7B2C8736@uni-konstanz.de> <5164443E.5040909@berkeley.edu>, <5164A45B.1060502@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFEA8D2@mbox-f-3.du.deakin.edu.au> <51658DAE.9080207@mpi.nl> <51659E90.4020805@berkeley.edu> <5165ADC7.6020906@berkeley.edu> <5A1787011651BC42A4D41856DBC2E0607BFECD49@mbox-f-3.du.deakin.edu.au> <516631A8.1030006@berkeley.edu> <51507.131.174.45.70.1365778991.squirrel@131.174.45.70> <51684D9F.8020207@berkeley.edu> Message-ID: <50252.131.174.45.70.1366023936.squirrel@131.174.45.70> hi Ingrid, FieldTrip segments the skull by a rough estimation: when it finds the brain surface, it extends it with using an image processing function of matlab. We have found this good enough for the BEM model, but in your case, maybe it is not satisfactory. But you can overlay the segmentation with the anatomy of the mri image with ft_sourceplot and check it at the coordinates of your electrodes and you can see then whether your skull segmentation should be extended or corrected. If you use the tutorial data, you can download the mri and the already made segmentation. I do not know exactly how other software are doing the segmentation of the skull, but you can find a plot of the brain, skull and scalp surfaces using FieldTrip and FreeSurfer on this page, http://fieldtrip.fcdonders.nl/development/replicate_functionality_of_mne_software#anatomical_processingeeg when you scroll a bit down . None of them seems to exactly fit to your need, but maybe there are other software (or FS has also a different algorithm?) which segments the skull and bone more precisely. Otherwise, it is also OK to correct the segmentation manually. Unfortunately, FieldTrip doesn't have an editing function for the segmentation yet. Therefore, I was suggesting to work with the matlab image processing toolbox functions. I hope this helps. Best, Lilla > Hi Lilla, > > Yeah, the skull, I was thinking about that too. So if I understand the > pics you sent, the skull is now extended as if it's massive just under > the skin. I don't know enough about the volume conduction model and the > exact effect of the skull/skin in it to really know what would be > better: Not extended skull or massive extended skull. But here's my 2 > cents: > > In my case, the low electrodes are mostly on the cheek and low in the > neck. As you can see on the pic I attached to this email, the neck bone > does not extend that low, and the cheek doesn't really have bone. So, > I'm not sure the extended massive-bone one would be better. Best would > be of course to segment the real bone from the MRI, but I have no clue > how the segmentation magic takes place, probably is not trivial. > Currently it only finds the not extended skull. And making the rest of > the bone, if you could segment it, into a mesh is not possible I think, > so it has to be sort of massive (meshable). So indeed, to extend or not > to extend, that's the question. Probably depends on the location of the > low electrodes. I think in my case I would tend to lean towards choosing > not to extend. > > Thanks, > Ingrid > > > On 4/12/2013 8:03 AM, Lilla.Magyari at mpi.nl wrote: >> hi Ingrid, >> >> I would like to comment on this because I have been discussing this with >> Robert, and we thought that for the lower electrodes, it is still not >> optimal when only the skin is extended which is more conductive then the >> skull. I have attached two images for illustration. The FT segmentation >> will produce the segmentation in origskull.jpg. This is fine when the >> electrodes do not extend lower than the skull. When the electrodes are >> lower, a segmentation like the one in extendedskull.jpg is probably more >> useful. >> >> I created this extended skull based on the skin segmentation with the >> imerode function of the matlab image processing toolbox >> (imerode(seg.skin,strel_bol(5)), strel_bol is from fieldtrip/private). >> >> Best, >> Lilla >> >> >> >>> Hi Imali, >>> >>> Tzvetan shared the bem model made from the tutorial MRI with me, that >>> one extends to low enough, so I'm good! Thanks a lot though! >>> >>> Cheers, >>> Ingird >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> On 4/10/2013 6:14 PM, IMALI THANUJA HETTIARACHCHI wrote: >>>> Hi Ingrid, >>>> >>>> I had similar issues with creating my own BEM as I too did not have >>>> the individual MRI's nor the digitized electrode positions. >>>> >>>> I created a BEM using the Curry (Neuroscan) software and imported in >>>> .mat format to use with Fieldtrip. However these are also based on the >>>> MNI template. >>>> >>>> I am not sure whether this extends lower enough for your situation. I >>>> am attaching here a picture of my head model showing the skull and >>>> cortex with my registered electrodes. If you are happy with it, I am >>>> more than happy to share it with you. >>>> >>>> Please let me know. >>>> >>>> Regards >>>> >>>> Imali >>>> >>>> *From:*fieldtrip-bounces at science.ru.nl >>>> [mailto:fieldtrip-bounces at science.ru.nl] *On Behalf Of *Ingrid >>>> Nieuwenhuis >>>> *Sent:* Thursday, 11 April 2013 4:22 AM >>>> *To:* fieldtrip at science.ru.nl >>>> *Subject:* Re: [FieldTrip] source analysis EEG data without MRI >>>> >>>> Hi all, >>>> >>>> Just had a brain wave, I'll share it for people with similar situation >>>> that might be interested in this thread. I think I should just get a >>>> random structural MRI that extends lower (includes ears and bit >>>> below), optimally of a subject with a head similar to the MNI >>>> template. Make a BEM model (hmm, have to fix these errors I mentioned >>>> earlier then, well, should be doable on linux using dipoli). Then use >>>> ft_electroderealign to align the electrodes to this MRI, do the source >>>> analysis for all subjects using this model, and subsequently use >>>> ft_volumenormalise to normalize to MNI template if I want to use any >>>> atlas functionality. >>>> >>>> If anyone did this already using FieldTrip and has a pre-made BEM >>>> (just like the standard_bem), would be really nice if you're willing >>>> to share :) >>>> If not, I'll make my own, and people with low electrodes and no >>>> structural MRI and or no linux access can email me if they want to use >>>> it. >>>> >>>> Cheers, >>>> Ingrid >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> On 4/10/2013 10:17 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Hi Lilla and Imali, >>>> >>>> Thanks for your replies. In my case, the problem is not the >>>> aligning. My nasion electrode is on the nasion, and Cz is on Cz, >>>> everything is where it should be. The EGI 128 electrode net >>>> really >>>> has these low electrodes, which are there specifically to make >>>> source analysis better by capturing more of the electric field. >>>> So >>>> I would have the best solution if I'd leave them there. However, >>>> in the model as derived from the MNI template, the skin part does >>>> not go down low enough. >>>> >>>> I looked at the picture after ft_prepare_vol_sens (see >>>> attachement, black is before, red is after), and indeed, this is >>>> not good. The low electrodes are squeezed up, and this will make >>>> source analysis worse. So I should indeed remove these electrodes >>>> (which is a pity), or find a better MNI template. >>>> >>>> *So my question is:* >>>> Does anyone know of a template in MNI space that extends more >>>> down? This template comes from SPM8, is there a version that >>>> extends lower? Or could I extend the skin roughly downwards with >>>> some triangular magic? >>>> >>>> I'm also a bit confused about the statement on this wiki page: >>>> http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem >>>> >>>> under "revision information" header "skin" is says: "This skin >>>> surface is not used in the BEM model itself for computational >>>> reasons, but can be used for visualization." >>>> But this does not seem to be the case, since my electrode >>>> positions are modified based on till where the skin goes. So the >>>> skin surface does significantly influence the source analysis. >>>> >>>> Anyway, thanks for all the help, and worse case, I just get rid >>>> of >>>> the low fellows. >>>> >>>> Cheers, >>>> Ingrid >>>> >>>> >>>> -- >>>> >>>> Ingrid Nieuwenhuis PhD >>>> >>>> Postdoctoral Fellow >>>> >>>> Sleep and Neuroimaging Laboratory >>>> >>>> Department of Psychology >>>> >>>> University of California, Berkeley >>>> >>>> California 94720-1650 >>>> >>>> Tolman Hall, room 5305 >>>> >>>> On 4/10/2013 9:05 AM, Magyari, Lilla wrote: >>>> >>>> hi Ingrid and Imali, >>>> >>>> >>>> I think it is a really good question what to do in Ingrid's >>>> case. I do not know the "right" answer, but I would like to >>>> share my thoughts about it. >>>> >>>> The ft_prepare_vol_sens is indeed projects the electrode >>>> positions closer to the headsurface as Imali wrote. But this >>>> function called automatically when you create your leadfield, >>>> so you do not have to do it separately (unless you want to >>>> visualize the corrected electrode positions). >>>> >>>> However, I have been advised to rely on this projection >>>> carefully if electrode positions are far from the skin and >>>> specially, if the inaccuracies (distance from the skin) are >>>> not equally distributed across the electrodes, because that >>>> can cause a spatial bias. >>>> >>>> Therefore, my question would be: why are those electrodes so >>>> low? Are those positions reflect the actual positions of the >>>> electrodes during the measurement? If yes, I would not change >>>> their positions, I would rather try to extend my headmodel >>>> e.g. by using another template. (or another (but quite >>>> suboptimal) possibility is maybe to exclude those electrodes >>>> (and the data) from the analysis if they are anyway far from >>>> the brain.) >>>> >>>> If the position of the electrodes should be higher up on the >>>> head, then instead of relying on projection, I would try >>>> first >>>> to scale the electrodes to fit them into the headsurface with >>>> the ft_electroderealign function. >>>> >>>> I looked to the standard_bem file in the template directory, >>>> and I also load in the standard_1020.elc, and those >>>> electrodes >>>> perfectly fit the vol. So, it seems that the extension of the >>>> standard bem headsurface is suitable for the area which is >>>> covered by the those template electrodes. And I do not know >>>> if >>>> the electrode set you use should cover a larger surface of >>>> the >>>> head, or if it should be just adjusted to the given >>>> headsurface. >>>> >>>> Lilla >>>> >>>> >>>> >>>> >>>> IMALI THANUJA HETTIARACHCHI wrote: >>>> >>>> Hi Ingrid, >>>> >>>> I had a similar issue a few weeks ago, where my lower most >>>> electrodes >>>> started floating after electrode realign using the >>>> ft_electroderealign >>>> function. >>>> >>>> I used the ft_prepare_vol_sens as, >>>> [vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the >>>> trick and >>>> brought the electrodes on to the skin. >>>> >>>> Hope this helps...! >>>> >>>> Regards >>>> Imali >>>> >>>> >>>> *From:* fieldtrip-bounces at science.ru.nl >>>> >>>> [fieldtrip-bounces at science.ru.nl >>>> ] on behalf of Ingrid >>>> Nieuwenhuis >>>> [inieuwenhuis at berkeley.edu >>>> ] >>>> *Sent:* Wednesday, 10 April 2013 9:29 AM >>>> *To:* fieldtrip at science.ru.nl >>>> >>>> *Subject:* Re: [FieldTrip] source analysis EEG data without >>>> MRI >>>> >>>> Hi all, >>>> >>>> A follow up on this and some new issues: >>>> >>>> 1) I first tried Jörn's approach by creating my own BEM, >>>> always fun to >>>> make it yourself ;) However, I did not succeed since: >>>> a) the dipoli method does not work on Windows >>>> b) I downloaded the openmeeg toolbox, but got an error >>>> "om_minverser.exe >>>> has stopped working" I've emailed their buglist >>>> c) bemcp did run, but the result was not ok (see >>>> attachement). >>>> I also >>>> got the warning "% Warning: Matrix is singular, close to >>>> singular or >>>> badly scaled. Results may be inaccurate." several times, so >>>> that might >>>> be the problem. >>>> d) and asa gave the following error: % Error using >>>> ft_prepare_headmodel >>>> (line 201) % You must supply a valid cfg.hdmfile for use with >>>> ASA headmodel >>>> >>>> And away went my determination to do it myself, so I >>>> continued >>>> using >>>> thestandard_bem.mat >>>> >>>> . >>>> >>>> (I did not know this existed, I've added this link to note in >>>> the >>>> headmodel tutorial >>>> >>>> >>>> to >>>> make it easier to find, thanks Tzvetan for pointing this >>>> out!). >>>> >>>> 2) This worked and after some fiddling to get the electrodes >>>> aligned it >>>> looks okay (see attached). >>>> However, as you can see in the figures, I have several very >>>> low >>>> electrodes, that are lower than the skin mesh. So I was >>>> wondering if >>>> this is a problem? Since for accurate calculation of how the >>>> currents >>>> flow from these low electrodes, I assume one needs the skin >>>> to >>>> go till >>>> there? What happens when I have electrodes floating in thin >>>> air? >>>> *So my question is:* >>>> a) will this cause great inaccuracies? >>>> b) if so, how can I extend the skin to go lower? The template >>>> MRI only >>>> goes that far to the bottom... Trick anyone? >>>> >>>> Thanks again, >>>> Ingrid >>>> >>>> >>>> On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Thanks Jörn and Tzvetan for the scripts! I'll try it out and >>>> put it on >>>> the wiki. >>>> Have a great day, >>>> Ingrid >>>> >>>> On 4/9/2013 12:32 AM, Tzvetan Popov wrote: >>>> >>>> Dear Ingrid, >>>> >>>> in addition to Jorn's approach since you don't have MR and >>>> digitized >>>> elec position's you can load and realign the electrodes to >>>> the >>>> standard bem. Subsequently you can calculate the lead field >>>> and >>>> continue with your analysis pipeline. >>>> Good luck >>>> tzvetan >>>> %% read electrodes >>>> elec = ft_read_sens('/your >>>> path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp'); >>>> >>>> %% read headmodel >>>> templateheadmodel = '/your >>>> path/fieldtrip-20130324/template/headmodel/standard_bem.mat'; >>>> load(templateheadmodel); >>>> %% electrode realign as good as possible >>>> % i.e. translate 0 -2 1.5 >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = vol.bnd(1).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> %% verify how the electrodes fit toghether with the brain >>>> volume >>>> cfg=[]; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elecR; >>>> cfg.headshape = vol.bnd(3).pnt; >>>> elecR = ft_electroderealign(cfg); >>>> >>>> >>>> >>>> Hi Ingrid, >>>> >>>> I just happen to done this a few weeks back, I changed things >>>> in the >>>> meanwhile, but I hope that the below steps are complete: >>>> /% read in the template MRI >>>> if isunix >>>> mri = >>>> ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii'); >>>> >>>> elseif ispc >>>> mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', >>>> 'external', >>>> 'spm8', 'templates', 'T1.nii')); >>>> end >>>> >>>> >>>> % segment the MRI >>>> cfg = []; >>>> cfg.output = {'brain' 'skull' 'scalp'}; >>>> segmentedmri = ft_volumesegment(cfg, mris); >>>> >>>> >>>> % create the headmodel (BEM) >>>> cfg = []; >>>> %cfg.method ='openmeeg'; % TODO FIXME download openmeeg >>>> if isunix >>>> cfg.method ='dipoli'; % dipoli only works under linux >>>> else >>>> disp('TODO FIXME stick to dipoli for now or download >>>> openmeeg\n'); >>>> keyboard; >>>> end >>>> hdm = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> elec = ft_read_sens('standard_1020.elc'); >>>> hdm = ft_convert_units(hdm, elec.unit); >>>> >>>> cfg = []; >>>> cfg.grid.xgrid = -125:8:125; >>>> cfg.grid.ygrid = -125:8:125; >>>> cfg.grid.zgrid = -125:8:125; >>>> cfg.grid.tight = 'yes'; >>>> cfg.grid.unit = hdm.unit; >>>> cfg.inwardshift = -1.5; >>>> cfg.vol = hdm; >>>> grid = ft_prepare_sourcemodel(cfg) >>>> grid = ft_convert_units(grid, elec.unit); >>>> >>>> figure; >>>> hold on; >>>> ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], >>>> 'facealpha', >>>> 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); >>>> ft_plot_mesh(grid.pos(grid.inside, :)); >>>> >>>> % this step is not necessary, cause you will see that >>>> everything is >>>> already aligned >>>> cfg = []; >>>> cfg.method = 'interactive'; >>>> cfg.elec = elec; >>>> cfg.headshape = hdm.bnd(1); >>>> tmp = ft_electroderealign(cfg); >>>> elec = tmp; % I had a bug here that I couldn't assign elec >>>> directly >>>> >>>> %% verify location of occipital electrodes >>>> >>>> occ_elec = elec; >>>> occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, >>>> elec.label); >>>> occ_idx = match_str(elec.label, occ_chan); >>>> occ_elec.chanpos = occ_elec.chanpos(occ_idx, :); >>>> occ_elec.elecpos = occ_elec.elecpos(occ_idx, :); >>>> occ_elec.label = occ_elec.label(occ_idx, :); >>>> figure; >>>> ft_plot_sens(occ_elec) >>>> hold on; >>>> ft_plot_vol(ft_convert_units(hdm, elec.unit))/ >>>> >>>> >>>> Afair, that's all that is needed. Of course you need to >>>> adjust >>>> folder and file names. >>>> >>>> Greetings >>>> Jörn >>>> >>>> On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote: >>>> >>>> Hi all, >>>> >>>> I'd like to do source analysis (loreta and or DICS) on my EEG >>>> data. >>>> I don't have anatomical MRIs and I don't have a measurement >>>> of >>>> the >>>> scalp surface. So I'd like to use a template MRI or a >>>> template >>>> head >>>> model that is located in the FieldTrip template directory. I >>>> have >>>> EGI (128 channels) data and electrode positions (not subject >>>> specific, just the standard file also available in FieldTrip >>>> electrode template, GSN-HydroCel-128.sfp), but I'm kind of >>>> stuck >>>> how to start. I don't see any examples on the FieldTrip page >>>> of how >>>> to make a headmodel and volume conduction model giving only >>>> this >>>> limited data. I'd be happy to make it into a example Matlab >>>> script >>>> on the FieldTrip page after I got it to work. Would someone >>>> be >>>> able >>>> to give me some pointers, or example code? >>>> >>>> Thanks a lot! >>>> Ingrid >>>> >>>> >>>> >>>> -- >>>> 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 >>>> >>>> >>>> ******************************************* >>>> Tzvetan Popov >>>> Clinical Psychology >>>> University of Konstanz >>>> Box 23 >>>> 78457 Konstanz, GERMANY >>>> Phone: 0049-7531-883086 >>>> Fax: 0049-7531-884601 >>>> Email: tzvetan.popov at uni-konstanz.de >>>> >>>> >>>> >>>> ******************************************* >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- >>>> Ingrid Nieuwenhuis PhD >>>> Postdoctoral Fellow >>>> Sleep and Neuroimaging Laboratory >>>> Department of Psychology >>>> University of California, Berkeley >>>> California 94720-1650 >>>> Tolman Hall, room 5305 >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> fieldtrip mailing list >>>> >>>> fieldtrip at donders.ru.nl >>>> >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From h.morgan at bangor.ac.uk Tue Apr 16 17:06:32 2013 From: h.morgan at bangor.ac.uk (Helen Morgan) Date: Tue, 16 Apr 2013 16:06:32 +0100 Subject: [FieldTrip] ERP Summer School, Bangor, UK Message-ID: <516D68F8.7020808@bangor.ac.uk> School of Psychology, Bangor University, Wales, UK 1st-5th July 2013 ERP Summer School "Brainwaves and the Human Mind" This Summer School is part of the celebrations of the 50th Anniversary of the School of Psychology, Bangor University. We invite applications for a summer school on the neuroscientific investigation of the human mind. Attendees will learn how to conduct, analyse, and interpret event-related potential studies in psychological domains like memory, development, mindfulness, language, and perception and cognition. The emphasis will be on practical sessions covering the analysis of event-related potentials like the treatment of artefacts and eye movements, filtering, segmentation, averaging, baseline correction, and data measurements. Travel grants are available and will be awarded on a competitive basis to support applicants who otherwise would have financial difficulties attending. Course fee: £270 (including accommodation), £170 (no accommodation). Please contact Becca Henderson at erpsummerschool at bangor.ac.uk for information about the Summer School. -- Rhif Elusen Gofrestredig / Registered Charity No. 1141565 Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi, gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar unwaith a dilëwch y neges. Os na fwriadwyd anfon y neges atoch chi, rhaid i chi beidio â defnyddio, cadw neu ddatgelu unrhyw wybodaeth a gynhwysir ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i hanfonodd yn unig ac nid yw o anghenraid yn cynrychioli barn Prifysgol Bangor. Nid yw Prifysgol Bangor yn gwarantu bod y neges e-bost hon neu unrhyw atodiadau yn rhydd rhag firysau neu 100% yn ddiogel. Oni bai fod hyn wedi ei ddatgan yn uniongyrchol yn nhestun yr e-bost, nid bwriad y neges e-bost hon yw ffurfio contract rhwymol - mae rhestr o lofnodwyr awdurdodedig ar gael o Swyddfa Cyllid Prifysgol Bangor. www.bangor.ac.uk This email and any attachments may contain confidential material and is solely for the use of the intended recipient(s). If you have received this email in error, please notify the sender immediately and delete this email. If you are not the intended recipient(s), you must not use, retain or disclose any information contained in this email. Any views or opinions are solely those of the sender and do not necessarily represent those of Bangor University. Bangor University does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of the text of the email, this email is not intended to form a binding contract - a list of authorised signatories is available from the Bangor University Finance Office. www.bangor.ac.uk From r.oostenveld at donders.ru.nl Thu Apr 18 10:23:59 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 18 Apr 2013 10:23:59 +0200 Subject: [FieldTrip] Calculating goodness of fit In-Reply-To: <51522E38.8040309@telus.net> References: <51522E38.8040309@telus.net> Message-ID: <7CEE609D-841C-475B-A0DE-EEF87E43F2EA@donders.ru.nl> Hi Jim On 27 Mar 2013, at 0:24, Jim McKay wrote: > I am trying to figure out how to calculate the goodness of fit (gof) after a dipole fit on MEG data. The equation for gof has two input variables, the measured data vector and the model data vector from the EC dipole fit. The measured data vector is easy, but I am confused which vector to use for the model data, which is a vector of length (1:Num_sensors). If dip1 is the output from the ft_dipolefitting function, candidates are: > > dip1.Vdata - perhaps this is the measured data? > dip1.Vmodel - sounds promising? > dip1.dip.pot - or maybe this? The output from ft_dipolefitting is a bit archaic. It is on the todo list to update this data structure and make it more self-explanatory. dip1.Vdata is the Nchans*Ntime matrix with the data that was fitted (can be either EEG or MEG, so don't be comfused by the "V" in the name) dip1.Vmodel is the Nchans*Ntime matrix with the forward solution predicted by the dipole model you can subtract the two and for example visualize the resudual. The field dip.dip.pot contains the same as dip.Vmodel. You might want to take a look at ft_dipolefitting around line 500, where these fields and the gof (actually residual variance) are dealt with. best regards, Robert From cmuehl at gmail.com Thu Apr 18 13:19:58 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Thu, 18 Apr 2013 13:19:58 +0200 Subject: [FieldTrip] Deadline Extension! Workshop of Affective Brain-Computer Interfaces at ACII2013 Message-ID: ** Submission deadline extension until 28th of April** 3rd Workshop on Affective Brain-Computer Interfaces (aBCI) Workshop at ACII 2013 (September 2-5), Geneva, Switzerland, September 2, 2013 http://hmi.ewi.utwente.nl/abci2013 http://www.acii2013.org During the last decade, brain computer interface (BCI) research has developed into a major research field establishing methodological frameworks, guidelines and a core community of established researchers. Besides proving valuable as a communication channel that bypasses impeded muscular pathways, the novel technology also spurred the investigation of applications for able-bodied users, foremost in the fields of entertainment, health and lifestyle. Affective BCI systems allowing users to control computer games, support relaxation training, or trigger your alarm clock during a shallow sleep stage have been proposed, implemented, and sold. Moreover, the affordable hardware and software tools also encouraged artists to play with the idea of a direct access to people’s most private information: their affective and cognitive states. From these explorations followed a number of interesting installations, suggesting novel ways of human-computer as well as human-human interaction: neurotechnology-based systems that encourage affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. The third workshop on affective brain-computer interfaces will explore the advantages and limitations of using neuro-physiological signals as a modality for the automatic recognition of affective and cognitive states, and the possibilities of using this information about the user state in applications for domains like health, arts, and entertainment. The goal is to bring researchers, artists, and practitioners together to present state-of-the-art progress and their visions, and thus to spur the development of guidelines and frameworks for affective BCI. Topics of interest include, but are not limited to: • affective/cognitive state induction and data collection for affective BCI • detection of mental state via BCI and other modalities • innovative concepts for adaptive interfaces and affective BCI • demos of affective BCI systems and artworks Submission Instructions * The papers should feature original empirical work, theoretical work, or a well defendable but arguable position of the authors. * Papers will be published in the proceedings of ACII 2013 by IEEE. Papers should be limited to 6 pages. * Further details about the submission instructions and format can be found on the website of ACII 2013. * For further information, contact abci at ewi.utwente.nl Important Dates: April 28, 2013: Submission of manuscripts May 27, 2013: Acceptance/Rejection notification June 17, 2013: Submission of camera-ready papers and presenting author’s registration September 2, 2013: Date of the Workshop Programme Chairs: * Brendan Allison, University of California, San Diego, USA * Guilliaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland, * Christian Mühl, INRIA Bordeaux - Sud-Ouest, France * Anton Nijholt, Universiteit Twente, the Netherlands Programme Committee: * Egon L. van den Broek, TNO Technical Sciences, Delft, The Netherlands * Anne-Marie Brouwer, TNO Perceptual and Cognitive Systems, Soesterberg, the Netherlands * Stephen Fairclough, John Moores University, Liverpool, UK * Didier Grandjean, Swiss Center for Affective Sciences, Geneva, Switzerland * Hayrettin Gürkök, University of Twente, Enschede, the Netherlands * Jonghwa Kim, University of Augsburg, Germany * Brent Lance, Army Research Laboratory/TNB, Aberdeen Proving Ground, USA, * Fabien Lotte, INRIA Bordeaux - Sud-Ouest, France * Winfried Menninghaus, Freie Universität Berlin, Germany * Gary Garcia Molina, Philips Research North America, Briarcliff, USA * Christopher Honey, Princeton University, USA * Ioannis Patras, Queen Mary University, London, UK * Mannes Poel, University of Twente, Enschede, the Netherlands * Olga Sourina, NanYang Technological University, Singapore * Ed Tan, Universiteit van Amsterdam, the Netherlands * Aleksander Valjamae, University of Graz, Austria * Thorsten Zander, Technische Universität Berlin, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Apr 19 08:53:43 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 19 Apr 2013 08:53:43 +0200 Subject: [FieldTrip] ft_read_sens on brain vision eeg data In-Reply-To: References: Message-ID: <606401BD-7553-4E6B-BD93-CF13D162C7A3@donders.ru.nl> Hi Nenad, The Brain Vision Recorder software writes EEG data into three files, that are usually called *.vhdr, *.vmrk and *.dat. Sometime the latter one is caller *.eeg, and also *.seg might happen (after processing the data in Brain Vision Analyzer). But none of the three files contains electrode positions, therefore ft_read_sens won't work on them. EEG electrode positions are usually recorded with a Polhemus electromagnetic tracking device. Sometimes an optical tracker (e.g. Optotrak), acoustic tracker (Zebris) or camera-based system is used. However, there is not a single unique file format for the Polhemus recordings. Depending on the company from which you purchased the Polhemus tracker (usually an EEG system integration company, like ANT), you will get different software with it that writes teh position to different file formats. The ft_read_sens function understands some of the formats, but probably not all. Usually the files that are written by the software that comes with the Polhemus are in ascii, so you can edit (and convert) them with a text editor. So rather than looking at the EEG amplifier with software, you should look at the electrode position recording device+software that you have been using. best regards, Robert PS it might be tha On 12 Apr 2013, at 21:16, Nenad Polomac wrote: > Dear all, > > I would like to read sensors locations with ft_read_sens and it doesn't work. I have eeg data recorded with Brain Vision Recorder. It seems that that ft_read_sens doesn't recognize this file format. > Please help! > > Thank you in advance! > > Nenad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From haiteng.jiang at gmail.com Fri Apr 19 10:25:33 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 19 Apr 2013 10:25:33 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge Message-ID: Hi FTer, I am doing Cluster-based permutation statistic after beamforming on two condition over subjects following the tutorial http://fieldtrip.fcdonders.nl/example/source_statistics, but I get something funny. In my case , I would expect decreased activity in the visual and posterior area. The effect is quite strong, which is showed in the grand average difference (log ratio to reduce inter subject variability). However , from the statistic , the identified areas go to the temporal area , which doesn't make sense at all . Please see the below and attached pictures. I understand cluster-based permutation test doesn't necessary pick the peak difference, but in general it should find main different area. Any comment would be greatly appreciated. Average: [image: Inline images 2] Statistic: [image: Inline images 1] Best, Haiteng -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: statistic.jpg Type: image/jpeg Size: 128261 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grandaverage.jpg Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grandaverage.jpg Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: statistic.jpg Type: image/jpeg Size: 128261 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Fri Apr 19 11:35:44 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 19 Apr 2013 11:35:44 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge In-Reply-To: References: Message-ID: <51710FF0.5040904@donders.ru.nl> Dear Haiteng, I think in the example the design matrix is wrongly computed. If you compare the single and the group-level example, it is described exactly the same, which does not make much sense. Afaik it should be this instead (analogue to freq statisics on group level): /subj = numel(sourceA.trial); design = zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; / Let me know if this makes things better (not in today, working from home, so better reply to this lis). Best, Jörn On 4/19/2013 10:25 AM, Haiteng Jiang wrote: > Hi FTer, > I am doing Cluster-based permutation statistic after > beamforming on two condition over subjects following the tutorial > http://fieldtrip.fcdonders.nl/example/source_statistics, but I get > something funny. > In my case , I would expect decreased activity in the visual and > posterior area. The effect is quite strong, which is showed in the > grand average difference (log ratio to reduce inter subject > variability). However , from the statistic , the identified areas > go to the temporal area , which doesn't make sense at all . Please > see the below and attached pictures. I understand cluster-based > permutation test doesn't necessary pick the peak difference, but in > general it should find main different area. Any comment would be > greatly appreciated. > > Average: > > Inline images 2 > > > > Statistic: > Inline images 1 > Best, > Haiteng > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 119056 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 128261 bytes Desc: not available URL: From litvak.vladimir at gmail.com Sat Apr 20 05:46:38 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sat, 20 Apr 2013 04:46:38 +0100 Subject: [FieldTrip] Statistical Parametric Mapping for MEG/EEG 2013 course - final reminder Message-ID: Dear colleagues, There are still a few places left for the May SPM for M/EEG course in London. This is the first course where SPM12b will be taught. The course program will also include a new extended demo of a group analysis of multimodal MEG-EEG dataset in SPM. Please see below for further details. With best wishes, Vladimir Litvak on behalf of the course faculty --------------------------------------------------------------------------------------------------------- Dear colleagues, We are happy to advertise the 2013 Statistical Parametric Mapping for MEG/EEG course presented by the Wellcome Trust Centre for Neuroimaging. The course will take place on Monday 13th May –Wednesday 15th May 2013 at the Wellcome Trust Centre for Neuroimaging in London. This course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course will cover (1) data pre-processing, (2) statistical analysis of sensor-space maps using GLMs and Random Field theory, (3) source reconstruction and (4) Dynamic Causal Modelling for EEG/MEG. The course will be followed by the long-established three-day course on ‘SPM for fMRI’ so it is possible to attend both courses. The course is suitable for beginners and more advanced users. We advise students to gain at least minimal familiarity with the methodology, for example, from reading the paper available at http://www.hindawi.com/journals/cin/2011/852961/ and other introductory articles listed at the SPM website or by following data analysis examples in the SPM manual. Video lectures from the 2012 course are available at http://www.fil.ion.ucl.ac.uk/spm/course/video/#MEEG For the practical part of the course please bring a laptop that can run Matlab (7.4 or later, no toolboxes are required) and is powerful enough to analyse your data (64-bit OS is highly recommended). The detailed schedule and booking forms can be found at http://www.ion.ucl.ac.uk/articles/events/SPM . For further details and registration please contact Jean Reynolds (jean.reynolds at ucl.ac.uk). With best wishes, Vladimir Litvak Ph.D. Lecturer Wellcome Trust Centre for Neuroimaging -------------------------------------------------------------------------------------------------- SPM (http://www.fil.ion.ucl.ac.uk/spm/) is free and open source software written in MATLAB (The MathWorks, Inc.). In addition to standard M/EEG pre-processing, we presently offer three main analysis tools: (i) statistical analysis of scalp-maps, time-frequency images and volumetric 3D source reconstruction images based on the general linear model, with correction for multiple comparisons using random field theory; (ii) Bayesian M/EEG source reconstruction, including support for group studies, simultaneous EEG and MEG, and fMRI priors; (iii) Dynamic Causal Modelling (DCM), an approach combining neural modelling with data analysis for which there are several variants dealing with evoked responses, steady state responses (power spectra and cross-spectra), induced responses and phase coupling. SPM is integrated with the FieldTrip toolbox (http://fieldtrip.fcdonders.nl/), making it possible for users to combine a variety of standard analysis methods with new schemes implemented in SPM and build custom analysis tools using powerful graphical user interface (GUI) and batching tools. -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Sat Apr 20 08:08:27 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Sat, 20 Apr 2013 08:08:27 +0200 Subject: [FieldTrip] Source statistic doesn't match grand average difference at all and prior knowledge Message-ID: > > Hi Jorn, > Thanks for your response . It is Within subjects experiments design. The result remains same because the design doesn't change . They are only just different expression on the source statistic comparing to sensor statistic on group level on FT tutorial. In my data, the cluster randomization picks something funny and doesn't make sense while the difference plots is more informative and more consistent with the topos. Technically speaking - the cluster randomization does not test for location , but only if there is a difference or not - thus the clusters should be interpreted with caution. Therefore , I think about trying another statistic method as well although cluster randomization is wildly used within donders institute . Do you have any suggestion? Best, Haiteng On 19 April 2013 11:35, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > > Today's Topics: > > 1. Re: Source statistic doesn't match grand average difference > at all and prior knowledge (J?rn M. Horschig) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 19 Apr 2013 11:35:44 +0200 > From: "J?rn M. Horschig" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Source statistic doesn't match grand average > difference at all and prior knowledge > Message-ID: <51710FF0.5040904 at donders.ru.nl> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Dear Haiteng, > > I think in the example the design matrix is wrongly computed. If you > compare the single and the group-level example, it is described exactly > the same, which does not make much sense. Afaik it should be this > instead (analogue to freq statisics on group level): > > /subj = numel(sourceA.trial); > design = zeros(2,2*subj); > for i = 1:subj > design(1,i) = i; > end > for i = 1:subj > design(1,subj+i) = i; > end > design(2,1:subj) = 1; > design(2,subj+1:2*subj) = 2; > / > Let me know if this makes things better (not in today, working from > home, so better reply to this lis). > > Best, > J?rn > > On 4/19/2013 10:25 AM, Haiteng Jiang wrote: > > Hi FTer, > > I am doing Cluster-based permutation statistic after > > beamforming on two condition over subjects following the tutorial > > http://fieldtrip.fcdonders.nl/example/source_statistics, but I get > > something funny. > > In my case , I would expect decreased activity in the visual and > > posterior area. The effect is quite strong, which is showed in the > > grand average difference (log ratio to reduce inter subject > > variability). However , from the statistic , the identified areas > > go to the temporal area , which doesn't make sense at all . Please > > see the below and attached pictures. I understand cluster-based > > permutation test doesn't necessary pick the peak difference, but in > > general it should find main different area. Any comment would be > > greatly appreciated. > > > > Average: > > > > Inline images 2 > > > > > > > > Statistic: > > Inline images 1 > > Best, > > Haiteng > > > > -- > > Haiteng Jiang > > PhD candidate > > Neuronal Oscillations Group > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > > > Visiting address > > Room 2.32 > > Donders Centre for Cognitive Neuroimaging > > Kapittelweg 29 > > 6525 EN Nijmegen > > the Netherlands > > > > Tel.: +31 (0)243668291 > > Web: https://sites.google.com/site/haitengjiang/ > > > > > > _______________________________________________ > > 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: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: not available > Type: image/jpeg > Size: 119056 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment.jpe > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: not available > Type: image/jpeg > Size: 128261 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130419/68633f28/attachment-0001.jpe > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 29, Issue 36 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sun Apr 21 04:11:11 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sun, 21 Apr 2013 10:11:11 +0800 Subject: [FieldTrip] Dose have some method that used to determine it in which brain regions (BA areas)? Message-ID: Dear all, I use the 'DICS' ,and got the cortical position of the power.(x,y,z) Dose have some method that used to determine it in which brain regions (BA areas)? thanks best xue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sun Apr 21 04:23:02 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sun, 21 Apr 2013 10:23:02 +0800 Subject: [FieldTrip] about EEGLAB Message-ID: Dear all, I got the '.set ' file from EEGLAB and read into FieldTrip . I'm confused about the coordinate of the tool is different . Do I need to convert the coordinates of the channel ? And how do it ? best, xue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From strauss.mel at gmail.com Mon Apr 22 16:02:41 2013 From: strauss.mel at gmail.com (=?ISO-8859-1?Q?M=E9lanie_Strauss?=) Date: Mon, 22 Apr 2013 16:02:41 +0200 Subject: [FieldTrip] Help to convert FIF MEG/EEG files to EDF format Message-ID: Dear fieldtrip members, I have some difficulties to convert a MEG+EEG FIF file (Elekta neuromag) to EDF format. I used the following functions : data = ft_preprocessing(cfg) filename = 'outfile'; ft_write_data(filename, data.trial{1,1},'header',data.hdr,'dataformat','edf'); There isn't any error during the execution of the function but the converted file seems to be empty. Would anybody have any suggestion to help me? Thanks a lot, Melanie Strauss --- MD, PhD student. CEA/DSV/I2BM / NeuroSpin INSERM U992 - Cognitive Neuroimaging Unit Bât 145 - Point Courrier 156 Gif sur Yvette F-91191 FRANCE Ph: +33(0)1.69.08.22.23 <%2B33%280%29169.08.65.21> E-mail: strauss.mel at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From m_wink10 at uni-muenster.de Mon Apr 22 20:36:18 2013 From: m_wink10 at uni-muenster.de (Martin Winkels) Date: Mon, 22 Apr 2013 20:36:18 +0200 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR Message-ID: Hello Guys, I am trying to perform connectivity analysis in sensor domain (fieldtrip and matlab are up to date). Within doing that I am facing a small problem in the ICA analysis in combination with a MVAR analysis. If I execute the following code, I get an error message as follows: Error using chol Matrix must be positive definite. Error in armorf (line 40) ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); Error in ft_mvaranalysis (line 390) [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), size(tmpdata.trial{1},2), cfg.order); Error in mu_firstexample (line 90) mdata = ft_mvaranalysis(cfg, data_ma_ica); Can anybody help me with that issue? % artifact correction: ica component analysis cfg = []; cfg.method = 'runica'; cfg.runica.pca = 40; comp = ft_componentanalysis(cfg, data_ma); cfg = []; cfg.layout = 'CTF275.lay'; cfg.viewmode = 'component'; ft_databrowser(cfg, comp) %% artifact correction: ica component rejection cfg = []; cfg.component = [4]; % to be removed component(s) data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); %% compute MVAR, spectral transfer and granger % mvar cfg = []; cfg.order = 5; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis(cfg, data_ma_ica); Thank you, -- Martin Winkels B.Sc. / Ingenieur in Medizininformatik und Biomedizintechnik University of Münster phone: +49 177 6090603 mail: m_wink10 at uni-muenster.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From ricardoojm at gmail.com Tue Apr 23 02:33:02 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Mon, 22 Apr 2013 21:33:02 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Lilla, Thanks a lot. It worked perfectly. Best, Ricardo On 12 April 2013 13:39, Ricardo Moura wrote: > Hi Lilla, > Thank you very much for your reply. > It returns "mexglx", which is expected for a linux system, right? > I tried to change the path by my self in the ft_headmodel_dipoli but it > didnt work. Do you know how can I change it properly? > > Best wishes > Ricardo > > > On 11 April 2013 16:40, Ricardo Moura wrote: > >> Hi, >> >> I had to re-install ubuntu in order to provide more space for the >> analysis (since I was having the problem with the temporary files, which >> might have been too large for my ubuntu partition). >> But now the problem I have with the "ft_prepare_headmodel" is even >> weirder than before. The program now is complaining that there is no dipoli >> for my system: >> >> >> cfg = []; >> cfg.method ='dipoli'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> >> >> ??? Error using ==> ft_headmodel_dipoli at 138 >> there is no dipoli executable for your platform >> >> Error in ==> ft_prepare_headmodel at 226 >> vol = >> ft_headmodel_dipoli(geometry,'conductivity',cfg.conductivity,'isolatedsource',cfg.isolatedsource); >> >> >> I am running this script in a 2010b matlab version, installed in ubuntu >> 12.04. It should be working fine, right? >> >> Thanks in advance, >> Ricardo >> >> >> On 28 March 2013 14:39, Ricardo Moura wrote: >> >>> Hi Jörn, >>> thank you very much for your response! >>> I checked the segmentation and everything seems to be ok (as far as I >>> can say... No error messages were shown during the processing and I checked >>> the generated objects and plots). >>> >>> But I had a strange error while preparing the head model. Somehow the >>> command cannot find the dipoli files, even thought they are really where >>> they should be. And the second message >>> ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue >>> of what it means. >>> >>> And I am running this command on a ubuntu 12.04 32-bit. >>> >>> Do you have any idea of how I can solve it? >>> >>> Thanks once again,Best, >>> Ricardo >>> >>> using the executable >>> "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: >>> /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: >>> /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: >>> not found >>> Warning: an error ocurred while running dipoli >>> > In ft_headmodel_dipoli at 201 >>> In ft_prepare_headmodel at 226 >>> >>> Error using fread >>> Invalid file identifier. Use fopen to generate a valid file identifier. >>> Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not >>> found. >>> > In ft_headmodel_dipoli at 209 >>> In ft_prepare_headmodel at 226 >>> >>> >>> On 27 March 2013 13:10, Ricardo Moura wrote: >>> >>>> Dear all >>>> I am creating a BEM model for eeg, following the appropriate tutorial, >>>> but I have a problem when preparing the headmodel. The output I have from >>>> the ft_prepare_headmodel command does not contain the "mat", and so, when I >>>> try to generate the leadfield, it returns an error message due to non >>>> existent "mat". I saw that other users had similar problem, but I haven't >>>> found a solution though. So, what is wrong with my script? >>>> >>>> Thanks a lot in advance! >>>> Best, >>>> Ricardo >>>> >>>> >>>> >>>> >>>> load standard_mri.mat >>>> mri_orig=mri; >>>> disp(mri) >>>> >>>> % Segmenting the data >>>> cfg = []; >>>> cfg.output= {'scalp','skull','brain'}; >>>> segmentedmri = ft_volumesegment(cfg, mri_orig); >>>> disp(segmentedmri) >>>> save segmentedmri segmentedmri >>>> >>>> % MESH >>>> cfg=[]; >>>> cfg.tissue={'brain','skull','scalp'}; >>>> cfg.numvertices = [3000 2000 1000]; >>>> bnd=ft_prepare_mesh(cfg,segmentedmri); >>>> disp(bnd(1)) >>>> >>>> % Head Model = variavel vol >>>> cfg = []; >>>> cfg.method ='bem_dipoli'; %dipoli singlesphere >>>> vol = ft_prepare_headmodel(cfg, segmentedmri); >>>> >>>> >>>> >> disp(vol) >>>> bnd: [1x3 struct] >>>> cond: [0.3300 0.0041 0.3300] >>>> skin_surface: 1 >>>> source: 3 >>>> type: 'dipoli' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Tue Apr 23 09:36:16 2013 From: narayan.ps at tut.fi (Narayan P Subramaniyam) Date: Tue, 23 Apr 2013 10:36:16 +0300 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR In-Reply-To: References: Message-ID: <517639F0.30808@tut.fi> Although I am not an expert in connectivity analysis, but from a mathematical point of view it looks like the case where at least one variable in covariance matrix is a exact linear combination of other and hence it is not positive definite. This could be due to rejection of few components by ICA ? Other experts may shed more light... On 22/04/2013 21:36, Martin Winkels wrote: > Hello Guys, > > I am trying to perform connectivity analysis in sensor domain > (fieldtrip and matlab are up to date). Within doing that I am facing a > small problem in the ICA analysis in combination with a MVAR analysis. > If I execute the following code, I get an error message as follows: > > > Error using chol > Matrix must be positive definite. > > Error in armorf (line 40) > ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); > > Error in ft_mvaranalysis (line 390) > [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), > size(tmpdata.trial{1},2), cfg.order); > > Error in mu_firstexample (line 90) > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Can anybody help me with that issue? > > > % artifact correction: ica component analysis > > cfg = []; > cfg.method = 'runica'; > cfg.runica.pca = 40; > comp = ft_componentanalysis(cfg, data_ma); > > cfg = []; > cfg.layout = 'CTF275.lay'; > cfg.viewmode = 'component'; > ft_databrowser(cfg, comp) > > %% artifact correction: ica component rejection > > cfg = []; > cfg.component = [4]; % to be removed component(s) > data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); > > %% compute MVAR, spectral transfer and granger > > % mvar > cfg = []; > cfg.order = 5; > cfg.toolbox = 'bsmart'; > > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Thank you, > > -- > Martin Winkels > > B.Sc. / Ingenieur in > Medizininformatik und Biomedizintechnik > > University of Münster > > phone: +49 177 6090603 > mail: m_wink10 at uni-muenster.de > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- With Best Regards, Narayan P Subramaniyam, M.Sc. Researcher/PhD student Department of Electronics and Communications Engineering Tampere University of Technology Finn-Medi 1, 4th Floor, Room 203 Biokatu 6, FI-33520 Tampere, Finland Tel: +358 (0)40 198 1951 E-mail: narayan.ps at tut.fi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 23 09:54:39 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 23 Apr 2013 09:54:39 +0200 Subject: [FieldTrip] Dose have some method that used to determine it in which brain regions (BA areas)? In-Reply-To: References: Message-ID: <51763E3F.70001@donders.ru.nl> Dear Xue, please have a look here: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended The atlas thing is sometimes a bit buggy, meaning that sometimes labels are not shown. It depends a bit on the type of atlas and the coordinate system. The method + atlas proposed in the tutorial should work. Best, Jörn On 4/21/2013 4:11 AM, ?? wrote: > Dear all, > I use the 'DICS' ,and got the cortical position of the power.(x,y,z) > Dose have some method that used to determine it in which brain regions > (BA areas)? > thanks > best > xue. > > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Tue Apr 23 09:59:58 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 23 Apr 2013 09:59:58 +0200 Subject: [FieldTrip] Question connectivity analysis / ICA / MVAR In-Reply-To: References: Message-ID: <51763F7E.4000304@donders.ru.nl> Hi Martin, that error most likely occurs because the rank of your datamatrix is not full. This can e.g. be the case for EEG data where you include the reference channel (or common average rereferenced) or when you used ft_channelrepair or, in your case, when you removed an ICA component, therefore reducing the rank of your data. I am not sure what the best solution for this is, because there are several, e.g. you could do your MVar analysis on ICA data directly, do it on a subset of channels so that the datamatrix is rank sufficient again or just refrain from doing the mvar analysis. Best, Jörn On 4/22/2013 8:36 PM, Martin Winkels wrote: > Hello Guys, > > I am trying to perform connectivity analysis in sensor domain > (fieldtrip and matlab are up to date). Within doing that I am facing a > small problem in the ICA analysis in combination with a MVAR analysis. > If I execute the following code, I get an error message as follows: > > > Error using chol > Matrix must be positive definite. > > Error in armorf (line 40) > ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))'); > > Error in ft_mvaranalysis (line 390) > [ar, tmpnoisecov] = armorf(dat, numel(rpt{rlop}), > size(tmpdata.trial{1},2), cfg.order); > > Error in mu_firstexample (line 90) > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Can anybody help me with that issue? > > > % artifact correction: ica component analysis > > cfg = []; > cfg.method = 'runica'; > cfg.runica.pca = 40; > comp = ft_componentanalysis(cfg, data_ma); > > cfg = []; > cfg.layout = 'CTF275.lay'; > cfg.viewmode = 'component'; > ft_databrowser(cfg, comp) > > %% artifact correction: ica component rejection > > cfg = []; > cfg.component = [4]; % to be removed component(s) > data_ma_ica = ft_rejectcomponent(cfg, comp, data_ma); > > %% compute MVAR, spectral transfer and granger > > % mvar > cfg = []; > cfg.order = 5; > cfg.toolbox = 'bsmart'; > > mdata = ft_mvaranalysis(cfg, data_ma_ica); > > > Thank you, > > -- > Martin Winkels > > B.Sc. / Ingenieur in > Medizininformatik und Biomedizintechnik > > University of Münster > > phone: +49 177 6090603 > mail: m_wink10 at uni-muenster.de > > > > > _______________________________________________ > 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 b.osuagwu.1 at research.gla.ac.uk Tue Apr 23 11:17:27 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Tue, 23 Apr 2013 10:17:27 +0100 Subject: [FieldTrip] ICA and covariance matrix for CSP Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> Hi Everyone, I want to ask a general mathematical question relating to ICA and common spatial pattern. Hopefully someone will help me out. I have noticed that after using ICA to remove artifact in my signal, I can no longer compute the covariance matrices needed for common spatial pattern without matlab giving me warning regarding the accuracy of the estimated matrix. Indeed the estimated matrix is not accurate. This does not happen if I use only a small subset of my channels after removing noise with ICA. If I do not use ICA at all the warning disappears. I want to ask if anybody knows why ICA causes this issue and how I can fix it. Thanks a lot. Bethel Osuagwu From zriouil.imane at gmail.com Tue Apr 23 16:09:10 2013 From: zriouil.imane at gmail.com (z.imane) Date: Tue, 23 Apr 2013 16:09:10 +0200 Subject: [FieldTrip] (no subject) Message-ID: hi, * * i'm started to use FielTrip, and i want to read data from .plx extension. with data.plx contain LFP and spike data * * when I execute the following function: data=ft_read_header('data.plx') I have the error message: ??? Error using ==> ft_read_header at 1550 * *different sampling rates in continuous data not supported * * * * and when I execute: data=ft_read_spike('data.plx') * * Error in ==> ft_read_spike at 180 * *nchan = length(hdr.ChannelHeader); * * * * Please suggestions thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Tue Apr 23 17:16:28 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Tue, 23 Apr 2013 17:16:28 +0200 Subject: [FieldTrip] ICA and covariance matrix for CSP In-Reply-To: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> References: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk> Message-ID: Hi Bethel, Removing a component with ICA will reduce the rank (number linear independent components) of your data. The covariance matrix itself probably can be computed, but I suspect the warning you are getting is when you are computing the inverse. The inverse of a rank-deficient matrix cannot be computed (and so the warnings you get are expected). Regularisation (e.g. adding some 'noise' to the diagonal of the covariance matrix, roughly equal to the amount of estimated sensor noise) prior to inversion is the common way around this problem. In FieldTrip, this is cfg.lambda when calling ft_sourceanalysis, which you can set to a percentage, for example '5%' is common, of the trace of the covariance matrix. Best, Johanna 2013/4/23 Bethel Osuagwu > Hi Everyone, > > I want to ask a general mathematical question relating to ICA and common > spatial pattern. Hopefully someone will help me out. > > I have noticed that after using ICA to remove artifact in my signal, I can > no longer compute the covariance matrices needed for common spatial pattern > without matlab giving me warning regarding the accuracy of the estimated > matrix. Indeed the estimated matrix is not accurate. This does not happen > if I use only a small subset of my channels after removing noise with ICA. > If I do not use ICA at all the warning disappears. > > I want to ask if anybody knows why ICA causes this issue and how I can fix > it. > > Thanks a lot. > Bethel Osuagwu > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coppolar at mail.nih.gov Tue Apr 23 20:53:08 2013 From: coppolar at mail.nih.gov (Coppola, Richard (NIH/NIMH) [E]) Date: Tue, 23 Apr 2013 18:53:08 +0000 Subject: [FieldTrip] Post-doc postion possibility at NIMH Message-ID: <94A0A015317F894DA3A7A53C578E81E90A7450@MLBXV06.nih.gov> We anticipate an opportunity for a post-doctoral fellow to join the research team of the Experimental Therapeutics and Pathophysiology Branch of the NIMH Intramural Research Program, led by Dr Zarate. This group has been involved with the groundbreaking studies examining neural plasticity in antidepressant action with MEG and other imaging modalities (see Cornwell B et al: Biol Psychiatry, 2012; Neuropsychopharmacology, 2010, etc). The fellow would be heavily involved in the planning and analyses of the MEG studies of the Branch in collaboration with the NIMH MEG Core Facility staff and Dr. Coppola. The fellow would have access to the unique large data set already collected as well as opportunity for future studies. The candidate should be a recent or expected Ph.D., and have an appropriate background in Neuroscience, neuroimaging methods, and applied statistics along with specific experience in advanced MEG and/or fMRI analysis. Substantial skills in statistics, programming and scientific writing will be essential. Please email with the subject line ETPB-PostDoc, a cover letter, CV, and names of references to Drs Zarate and Coppola. Dr. Zarate's current research focus is on developing novel medications for treatment-resistant depression and bipolar disorder. His areas of expertise include biological and pharmacological aspects of mood disorders in adults. Dr. Zarate's group conducts proof-of-concept studies utilizing novel compounds and biomarkers (magnetoencephalography [MEG] and polysomnography [PSG], positron emission tomography, functional MRI and magnetic resonance spectroscopy [MRS]) to identify potentially relevant drug targets and biosignatures of treatment response. A multidisciplinary translational research team conducts the research in the ETPB. In addition, the Branch provides training to develop the next generation of clinical translational researchers. Carlos A. Zarate, Jr., M.D. Chief Experimental Therapeutics & Pathophysiology Branch & Section Neurobiology and Treatment of Mood Disorders Division of Intramural Research Program National Institute of Mental Health 10 Center Drive, CRC, Unit 7 SE, Rm. 7-3465 Bethesda, MD 20892-1282 zaratec at mail.nih.gov http://intramural.nimh.nih.gov/research/pi/pi_zarate_c.html The MEG Core provides a state of the art facility supporting the (CTF) Omega 2000 275-channel MEG system for the use of PI's of the Intramural Research Programs of NIMH and NINDS Dr. Richard Coppola Dir. NIMH MEG Core Facility Bldg 10 Room 3C119 Bethesda, MD 20892 coppolar at mail.nih.gov http://kurage.nimh.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Korey.Kam at med.nyu.edu Wed Apr 24 01:18:19 2013 From: Korey.Kam at med.nyu.edu (Kam, Korey) Date: Tue, 23 Apr 2013 23:18:19 +0000 Subject: [FieldTrip] Import of Spike2 data (.smr) Message-ID: Hello everyone, As a potential user of FT, I am interested in performing spike train and spike-LFP analyses. My data files are in .smr (Spike2 file format). Therefore, my question is the following: Is there a function to import .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no avail. Thanks and this really is a great community, Korey -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Wed Apr 24 07:39:20 2013 From: inieuwenhuis at berkeley.edu (Ingrid Lyda Catharina Nieuwenhuis) Date: Tue, 23 Apr 2013 22:39:20 -0700 Subject: [FieldTrip] using sloreta in FieldTrip Message-ID: Hi all, Does anyone has experience with using FieldTrip for looking at sources generated using the Loreta-key program? I've generated sLoreta files and read them into FieldTrip using loreta2fieldtrip as described on the FieldTrip wiki . Note, I first got an "Invalid precision" error from fread due to line 89: activity = fread(fid, [voxnumber 1], 'float = >single'); But after I changed this line to: activity = fread(fid, [voxnumber 1]); it worked. But now I'd like to plot this on an anatomical MRI since without anatomy it looks hard to interpret (see attached). The source should be in MNI space (see info on loreta-key page), so I tried using the T1.nii template from SPM (that's in MNI space, correct?: %read in template MRI (MNI) template = ft_read_mri('C:\Users\Ingrid\Documents\MATLAB\FieldTrip\external\spm8\templates\T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % interpolate cfg = []; cfg.parameter = 'avg.pow'; [interp] = ft_sourceinterpolate(cfg, GA_source, template); %sourceplot cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.coordsys = 'mni'; ft_sourceplot(cfg,interp); But that doesn't work (see capture2). I'm a bit lost now... Anyone any ideas? Maybe I should use the "mni152" template. since that is what the loreta website says it's based on. Anyone know where to get that template in a format FieldTrip can read? So in short: 1) has anyone done this before and has tips / code to share? 2) is the T1.nii template from SPM in MNI space? 3) do you think the mni152 is different from T1.nii, and would work? if so anyone know where to get it in format FieldTrip can read? 4) am I missing something in steps explaining why my source does not match the anatomy? Thanks! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture.PNG Type: image/png Size: 48260 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture2.PNG Type: image/png Size: 94462 bytes Desc: not available URL: From wljj09 at gmail.com Wed Apr 24 09:28:05 2013 From: wljj09 at gmail.com (Jing Wang) Date: Wed, 24 Apr 2013 15:28:05 +0800 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: Dear Korey, As far as I know, you can not import .smr file into FT directly. My experience is to use third sofeware such as Neuroexplore to transform .smr to .nex format, which could be imported directly. Best Jing 2013/4/24 Kam, Korey > Hello everyone, > > As a potential user of FT, I am interested in performing spike train and > spike-LFP analyses. My data files are in .smr (Spike2 file format). > > Therefore, my question is the following: Is there a function to import > .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no > avail. > > Thanks and this really is a great community, > > Korey > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Wed Apr 24 09:31:58 2013 From: zriouil.imane at gmail.com (z.imane) Date: Wed, 24 Apr 2013 09:31:58 +0200 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: hi, have you read the contents of your file. smr by using the function " FT_READ_SPIKE"? thanks 2013/4/24 Jing Wang > Dear Korey, > > As far as I know, you can not import .smr file into FT directly. My > experience is to use third sofeware such as Neuroexplore to transform .smr > to .nex format, which could be imported directly. > > Best > > Jing > > > 2013/4/24 Kam, Korey > >> Hello everyone, >> >> As a potential user of FT, I am interested in performing spike train and >> spike-LFP analyses. My data files are in .smr (Spike2 file format). >> >> Therefore, my question is the following: Is there a function to import >> .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no >> avail. >> >> Thanks and this really is a great community, >> >> Korey >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Zriouil Imane -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonas at obleser.de Wed Apr 24 11:23:20 2013 From: jonas at obleser.de (Jonas Obleser) Date: Wed, 24 Apr 2013 11:23:20 +0200 Subject: [FieldTrip] Postdoctoral posititon in auditory cognition/auditory neuroscience, Max Planck Institute, Leipzig Message-ID: <752383FF-BD27-4536-BDE8-DA390D3BE71B@obleser.de> -- Apologies for cross-postings -- The Max Planck Institute for Human Cognitive and Brain Sciences (MPI–CBS) in Leipzig and the Max Planck Research Group “Auditory Cognition” (headed by Jonas Obleser) are now offering a Postdoctoral researcher Position, for initially 2 years, preferably starting by October 2013. Successful candidates will have a PhD in cognitive neuroscience, psychology, or natural sciences. Prior experience with either fMRI or EEG/MEG methods is expected, and an interest in further applying and combining both domains in their research is highly desirable. Candidates with a background and/or interest in advanced fMRI methods are particularly encouraged to apply. The successful candidate will share our enthusiasm in problems of auditory cognition and auditory neuroscience, and ideally has already demonstrated this by contributing to the field. However, researchers with a background in visual or other neuroscience are also encouraged to apply. He or she should have a solid methods background and strong methods interest, hands-on experience in problems of data and statistical analysis, and the interest to co-supervise the PhD and Master students in the group. The position offered does not include any teaching obligations. Starting date is flexible. Salary is dependent on experience and based on MPI stipends or equivalent salary according to German Public service regulations. The research will be conducted at the MPI–CBS in Leipzig, Germany, an internationally leading centre for cognitive and imaging neuroscience equipped with a 7.0 T MRI scanner, three 3.0 T MRI scanners, a 306 channels MEG system, a TMS system and several EEG suites. All facilities are supported by experienced IT and physics staff. Our institute (just 190 km, or 70 minutes by train, south of Berlin) offers a very international environment, with English being the language spoken in the laboratory. It offers a friendly and generous environment of researchers with diverse backgrounds and with an excellent infrastructure. In order to increase the proportion of female staff members, applications from female scientists are particularly encouraged. Preference will be given to disabled persons with the same qualification. Applications should be kindly sent to personal at cbs.mpg.de using the application code “PD 03/2013” in the subject. Please send your application as a single pdf attachment, with the file name containing your surname. It should enclose a cover letter (max. 2 pages) that also specifies your future research interests; a CV; up to three representative reprints; and contact details of 2 personal references. This call remains open until the position is filled. For further details please contact Dr Jonas Obleser, Max Planck Institute for Human Cognitive and Brain Sciences, Leipzig, Germany, obleser at cbs.mpg.de http://www.cbs.mpg.de http://www.cbs.mpg.de/groups/misc/mprg-ac http://obleserlab.com From b.osuagwu.1 at research.gla.ac.uk Wed Apr 24 11:31:04 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Wed, 24 Apr 2013 10:31:04 +0100 Subject: [FieldTrip] ICA and covariance matrix for CSP In-Reply-To: References: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202569@CMS07.campus.gla.ac.uk>, Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BE9202571@CMS07.campus.gla.ac.uk> Thank you Johanna for that explanation. I guess I should try out the regularization then! Thanks Bethel ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] On Behalf Of Johanna Zumer [johanna.zumer at donders.ru.nl] Sent: 23 April 2013 16:16 To: FieldTrip discussion list Subject: Re: [FieldTrip] ICA and covariance matrix for CSP Hi Bethel, Removing a component with ICA will reduce the rank (number linear independent components) of your data. The covariance matrix itself probably can be computed, but I suspect the warning you are getting is when you are computing the inverse. The inverse of a rank-deficient matrix cannot be computed (and so the warnings you get are expected). Regularisation (e.g. adding some 'noise' to the diagonal of the covariance matrix, roughly equal to the amount of estimated sensor noise) prior to inversion is the common way around this problem. In FieldTrip, this is cfg.lambda when calling ft_sourceanalysis, which you can set to a percentage, for example '5%' is common, of the trace of the covariance matrix. Best, Johanna 2013/4/23 Bethel Osuagwu > Hi Everyone, I want to ask a general mathematical question relating to ICA and common spatial pattern. Hopefully someone will help me out. I have noticed that after using ICA to remove artifact in my signal, I can no longer compute the covariance matrices needed for common spatial pattern without matlab giving me warning regarding the accuracy of the estimated matrix. Indeed the estimated matrix is not accurate. This does not happen if I use only a small subset of my channels after removing noise with ICA. If I do not use ICA at all the warning disappears. I want to ask if anybody knows why ICA causes this issue and how I can fix it. Thanks a lot. Bethel Osuagwu _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From litvak.vladimir at gmail.com Wed Apr 24 11:47:12 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 24 Apr 2013 10:47:12 +0100 Subject: [FieldTrip] Import of Spike2 data (.smr) In-Reply-To: References: Message-ID: Dear Korey, FT_READ_SPIKE function does not have anything to do with Spike2 software. It is a function for reading spike data from many formats. You could read .smr files created by Spike2 v. 5 and earlier directly into Fieldtrip using ft_preprocessing. This requires Neuroshare library that you can get from http://neuroshare.sourceforge.net/. For v. 6 and later you can export the data into .mat file from Spike 2 and those mat files can be converted into Fieldtrip. The settings should be something like the attached. Best, Vladimir On Wed, Apr 24, 2013 at 12:18 AM, Kam, Korey wrote: > Hello everyone, > > As a potential user of FT, I am interested in performing spike train and > spike-LFP analyses. My data files are in .smr (Spike2 file format). > > Therefore, my question is the following: Is there a function to import > .smr files into FT? For preprocessing, I have tried 'FT_READ_SPIKE' to no > avail. > > Thanks and this really is a great community, > > Korey > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nishiokov at gmail.com Wed Apr 24 17:26:24 2013 From: nishiokov at gmail.com (Yoshiyuki Nishio) Date: Wed, 24 Apr 2013 11:26:24 -0400 Subject: [FieldTrip] ft_databrowser with cfg.selectmode='markpeakevent'/'marktroughevent' Message-ID: Dear FieldTrippers, When I tried to identify time-points of interest on ft_databrowser with cfg.selectmode='markpeakevent' or 'marktroughevent', I got the error message below: *Attempt to reference field of non-structure array.* *Error in ft_databrowser>select_range_cb (line 960)* * if any(intersect(begsel:endsel, [opt.event.sample]))* *Error in ft_select_range>evalCallback (line 325)* * feval(funhandle, funargs{:}, val, cmenulab);* *Error in ft_select_range (line 159)* * evalCallback(callback, userData.range); * *Error using waitfor* *Error while evaluating figure WindowButtonDownFcn* * * Here's the script: cfg.viewmode = 'vertical'; cfg.blocksize = 2; cfg.continuous = 'yes'; cfg.channel = 'EEG RMFP_06-REF'; cfg.selectmode = 'marktroughevent'; cfg.trl = 'all'; cfg = ft_databrowser(cfg, data); The error never happens on the 'markaritifact' mode. Can you help me find the problem? Thanks a lot, Yoshi -------------- next part -------------- An HTML attachment was scrubbed... URL: From isabella.premoli at gmail.com Thu Apr 25 13:42:33 2013 From: isabella.premoli at gmail.com (isabella premoli) Date: Thu, 25 Apr 2013 13:42:33 +0200 Subject: [FieldTrip] Problem in importing BVA file Message-ID: Hi! I have a problem in reading .dat Brain Vision files with fieldtrip. The export parameters used in Brain Vision are: *** Generic Data Export *** File name parameter: $n_$h File extension: .dat Write header file: yes Write marker file: yes Format: ASCII Orientation: MULTIPLEXED Line Delimiter: CRLF (PC style) Add channel names: no Overwrite default decimal symbol: yes Decimal symbol: . Export all channels: yes The code in fieldtrip to read the data is: cfg= []; cfg.dataset= sprintf('%s.dat',read_data_name); cfg.trialdef.eventtype= 'Stimulus'; cfg.trialdef.eventvalue= {cond1;cond2;cond3;cond4}'; cfg.trialdef.poststim= 0.5; cfg.trialdef.prestim= 0.3; cfg = ft_definetrial(cfg); cfg.channel = {'all'}; cfg.continuous = 'no'; trl = cfg.trl; The problem is that for some subjects is working and for others not. The files are exported exactly in the same way and they undergo exactly the same steps in the Brain Vision analyzer. The error I encounter is: Error using str2num (line 33) Requires string or character array input. Error in read_brainvision_eeg (line 112) dat(line,:) = str2num(str); Error in ft_read_data (line 340) dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample, chanindx); Error in ft_preprocessing (line 503) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) Do you have any ideas on how I can fix this? Any help would be much appreciated. Cheers, Isabella -- Isabella Premoli, PhD student Department of Neurology, Tübingen University Hospital, Hoppe-Seyler-Str. 3, D-72076 Tübingen -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayelet.landau at gmail.com Thu Apr 25 14:16:36 2013 From: ayelet.landau at gmail.com (Ayelet Landau) Date: Thu, 25 Apr 2013 14:16:36 +0200 Subject: [FieldTrip] unit problem when following example script: Create MNI-aligned grids in individual head-space BUG? In-Reply-To: References: <51670147.4080803@berkeley.edu> Message-ID: Hi all, Barbara Händel and I have spent some time checking how deep this unit problem goes. I don't know if the bug control made it to this issue as of yet, but it occurs to us that this can be very easily controlled if one were to add a cfg.unit to ft_plot_mesh and ft_plot_vol. evidently, the defaults for grid and the defaults for volume seem to be different (cm for the first mm for the latter and others). When you run the two plotting commands there is no way to propagate a "common scaling" since those are separate commands. Adding the units and having a single (common) unit for the output which is plotted would deal with this problem. greetings from Frankfurt, Ayelet and Barbara On Fri, Apr 12, 2013 at 8:06 AM, Diego Lozano Soldevilla < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Ingrid, > > I had similar problem with MEG and changing the units with > ft_convert_units solved the issue: > > vol = ft_convert_units(vol,'cm') > > If not, please file a bug with a piece of data and I'll have a look, > > best, > > Diego > > > > > On 11 April 2013 20:30, Ingrid Nieuwenhuis wrote: > >> Hi all, >> >> When I follow the code according to the example matlab script "Create >> MNI-aligned grids in individual head-space" something goes all wrong with >> the units. >> >> I've followed the code (pasted below, from the wiki), but when I make the >> figure with the template head model and dipole grid, it's wrong (see >> attached ..._problem.png). The dipole grid is tiny in the bottom of the >> head model. The black area is the dipole grid, not good. >> template_grid = >> xgrid: [1x41 double] >> ygrid: [1x41 double] >> zgrid: [1x41 double] >> dim: [41 41 41] >> pos: [68921x3 double] >> unit: 'mm' >> inside: [1x68910 double] >> outside: [758 759 760 761 799 800 801 802 843 884 925] >> cfg: [1x1 struct] >> >> It's a problem with the units, because the template grid has 'mm' in the >> unit field, but when I look in the xgrid, ygrid, zgrid and pos fields the >> numbers are clearly cm not mm. However, when I multiply my xyzgrid and pos >> field by 10, the grid is not tight (see attached ..._multiplied10.png). It >> looks like the unit problem messed up the determination of what's inside >> and outside. As you can see in the template_grid, there are only a few grid >> point outside, which is clearly not correct (maybe inside/outside was >> determined on wrong units?). >> >> So, it looks like a bug to me, or am I doing something wrong? I'm using >> the newest FT version. >> >> Thanks, >> Ingrid >> >> %%% CODE FROM WIKI %%% >> template = ft_read_mri([cur_path_FT 'external', filesep, 'spm8', >> filesep,'templates', filesep,'T1.nii']); >> template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the >> coordinate system >> >> % segment the template brain and construct a volume conduction model >> (i.e. head model): this is needed >> % for the inside/outside detection of voxels. >> cfg = []; >> template_seg = ft_volumesegment(cfg, template); >> >> cfg = []; >> cfg.method = 'singleshell'; >> template_vol = ft_prepare_headmodel(cfg, template_seg); >> >> % construct the dipole grid in the template brain coordinates >> % the source units are in cm >> % the negative inwardshift means an outward shift of the brain surface >> for inside/outside detection >> cfg = []; >> cfg.grid.xgrid = -20:1:20; >> cfg.grid.ygrid = -20:1:20; >> cfg.grid.zgrid = -20:1:20; >> cfg.grid.unit = 'cm'; >> cfg.grid.tight = 'yes'; >> cfg.inwardshift = -1.5; >> cfg.vol = template_vol; >> template_grid = ft_prepare_sourcemodel(cfg); >> >> % make a figure with the template head model and dipole grid >> figure >> hold on >> ft_plot_vol(template_vol); >> ft_plot_mesh(template_grid); >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Ayelet N. Landau Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Mobile: +49 (0)16 22733 110 Fax: +49 (0)69 96769 555 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Thu Apr 25 15:49:00 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Thu, 25 Apr 2013 09:49:00 -0400 Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser Message-ID: dear Fieldtrippers, i am analysing spontaneous data and have some artifacts i'd like to exlcude by visual inspection on the contiunous data. So after prepocessing the data, I use cfg=ft_databrowser(cfg,alldata) and select manually the segments with artfacts. Then i run ft_rejectartifact cleandata = ft_rejectartifact(cfg,alldata); detected 12 visual artifacts rejected 1 trials completely rejected 0 trials partially resulting 0 trials Error using ft_rejectartifact (line 478) No trials left after artifact rejection. any idea which cfg specs should i use? thanks, -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Apr 25 15:59:07 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 25 Apr 2013 15:59:07 +0200 (CEST) Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: Message-ID: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> Hi Jose, Are you analyzing continuous data? If this is the case, you should specify cfg.artfctdef.reject = 'partial' before calling ft_rejectartifact. The reason is that the default is 'complete' and if you're computing continuous data (not stimulus locked) you only have one trial and for instance nothing left after the rejection. best, Diego ----- Original Message ----- > From: "Jose Herrero" > To: "FieldTrip discussion list" > Sent: Thursday, 25 April, 2013 3:49:00 PM > Subject: [FieldTrip] using ft_rejectartifact on continuos data after > manual rejection with ft_databrowser > dear Fieldtrippers, > i am analysing spontaneous data and have some artifacts i'd like to > exlcude by visual inspection on the contiunous data. > So after prepocessing the data, I use > cfg=ft_databrowser(cfg,alldata) > and select manually the segments with artfacts. > Then i run ft_rejectartifact > cleandata = ft_rejectartifact(cfg,alldata); > detected 12 visual artifacts > rejected 1 trials completely > rejected 0 trials partially > resulting 0 trials > Error using ft_rejectartifact (line 478) > No trials left after artifact rejection. > any idea which cfg specs should i use? > thanks, > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Trigon, room 0.83 Kapittelweg 29 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands E-Mail: d.lozanosoldevilla at fcdonders.ru.nl Tel: +31-(0)24-36-66274 Web: http://www.neuosc.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From strauss.mel at gmail.com Thu Apr 25 16:05:17 2013 From: strauss.mel at gmail.com (=?ISO-8859-1?Q?M=E9lanie_Strauss?=) Date: Thu, 25 Apr 2013 16:05:17 +0200 Subject: [FieldTrip] Problem to convert files from fif to edf format Message-ID: Dear all, I have some difficulties to convert a MEG+EEG FIF file (Elekta neuromag) to EDF format. I used the following functions : cfg.dataset = DATA data = ft_preprocessing(cfg) ft_write_data(filename, data.trial{1,1},'dataformat','edf'); There is no error during the execution of the function but the converted file is empty. Has anybody any suggestion to help me? Thanks a lot, Melanie Strauss --- MD, PhD student. CEA/DSV/I2BM / NeuroSpin INSERM U992 - Cognitive Neuroimaging Unit Bât 145 - Point Courrier 156 Gif sur Yvette F-91191 FRANCE Ph: +33(0)1.69.08.22.23 <%2B33%280%29169.08.65.21> E-mail: strauss.mel at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Thu Apr 25 16:51:18 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Thu, 25 Apr 2013 10:51:18 -0400 Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> References: <1293138897.728319.1366898347707.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: thanks so much Diego. that works just fine. it is a nice tool and, as far as i see, you can do it again if necessary [e.g. artf1=ft_databrowser(cfg,cleandata)] and artf1.artfctdef.visual.artifact will keep adding times for artifacts, correct? On Thu, Apr 25, 2013 at 9:59 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Jose, > > Are you analyzing continuous data? If this is the case, you should > specify cfg.artfctdef.reject = 'partial' before calling ft_rejectartifact. > The reason is that the default is 'complete' and if you're computing > continuous data (not stimulus locked) you only have one trial and for > instance nothing left after the rejection. > > best, > > Diego > > ------------------------------ > > *From: *"Jose Herrero" > *To: *"FieldTrip discussion list" > *Sent: *Thursday, 25 April, 2013 3:49:00 PM > *Subject: *[FieldTrip] using ft_rejectartifact on continuos data after > manual rejection with ft_databrowser > > > dear Fieldtrippers, > > i am analysing spontaneous data and have some artifacts i'd like to > exlcude by visual inspection on the contiunous data. > > So after prepocessing the data, I use > cfg=ft_databrowser(cfg,alldata) > and select manually the segments with artfacts. > > Then i run ft_rejectartifact > > cleandata = ft_rejectartifact(cfg,alldata); > detected 12 visual artifacts > rejected 1 trials completely > rejected 0 trials partially > resulting 0 trials > Error using ft_rejectartifact (line 478) > No trials left after artifact rejection. > > any idea which cfg specs should i use? > > thanks, > > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Trigon, room 0.83 > Kapittelweg 29 > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > E-Mail: d.lozanosoldevilla at fcdonders.ru.nl > Tel: +31-(0)24-36-66274 > Web: http://www.neuosc.com/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Apr 25 17:07:34 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 25 Apr 2013 17:07:34 +0200 (CEST) Subject: [FieldTrip] using ft_rejectartifact on continuos data after manual rejection with ft_databrowser In-Reply-To: Message-ID: <891914955.730839.1366902454784.JavaMail.root@sculptor.zimbra.ru.nl> Indeed: artf1.artfctdef.visual.artifact is a Nx2 matrix that contains the begin and the end sample that you manually select, being N the number of selected artifacts Saludos! Diego ----- Original Message ----- > From: "Jose Herrero" > To: "Diego Lozano" , > "FieldTrip discussion list" > Sent: Thursday, 25 April, 2013 4:51:18 PM > Subject: Re: [FieldTrip] using ft_rejectartifact on continuos data > after manual rejection with ft_databrowser > thanks so much Diego. that works just fine. > it is a nice tool and, as far as i see, you can do it again if > necessary > [e.g. artf1=ft_databrowser(cfg,cleandata)] and > artf1.artfctdef.visual.artifact will keep adding times for artifacts, > correct? > On Thu, Apr 25, 2013 at 9:59 AM, Lozano Soldevilla, D. (Diego) < > d.lozanosoldevilla at fcdonders.ru.nl > wrote: > > Hi Jose, > > Are you analyzing continuous data? If this is the case, you should > > specify cfg.artfctdef.reject = 'partial' before calling > > ft_rejectartifact. The reason is that the default is 'complete' and > > if > > you're computing continuous data (not stimulus locked) you only have > > one trial and for instance nothing left after the rejection. > > best, > > Diego > > > From: "Jose Herrero" < jose.herrero66 at gmail.com > > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > > Sent: Thursday, 25 April, 2013 3:49:00 PM > > > Subject: [FieldTrip] using ft_rejectartifact on continuos data > > > after > > > manual rejection with ft_databrowser > > > dear Fieldtrippers, > > > i am analysing spontaneous data and have some artifacts i'd like > > > to > > > exlcude by visual inspection on the contiunous data. > > > So after prepocessing the data, I use > > > cfg=ft_databrowser(cfg,alldata) > > > and select manually the segments with artfacts. > > > Then i run ft_rejectartifact > > > cleandata = ft_rejectartifact(cfg,alldata); > > > detected 12 visual artifacts > > > rejected 1 trials completely > > > rejected 0 trials partially > > > resulting 0 trials > > > Error using ft_rejectartifact (line 478) > > > No trials left after artifact rejection. > > > any idea which cfg specs should i use? > > > thanks, > > > -- > > > Jose L Herrero, PhD > > > Department of Psychiatry > > > Columbia University College of Physicians and Surgeons > > > Cognitive Neuroscience and Schizophrenia Program > > > Nathan S. Kline Institute for Psychiatric Research > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > > PhD Student > > Neuronal Oscillations Group > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Trigon, room 0.83 > > Kapittelweg 29 > > Radboud University Nijmegen > > NL-6525 EN Nijmegen > > The Netherlands > > E-Mail: d.lozanosoldevilla at fcdonders.ru.nl > > Tel: +31-(0)24-36-66274 > > Web: http://www.neuosc.com/ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Trigon, room 0.83 Kapittelweg 29 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands E-Mail: d.lozanosoldevilla at fcdonders.ru.nl Tel: +31-(0)24-36-66274 Web: http://www.neuosc.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From robince at gmail.com Fri Apr 26 11:11:05 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 10:11:05 +0100 Subject: [FieldTrip] filter in-memory trials data with mirroring Message-ID: Hello, Is it possible filter in-memory extracted trials data with mirroring at the edges? When I try: % filter cfg = [];cfg.lpfilter = 'yes';cfg.lpfreq = '40';cfg.lpfilttype = 'but';cfg.padtype = 'mirror';% trial length is 1.1s so mirror-pad to 1.5s (200ms each side)cfg.padding = 1.5; flt_data = ft_preprocessing(cfg, block_data); I get: Reference to non-existent field 'Fs'. Error in ft_preprocessing (line 288) padding = round(cfg.padding * data.Fs); Adding block_data.Fs = block_data.fsample; seems to work. But in the resulting data structure the time vectors no longer match the trial data, so obviously something is going wrong: >> size(block_data.time{1}) ans = 1 560 >> size(block_data.trial{1}) ans = 234 560 >> size(flt_data.trial{1}) ans = 234 560 >> size(flt_data.time{1}) ans = 1 357 Is there a correct way to do this? (Filter trials with mirrored edges) Thanks, Robin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 26 11:37:37 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 26 Apr 2013 11:37:37 +0200 Subject: [FieldTrip] filter in-memory trials data with mirroring In-Reply-To: References: Message-ID: <517A4AE1.6000507@donders.ru.nl> Hi Robin, yep, that sounds pretty much like a bug to me. Would you mind creating a bug on bugzilla for this? http://bugzilla.fcdonders.nl/ I will try to look into this next week. Thanks so far for reporting this. Best, Jörn On 4/26/2013 11:11 AM, Robin wrote: > > Hello, > > Is it possible filter in-memory extracted trials data with mirroring > at the edges? > > When I try: > > |% filter > cfg =[]; > cfg.lpfilter ='yes'; > cfg.lpfreq ='40'; > cfg.lpfilttype ='but'; > cfg.padtype ='mirror'; > % trial length is 1.1s so mirror-pad to 1.5s (200ms each side) > cfg.padding =1.5; > flt_data = ft_preprocessing(cfg, block_data);| > > I get: > > |Reference to non-existent field 'Fs'. > > Error in ft_preprocessing (line 288) > padding = round(cfg.padding * data.Fs);| > > Adding |block_data.Fs = block_data.fsample;| seems to work. But in the > resulting data structure the time vectors no longer match the trial > data, so obviously something is going wrong: > > |>> size(block_data.time{1}) > > ans = > > 1 560 > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.time{1}) > > ans = > > 1 357| > > Is there a correct way to do this? (Filter trials with mirrored edges) > > Thanks, > > Robin > > > > _______________________________________________ > 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 robince at gmail.com Fri Apr 26 11:58:56 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 10:58:56 +0100 Subject: [FieldTrip] filter in-memory trials data with mirroring In-Reply-To: <517A4AE1.6000507@donders.ru.nl> References: <517A4AE1.6000507@donders.ru.nl> Message-ID: Hi Jörn, Thanks: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2140 Cheers Robin On Fri, Apr 26, 2013 at 10:37 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Robin, > > yep, that sounds pretty much like a bug to me. Would you mind creating a > bug on bugzilla for this? > http://bugzilla.fcdonders.nl/ > I will try to look into this next week. Thanks so far for reporting this. > > Best, > Jörn > > > On 4/26/2013 11:11 AM, Robin wrote: > > Hello, > > Is it possible filter in-memory extracted trials data with mirroring at > the edges? > > When I try: > > % filter > cfg = [];cfg.lpfilter = 'yes';cfg.lpfreq = '40';cfg.lpfilttype = 'but';cfg.padtype = 'mirror';% trial length is 1.1s so mirror-pad to 1.5s (200ms each side)cfg.padding = 1.5; > flt_data = ft_preprocessing(cfg, block_data); > > I get: > > Reference to non-existent field 'Fs'. > > Error in ft_preprocessing (line 288) > padding = round(cfg.padding * data.Fs); > > Adding block_data.Fs = block_data.fsample; seems to work. But in the > resulting data structure the time vectors no longer match the trial data, > so obviously something is going wrong: > > >> size(block_data.time{1}) > > ans = > > 1 560 > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.trial{1}) > > ans = > > 234 560 > > >> size(flt_data.time{1}) > > ans = > > 1 357 > > Is there a correct way to do this? (Filter trials with mirrored edges) > > Thanks, > > Robin > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 robince at gmail.com Fri Apr 26 12:19:53 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 11:19:53 +0100 Subject: [FieldTrip] not seeing expected effects of filtering Message-ID: Hello, I am having a problem with simple low-pass filtering where I am not seeing the results I would expect. I am using SVN r8075. I have a block_data structure which is the result of ft_appenddata with several runs. >> block_data block_data = hdr: [1x1 struct] label: {234x1 cell} fsample: 508.6300 trial: {1x1265 cell} time: {1x1265 cell} trialinfo: [1265x1 double] cfg: [1x1 struct] sampleinfo: [1265x2 double] >> size(block_data.trial{1}) ans = 234 560 I then run the following script to lpfilter with two different cut offs and plot the results which are attached. The output of the filter seems to be the same whatever I set lpfreq to (but it is definitely doing something). Am I do something wrong? Cheers Robin % Filtering test % filter cfg = []; cfg.lpfilter = 'yes'; cfg.lpfreq = '5'; cfg.lpfilttype = 'but'; cfg.lpfiltord = 3; flt_data_5 = ft_preprocessing(cfg, block_data); cfg = []; cfg.lpfilter = 'yes'; cfg.lpfreq = '70'; cfg.lpfilttype = 'but'; cfg.lpfiltord = 3; flt_data_70 = ft_preprocessing(cfg, block_data); %% figure subplot(131) trl = 100; chan = 200; plot(block_data.time{trl}, block_data.trial{trl}(chan,:)); title('Raw Data'); axis tight; subplot(132) plot(flt_data_5.time{trl}, flt_data_5.trial{trl}(chan,:)); title('5Hz low pass'); axis tight; subplot(133) plot(flt_data_70.time{trl}, flt_data_70.trial{trl}(chan,:)); title('70Hz low pass'); axis tight; -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: filter_problem.png Type: image/png Size: 10186 bytes Desc: not available URL: From robince at gmail.com Fri Apr 26 12:23:45 2013 From: robince at gmail.com (Robin) Date: Fri, 26 Apr 2013 11:23:45 +0100 Subject: [FieldTrip] not seeing expected effects of filtering In-Reply-To: References: Message-ID: Sorry! Just noticed I had the frequencies quoted! I entered them like that without noticing as I was entering the other arguments. It's working correctly now! On Fri, Apr 26, 2013 at 11:19 AM, Robin wrote: > Hello, > > I am having a problem with simple low-pass filtering where I am not seeing > the results I would expect. I am using SVN r8075. > > I have a block_data structure which is the result of ft_appenddata with > several runs. > > >> block_data > > block_data = > > hdr: [1x1 struct] > label: {234x1 cell} > fsample: 508.6300 > trial: {1x1265 cell} > time: {1x1265 cell} > trialinfo: [1265x1 double] > cfg: [1x1 struct] > sampleinfo: [1265x2 double] > > >> size(block_data.trial{1}) > > ans = > > 234 560 > > I then run the following script to lpfilter with two different cut offs > and plot the results which are attached. The output of the filter seems to > be the same whatever I set lpfreq to (but it is definitely doing > something). Am I do something wrong? > > Cheers > > Robin > > % Filtering test > % filter > cfg = []; > cfg.lpfilter = 'yes'; > cfg.lpfreq = '5'; > cfg.lpfilttype = 'but'; > cfg.lpfiltord = 3; > flt_data_5 = ft_preprocessing(cfg, block_data); > > > cfg = []; > cfg.lpfilter = 'yes'; > cfg.lpfreq = '70'; > cfg.lpfilttype = 'but'; > cfg.lpfiltord = 3; > flt_data_70 = ft_preprocessing(cfg, block_data); > > %% > figure > subplot(131) > trl = 100; > chan = 200; > plot(block_data.time{trl}, block_data.trial{trl}(chan,:)); > title('Raw Data'); axis tight; > subplot(132) > plot(flt_data_5.time{trl}, flt_data_5.trial{trl}(chan,:)); > title('5Hz low pass'); axis tight; > subplot(133) > plot(flt_data_70.time{trl}, flt_data_70.trial{trl}(chan,:)); > title('70Hz low pass'); axis tight; > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.noordenbos at gmail.com Fri Apr 26 15:58:40 2013 From: mark.noordenbos at gmail.com (Mark Noordenbos) Date: Fri, 26 Apr 2013 15:58:40 +0200 Subject: [FieldTrip] cluster-level statistic effect size Message-ID: Dear Fieldtrippers, When computing cluster-level statistics recent versions of Fieldtrip now also compute the SD and confidence interval of the estimated p-value for each cluster. But I was wondering if it is also possible to compute an effect size such as Cohen’s d of the observed effect. Normally, 2*t-value divided by sqrt(df) gives Cohen’s d. However, this does not work for the summed t-values in each cluster. Any suggestion how to compute an effect size for the cluster-level statistic? Best, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Fri Apr 26 16:02:06 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Fri, 26 Apr 2013 16:02:06 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From jose.herrero66 at gmail.com Fri Apr 26 16:40:59 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Fri, 26 Apr 2013 10:40:59 -0400 Subject: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact on continous data Message-ID: dear Fieldtripers, i have cleaned the continuous data manually (ft_databrowser) and then rejected artifacts (ft_rejectartifact). Now i am trying to do freq analysis on the cleaned data after segmentation (ft_redefinetrial, with cfg.length=4;cfg.overlap=0.5). I am getting the folowing warning message(see below). I don't get it if i use the original (not cleaned) continuous data. Should i be concerned? freq = ft_freqanalysis(cfg, trials); the input is raw data with 43 channels and 188 trials Warning: correcting numerical inaccuracy in the time axes > In utilities\private\warning_once at 116 In ft_datatype_raw>fixtimeaxes at 289 In ft_datatype_raw at 241 In ft_checkdata at 213 In ft_freqanalysis at 219 processing trials processing trial 188/188 nfft: 8000 samples, datalength: 8000 samples, 1 tapers thanks -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.herrero66 at gmail.com Fri Apr 26 17:18:43 2013 From: jose.herrero66 at gmail.com (Jose Herrero) Date: Fri, 26 Apr 2013 11:18:43 -0400 Subject: [FieldTrip] select channels using ft_connectivityanalysis and ft_connectivityplot Message-ID: Dear Fieldtripers, a quick question about ft_connectivityanalysis and ft_connectivityplot. Is there a way to select channels when the input data is not univariate? cfg.channel and cfg.partchannel do not work apperently thanks -- Jose L Herrero, PhD Department of Psychiatry Columbia University College of Physicians and Surgeons Cognitive Neuroscience and Schizophrenia Program Nathan S. Kline Institute for Psychiatric Research -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Fri Apr 26 17:24:17 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Fri, 26 Apr 2013 17:24:17 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From kekeliao at gmail.com Fri Apr 26 21:46:24 2013 From: kekeliao at gmail.com (liao ke) Date: Fri, 26 Apr 2013 14:46:24 -0500 Subject: [FieldTrip] design matrix for ft_freqstatistics; between subjects In-Reply-To: References: Message-ID: Hi, Kathrin, I meet similar question on comparison of ERP between two group subjects using ft_timelockstatistics and ft_timelockanalysis. One group has 12 subjects, another group has 43 subjects, and my design matrix is like design = zeros(1, 55); design(1, 1:12) = 1; design(1, 12+1:end )= 2; cfg.design = design; % design matrix cfg.ivar = 1; After I invoke ft_timelockanalysis, I use ft_timelockgrandaverage to calculate grand average with cfg.keepindividual = 'yes' . Then the following ft_timelockstatistics works well. If I use cfg.keepindividual = 'no' in ft_timelockgrandaverage , the ft_timelockstatistics has error 'the size of the design matrix does not match the number of observations in the data' in its statistics_wrapper subfunction. My question is why I should keep all trials data (cfg.keepindividual = 'yes') in ft_timelockgrandaverage ? I guess the method in ft_timelockstatistics should use subjects averaged data as sample ( average over trials data of this subject ) not use all subjects trial-based data. Am I correct? Thanks for your help. ke On Sat, Dec 1, 2012 at 9:15 AM, Kathrin Müsch wrote: > Hi Nenad, > > It's like a between trials experiment within one subject (first example of > the tutorial). Your design is correct. Remember to use independent samples > statistics because you compare two independent groups (in your case > subjects). > > cfg.statistic = 'indepsamplesT'; > cfg. design = design; > cfg.ivar = 1; > > Best, > Kathrin > > Am 01.12.2012 um 15:02 schrieb Nenad Polomac: > > > Hi everybody, > > > > I have some doubts concerning statistic in between subjects experiment. > I couldn't find explanation for this case in tutorial. > > I have two groups of subjects. And I would like to compare this two > groups for the same condition using ft_freqstatistics (cfg.correctm = > 'cluster'). I have two time frequency grand average for each group (8 > subjects in each group; cfg.keepindividual = 'yes';). I am not sure how a > design matrix for ft_freqstatistics suppose to look like > > > > I suppose: design=[1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2] > > Is this correct? > > > > Thank you in advance! > > > > Nenad > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen > Rechts; Gerichtsstand: Hamburg > > Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander > Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Fri Apr 26 22:08:36 2013 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 26 Apr 2013 22:08:36 +0200 Subject: [FieldTrip] design matrix for ft_freqstatistics; between subjects In-Reply-To: References: Message-ID: Dear Ke, A grandaverage is typically an average over subjects, not trials - seems appropriate in the case you describe. Does it make sense then? Dear Nenad, Have you taken a look at the end of [user documentation] --> [walkthrough] on the wiki? In it I've made some effort explaining the cfg.design in the statistics functions. It might need more work so if it is still unclear (or if it does help and you have a suggestion for placing a link at an appropriate place in the tutorial) it would be great to hear so I can work on making it clearer. Cheers, Stephen On 26 April 2013 21:46, liao ke wrote: > Hi, Kathrin, > > I meet similar question on comparison of ERP between two group subjects > using ft_timelockstatistics and ft_timelockanalysis. One group has 12 > subjects, another group has 43 subjects, and my design matrix is like > > design = zeros(1, 55); > design(1, 1:12) = 1; > design(1, 12+1:end )= 2; > cfg.design = design; % design matrix > cfg.ivar = 1; > > > After I invoke ft_timelockanalysis, I use ft_timelockgrandaverage to > calculate grand average with cfg.keepindividual = 'yes' . Then the following > ft_timelockstatistics works well. If I use cfg.keepindividual = 'no' in > ft_timelockgrandaverage , the ft_timelockstatistics has error 'the size of > the design matrix does not match the number of observations in the data' in > its statistics_wrapper subfunction. > > My question is why I should keep all trials data (cfg.keepindividual = > 'yes') in ft_timelockgrandaverage ? I guess the method in > ft_timelockstatistics should use subjects averaged data as sample ( average > over trials data of this subject ) not use all subjects trial-based data. Am > I correct? > > Thanks for your help. > > ke > > > On Sat, Dec 1, 2012 at 9:15 AM, Kathrin Müsch > wrote: >> >> Hi Nenad, >> >> It's like a between trials experiment within one subject (first example of >> the tutorial). Your design is correct. Remember to use independent samples >> statistics because you compare two independent groups (in your case >> subjects). >> >> cfg.statistic = 'indepsamplesT'; >> cfg. design = design; >> cfg.ivar = 1; >> >> Best, >> Kathrin >> >> Am 01.12.2012 um 15:02 schrieb Nenad Polomac: >> >> > Hi everybody, >> > >> > I have some doubts concerning statistic in between subjects experiment. >> > I couldn't find explanation for this case in tutorial. >> > I have two groups of subjects. And I would like to compare this two >> > groups for the same condition using ft_freqstatistics (cfg.correctm = >> > 'cluster'). I have two time frequency grand average for each group (8 >> > subjects in each group; cfg.keepindividual = 'yes';). I am not sure how a >> > design matrix for ft_freqstatistics suppose to look like >> > >> > I suppose: design=[1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2] >> > Is this correct? >> > >> > Thank you in advance! >> > >> > Nenad >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >> Genossenschaftsregister sowie das Unternehmensregister (EHUG): >> >> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen >> Rechts; Gerichtsstand: Hamburg >> >> Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander >> Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Sat Apr 27 13:04:21 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Sat, 27 Apr 2013 13:04:21 +0200 (CEST) Subject: [FieldTrip] cluster-level statistic effect size In-Reply-To: References: Message-ID: <002301ce4336$fc1a7390$f44f5ab0$@maris@psych.ru.nl> Dear Mark, When computing cluster-level statistics recent versions of Fieldtrip now also compute the SD and confidence interval of the estimated p-value for each cluster. But I was wondering if it is also possible to compute an effect size such as Cohen’s d of the observed effect. Normally, 2*t-value divided by sqrt(df) gives Cohen’s d. However, this does not work for the summed t-values in each cluster. Any suggestion how to compute an effect size for the cluster-level statistic? Why would you want to compute an effect size for a neuronal variable (such as an evoked response, an induced oscillation)? An effect size for a behavioral variable (such response time or accuracy), on the other hand, would definitely make sense. In cognitive neuroscience, we use neuronal variables to explain behavior; it’s not the neuronal variables that we are trying to explain. This would be more the domain of basic neuroscience. As I see it, cognitive neuroscience would be helped a lot if we could quantify the extent to which a particular neuronal variable can explain some behavioral variable. That is, we would be computing an effect size for a behavioral variable, using the neuronal variable as the explanatory (instead of to-be-explained) variable. Together with Freek van Ede and Malte Köster, I proposed a method that is able to do precisely this (Journal of Neurophysiology 108 (9), 2352-2362, http://jn.physiology.org/content/108/9/2352.short). The crucial methodological issue here is how to deal with the inherent unreliability of the measured neuronal variables. Of course, a basic neuroscientist who is trying to explain to explain the firing rate of a single neuron may very well be interested in an effect size for this firing rate which could show, for instance, that this firing rate is only very weakly determined by the presence/absence of a stimulus. Best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From lmelloni at gmail.com Mon Apr 29 02:38:57 2013 From: lmelloni at gmail.com (Lucia Melloni) Date: Sun, 28 Apr 2013 20:38:57 -0400 Subject: [FieldTrip] Only 1 and Inf as output of ft_connectivityanalysis Message-ID: Hi! I am trying to calculate coherence using ft_connectivityanalysis, but I am getting only ones and infinity as output in cohspctrm with all of my data sets. I first run ft_freqanalysis with cfg.method = 'mtmfft'; cfg.taper = 'dpss'; cfg.output = 'fourier'; cfg.foilim = [1 45]; cfg.tapsmofrq = 1; cfg.keeptrials = 'yes'; cfg.keeptapers = 'yes'; freq = ft_freqanalysis(cfg, data); Whether I do or I do not specify cfg.channel and cfg.channelcmb here does not seem to make a difference for my problem later on. The spectra look absolutely fine. I then run ft_connectivityanalysis with cfg.method = 'coh'; cfg.removemean= 'yes'; cfg.trials = 'all'; cfg.feedback = 'yes'; cfg.complex = 'abs'; coh = ft_connectivityanalysis(cfg, freq); The cohspctrm looks like this: val(:,:,1,1) = 1 Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf (etc.) I get the following warning during ft_connectivityanalysis Warning: Divide by zero. > In ft_connectivity_corr at 103 In ft_connectivityanalysis at 524 Warning: Divide by zero. > In ft_connectivity_corr at 104 In ft_connectivityanalysis at 524 The same happens if I try to calculate PLV through ft_connectivityanalysis. This is with Fieldtrip version 20130422 and 20130427, Matlab R2009a, Windows 7 (64bit). Any advice? Thanks! Lucia From joseangel.pineda at ctb.upm.es Mon Apr 29 12:31:19 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Mon, 29 Apr 2013 12:31:19 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape Message-ID: Dear experts, I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. So I already have one affine transformation (Aff_1) I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. Could you please give me any advice to solve this? Thanks cheers Jose [image: Imágenes integradas 1] -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 109355 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From s.vanpelt at fcdonders.ru.nl Mon Apr 29 12:49:04 2013 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 29 Apr 2013 12:49:04 +0200 (CEST) Subject: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact on continous data In-Reply-To: Message-ID: <1824346511.946519.1367232544565.JavaMail.root@indus.zimbra.ru.nl> Dear Jose, You don't need to worry about the warning. When performing operations like redefining trials, the time axes values might change slightly (in the order of microseconds or so, don't know the exact figure), resulting in different time axes for, e.g., different channels. Nowadays, FT recognizes these time differences as being non-intended (it is very unlikely that you on purpose would want trials to start at such small different moments in time), corrects them, and outputs you the warning. So, in your case, the trials in 'trials.time' would have slightly different time values. In freq.time, these should be equal. Best, Stan ----- Oorspronkelijk bericht ----- > Van: "Jose Herrero" > Aan: "FieldTrip discussion list" > Verzonden: Vrijdag 26 april 2013 16:40:59 > Onderwerp: [FieldTrip] ft_freqanalysis warning after ft_rejectartifact > on        continous data > dear Fieldtripers, > i have cleaned the continuous data manually (ft_databrowser) and then > rejected artifacts (ft_rejectartifact). Now i am trying to do freq > analysis on the cleaned data after segmentation (ft_redefinetrial, > with cfg.length=4;cfg.overlap=0.5). I am getting the folowing warning > message(see below). I don't get it if i use the original (not > cleaned) continuous data. Should i be concerned? > freq = ft_freqanalysis(cfg, trials); > the input is raw data with 43 channels and 188 trials > Warning: correcting numerical inaccuracy in the time axes  > > In utilities\private\warning_once at 116 >   In ft_datatype_raw>fixtimeaxes at 289 >   In ft_datatype_raw at 241 >   In ft_checkdata at 213 >   In ft_freqanalysis at 219  > processing trials > processing trial 188/188 nfft: 8000 samples, datalength: 8000 samples, > 1 tapers > thanks > -- > Jose L Herrero, PhD > Department of Psychiatry > Columbia University College of Physicians and Surgeons > Cognitive Neuroscience and Schizophrenia Program > Nathan S. Kline Institute for Psychiatric Research > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Apr 29 15:15:57 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 29 Apr 2013 15:15:57 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape In-Reply-To: References: Message-ID: José, Coregistration is a tricky thing, particularly if you start mixing results from two different software packages. I'd stick to one package, that's my recommendation, unless you really know what all individual steps are doing. Are you sure that your Aff_1 is doing what you think it is doing? E.g. does it apply to an anatomical volume with the same orientation, FOV, etc as the T1.nii? Also, I think that for any automatic registration tool you use, it is necessary to get the geometric objects in approximate alignment, which means you need to select fiducials, otherwise your algorithm will not converge to the correct solution. I usually use ft_volumerealign twice. The first time to get an approximate registration (cfg.method = 'interactive'). If you have a headsurface determined with a polhemus device, you can call ft_volumerealign a second time (with the output to the first call as the input mri), in combination with cfg.method = 'headshape', and cfg.headshape = ft_read_headshape('headshapefile.txt') Finally, I'd recommend not to re-post the same question too quickly after itself. Best wishes, Jan-Mathijs On Apr 29, 2013, at 12:31 PM, José Ángel Pineda wrote: > Dear experts, > > I was using manual selection of the fiducials in order to get the affine transformation of the MRI T1 image to the MEG sensor space. > Now, I have decided to use freesurfer for obtaining the head surface and some function for performing an automatic corregistration from head surface to fiducials (and polhemus information), in order to avoid manual selection of the fiducials for each subject. > > So I already have one affine transformation (Aff_1) > > I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the mri.transform to mri.transform*Aff_1, but when I plot the results (ft_determine_coordsys) I got what is in the attached snapshot. > > Could you please give me any advice to solve this? > > Thanks > > cheers > > Jose > > > > -- > José Angel Pineda Pardo > Center of Biomedical Technology (CTB) > Parque Científico y Tecnológico de la UPM > Campus de Montegancedo > 28223 Pozuelo de Alarcón, Madrid, ES > Spam detection software, running on the system "brievenbus.science.ru.nl", has > identified this incoming email as possible spam. The original message > has been attached to this so you can view it (if it isn't spam) or label > similar future email. If you have any questions, see > postmaster at science.ru.nl for details. > > Content preview: Dear experts, I was using manual selection of the fiducials > in order to get the affine transformation of the MRI T1 image to the MEG > sensor space. Now, I have decided to use freesurfer for obtaining the head > surface and some function for performing an automatic corregistration from > head surface to fiducials (and polhemus information), in order to avoid manual > selection of the fiducials for each subject. [...] > > Content analysis details: (5.0 points, 5.0 required) > > pts rule name description > ---- ---------------------- -------------------------------------------------- > 3.9 BAYES_99 BODY: Bayesian spam probability is 99 to 100% > [score: 0.9997] > 1.6 HTML_IMAGE_ONLY_28 BODY: HTML: images with 2400-2800 bytes of words > 0.0 HTML_MESSAGE BODY: HTML included in message > -1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low > trust > [209.85.128.179 listed in list.dnswl.org] > 0.6 DC_PNG_UNO_LARGO Message contains a single large inline gif > 0.0 DC_IMAGE_SPAM_TEXT Possible Image-only spam with little text > 0.0 DC_IMAGE_SPAM_HTML Possible Image-only spam > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Mon Apr 29 15:38:36 2013 From: joseangel.pineda at ctb.upm.es (=?ISO-8859-1?Q?Jos=E9_=C1ngel_Pineda?=) Date: Mon, 29 Apr 2013 15:38:36 +0200 Subject: [FieldTrip] Automatic Alignment of T1 with headshape In-Reply-To: References: Message-ID: Thanks Jan, Ill try as you said. cheers Jose 2013/4/29 jan-mathijs schoffelen > José, > > Coregistration is a tricky thing, particularly if you start mixing results > from two different software packages. I'd stick to one package, that's my > recommendation, unless you really know what all individual steps are > doing. Are you sure that your Aff_1 is doing what you think it is doing? > E.g. does it apply to an anatomical volume with the same orientation, FOV, > etc as the T1.nii? > Also, I think that for any automatic registration tool you use, it is > necessary to get the geometric objects in approximate alignment, which > means you need to select fiducials, otherwise your algorithm will not > converge to the correct solution. I usually use ft_volumerealign twice. The > first time to get an approximate registration (cfg.method = 'interactive'). > If you have a headsurface determined with a polhemus device, you can call > ft_volumerealign a second time (with the output to the first call as the > input mri), in combination with cfg.method = 'headshape', and cfg.headshape > = ft_read_headshape('headshapefile.txt') > Finally, I'd recommend not to re-post the same question too quickly after > itself. > > Best wishes, > Jan-Mathijs > > > > > On Apr 29, 2013, at 12:31 PM, José Ángel Pineda wrote: > > Dear experts, > > I was using manual selection of the fiducials in order to get the affine > transformation of the MRI T1 image to the MEG sensor space. > Now, I have decided to use freesurfer for obtaining the head surface and > some function for performing an automatic corregistration from head surface > to fiducials (and polhemus information), in order to avoid manual selection > of the fiducials for each subject. > > So I already have one affine transformation (Aff_1) > > I loaded the MRI T1 volume (mri = ft_read_mri(T1.nii)), I change the > mri.transform to mri.transform*Aff_1, but when I plot the results > (ft_determine_coordsys) I got what is in the attached snapshot. > > Could you please give me any advice to solve this? > > Thanks > > cheers > > Jose > > > > > -- > José Angel Pineda Pardo > Center of Biomedical Technology (CTB) > Parque Científico y Tecnológico de la UPM > Campus de Montegancedo > 28223 Pozuelo de Alarcón, Madrid, ES > Spam detection software, running on the system "brievenbus.science.ru.nl", > has > identified this incoming email as possible spam. The original message > has been attached to this so you can view it (if it isn't spam) or label > similar future email. If you have any questions, see > postmaster at science.ru.nl for details. > > Content preview: Dear experts, I was using manual selection of the > fiducials > > in order to get the affine transformation of the MRI T1 image to the MEG > sensor space. Now, I have decided to use freesurfer for obtaining the head > surface and some function for performing an automatic corregistration > from > head surface to fiducials (and polhemus information), in order to avoid > manual > selection of the fiducials for each subject. [...] > > Content analysis details: (5.0 points, 5.0 required) > > pts rule name description > ---- ---------------------- > -------------------------------------------------- > 3.9 BAYES_99 BODY: Bayesian spam probability is 99 to 100% > [score: 0.9997] > 1.6 HTML_IMAGE_ONLY_28 BODY: HTML: images with 2400-2800 bytes of words > 0.0 HTML_MESSAGE BODY: HTML included in message > -1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, > low > trust > [209.85.128.179 listed in list.dnswl.org] > 0.6 DC_PNG_UNO_LARGO Message contains a single large inline gif > 0.0 DC_IMAGE_SPAM_TEXT Possible Image-only spam with little text > 0.0 DC_IMAGE_SPAM_HTML Possible Image-only spam > > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- José Angel Pineda Pardo Center of Biomedical Technology (CTB) Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggonesc at upo.es Mon Apr 29 23:58:16 2013 From: ggonesc at upo.es (Gabriel Gonzalez Escamilla) Date: Mon, 29 Apr 2013 23:58:16 +0200 Subject: [FieldTrip] beggining Help Message-ID: An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Tue Apr 30 09:51:14 2013 From: zriouil.imane at gmail.com (z.imane) Date: Tue, 30 Apr 2013 09:51:14 +0200 Subject: [FieldTrip] convert dataformat for plexon.plx to plexon.nex? Message-ID: i wan't to convert my data to plexon.nex. if you need me -- Zriouil Imane -------------- next part -------------- An HTML attachment was scrubbed... URL: From mushfa.yousuf at googlemail.com Tue Apr 30 17:19:59 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Tue, 30 Apr 2013 17:19:59 +0200 Subject: [FieldTrip] Source Reconstruction using Openmeeg method Message-ID: Hello Fieldtrippers, I am doing source reconstruction using EEG channels on a fieldtrip. I have computed Forward solution i.e head model using 'Openmeeg' and lead field successfully. For the inverse solution using 'dics' method, I wrote the following syntax cfg = []; cfg.method = 'dics'; cfg.frequency = 130; cfg.elec = dataFIC12.hdr.elec; cfg.grid = grid; cfg.vol = vol; sourcePost = ft_sourceanalysis(cfg, freqPost); and I have received the following error: ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> beamformer_dics at 314 filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ==> ft_sourceanalysis at 595 dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), optarg{:}); Error in ==> newCode at 214 sourcePost = ft_sourceanalysis(cfg, freqPost); Any help would be appreciated. Regards; Mushfa Yousuf Neurozentrum, Universitätsklinikum Schleswig-Holstein, Campus Kiel (UKSH), Deutschland -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Tue Apr 30 18:23:24 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Tue, 30 Apr 2013 18:23:24 +0200 Subject: [FieldTrip] Source Reconstruction using Openmeeg method In-Reply-To: References: Message-ID: Hi Mushfa, My guess is that the channels that have you used to compute .csdspctrm are not the same as the channels in cfg.elec. If you set cfg.channel = freqPost.label, does that solve it? Cheers, Johanna 2013/4/30 Mushfa Yousuf > Hello Fieldtrippers, > > I am doing source reconstruction using EEG channels on a fieldtrip. > > I have computed Forward solution i.e head model using 'Openmeeg' and lead > field successfully. > > For the inverse solution using 'dics' method, I wrote the following syntax > > > > > > cfg = []; > cfg.method = 'dics'; > cfg.frequency = 130; > cfg.elec = dataFIC12.hdr.elec; > cfg.grid = grid; > cfg.vol = vol; > > sourcePost = ft_sourceanalysis(cfg, freqPost); > > > and I have received the following error: > > > ??? Error using ==> mtimes > Inner matrix dimensions must agree. > > Error in ==> beamformer_dics at 314 > filt = pinv(lf' * invCf * lf) * lf' * invCf; % > Gross eqn. 3, use PINV/SVD to cover rank deficient > leadfield > > Error in ==> ft_sourceanalysis at 595 > dip(i) = beamformer_dics(grid, sens, vol, [], > squeeze(Cf(i,:,:)), optarg{:}); > > Error in ==> newCode at 214 > sourcePost = ft_sourceanalysis(cfg, freqPost); > > > > > Any help would be appreciated. > > > Regards; > > > Mushfa Yousuf > > Neurozentrum, > Universitätsklinikum Schleswig-Holstein, > Campus Kiel (UKSH), Deutschland > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: