From r.oostenveld at donders.ru.nl Tue Oct 1 10:03:40 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 1 Oct 2013 10:03:40 +0200 Subject: [FieldTrip] ICA on elekta data In-Reply-To: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> References: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> Message-ID: <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> Hi Craig, I am CCing the FT mailing list, as there is a lot of expertise there as well (as well as interest in the answer probably). You would for sure combine the gradiometers. They have their signals expressed in the same units (fieldtrength/distance). But you would probably also benefit from including the magnetometers, as they reflect the same sources that linearly mix on the channel level. However, the magnetometers are expressed in another unit (fieldstrength) which results in them being potentially weighted differently. E.g. imagine that you express distance in mm, then the planar signals are 1000 times smaller than if you express distance in meter, whereas the magnetometer signals (the 102 rows of the same data matrix) don't change. If you were to do PCA, it would make a large difference since the channel-level variances are hugely different. But I think that if you do ICA, the "sphering" step that is done prior to the unmixing matrix estimation takes care of the different scaling and it would not matter if you were to to it in meter or milimeter. As I don't have the hands-on experience, it is something I would explicitly check by doing the ICA decomposition twice on differently scaled gradiometer data (keeping the magnetometer rows in the data the same). best regards, Robert On 30 Sep 2013, at 15:33, Richter, Craig wrote: > Hi Robert, > > How would you approach ICA on data from the Elekta system? I have the 102 chips with 1 magnetometer, and two orthogonal planar gradiometers, as you know. It seems to me that the magnetometers should be done separately, but how would you handle the gradiometers? Do these need to be combined? > > I wanted to see how you would proceed. > > Best, > > C. > From mluessi at nmr.mgh.harvard.edu Tue Oct 1 13:43:31 2013 From: mluessi at nmr.mgh.harvard.edu (Martin Luessi) Date: Tue, 01 Oct 2013 07:43:31 -0400 Subject: [FieldTrip] ICA on elekta data In-Reply-To: <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> References: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> Message-ID: <524AB563.1020403@nmr.mgh.harvard.edu> Hi Craig, What you could do to handle the different units is whiten the data using a noise covariance. I.e., you collect empty-room noise, compute a noise covariance "C" and then pre-multiply the data with "C^{-1/2}". This method is used in the MNE software to combine different sensor types (gradiometers, magnetometers, eeg) for ICA, minimum norm solutions etc. The ICA code is here: https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/ica.py The code is in Python, but it should be straight-forward to translate parts to Matlab. If you don't want to implement it yourself, you could also use MNE to clean the raw data, save it back as a raw .fif file and then continue your analysis in FT. There is an example here: http://martinos.org/mne/auto_examples/preprocessing/plot_ica_from_raw.html#example-preprocessing-plot-ica-from-raw-py I hope this helps, Martin PS: Robert, I hope you don't mind that I advertise MNE on this list ;). I felt that it was appropriate since whitening is very useful when working with an Elekta system. On 10/01/13 04:03, Robert Oostenveld wrote: > Hi Craig, > > I am CCing the FT mailing list, as there is a lot of expertise there as well (as well as interest in the answer probably). > > You would for sure combine the gradiometers. They have their signals expressed in the same units (fieldtrength/distance). But you would probably also benefit from including the magnetometers, as they reflect the same sources that linearly mix on the channel level. However, the magnetometers are expressed in another unit (fieldstrength) which results in them being potentially weighted differently. E.g. imagine that you express distance in mm, then the planar signals are 1000 times smaller than if you express distance in meter, whereas the magnetometer signals (the 102 rows of the same data matrix) don't change. > > If you were to do PCA, it would make a large difference since the channel-level variances are hugely different. But I think that if you do ICA, the "sphering" step that is done prior to the unmixing matrix estimation takes care of the different scaling and it would not matter if you were to to it in meter or milimeter. As I don't have the hands-on experience, it is something I would explicitly check by doing the ICA decomposition twice on differently scaled gradiometer data (keeping the magnetometer rows in the data the same). > > best regards, > Robert > > > > > > On 30 Sep 2013, at 15:33, Richter, Craig wrote: > >> Hi Robert, >> >> How would you approach ICA on data from the Elekta system? I have the 102 chips with 1 magnetometer, and two orthogonal planar gradiometers, as you know. It seems to me that the magnetometers should be done separately, but how would you handle the gradiometers? Do these need to be combined? >> >> I wanted to see how you would proceed. >> >> Best, >> >> C. >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Martin Luessi, Ph.D. Research Fellow Department of Radiology Athinoula A. Martinos Center for Biomedical Imaging Massachusetts General Hospital Harvard Medical School 149 13th Street Charlestown, MA 02129 Fax: +1 617 726-7422 The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. From styliadis at hotmail.com Wed Oct 2 12:39:32 2013 From: styliadis at hotmail.com (Haris Styliadis) Date: Wed, 2 Oct 2013 11:39:32 +0100 Subject: [FieldTrip] sloreta gamma band Message-ID: Dear Fieldtripers,Since there is no forum for the software sLORETA (http://www.uzh.ch/keyinst/loreta.htm), I have decided to post here to see if I can get any help.I am currently processing my data on sLORETA and I have noticed that the gamma band is excluded from the 'EEG to CROSS SPECTRA' module. However, there is a prompt for a user defined bands selection. I was not able to figure out if this file should be a text file (most probable) and hoe it should be written. Please help!With kind regards,Haris Styliadis -- Haris StyliadisM.Sc. Telecommunications & Computer Network EngineeringB.Eng. Electronic Engineering with Medical ElectronicsPhD Candidate - Research AssistantDepartment of MedicineSchool of Health SciencesAristotle University of Thessaloniki PO Box 376, 54124, Thessaloniki, Greece -------------- next part -------------- An HTML attachment was scrubbed... URL: From b.osuagwu.1 at research.gla.ac.uk Wed Oct 2 13:44:44 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Wed, 2 Oct 2013 12:44:44 +0100 Subject: [FieldTrip] sloreta gamma band In-Reply-To: References: Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BF3C8A53A@CMS07.campus.gla.ac.uk> Hi Haris see this link below has the answere you are after:Please not that this is a new sloreta forum under construction http://biomedsig.com/forum/viewtopic.php?f=2&t=3#p3 Hope that helps Bethel ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] On Behalf Of Haris Styliadis [styliadis at hotmail.com] Sent: 02 October 2013 11:39 To: fieldtrip at science.ru.nl Cc: Panagiotis Kartsidis Subject: [FieldTrip] sloreta gamma band Dear Fieldtripers, Since there is no forum for the software sLORETA (http://www.uzh.ch/keyinst/loreta.htm), I have decided to post here to see if I can get any help. I am currently processing my data on sLORETA and I have noticed that the gamma band is excluded from the 'EEG to CROSS SPECTRA' module. However, there is a prompt for a user defined bands selection. I was not able to figure out if this file should be a text file (most probable) and hoe it should be written. Please help! With kind regards, Haris Styliadis -- Haris Styliadis M.Sc. Telecommunications & Computer Network Engineering B.Eng. Electronic Engineering with Medical Electronics PhD Candidate - Research Assistant Department of Medicine School of Health Sciences Aristotle University of Thessaloniki PO Box 376, 54124, Thessaloniki, Greece From Lilla.Magyari at mpi.nl Wed Oct 2 15:12:45 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Wed, 2 Oct 2013 15:12:45 +0200 (CEST) Subject: [FieldTrip] EEG Source reconstruction: sourcespace and the volume conductor misaligned In-Reply-To: References: Message-ID: <1365.195.169.109.44.1380719565.squirrel@195.169.109.44> Dear all, I just would like to mention that I also went through again on the MNE tutorial and I managed to reproduce the results. I also had to convert the units of the volume conductor. However, it was not possible to convert the units of the volume conductor directly. I converted the units of the segmentation, and then I created the vol which got the same units as the segmentation. I do not if this is due to a difference between the FieldTrip versions. I was using the latest one. Best, Lilla > Hey Steve, > thanks, you are great, I tried that again and it basically fixed my > problem > (see picture). > For documentation and maybe others to profit from: > Going through the > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate > tutorial I had problems building the volume conduction model which I > solved > by going through the additional tutorial > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > > But after the combination of the matrices and aligning them I got a > considerable sizing problem, see 2nd picture > [[[ mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > > > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > % go to the Subject01/bem directory > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', > 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > > ... > > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight]]] > > So I included Steve's suggestion > > vol = ft_convert_units(vol, 'cm') > > and specified the location of the fiducials again > > [[[ cfg = []; > > > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > > with the preauricular points this time in front of the auditory canals > and it worked out well. > > > Thanks all > > > Leo > > > > > > > On Mon, Sep 30, 2013 at 1:12 PM, Stephen Politzer-Ahles < > politzerahless at gmail.com> wrote: > >> Hi Leo, >> >> If I am remembering correctly, I think the problem could still be >> related >> to ft_convert_units even if the volume conductor and head model look >> like >> they're similar in size. For example, in the images I sent out when I >> was >> having this problem earlier, the volume conductor and hte sourcespace >> are >> the same size but one is tilted more, and the solution was nevertheless >> related to ft_convert_units (I think). In my case, this was because the >> conversion had to happen at a different time than it does in the >> tutorial. >> (I had to insert ft_convert_units somewhere earlier in the pipeline than >> where it was happening in the tutorial.) I'm sorry I can't be more >> specific, but if it will help I could try to look through my old code >> and >> re-figure out what I changed at the time. >> >> Best, >> Steve >> >> >> >> Stephen Politzer-Ahles >> New York University, Abu Dhabi >> Neuroscience of Language Lab >> http://www.nyu.edu/projects/politzer-ahles/ >> >> >> >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Mon, 30 Sep 2013 12:53:06 +0200 >>> From: Leopold Zizlsperger >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] EEG Source reconstruction: sourcespace and >>> >>> the volume conductor misaligned >>> Message-ID: >>> >> WTe+T1PZO0jMb6KUvpHFyi-c0tFuG8Mc0m9um6vVdacA at mail.gmail.com> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> >>> Hello >>> thanks for your answers, in combination with the tutorial they were a >>> big >>> help. >>> I think I got closer but have a last issue: >>> @ Jan-Mathijs: I redid the headmodel and it looks better now as shown >>> on >>> the screenshots attached, thanks >>> @ Lilla and Stephen: the scaling in general should not be the problem I >>> think, the sizes seem to match, thank you >>> While both the volume conduction and the headmodel are expressed in CTF >>> coordinates, see second screenshot vol vs sourcespace, they don't align >>> very well > first screenshot >>> Is there a way to align them manually? Or would it be legitimate to >>> "cheat" >>> with the fiducials of the sourcemodel ? By changing the preauricular >>> points >>> I think I could align them, but I am not sure if that would cuase >>> problems >>> later on... >>> Thanks in advance >>> Leo >>> >>> >>> On Mon, Sep 30, 2013 at 12:43 PM, Leopold Zizlsperger < >>> zizlsperger at gmail.com >>> > wrote: >>> >>> > Hello >>> > thanks for your answers, in combination with the tutorial they were a >>> big >>> > help. >>> > I think I got closer but have a last issue: >>> > @ Jan-Mathijs: I redid the headmodel and it looks better now as shown >>> on >>> > the screenshots attached, thanks >>> > @ Lilla and Stephen: the scaling in general should not be the problem >>> I >>> > think, the sizes seem to match, thank you >>> > While both the volume conduction and the headmodel are expressed in >>> CTF >>> > coordinates, see third screenshot vol vs sourcespace, they don't >>> align >>> very >>> > well > first two screenshots >>> > Is there a way to align them manually? Or would it be legitimate to >>> > "cheat" with the fiducials of the sourcemodel ? By changing the >>> > preauricular points I think I could align them, but I am not sure if >>> that >>> > would cuase problems later on... >>> > Thanks in advance >>> > Leo >>> > >>> > >>> > >>> > On Mon, Sep 30, 2013 at 10:29 AM, jan-mathijs schoffelen < >>> > jan.schoffelen at donders.ru.nl> wrote: >>> > >>> >> Hi Leo, >>> >> >>> >> May I add to Lilla's comments that the reconstructed headmodel looks >>> >> quite bad to me. This suggests that the automatic anatomical >>> segmentation >>> >> did not work well. The most likely cause is that the coordinate >>> system >>> >> which you specified for the anatomical image in the input was >>> incorrect >>> >> (e.g. specifying 'spm', while it should have been 'ctf' or so), or >>> that the >>> >> transformation matrix mapping from voxels to head coordinates was >>> not >>> >> correct. >>> >> >>> >> Best, >>> >> Jan-Mathijs >>> >> >>> >> >>> >> On Sep 30, 2013, at 9:53 AM, lilla.magyari at mpi.nl wrote: >>> >> >>> >> Hello Leo and Stephen, >>> >> >>> >> yes, it is unfortunate, that there is still a problem with the MNE >>> >> tutorial. I think the main problem is the integration of the >>> pipeline >>> with >>> >> Freesurfer which requires a more careful look on the script. >>> >> I could not find the attached image from Leo. If the sourcespace and >>> the >>> >> volume conduction models are not well-aligned because one of them is >>> too >>> >> small compared to the other, then it will probably help if you >>> convert >>> the >>> >> units. >>> >> In Fieldtrip, the handling of the units of the volume conduction >>> model >>> has >>> >> changed, which means that they are not automatically converted to >>> 'cm' >>> >> anymore. >>> >> Lilla >>> >> >>> >> >>> >> Hello Leo, >>> >> >>> >> >>> >> This looks like the same problem I was having a few months ago, and >>> there >>> >> >>> >> should be some messages on the list about it. I am not able to look >>> at >>> my >>> >> >>> >> data and scripts right now, but if I remember correctly (you can >>> check >>> the >>> >> >>> >> lists for more) the problem had to do with the transformation >>> matrix, >>> and >>> >> >>> >> ft_convert_units. In my case, during the "volume conduction model" >>> step of >>> >> >>> >> the tutorial (the last step before you can plot the vol and >>> sourcespace >>> >> >>> >> together), I had to add an extra >>> >> >>> >> >>> >> vol = ft_convert_units(vol, 'cm') >>> >> >>> >> >>> >> before ft_transform_geometry. I don't remember if this alone will >>> solve >>> >> >>> >> the >>> >> >>> >> problem (unfortunately the the situation is kind of complicated >>> right >>> now, >>> >> >>> >> there is also a different version of the minimum norms tutorial that >>> is >>> >> >>> >> still in development--see the previous messages for links--and I >>> think >>> my >>> >> >>> >> processing pipeline ended up being a mixture of the two to get >>> things >>> >> >>> >> working. Which means that it's hard to track where exactly I solved >>> the >>> >> >>> >> problem.) >>> >> >>> >> >>> >> Best, >>> >> >>> >> Steve >>> >> >>> >> >>> >> >>> >> >>> >> Message: 1 >>> >> >>> >> Date: Sat, 28 Sep 2013 15:25:32 +0200 >>> >> >>> >> From: Zizlsperger Leopold >>> >> >>> >> To: >>> >> >>> >> Subject: [FieldTrip] EEG Source reconstruction: sourcespace and the >>> >> >>> >> volume conductor misaligned >>> >> >>> >> Message-ID: <06D14B0C-655A-4EF2-A69A-B735DBDBC504 at gmail.com> >>> >> >>> >> Content-Type: text/plain; charset="iso-8859-1" >>> >> >>> >> >>> >> Hi all, >>> >> >>> >> I am following the instructions in the "Source reconstruction of >>> >> >>> >> event-related fields using minimum-norm estimate" tutorial closely >>> to >>> do >>> >> >>> >> a >>> >> >>> >> source-analysis of EEG data using the example MRI. As I am following >>> the >>> >> >>> >> tutorial almost unchanged I am not including the script here. >>> >> >>> >> >>> >> When I re-align the volume conduction model to the sourcespace they >>> are >>> >> >>> >> not aligned very well, see screenshot attached. I remember a similar >>> >> >>> >> question in the mailing list a while ago but cannot find it... >>> >> >>> >> >>> >> Is there a way to interactively realign volume conduction model and >>> >> >>> >> sourcespace? Re-doing the fiducials did not change the aligment >>> >> >>> >> considerably. Also, my volume conduction model looks weird... >>> >> >>> >> I used ft_determine_coordsys on both the vol and the sourcespace, >>> see >>> >> >>> >> screenshots attached, too. >>> >> >>> >> Would be nice if you could point me in the right direction. >>> >> >>> >> Thanks in advance. >>> >> >>> >> Leo >>> >> >>> >> >>> >> ---- >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> Dr. med. Leopold Zizlsperger >>> >> >>> >> Klinik f?r Neurologie >>> >> >>> >> Uniklinik RWTH Aachen >>> >> >>> >> Pauwelsstrasse 30 >>> >> >>> >> 52074 Aachen >>> >> >>> >> Tel: +49 241 80 35465 >>> >> >>> >> lzizlsperger at ukaachen.de >>> >> >>> >> >>> >> Leopold Zizlsperger, MD >>> >> >>> >> Department of Neurology >>> >> >>> >> RWTH Aachen University >>> >> >>> >> Pauwelsstrasse 30 >>> >> >>> >> 52074 Aachen, Germany >>> >> >>> >> Tel: +49 241 80 35465 >>> >> >>> >> lzizlsperger at ukaachen.de >>> >> >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> An HTML attachment was scrubbed... >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment.html >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: align 2.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 200601 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: align.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 208103 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0001.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: vol.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 148045 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0002.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: sourcespace.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 122200 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0003.png >>> >> >>> >> >>> >> >>> >> ------------------------------ >>> >> >>> >> >>> >> _______________________________________________ >>> >> >>> >> fieldtrip mailing list >>> >> >>> >> fieldtrip at donders.ru.nl >>> >> >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> End of fieldtrip Digest, Vol 34, Issue 28 >>> >> >>> >> ***************************************** >>> >> >>> >> >>> >> _______________________________________________ >>> >> >>> >> 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 >>> >> >>> >> >>> >> Jan-Mathijs Schoffelen, MD PhD >>> >> >>> >> Donders Institute for Brain, Cognition and Behaviour, >>> >> Centre for Cognitive Neuroimaging, >>> >> Radboud University Nijmegen, The Netherlands >>> >> >>> >> Max Planck Institute for Psycholinguistics, >>> >> Nijmegen, The Netherlands >>> >> >>> >> J.Schoffelen at donders.ru.nl >>> >> Telephone: +31-24-3614793 >>> >> >>> >> http://www.hettaligebrein.nl >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> > >>> > >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment.html >>> > >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: source sourcespace mit vol.png >>> Type: image/png >>> Size: 307944 bytes >>> Desc: not available >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment.png >>> > >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: source sourcespace vs vol.png >>> Type: image/png >>> Size: 337423 bytes >>> Desc: not available >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment-0001.png >>> > >>> >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> End of fieldtrip Digest, Vol 34, Issue 31 >>> ***************************************** >>> >> >> >> _______________________________________________ >> 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 Keith.McConnell at cchmc.org Wed Oct 2 18:46:17 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Wed, 2 Oct 2013 16:46:17 +0000 Subject: [FieldTrip] ft_rejectartifact Message-ID: Hello, I have an experiment for which I have an extended stimulus for a very few number of trials (20). I would like to build a for loop to create TF plots for each trial individually. There are jump artifacts in the data. When a trial is rejected due to jump artifact my loop crashes: Error using ft_rejectartifact (line 491) No trials left after artifact rejection. I would like to create an if/then statement that will identify that the individual trial was rejected and return to running the for loop. I cannot find the flag that is generated that tells me that there are no trials left. Can someone help? Thanks, Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Thu Oct 3 11:24:08 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 3 Oct 2013 11:24:08 +0200 (CEST) Subject: [FieldTrip] ft_rejectartifact In-Reply-To: Message-ID: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> Dear Keith, What ft_rejectartifact does when rejecting trials completely is check the cfg.trl matrix (which contains the first, last, and offset sample with respect to the original data) for occurences of the artifact that you want to reject. If an artifact is present, it removes the line from this matrix. Then the artifact free data is read-in from disk or from memory. Basically line 491 checks whether cfg.trl is empty as that would indicate that no trials are left after rejection. Am I correct in assuming you are running ft_rejectartifact on each trial separately? If so, you could also run it on the entire dataset before going through your loop with the option cfg.artfctdef.feedback = 'yes'; .Doing this will remove the trials containing jump artifacts while preserving the other trials and it will give you feedback on which trials were removed. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "Keith McConnell" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 2 oktober 2013 18:46:17 > Onderwerp: [FieldTrip] ft_rejectartifact > Hello, > I have an experiment for which I have an extended stimulus for a very > few number of trials (20). I would like to build a for loop to create > TF plots for each trial individually. > There are jump artifacts in the data. > When a trial is rejected due to jump artifact my loop crashes: > Error using ft_rejectartifact (line 491) > No trials left after artifact rejection. > I would like to create an if/then statement that will identify that > the individual trial was rejected and return to running the for loop. > I cannot find the flag that is generated that tells me that there are > no trials left. > Can someone help? > Thanks, > Keith > Keith McConnell, M.S. > 513.636.0739 (desk) > 513.504.9907 (cell) > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Thu Oct 3 13:24:05 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Thu, 3 Oct 2013 11:24:05 +0000 Subject: [FieldTrip] ft_rejectartifact In-Reply-To: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> References: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> Message-ID: Thanks Jim. You're correct, I was trying to run ft_rejectartifact on each trial individually. Your strategy seems like a much more workable solution. Thanks. Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Thursday, October 03, 2013 5:24 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_rejectartifact Dear Keith, What ft_rejectartifact does when rejecting trials completely is check the cfg.trl matrix (which contains the first, last, and offset sample with respect to the original data) for occurences of the artifact that you want to reject. If an artifact is present, it removes the line from this matrix. Then the artifact free data is read-in from disk or from memory. Basically line 491 checks whether cfg.trl is empty as that would indicate that no trials are left after rejection. Am I correct in assuming you are running ft_rejectartifact on each trial separately? If so, you could also run it on the entire dataset before going through your loop with the option cfg.artfctdef.feedback = 'yes'; .Doing this will remove the trials containing jump artifacts while preserving the other trials and it will give you feedback on which trials were removed. Best, Jim ________________________________ Van: "Keith McConnell" > Aan: fieldtrip at science.ru.nl Verzonden: Woensdag 2 oktober 2013 18:46:17 Onderwerp: [FieldTrip] ft_rejectartifact Hello, I have an experiment for which I have an extended stimulus for a very few number of trials (20). I would like to build a for loop to create TF plots for each trial individually. There are jump artifacts in the data. When a trial is rejected due to jump artifact my loop crashes: Error using ft_rejectartifact (line 491) No trials left after artifact rejection. I would like to create an if/then statement that will identify that the individual trial was rejected and return to running the for loop. I cannot find the flag that is generated that tells me that there are no trials left. Can someone help? Thanks, Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From vnune at hunter.cuny.edu Thu Oct 3 16:22:53 2013 From: vnune at hunter.cuny.edu (Valerie Nunez) Date: Thu, 3 Oct 2013 10:22:53 -0400 (EDT) Subject: [FieldTrip] Cluster-level permutation test statistics Message-ID: <201310031422.041560@msa1.hunter.cuny.edu> Hello, I'm a little confused about the notion of unit of observation (UO) as subject or trial in the cluster_permutation_timelock tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock Specifically, I don't quite understand how the example of congruent and incongruent trials for a single subject is considered a between-trials design and therefore uses an independent t-test. If two trials have taken place for one subject, why isn't this considered a within-subject design, thereby requiring a dependent-samples t-test? What am I missing? Thanks, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Oct 3 16:39:14 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 3 Oct 2013 16:39:14 +0200 Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: <201310031422.041560@msa1.hunter.cuny.edu> References: <201310031422.041560@msa1.hunter.cuny.edu> Message-ID: Hi Valerie, The crucial thing to note here is that it does not make sense to pair any individual trial in condition A with another individual trial in condition B. There are no pairs, the design is between-units-of-observation, thus a two-sample (= independent) t-test is used. Note furthermore that when doing this test you are testing a hypothesis about a population of trials, and not about a population of people. If you want to test a hypothesis about a population of people, you would typically compute some average value for condition A and condition B for each subject, and then do a test over subjects. Note that here you would do a paired-sample (= dependent) t-test, since now it does make sense to pair each value in condition A with another value in condition B (namely, those belonging to the same subject). Now you have one value per condition per subject, and each subject was tested in two conditions. Does this help? Best, Eelke On 3 October 2013 16:22, Valerie Nunez wrote: > Hello, > > I'm a little confused about the notion of unit of observation (UO) as > subject or trial in the cluster_permutation_timelock tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock > > Specifically, I don't quite understand how the example of congruent and > incongruent trials for a single subject is considered a between-trials > design and therefore uses an independent t-test. If two trials have taken > place for one subject, why isn't this considered a within-subject design, > thereby requiring a dependent-samples t-test? > > What am I missing? > > Thanks, > > Valerie > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From vnune at hunter.cuny.edu Thu Oct 3 16:59:04 2013 From: vnune at hunter.cuny.edu (Valerie Nunez) Date: Thu, 3 Oct 2013 10:59:04 -0400 (EDT) Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: References: Message-ID: <201310031459.041567@msa1.hunter.cuny.edu> Hi Eelke, That makes much more sense. Thanks for your help, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Oct 4 06:53:30 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 4 Oct 2013 06:53:30 +0200 (CEST) Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: <201310031422.041560@msa1.hunter.cuny.edu> References: <201310031422.041560@msa1.hunter.cuny.edu> Message-ID: <03d301cec0bd$ae207e00$0a617a00$@maris@psych.ru.nl> Hi Valerie, A dependent samples t-test (also called paired-samples t-tests) involves pairs of observations. If you have 20 trials in one subject, 10 in condition A and 10 in condition B, what would be your pairs (i.e., in which natural way would you construct pairs)? It may good to also read one of our papers before starting with the tutorial. The concept of a UO is not specific to permutation-based statistics, and given that your problem seems to be with this concept, you could try Maris_Psychophysiology_2012, which starts out with classical statistical tests. For cluster-based permutation statistics itself, Maris&Oostenveld_JNM_2007 is the better choice. Best, Eric Maris From: Valerie Nunez [mailto:vnune at hunter.cuny.edu] Sent: donderdag 3 oktober 2013 16:23 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Cluster-level permutation test statistics Hello, I'm a little confused about the notion of unit of observation (UO) as subject or trial in the cluster_permutation_timelock tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock Specifically, I don't quite understand how the example of congruent and incongruent trials for a single subject is considered a between-trials design and therefore uses an independent t-test. If two trials have taken place for one subject, why isn't this considered a within-subject design, thereby requiring a dependent-samples t-test? What am I missing? Thanks, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From chan at med.uni-frankfurt.de Fri Oct 4 15:38:53 2013 From: chan at med.uni-frankfurt.de (Jason Chan) Date: Fri, 4 Oct 2013 15:38:53 +0200 Subject: [FieldTrip] 2IFC baseline-corrected TFR Message-ID: <002001cec107$11240c30$336c2490$@med.uni-frankfurt.de> Dear Fieldtripers, I ran a 2 interval force choice experiment (2-IFC) experiment in the MEG whereby participants indicated in which interval an event occurred. I am trying to do a baseline-corrected TFR analyses on Interval 2. I would like to keep the same baseline window for Interval 2 as Interval 1 (i.e., before Interval 1). I have tried to do this two different ways. 1. When preprocessing, specifying the cfg.baseline to the desired time. However, it appears that this will not append the specified baseline to the 'trial' time. 2. I preprocessed the entire length of the trial (baseline + Interval 1+Interval 2) and ran a TFR . However, trial lengths are obviously different between the two interval. This is a problem when I want to append Interval 1 and 2, based on participants' responses. Is there a way that I can specify a baseline window that is separate from the 'trial' duration? Kind regards, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Sat Oct 5 04:26:17 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Oct 2013 04:26:17 +0200 Subject: [FieldTrip] follow-up on grad fields with NaNs after ICA Message-ID: <524F78C9.4090002@gmail.com> Hi FT-ers, It took me a while to find some older posts that would answer my question, and this thread almost did the whole job: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006779.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006788.html Like Alex, I figured out that it was the ICA that left my grad.chanpos with NaNs only, and like Haiteng, I thought just replacing the grad field with a pre-ICA grad field would be one way to go. But just like Alex I was wondering whether this is the right way to go: "however, it feels somewhat dangerous to perform such "dirty" fixes, since that grad info is probably removed for a certain reason. We are oblivious to its impact subsequent steps like planar transform and source reconstruction." Talking to a knowledgeable colleague yesterday about this issue, he also had his question marks. But I don't see any follow-up on Alex's remark (I guess he further discussed this with colleagues while drinking coffee at the DCCN kitchen...! :-) SS So I still don't know the answer and maybe some other people may want to know it as well in the future. Any opinion on whether it's safe to use pre-ICA grad information for subsequent planar transformation and source analyses? Thanks a lot, Vitória -- ** Please consider the environment - do you really need to print? ** From vitoria.piai at gmail.com Sat Oct 5 15:39:13 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Oct 2013 15:39:13 +0200 Subject: [FieldTrip] follow-up on grad fields with NaNs after ICA In-Reply-To: <6CDC0300-2062-49CB-AAAD-BF28339F1EA1@gmail.com> References: <6CDC0300-2062-49CB-AAAD-BF28339F1EA1@gmail.com> Message-ID: <52501681.9090904@gmail.com> Dear Vitória, The short answer to your question would be: If in subsequent steps you do planar gradient transformation or data visualization it's safe to replace the grad. If in subsequent steps you want to do sourceanalysis, it's not safe to replace the grad. Reason: essential information that is needed for a correct forward computation (i.e. construction of the leadfields) is removed by replacing the grad. This information is represented in grad.tra. The explanation would be a bit technical, and it has been our intention for a while to document this on the FT-wiki as a FAQ, but we didn't get to it yet. For visualization and planar gradient transformation, only the grad.chanpos is needed, and this is correctly represented in an 'earlier-stage' grad-structure. Note that we have made some changes just this past week that actually addresses this NaN-issue. It will not work on backprojected data (i.e. data that has gone through ft_componentanalysis, followed by ft_rejectcomponent), but if you grab the most recent FT version and do ft_rejectcomponent, I believe the grad.chanpos will be reconstructed without NaNs. I haven't tried it myself, but rumour has it that this is the case. Would you be interested in contributing to the documentation, let me know... Best wishes, Jan-Mathijs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% On Oct 5, 2013, at 4:26 AM, Vitória Magalhães Piai wrote: > Hi FT-ers, > > It took me a while to find some older posts that would answer my > question, and this thread almost did the whole job: > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006779.html > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006788.html > > Like Alex, I figured out that it was the ICA that left my grad.chanpos > with NaNs only, and like Haiteng, I thought just replacing the grad > field with a pre-ICA grad field would be one way to go. > But just like Alex I was wondering whether this is the right way to > go: "however, it feels somewhat dangerous to perform such "dirty" > fixes, since that grad info is probably removed for a certain reason. > We are oblivious to its impact subsequent steps like planar transform > and source reconstruction." > Talking to a knowledgeable colleague yesterday about this issue, he > also had his question marks. But I don't see any follow-up on Alex's > remark (I guess he further discussed this with colleagues while > drinking coffee at the DCCN kitchen...! :-) > SS > So I still don't know the answer and maybe some other people may want > to know it as well in the future. > > Any opinion on whether it's safe to use pre-ICA grad information for > subsequent planar transformation and source analyses? > Thanks a lot, Vitória > > -- > ** Please consider the environment - do you really need to print? ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Mon Oct 7 23:54:40 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 00:54:40 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) Message-ID: Hello all, We are having some problems defining atlas-based ROIs using ft_sourcestatistics on two source structures obtained via ft_sourceanalysis (whose grid is later changed according to a precalculated MNI-warped grid). It seems like the function "statistics_wrapper" has changed between "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls "volumelookup" and not "ft_volumelookup", so we get the following error: ??? Undefined function or method 'volumelookup' for input arguments of type 'struct'. Error in ==> statistics_wrapper at 136 tmp = volumelookup(tmpcfg, varargin{1}); Using the older fieldtrip vesion we get this error: ??? Subscript indices must either be real positive integers or logicals. Error in ==> statistics_wrapper at 213 tmp(i,:) = mean(dat(roi,:), 1); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So it seems like we didn't define the ROIs correctly, however we are not sure why. Any suggestions would be greatly appreciated! The relevant pieceof code is attached. Thank you all, Aia and Roey Relevant code ============ % Convert sources units to mm, to fit the atlas's units sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); sourceCondition2 = ft_convert_units(sourceCondition2, ' design = [ ones(1,length(sourceCondition1.trial)), 2*ones(1,length(sourceCondition2.trial)) ]; cfg = []; cfg.dim = sourceCondition1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.01; cfg.tail = 0; cfg.design(1,:) = design; cfg.ivar = 1; % Load the Atlas templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory backslashIndices = find(templateDir=='\'); templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: "Precentral_L", "Precentral_R", etc/ cfg.avgoverroi = 'yes'; cfg.hemisphere = 'both'; cfg.inputcoord = 'mni'; stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 08:25:46 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 09:25:46 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: Message-ID: Hello again, Sorry, it seems like the older version (with ft_volumelookup) is just our mistake. However the problem is still relevant, for the function volumelookup is still undefinded in our case. Hopefully someone might know what we did wrong. Thank you once again! Aia and Roey On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > Hello all, > > We are having some problems defining atlas-based ROIs using > ft_sourcestatistics on two source structures obtained via ft_sourceanalysis > (whose grid is later changed according to a precalculated MNI-warped grid). > > It seems like the function "statistics_wrapper" has changed between > "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls > "volumelookup" and not "ft_volumelookup", so we get the following error: > > ??? Undefined function or method 'volumelookup' for input > arguments of type 'struct'. > > Error in ==> statistics_wrapper at 136 > tmp = volumelookup(tmpcfg, varargin{1}); > > Using the older fieldtrip vesion we get this error: > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > So it seems like we didn't define the ROIs correctly, however we are not > sure why. > > Any suggestions would be greatly appreciated! > The relevant pieceof code is attached. > > Thank you all, > Aia and Roey > > > > Relevant code > ============ > % Convert sources units to mm, to fit the atlas's units > sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); > sourceCondition2 = ft_convert_units(sourceCondition2, ' > design = [ ones(1,length(sourceCondition1.trial)), > 2*ones(1,length(sourceCondition2.trial)) ]; > > cfg = []; > cfg.dim = sourceCondition1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.01; > cfg.tail = 0; > cfg.design(1,:) = design; > cfg.ivar = 1; > > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) > to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; > > > cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: > "Precentral_L", "Precentral_R", etc/ > > cfg.avgoverroi = 'yes'; > cfg.hemisphere = 'both'; > cfg.inputcoord = 'mni'; > > stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Oct 8 08:38:33 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 8 Oct 2013 08:38:33 +0200 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: Message-ID: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Dear Roey and Aia, This indeed was our bad. We have fixed it in the current version of FieldTrip. The version will be available for download tonight (CET), but you can get an instantaneous update of the code repository by doing 'ft_version update' on the Matlab command line. This will update the fieldtrip copy you are using to the latest version. Note that if you want to keep a 'static' version, you need to back up the version with a fixed date, because all changes will be incorporated. A little note to the following piece of code: > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; The same can be achieved with the fullfile function (which deals with platform specific file-separators automatically): templateDir=which('ft_defaults'); cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); Best, Jan-Mathijs On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > Hello again, > > Sorry, it seems like the older version (with ft_volumelookup) is just our mistake. > However the problem is still relevant, for the function volumelookup is still undefinded in our case. > > Hopefully someone might know what we did wrong. > > Thank you once again! > Aia and Roey > > > On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > Hello all, > > We are having some problems defining atlas-based ROIs using ft_sourcestatistics on two source structures obtained via ft_sourceanalysis (whose grid is later changed according to a precalculated MNI-warped grid). > > It seems like the function "statistics_wrapper" has changed between "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls "volumelookup" and not "ft_volumelookup", so we get the following error: > > ??? Undefined function or method 'volumelookup' for input > arguments of type 'struct'. > > Error in ==> statistics_wrapper at 136 > tmp = volumelookup(tmpcfg, varargin{1}); > > Using the older fieldtrip vesion we get this error: > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > So it seems like we didn't define the ROIs correctly, however we are not sure why. > > Any suggestions would be greatly appreciated! > The relevant pieceof code is attached. > > Thank you all, > Aia and Roey > > > > Relevant code > ============ > % Convert sources units to mm, to fit the atlas's units > sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); > sourceCondition2 = ft_convert_units(sourceCondition2, ' > design = [ ones(1,length(sourceCondition1.trial)), 2*ones(1,length(sourceCondition2.trial)) ]; > > cfg = []; > cfg.dim = sourceCondition1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.01; > cfg.tail = 0; > cfg.design(1,:) = design; > cfg.ivar = 1; > > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; > > > cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: "Precentral_L", "Precentral_R", etc/ > > cfg.avgoverroi = 'yes'; > cfg.hemisphere = 'both'; > cfg.inputcoord = 'mni'; > > stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 08:43:14 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 09:43:14 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Thank you so much for your kind and quick answer! We do hope this will fix things up. We will check it asap. Best regards, Aia and Roey On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Roey and Aia, > > This indeed was our bad. We have fixed it in the current version of > FieldTrip. > The version will be available for download tonight (CET), but you can get > an instantaneous update of the code repository by doing 'ft_version update' > on the Matlab command line. > This will update the fieldtrip copy you are using to the latest version. > Note that if you want to keep a 'static' version, you need to back up the > version with a fixed date, because all changes will be incorporated. > > A little note to the following piece of code: > > % Load the Atlas >> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >> to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >> > > The same can be achieved with the fullfile function (which deals with > platform specific file-separators automatically): > > templateDir=which('ft_defaults'); > cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); > > > Best, > Jan-Mathijs > > > > On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > > Hello again, > > Sorry, it seems like the older version (with ft_volumelookup) is just our > mistake. > However the problem is still relevant, for the function volumelookup is > still undefinded in our case. > > Hopefully someone might know what we did wrong. > > Thank you once again! > Aia and Roey > > > On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > >> Hello all, >> >> We are having some problems defining atlas-based ROIs using >> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >> (whose grid is later changed according to a precalculated MNI-warped grid). >> >> It seems like the function "statistics_wrapper" has changed between >> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >> "volumelookup" and not "ft_volumelookup", so we get the following error: >> >> ??? Undefined function or method 'volumelookup' for input >> arguments of type 'struct'. >> >> Error in ==> statistics_wrapper at 136 >> tmp = volumelookup(tmpcfg, varargin{1}); >> >> Using the older fieldtrip vesion we get this error: >> ??? Subscript indices must either be real positive integers or >> logicals. >> >> Error in ==> statistics_wrapper at 213 >> tmp(i,:) = mean(dat(roi,:), 1); >> >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> So it seems like we didn't define the ROIs correctly, however we are not >> sure why. >> >> Any suggestions would be greatly appreciated! >> The relevant pieceof code is attached. >> >> Thank you all, >> Aia and Roey >> >> >> >> Relevant code >> ============ >> % Convert sources units to mm, to fit the atlas's units >> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >> sourceCondition2 = ft_convert_units(sourceCondition2, ' >> design = [ ones(1,length(sourceCondition1.trial)), >> 2*ones(1,length(sourceCondition2.trial)) ]; >> >> cfg = []; >> cfg.dim = sourceCondition1.dim; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'indepsamplesT'; >> cfg.parameter = 'pow'; >> cfg.correctm = 'cluster'; >> cfg.numrandomization = 1000; >> cfg.alpha = 0.01; >> cfg.tail = 0; >> cfg.design(1,:) = design; >> cfg.ivar = 1; >> >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >> to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >> >> >> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >> "Precentral_L", "Precentral_R", etc/ >> >> cfg.avgoverroi = 'yes'; >> cfg.hemisphere = 'both'; >> cfg.inputcoord = 'mni'; >> >> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tahere.toosi at gmail.com Tue Oct 8 08:54:26 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Tue, 8 Oct 2013 10:24:26 +0330 Subject: [FieldTrip] Layout for QuickCap 32 channel (Neuroscan) Message-ID: Hi Filedtripers, I have a problem making the layout file for Neuroscan 32 channel Quick Cap . I read the description on constructing layout for 128 channel Quick cap, but I encountered the same problem that Andre reported before : the electrodes seems to be shifted toward the back of the head. Could you please help me constructing the layout? Attached, please find the .sfp file. Thanks, Tahereh -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: QuickCap_32Custom.sfp Type: application/octet-stream Size: 1152 bytes Desc: not available URL: From MEpstein at NKI.RFMH.ORG Tue Oct 8 17:50:07 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Tue, 8 Oct 2013 15:50:07 +0000 Subject: [FieldTrip] definetrial with ANT .cnt files Message-ID: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> Hi all, I'm having a problem defining triggers using ft_definetrial with ANT .cnt files. Say I want to do a simple epoching around events with a trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get an error saying no trials are defined. However I figured out that if I put in cfg.trialdef.eventvalue =[1 char(0) char(0)]; then it works fine. The trigger files look totally normal, and other programs don't seem to have this issue. Anyone else ever have a problem like this? Thanks, -Michael IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From notthemindprobe at yahoo.com Tue Oct 8 15:01:11 2013 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Tue, 8 Oct 2013 06:01:11 -0700 (PDT) Subject: [FieldTrip] Automatically saving GDF using the realtime buffer Message-ID: <1381237271.38083.YahooMailNeo@web165005.mail.bf1.yahoo.com> Fieldtrip:   Hi, I am a new user of Fieldtrip, but our lab has a (pretty well working) real-time analysis of BioSemi EEG using two computers, matlab, and the FieldTrip buffer.  The buffer is used for communicating data between two machines: machine A collects and saves the data while also writingto the buffer, and machine B uses matlab to read the data off of the buffer (TCP/IP connection) and then run a soft real-time analysis of the EEG data.   Currently we manually start and stop the saving of a GDF file on machine A by hitting the S and D keys.   I would like to automatically start and stop the file saving, and was wondering if anyone had any suggestions?  I read that the OnlineDataManager (which interacts with our biosemi2ft code) handles the saving, and also does listen for ASCII messages on a TCP port for various commands, including "SAVE START/STOP".  Unfortunately, I'm not a programmer, and haven't been able to figure out how to write those commands to the port.  Is there a way to use the ft_write_data (or similar) to do that?  How do you make address the command to the specific port?   Any suggestions would be greatfully received.   Thanks!   Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 23:41:19 2013 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 9 Oct 2013 00:41:19 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: Dear fieldtrippers (Jan-Mathijs included), (This message seems long, but is actually quite simple) Having downloaded the latest fieldtrip version (20131008), we tried rerunning the code and got the following error: ??? Reference to non-existent field 'coordsys'. Error in ==> ft_volumelookup at 206 if strcmp(cfg.inputcoord, 'mni') && strcmp(atlas.coordsys, 'tal') Error in ==> statistics_wrapper at 136 tmp = ft_volumelookup(tmpcfg, varargin{1}); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); Since the spm8 MNI atlas indeed has no "coordsys" field. Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by hand, or by simply deleting that "if" line), we still get one of two errors: * * * * * (1) * * * * * If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the MNI atlas has to offer, we get an indices error: ??? Subscript indices must either be real positive integers or logicals. Error in ==> statistics_wrapper at 213 tmp(i,:) = mean(dat(roi,:), 1); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); * * * * * (2) * * * * * If we define "cfg.roi = AAL_names{1};" for example, we get a different error: ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 187 tmp(cfg.inside) = postailobs; Error in ==> ft_statistics_montecarlo at 326 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 298 [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); And in "cluserstat" appears this comment: "%this snippet is to support correct clustering of N-dimensional data, not fully tested yet". Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the variables vectors "postailobs" and "negtailobs" Any ideas on how to solve this atlas source statistics problem (defining the coordsys field, performing statistics across all ROIs, and using the postailobs/negtailobs vectors) would be greatly appreciated! Good night, Aia and Roey On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Dear Roey and Aia, >> >> This indeed was our bad. We have fixed it in the current version of >> FieldTrip. >> The version will be available for download tonight (CET), but you can get >> an instantaneous update of the code repository by doing 'ft_version update' >> on the Matlab command line. >> This will update the fieldtrip copy you are using to the latest version. >> Note that if you want to keep a 'static' version, you need to back up the >> version with a fixed date, because all changes will be incorporated. >> >> A little note to the following piece of code: >> >> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = []; clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >> >> The same can be achieved with the fullfile function (which deals with >> platform specific file-separators automatically): >> >> templateDir=which('ft_defaults'); >> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >> >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >> >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) is just >> our mistake. >> However the problem is still relevant, for the function volumelookup is >> still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >> >>> Hello all, >>> >>> We are having some problems defining atlas-based ROIs using >>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>> (whose grid is later changed according to a precalculated MNI-warped grid). >>> >>> It seems like the function "statistics_wrapper" has changed between >>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>> >>> ??? Undefined function or method 'volumelookup' for input >>> arguments of type 'struct'. >>> >>> Error in ==> statistics_wrapper at 136 >>> tmp = volumelookup(tmpcfg, varargin{1}); >>> >>> Using the older fieldtrip vesion we get this error: >>> ??? Subscript indices must either be real positive integers or >>> logicals. >>> >>> Error in ==> statistics_wrapper at 213 >>> tmp(i,:) = mean(dat(roi,:), 1); >>> >>> Error in ==> ft_sourcestatistics at 107 >>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> So it seems like we didn't define the ROIs correctly, however we are not >>> sure why. >>> >>> Any suggestions would be greatly appreciated! >>> The relevant pieceof code is attached. >>> >>> Thank you all, >>> Aia and Roey >>> >>> >>> >>> Relevant code >>> ============ >>> % Convert sources units to mm, to fit the atlas's units >>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>> design = [ ones(1,length(sourceCondition1.trial)), >>> 2*ones(1,length(sourceCondition2.trial)) ]; >>> >>> cfg = []; >>> cfg.dim = sourceCondition1.dim; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'indepsamplesT'; >>> cfg.parameter = 'pow'; >>> cfg.correctm = 'cluster'; >>> cfg.numrandomization = 1000; >>> cfg.alpha = 0.01; >>> cfg.tail = 0; >>> cfg.design(1,:) = design; >>> cfg.ivar = 1; >>> >>> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = []; clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >>> >>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>> "Precentral_L", "Precentral_R", etc/ >>> >>> cfg.avgoverroi = 'yes'; >>> cfg.hemisphere = 'both'; >>> cfg.inputcoord = 'mni'; >>> >>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>> >>> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Wed Oct 9 00:13:19 2013 From: octavian.lie at gmail.com (octavian lie) Date: Tue, 8 Oct 2013 17:13:19 -0500 Subject: [FieldTrip] error ft_version Message-ID: Dear All, I was trying to update fieldtrip code, I get the following: ft_version update comparing local and remote (latest) hashes, this might take a minute... the following new files will be added: ! 1. r7274 fileio/ft_read_mri.m 2. r7273 test/test_ft_datatype_sens.m ! 3. r7272 utilities/private/scalingfactor.m ! 4. r7272 forward/private/scalingfactor.m ! 5. r7272 fileio/private/scalingfactor.m ! 6. r7271 private/scalingfactor.m 7. r7271 test/test_bug1916.m ! 8. r7270 utilities/printstruct.m ! 9. r7267 plotting/ft_plot_text.m ! 10. r7264 plotting/private/ft_voltype.m ! 11. r7264 inverse/private/ft_voltype.m ! 12. r7264 fileio/private/ft_voltype.m ! 13. r7263 forward/ft_voltype.m the following files will be updated: 14. r7233-->r7276 ft_freqanalysis.m 15. r7220-->r7275 ft_volumesegment.m 16. r7133-->r7272 plotting/private/scalingfactor.m 17. r7209-->r7268 fileio/ft_read_data.m 18. r7208-->r7268 fileio/ft_chanunit.m 19. r7188-->r7266 ft_prepare_sourcemodel.m 20. r7261-->r7265 utilities/private/ft_postamble_debug.m 21. r7258-->r7263 forward/ft_headmodel_concentricspheres.m 22. r7258-->r7263 forward/ft_headmodel_localspheres.m 23. r7258-->r7263 forward/ft_headmodel_singlesphere.m !!NOTE: if you choose to include changes marked with a leading !, they will overwrite local changes or additions! which changes do you want to include? ([vector] for specific changes, 'all', or [] for none) ? all Undefined function or variable "status". Error in ft_version (line 344) if status && isnumeric(changesToInclude) && all(changesToInclude > 0)... Please advise, Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Oct 9 08:56:36 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 09 Oct 2013 08:56:36 +0200 Subject: [FieldTrip] definetrial with ANT .cnt files In-Reply-To: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> References: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> Message-ID: <5254FE24.8080209@donders.ru.nl> Hi Michael, it might help if you set cfg.trialdef.eventtype = '?' and check what triggervalues and -types FieldTrip actually detects. Maybe the triggers are not saved as numeric values but as characters, thus maybe you need to set eventvalue = '1' instead of =1? FieldTrip can be sensitive to those kind of things. For example, our BVA-files record triggers are stored as 'S 1', and you need to add the two white spaces between the 'S' and the '1' when defining cfg.trialdef.eventvalue, otherwise desired and actual triggervalues do not match. Best, Jörn On 10/8/2013 5:50 PM, Epstein, Michael wrote: > > Hi all, > > I'm having a problem defining triggers using ft_definetrial with ANT > .cnt files. Say I want to do a simple epoching around events with a > trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get > an error saying no trials are defined. However I figured out that if I > put in cfg.trialdef.eventvalue =[1char(0) char(0)]; then it works > fine. The trigger files look totally normal, and other programs don't > seem to have this issue. Anyone else ever have a problem like this? > > Thanks, > > -Michael > > IMPORTANT NOTICE: This e-mail is meant only for the use of the > intended recipient. It may contain confidential information which is > legally privileged or otherwise protected by law. If you received this > e-mail in error or from someone who is not authorized to send it to > you, you are strictly prohibited from reviewing, using, disseminating, > distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF > THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. > Thank you for your cooperation. > > > _______________________________________________ > 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 Wed Oct 9 09:15:54 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 09 Oct 2013 09:15:54 +0200 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: <525502AA.8000501@donders.ru.nl> Hi Roey, habe you tried the atlas that is shipped with FieldTrip? It can be found in fieldtrip/templates/atlas/AAL/ Best, Jörn On 10/8/2013 11:41 PM, Roey Schurr wrote: > Dear fieldtrippers (Jan-Mathijs included), > > (This message seems long, but is actually quite simple) > > Having downloaded the latest fieldtrip version (20131008), we tried > rerunning the code and got the following error: > > ??? Reference to non-existent field 'coordsys'. > > Error in ==> ft_volumelookup at 206 > if strcmp(cfg.inputcoord, 'mni') && > strcmp(atlas.coordsys, 'tal') > > Error in ==> statistics_wrapper at 136 > tmp = ft_volumelookup(tmpcfg, varargin{1}); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > Since the spm8 MNI atlas indeed has no "coordsys" field. > Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " > by hand, or by simply deleting that "if" line), we still get one of > two errors: > > * * * * * (1) * * * * * > If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs > the MNI atlas has to offer, we get an indices error: > > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > * * * * * (2) * * * * * > If we define "cfg.roi = AAL_names{1};" for example, we get a different > error: > > ??? In an assignment A(:) = B, the number of elements in A and > B must be the same. > > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, > statobs,'issource',issource); > > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, > 'issource',issource); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > And in "cluserstat" appears this comment: "%this snippet is to support > correct clustering of N-dimensional data, not fully tested yet". > Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 > to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but > misuses the variables vectors "postailobs" and "negtailobs" > > > Any ideas on how to solve this atlas source statistics problem > (defining the coordsys field, performing statistics across all ROIs, > and using the postailobs/negtailobs vectors) would be greatly appreciated! > > Good night, > Aia and Roey > > > On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr > wrote: > > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen > > wrote: > > Dear Roey and Aia, > > This indeed was our bad. We have fixed it in the current > version of FieldTrip. > The version will be available for download tonight (CET), but > you can get an instantaneous update of the code repository by > doing 'ft_version update' on the Matlab command line. > This will update the fieldtrip copy you are using to the > latest version. Note that if you want to keep a 'static' > version, you need to back up the version with a fixed date, > because all changes will be incorporated. > > A little note to the following piece of code: > >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known >> function (ft_defaults) to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, >> 'template\atlas\aal\ROI_MNI_V4.nii']; >> > > The same can be achieved with the fullfile function (which > deals with platform specific file-separators automatically): > > templateDir=which('ft_defaults'); > cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); > > > Best, > Jan-Mathijs > > > > On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) >> is just our mistake. >> However the problem is still relevant, for the function >> volumelookup is still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr >> > wrote: >> >> Hello all, >> >> We are having some problems defining atlas-based ROIs >> using ft_sourcestatistics on two source structures >> obtained via ft_sourceanalysis (whose grid is later >> changed according to a precalculated MNI-warped grid). >> >> It seems like the function "statistics_wrapper" has >> changed between "fieldtrip-20130822" and >> "fieldtrip-20131007": line 136 now calls "volumelookup" >> and not "ft_volumelookup", so we get the following error: >> >> ??? Undefined function or method 'volumelookup' for >> input >> arguments of type 'struct'. >> >> Error in ==> statistics_wrapper at 136 >> tmp = volumelookup(tmpcfg, varargin{1}); >> >> Using the older fieldtrip vesion we get this error: >> ??? Subscript indices must either be real positive >> integers or >> logicals. >> >> Error in ==> statistics_wrapper at 213 >> tmp(i,:) = mean(dat(roi,:), 1); >> >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> So it seems like we didn't define the ROIs correctly, >> however we are not sure why. >> >> Any suggestions would be greatly appreciated! >> The relevant pieceof code is attached. >> >> Thank you all, >> Aia and Roey >> >> >> >> Relevant code >> ============ >> % Convert sources units to mm, to fit the atlas's units >> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >> sourceCondition2 = ft_convert_units(sourceCondition2, ' >> design = [ ones(1,length(sourceCondition1.trial)), >> 2*ones(1,length(sourceCondition2.trial)) ]; >> >> cfg = []; >> cfg.dim = sourceCondition1.dim; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'indepsamplesT'; >> cfg.parameter = 'pow'; >> cfg.correctm = 'cluster'; >> cfg.numrandomization = 1000; >> cfg.alpha = 0.01; >> cfg.tail = 0; >> cfg.design(1,:) = design; >> cfg.ivar = 1; >> >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known >> function (ft_defaults) to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, >> 'template\atlas\aal\ROI_MNI_V4.nii']; >> >> >> cfg.roi = AAL_names; % This is a cell array of the >> atlas's ROIs: "Precentral_L", "Precentral_R", etc/ >> >> cfg.avgoverroi = 'yes'; >> cfg.hemisphere = 'both'; >> cfg.inputcoord = 'mni'; >> >> stat = ft_sourcestatistics(cfg, sourceCondition1, >> sourceCondition2); >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > 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 m.stoica at uke.de Wed Oct 9 15:59:50 2013 From: m.stoica at uke.de (Stoica, Mircea) Date: Wed, 9 Oct 2013 13:59:50 +0000 Subject: [FieldTrip] Problem reading data at the beginning of the buffer Message-ID: Dear fieldtrip users, my setup consists of a Biosemi amplifier with 32 channels, from which I stream data using the buffer (biosemi2ft.exe). At the full sampling rate of 2048 Hz, the buffer returns error 517 whenever I try reading data older than about 5 minutes. As expected, with lower sampling rates this time grows larger. While I could work around this, by reading smaller chunks of data, it is still quite frustrating and I couldn't find any info on how to fix this. Any suggestions would be highly appreciated. Best, Mircea -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Oct 9 16:41:33 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 9 Oct 2013 16:41:33 +0200 Subject: [FieldTrip] file imports Message-ID: Dear all, I've got a very simple question. How does one import files acquired in SIG/STS file formats and convert them into EDF or EEG files that most software supports? I've downloaded the browser from Stellate, and I can see the data, but I was not able to export the files to any other format. Please help! Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 10 10:43:38 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 10 Oct 2013 10:43:38 +0200 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> Message-ID: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Hi Craig, Let me forward this to the email discussion list. On 9 Oct 2013, at 23:27, CR wrote: > Hi Robert, > I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. > > Method 1: ICA > > I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. so a bit like http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts with the correlation method of http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > Method 2: PCA > > I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. > > Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. Option 1 is better, as it is less aggressive in removing brain components. If speed is a concern, you could do - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data - a combination of the two - try out anothe rica algorithm (fastica versus runica) - try out with the options of the ica algorithm, esp the stopping options - get a faster computer best regards Robert From alik.widge at gmail.com Thu Oct 10 11:50:13 2013 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 10 Oct 2013 05:50:13 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: Thank you for posting this, as I'm in the middle of this same processing step, and I've been pondering methods as well while following the tutorials. (In my case, 60-channel EEG plus one bipolar EOG in a diagonal configuration.) Your response to Craig contains something that's been bugging me a little bit: When doing the ICA on a test recording, I find (and it sounds like he finds as well) that there is not a single component that captures eyeblinks well (and I have tried various adjustments, such as altering number of components via pre-PCA, clipping or not clipping out epochs that look to me to have substantial slow eye-roll, turning runica.extended on/off). I do get components that have the classic "pair of eyeglasses" or "single eyeball" look... but I get four or five of them on a 58-component decomposition, and that's before we talk about the components that are almost pure 60-cycle noise or temporal EMG. You seem to be telling us, in your comment about orthogonality and percentage of variance captured, that this is actually a *good* thing, because it reduces the chance of removing activity from the frontal pole. Can you help me understand that a bit better? I've felt very nervous about the sheer number of components I'm removing; it feels as though I'm killing a big chunk of the dataset, and doing so somewhat blindly. Thanks, Alik Widge, MD, PhD Massachusetts General Hospital Charlestown, MA, USA alik.widge at gmail.com (206) 866-5435 On Thu, Oct 10, 2013 at 4:43 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Craig, > > Let me forward this to the email discussion list. > > > On 9 Oct 2013, at 23:27, CR wrote: > > > Hi Robert, > > I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > > > > Method 1: ICA > > > > I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there > something else that makes the data not compatible with the stationary > mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you use > the default cfg.demean=yes). Doing a low-pass filter on the continuous data > would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant components, > and reject these based on a threshold. > > so a bit like > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > with the correlation method of > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > > > Method 2: PCA > > > > I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > > > > Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of > the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > 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 hamid.mohseni at eng.ox.ac.uk Thu Oct 10 12:51:07 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Thu, 10 Oct 2013 11:51:07 +0100 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: This is an interesting question! I think PCA is better than ICA in eye-blink removal. Because what ICA does is first ESTIMATING the eye blink component and then linearly removing that component from the data set. However, in PCA approach, a better estimation of eyeblink component is employed (using for example eye-blink system) to linearly remove that component from the data set---note that this component also does not contain brain activity. In the cases when we do not have the direct eye-blink measurement ICA is better. Other ideas? Thanks On 10 October 2013 10:50, Alik Widge wrote: > Thank you for posting this, as I'm in the middle of this same processing > step, and I've been pondering methods as well while following the > tutorials. (In my case, 60-channel EEG plus one bipolar EOG in a diagonal > configuration.) Your response to Craig contains something that's been > bugging me a little bit: > > When doing the ICA on a test recording, I find (and it sounds like he > finds as well) that there is not a single component that captures eyeblinks > well (and I have tried various adjustments, such as altering number of > components via pre-PCA, clipping or not clipping out epochs that look to me > to have substantial slow eye-roll, turning runica.extended on/off). I do > get components that have the classic "pair of eyeglasses" or "single > eyeball" look... but I get four or five of them on a 58-component > decomposition, and that's before we talk about the components that are > almost pure 60-cycle noise or temporal EMG. > > You seem to be telling us, in your comment about orthogonality and > percentage of variance captured, that this is actually a *good* thing, > because it reduces the chance of removing activity from the frontal pole. > Can you help me understand that a bit better? I've felt very nervous about > the sheer number of components I'm removing; it feels as though I'm killing > a big chunk of the dataset, and doing so somewhat blindly. > > > Thanks, > > Alik Widge, MD, PhD > Massachusetts General Hospital > Charlestown, MA, USA > alik.widge at gmail.com > (206) 866-5435 > > > > On Thu, Oct 10, 2013 at 4:43 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Craig, >> >> Let me forward this to the email discussion list. >> >> >> On 9 Oct 2013, at 23:27, CR wrote: >> >> > Hi Robert, >> > I wanted to see what your thoughts were on the merits of 2 different >> methods of removing blinks. I have a 12 minute resting state segment of >> data, so it has required me to do some things a little differently. >> > >> > Method 1: ICA >> > >> > I break the 12 minute segment into 2 second intervals, since doing ICA >> on the whole segment gave a poor result. >> >> why does it give you a poor result? Has the subject been moving? Is there >> something else that makes the data not compatible with the stationary >> mixing assumption? >> >> Or is it the difference in the preprocessing? 12 minutes of data >> represented in one segment can have drift, whereas 12 minutes of data >> represented in 2 second snippets will not have the drift (assuming you use >> the default cfg.demean=yes). Doing a low-pass filter on the continuous data >> would have a similar effect as segmenting it and demeaning the 2 sec >> snippets. >> >> > I apply the resulting unmixing matrix to the 12 minute segment and >> correlate each component with the EOG to find the most relevant components, >> and reject these based on a threshold. >> >> so a bit like >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts >> with the correlation method of >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts >> >> >> > Method 2: PCA >> > >> > I do a timelock analysis based on the blink onset point returned by the >> eyelink system. I then PCA the resulting blink ERF. I then reject the >> component(s) that account for say 98% of the total variance. >> > >> > Obviously option 2 is much faster. What do you see as the relative >> merits/problems with the techniques? Technique 1 is largely what the FT >> tutorials suggest, so what about method 2? >> >> Option 2 makes the large variance component orthogonal to the remainder >> of the components, whereas in option 1 the eye component and frontal brain >> components are both estimated, not orthogonal, and removing of the eye >> component does not remove the frontal brain component. >> >> Option 1 is better, as it is less aggressive in removing brain components. >> >> If speed is a concern, you could do >> - ft_resampledata to e.g. 250 Hz or even less, estimate the components >> based on that and project them out of the original high Fsample data. >> - do ft_componentanalysis on a subset of the data (say every 4th data >> segment after cutting it in pieces), and project them out of the original >> segmented data >> - a combination of the two >> - try out anothe rica algorithm (fastica versus runica) >> - try out with the options of the ica algorithm, esp the stopping options >> - get a faster computer >> >> best regards >> Robert >> >> >> >> >> >> >> _______________________________________________ >> 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 > -- Hamid R. Mohseni, PhD Post-Doctoral Research Fellow Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Thu Oct 10 15:35:32 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 10 Oct 2013 09:35:32 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: Dear Robert, Over a year ago I tried to use the suggested method of the lower sample rate and project onto my original data. I had problems. Can you provide a little snippet of the projection? Best, Raquel Sent from my iPhone > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld wrote: > > Hi Craig, > > Let me forward this to the email discussion list. > > >> On 9 Oct 2013, at 23:27, CR wrote: >> >> Hi Robert, >> I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. >> >> Method 1: ICA >> >> I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > >> I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. > > so a bit like > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > with the correlation method of > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > >> Method 2: PCA >> >> I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. >> >> Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From j.herring at fcdonders.ru.nl Thu Oct 10 17:35:25 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 10 Oct 2013 17:35:25 +0200 (CEST) Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: <000f01cec5ce$5743f790$05cbe6b0$@herring@fcdonders.ru.nl> Dear Raquel, What you could do, for example, is: % Save your data to disk Save('data','data','-v7.3'); % Saves the variable data to the file data.mat. The '-v7.3' switch allows the file to be larger than 4gb, if necessary. % Resample your data cfg = []; cfg.resamplefs = 250; % Or less data_resampled = ft_resampledata(cfg, data); % Clear original data from memory Clear data % Perform ICA on resampled data cfg = []; cfg.method = 'runica'; % or 'fastica', for example. comp = ft_componentanalysis(cfg, data_resampled); % clear resampled data Clear data_resampled % load original data Load('data.mat'); % Use previously calculated unmixing matrix on original data cfg = []; cfg.unmixing = comp.unmixing; % copy unmixing matrix to new configuration structure cfg.topolabel = comp.topolabel; % copy channel labels to new config structure. comp = ft_componentanalysis(cfg, data); All the saving and clearing in between might not be necessary depending on how much RAM you have and on the size of your data. Best, Jim -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi Sent: donderdag 10 oktober 2013 15:36 To: FieldTrip discussion list Cc: FieldTrip discussion list; CR Subject: Re: [FieldTrip] ICA/PCA EOG artifact removal Dear Robert, Over a year ago I tried to use the suggested method of the lower sample rate and project onto my original data. I had problems. Can you provide a little snippet of the projection? Best, Raquel Sent from my iPhone > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld wrote: > > Hi Craig, > > Let me forward this to the email discussion list. > > >> On 9 Oct 2013, at 23:27, CR wrote: >> >> Hi Robert, >> I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. >> >> Method 1: ICA >> >> I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > >> I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. > > so a bit like > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i ca_to_remove_eog_artifacts > with the correlation method of > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i ca_to_remove_ecg_artifacts > > >> Method 2: PCA >> >> I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. >> >> Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > 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 mcantor at umich.edu Thu Oct 10 17:29:52 2013 From: mcantor at umich.edu (Max Cantor) Date: Thu, 10 Oct 2013 11:29:52 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: My lab is trying to sort out a very similar issue, this was a very convenient coincidence. Anyway, my PI probably understands this issue better, but for my sake, there seems to be some disagreement here about whether ICA or PCA is better? We have a dedicated VEOG channel, but no dedicated ECG channel, so according to Hamid, we would be better off using ICA for removing ECG artifacts and PCA for EOG artifacts? Also, I'm looking at ft_componentanalysis and ft_denoise_pca, and I'm wondering if there is a simple explanation for what the difference between using ft_componentanalysis with, for instance, cfg.runica.pca, and just using ft_denoise_pca is for PCA? Finally, I noticed ft_componentanalysis has an option for a displaymode and interactivepca, and I'm wondering if this essentially turns the inputting of components to be rejected into a gui? I'm trying to create functions for our muscle, EOG, and ECG artifact rejections, but because the components to be removed seem to need to be added into the script itself, trying to run it as a function within our analysis script obviously leads to it not rejecting any components. On Thu, Oct 10, 2013 at 9:35 AM, Raquel Bibi wrote: > Dear Robert, > Over a year ago I tried to use the suggested method of the lower sample > rate and project onto my original data. I had problems. Can you provide a > little snippet of the projection? > > Best, > > Raquel > Sent from my iPhone > > > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > > > > Hi Craig, > > > > Let me forward this to the email discussion list. > > > > > >> On 9 Oct 2013, at 23:27, CR wrote: > >> > >> Hi Robert, > >> I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > >> > >> Method 1: ICA > >> > >> I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > > > why does it give you a poor result? Has the subject been moving? Is > there something else that makes the data not compatible with the stationary > mixing assumption? > > > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you use > the default cfg.demean=yes). Doing a low-pass filter on the continuous data > would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > >> I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant components, > and reject these based on a threshold. > > > > so a bit like > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > > with the correlation method of > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > > > > >> Method 2: PCA > >> > >> I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > >> > >> Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > > > Option 2 makes the large variance component orthogonal to the remainder > of the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > > > Option 1 is better, as it is less aggressive in removing brain > components. > > > > If speed is a concern, you could do > > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > > - a combination of the two > > - try out anothe rica algorithm (fastica versus runica) > > - try out with the options of the ica algorithm, esp the stopping options > > - get a faster computer > > > > best regards > > Robert > > > > > > > > > > > > > > _______________________________________________ > > 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 bibi.raquel at gmail.com Thu Oct 10 19:58:45 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 10 Oct 2013 13:58:45 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <5256c967.070a0e0a.7aea.6d36SMTPIN_ADDED_BROKEN@mx.google.com> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> <5256c967.070a0e0a.7aea.6d36SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Thanks Jim and Craig! On Thu, Oct 10, 2013 at 11:35 AM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Dear Raquel, > > What you could do, for example, is: > > > > % Save your data to disk > Save('data','data','-v7.3'); % Saves the variable data to the file > data.mat. The '-v7.3' switch allows the file to be larger than 4gb, if > necessary. > > % Resample your data > cfg = []; > cfg.resamplefs = 250; % Or less > > data_resampled = ft_resampledata(cfg, data); > > % Clear original data from memory > Clear data > > > % Perform ICA on resampled data > cfg = []; > cfg.method = 'runica'; % or 'fastica', for example. > > comp = ft_componentanalysis(cfg, data_resampled); > > % clear resampled data > Clear data_resampled > > % load original data > Load('data.mat'); > > % Use previously calculated unmixing matrix on original data > cfg = []; > cfg.unmixing = comp.unmixing; % copy unmixing matrix to new configuration > structure > cfg.topolabel = comp.topolabel; % copy channel labels to new config > structure. > > comp = ft_componentanalysis(cfg, data); > > > > All the saving and clearing in between might not be necessary depending on > how much RAM you have and on the size of your data. > > Best, > > Jim > > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi > Sent: donderdag 10 oktober 2013 15:36 > To: FieldTrip discussion list > Cc: FieldTrip discussion list; CR > Subject: Re: [FieldTrip] ICA/PCA EOG artifact removal > > Dear Robert, > Over a year ago I tried to use the suggested method of the lower sample > rate and project onto my original data. I had problems. Can you provide a > little snippet of the projection? > > Best, > > Raquel > Sent from my iPhone > > > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld > wrote: > > > > Hi Craig, > > > > Let me forward this to the email discussion list. > > > > > >> On 9 Oct 2013, at 23:27, CR wrote: > >> > >> Hi Robert, > >> I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > >> > >> Method 1: ICA > >> > >> I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > > > why does it give you a poor result? Has the subject been moving? Is > there something else that makes the data not compatible with the > stationary mixing assumption? > > > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you > use the default cfg.demean=yes). Doing a low-pass filter on the continuous > data would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > >> I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant > components, and reject these based on a threshold. > > > > so a bit like > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_eog_artifacts > > with the correlation method of > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_ecg_artifacts > > > > > >> Method 2: PCA > >> > >> I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > >> > >> Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > > > Option 2 makes the large variance component orthogonal to the remainder > of the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > > > Option 1 is better, as it is less aggressive in removing brain > components. > > > > If speed is a concern, you could do > > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > > - a combination of the two > > - try out anothe rica algorithm (fastica versus runica) > > - try out with the options of the ica algorithm, esp the stopping > options > > - get a faster computer > > > > best regards > > Robert > > > > > > > > > > > > > > _______________________________________________ > > 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 roeysc at gmail.com Thu Oct 10 20:48:05 2013 From: roeysc at gmail.com (Roey Schurr) Date: Thu, 10 Oct 2013 21:48:05 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: <525502AA.8000501@donders.ru.nl> References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> <525502AA.8000501@donders.ru.nl> Message-ID: Hello again, Thanks Jörn, indeed we are using the atlas you mentioned. We also found out one of the problems was that ft_read_atlas was taken from an EEGLAB directory and not a FT one. Yet the problems persist in the function clusterstat, when using cfg.avgoverroi = 'yes': ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 210 tmp(cfg.inside) = postailobs; Some dimensions in our code: The template sourcemodel gris for the singlesphere is 17 X 17 X 17 Hence the subject's sourcemodel grid for the singlesphere is 17 X 17 X 17 Hence the source reconstruction is also 17 X 17 X 17 The MNI MRI is 91 X 109 X 91 The AAL atlas is also 91 X 109 X 91 We don't understane how come "poastailobs" is 232 (twice the number of ROIs defined in the atlas). But still, " cfg.inside " defined all voxel that are inside the brain in the source space, so it is clear that an assignment as that demanded by line 210 in clusterstat would not work, We thought we could use ft_volumelookup in order to find those voxels that correspond to the areas that got 1 in "postailobs", but that won't work, since we do not have the source struct available at that point in the code. Are we using structures of insuitable dimensions? Are we doing anything wrong? Or is there a problem with the firldtrip code itself? Any help would be greatly appreciated! Aia and Roey On Wed, Oct 9, 2013 at 10:15 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Roey, > > habe you tried the atlas that is shipped with FieldTrip? It can be found > in fieldtrip/templates/atlas/AAL/ > > Best, > Jörn > > > On 10/8/2013 11:41 PM, Roey Schurr wrote: > > Dear fieldtrippers (Jan-Mathijs included), > > (This message seems long, but is actually quite simple) > > Having downloaded the latest fieldtrip version (20131008), we tried > rerunning the code and got the following error: > > ??? Reference to non-existent field 'coordsys'. > > Error in ==> ft_volumelookup at 206 > if strcmp(cfg.inputcoord, 'mni') && > strcmp(atlas.coordsys, 'tal') > > Error in ==> statistics_wrapper at 136 > tmp = ft_volumelookup(tmpcfg, varargin{1}); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > Since the spm8 MNI atlas indeed has no "coordsys" field. > Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by > hand, or by simply deleting that "if" line), we still get one of two errors: > > * * * * * (1) * * * * * > If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the > MNI atlas has to offer, we get an indices error: > > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > * * * * * (2) * * * * * > If we define "cfg.roi = AAL_names{1};" for example, we get a different > error: > > ??? In an assignment A(:) = B, the number of elements in A and > B must be the same. > > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, > statobs,'issource',issource); > > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, > 'issource',issource); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > And in "cluserstat" appears this comment: "%this snippet is to support > correct clustering of N-dimensional data, not fully tested yet". > Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to > "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the > variables vectors "postailobs" and "negtailobs" > > > Any ideas on how to solve this atlas source statistics problem (defining > the coordsys field, performing statistics across all ROIs, and using the > postailobs/negtailobs vectors) would be greatly appreciated! > > Good night, > Aia and Roey > > > On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > >> Dear Jan-Mathijs, >> >> Thank you so much for your kind and quick answer! >> We do hope this will fix things up. We will check it asap. >> >> Best regards, >> Aia and Roey >> >> >> >> >> On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Dear Roey and Aia, >>> >>> This indeed was our bad. We have fixed it in the current version of >>> FieldTrip. >>> The version will be available for download tonight (CET), but you can >>> get an instantaneous update of the code repository by doing 'ft_version >>> update' on the Matlab command line. >>> This will update the fieldtrip copy you are using to the latest version. >>> Note that if you want to keep a 'static' version, you need to back up the >>> version with a fixed date, because all changes will be incorporated. >>> >>> A little note to the following piece of code: >>> >>> % Load the Atlas >>>> templateDir = which('ft_defaults'); % use a known function >>>> (ft_defaults) to find FieldTrip's directory >>>> backslashIndices = find(templateDir=='\'); >>>> templateDir(backslashIndices(end)+1:end) = []; clear >>>> backslashIndices; >>>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>>> >>> >>> The same can be achieved with the fullfile function (which deals with >>> platform specific file-separators automatically): >>> >>> templateDir=which('ft_defaults'); >>> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >>> >>> >>> Best, >>> Jan-Mathijs >>> >>> >>> >>> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >>> >>> Hello again, >>> >>> Sorry, it seems like the older version (with ft_volumelookup) is just >>> our mistake. >>> However the problem is still relevant, for the function volumelookup is >>> still undefinded in our case. >>> >>> Hopefully someone might know what we did wrong. >>> >>> Thank you once again! >>> Aia and Roey >>> >>> >>> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >>> >>>> Hello all, >>>> >>>> We are having some problems defining atlas-based ROIs using >>>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>>> (whose grid is later changed according to a precalculated MNI-warped grid). >>>> >>>> It seems like the function "statistics_wrapper" has changed between >>>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>>> >>>> ??? Undefined function or method 'volumelookup' for input >>>> arguments of type 'struct'. >>>> >>>> Error in ==> statistics_wrapper at 136 >>>> tmp = volumelookup(tmpcfg, varargin{1}); >>>> >>>> Using the older fieldtrip vesion we get this error: >>>> ??? Subscript indices must either be real positive integers or >>>> logicals. >>>> >>>> Error in ==> statistics_wrapper at 213 >>>> tmp(i,:) = mean(dat(roi,:), 1); >>>> >>>> Error in ==> ft_sourcestatistics at 107 >>>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>>> >>>> So it seems like we didn't define the ROIs correctly, however we are >>>> not sure why. >>>> >>>> Any suggestions would be greatly appreciated! >>>> The relevant pieceof code is attached. >>>> >>>> Thank you all, >>>> Aia and Roey >>>> >>>> >>>> >>>> Relevant code >>>> ============ >>>> % Convert sources units to mm, to fit the atlas's units >>>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>>> design = [ ones(1,length(sourceCondition1.trial)), >>>> 2*ones(1,length(sourceCondition2.trial)) ]; >>>> >>>> cfg = []; >>>> cfg.dim = sourceCondition1.dim; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'indepsamplesT'; >>>> cfg.parameter = 'pow'; >>>> cfg.correctm = 'cluster'; >>>> cfg.numrandomization = 1000; >>>> cfg.alpha = 0.01; >>>> cfg.tail = 0; >>>> cfg.design(1,:) = design; >>>> cfg.ivar = 1; >>>> >>>> % Load the Atlas >>>> templateDir = which('ft_defaults'); % use a known function >>>> (ft_defaults) to find FieldTrip's directory >>>> backslashIndices = find(templateDir=='\'); >>>> templateDir(backslashIndices(end)+1:end) = []; clear >>>> backslashIndices; >>>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>>> >>>> >>>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>>> "Precentral_L", "Precentral_R", etc/ >>>> >>>> cfg.avgoverroi = 'yes'; >>>> cfg.hemisphere = 'both'; >>>> cfg.inputcoord = 'mni'; >>>> >>>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>>> >>>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> Jan-Mathijs Schoffelen, MD PhD >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Cognitive Neuroimaging, >>> Radboud University Nijmegen, The Netherlands >>> >>> Max Planck Institute for Psycholinguistics, >>> Nijmegen, The Netherlands >>> >>> J.Schoffelen at donders.ru.nl >>> Telephone: +31-24-3614793 >>> >>> http://www.hettaligebrein.nl >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > _______________________________________________ > 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 notthemindprobe at yahoo.com Thu Oct 10 21:39:00 2013 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Thu, 10 Oct 2013 12:39:00 -0700 (PDT) Subject: [FieldTrip] Automatically saving GDF using the realtime buffer In-Reply-To: References: Message-ID: <1381433940.31104.YahooMailNeo@web165003.mail.bf1.yahoo.com> Fieldtrip users:   Well, I managed to get the remote start/stop of GDF files working via the TCP/IP port.  It is not that complicated, but there are some ambiguities in the documentation, so I thought I would post the solution in case it helped anyone else.    Apparently there is a fifth argument that can be given to the biosemi2ft code.  I had seen the listing of the command as:   biosemi2ft   However, if you give it a 5th argument, that works as the port to which to control the ODM, if not specified the control port is 8000, since I had been trying to use the local default port (1972) that is why I was having issues.  At some spoint someone may want to update the documentation to specify that the control port default is 8000, and not the port used for the buffer.  I was able to control the saving of the GDF files by just using the matlab tcp_udp_ip toolbox:   host = 'localhost'; port = 8000;   con=pnet('tcpconnect',host,port) pnet(con,'setwritetimeout',2) [ip,port]=pnet(con,'gethost') stat=pnet(con,'status')   msg = 'SAVE START'; pnet(con,'printf','\n%s\n',msg); pause(5) msg = 'SAVE STOP'; pnet(con,'printf','\n%s\n',msg); pause(5) % pnet(con,'close')     Best, Eric ________________________________ From: "fieldtrip-request at science.ru.nl" To: fieldtrip at science.ru.nl Sent: Tuesday, October 8, 2013 5:41 PM Subject: fieldtrip Digest, Vol 35, Issue 11 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. definetrial with ANT .cnt files (Epstein, Michael)   2. Automatically saving GDF using the realtime buffer       (Eric Pohlmeyer)   3. Re: Using Atlas ROIs in EEG Source Statistics       (ft_sourcestatistics) (Roey Schurr) ---------------------------------------------------------------------- Message: 1 Date: Tue, 8 Oct 2013 15:50:07 +0000 From: "Epstein, Michael" To: FieldTrip discussion list Subject: [FieldTrip] definetrial with ANT .cnt files Message-ID: <3E54C3C165B1F2428D0A866C8A04ADBD011246 at nki-exchdb2> Content-Type: text/plain; charset="us-ascii" Hi all, I'm having a problem defining triggers using ft_definetrial  with ANT .cnt files. Say I want to do a simple epoching around events with a trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get an error saying no trials are defined. However I figured out that if I put in cfg.trialdef.eventvalue =[1 char(0) char(0)]; then it works fine. The trigger files look totally normal, and other programs don't seem to have this issue. Anyone else ever have a problem like this? Thanks, -Michael IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 8 Oct 2013 06:01:11 -0700 (PDT) From: Eric Pohlmeyer To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] Automatically saving GDF using the realtime     buffer Message-ID:     <1381237271.38083.YahooMailNeo at web165005.mail.bf1.yahoo.com> Content-Type: text/plain; charset="iso-8859-1" Fieldtrip: ? Hi, I am a new user of Fieldtrip, but our lab has a (pretty well working) real-time analysis of BioSemi EEG using?two computers, matlab, and the FieldTrip buffer.? The buffer is used for communicating?data between two machines: machine A?collects and saves?the data while also writingto the buffer, and machine B uses matlab to read the data off of the buffer (TCP/IP connection) and then run a soft real-time analysis of the EEG data. ? Currently we manually start and stop?the saving of a GDF file on?machine A by hitting the S and D keys. ? I would like to automatically start and stop the file saving, and was wondering if anyone had any suggestions?? I read that the OnlineDataManager (which interacts with our biosemi2ft code) handles the saving, and also does listen for ASCII messages on a TCP port for various commands, including "SAVE START/STOP".? Unfortunately, I'm not a programmer, and haven't been able to figure out how to write those commands to the port.? Is there a way to use the ft_write_data (or similar) to do that?? How do you make address the command to the specific port? ? Any suggestions would be greatfully received. ? Thanks! ? Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Wed, 9 Oct 2013 00:41:19 +0300 From: Roey Schurr To: FieldTrip discussion list Subject: Re: [FieldTrip] Using Atlas ROIs in EEG Source Statistics     (ft_sourcestatistics) Message-ID:     Content-Type: text/plain; charset="iso-8859-1" Dear fieldtrippers (Jan-Mathijs included), (This message seems long, but is actually quite simple) Having downloaded the latest fieldtrip version (20131008), we tried rerunning the code and got the following error:     ??? Reference to non-existent field 'coordsys'.     Error in ==> ft_volumelookup at 206           if    strcmp(cfg.inputcoord, 'mni') &&           strcmp(atlas.coordsys, 'tal')     Error in ==> statistics_wrapper at 136             tmp = ft_volumelookup(tmpcfg, varargin{1});     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); Since the spm8 MNI atlas indeed has no "coordsys" field. Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by hand, or by simply deleting that "if" line), we still get one of two errors: * * * * * (1) * * * * * If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the MNI atlas has to offer, we get an indices error:     ??? Subscript indices must either be real positive integers or     logicals.     Error in ==> statistics_wrapper at 213           tmp(i,:) = mean(dat(roi,:), 1);     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); * * * * * (2) * * * * * If we define "cfg.roi = AAL_names{1};" for example, we get a different error:     ??? In an assignment  A(:) = B, the number of elements in A and     B must be the same.     Error in ==> clusterstat at 187         tmp(cfg.inside) = postailobs;     Error in ==> ft_statistics_montecarlo at 326       [stat, cfg] = clusterstat(cfg, statrand,       statobs,'issource',issource);     Error in ==> statistics_wrapper at 298         [stat, cfg] = statmethod(cfg, dat, design,         'issource',issource);     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); And in "cluserstat" appears this comment: "%this snippet is to support correct clustering of N-dimensional data, not fully tested yet". Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the variables vectors "postailobs" and "negtailobs" Any ideas on how to solve this atlas source statistics problem (defining the coordsys field, performing statistics across all ROIs, and using the postailobs/negtailobs vectors) would be greatly appreciated! Good night, Aia and Roey On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Dear Roey and Aia, >> >> This indeed was our bad. We have fixed it in the current version of >> FieldTrip. >> The version will be available for download tonight (CET), but you can get >> an instantaneous update of the code repository by doing 'ft_version update' >> on the Matlab command line. >> This will update the fieldtrip copy you are using to the latest version. >> Note that if you want to keep a 'static' version, you need to back up the >> version with a fixed date, because all changes will be incorporated. >> >> A little note to the following piece of code: >> >> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = [];      clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >> >> The same can be achieved with the fullfile function (which deals with >> platform specific file-separators automatically): >> >> templateDir=which('ft_defaults'); >> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >> >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >> >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) is just >> our mistake. >> However the problem is still relevant, for the function volumelookup is >> still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >> >>> Hello all, >>> >>> We are having some problems defining atlas-based ROIs using >>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>> (whose grid is later changed according to a precalculated MNI-warped grid). >>> >>> It seems like the function "statistics_wrapper" has changed between >>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>> >>>      ??? Undefined function or method 'volumelookup' for input >>>      arguments of type 'struct'. >>> >>>      Error in ==> statistics_wrapper at 136 >>>              tmp = volumelookup(tmpcfg, varargin{1}); >>> >>> Using the older fieldtrip vesion we get this error: >>>    ??? Subscript indices must either be real positive integers or >>>    logicals. >>> >>>      Error in ==> statistics_wrapper at 213 >>>            tmp(i,:) = mean(dat(roi,:), 1); >>> >>>      Error in ==> ft_sourcestatistics at 107 >>>          [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> So it seems like we didn't define the ROIs correctly, however we are not >>> sure why. >>> >>> Any suggestions would be greatly appreciated! >>> The relevant pieceof code is attached. >>> >>> Thank you all, >>> Aia and Roey >>> >>> >>> >>> Relevant code >>> ============ >>> % Convert sources units to mm, to fit the atlas's units >>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>> design = [ ones(1,length(sourceCondition1.trial)), >>> 2*ones(1,length(sourceCondition2.trial)) ]; >>> >>> cfg = []; >>> cfg.dim = sourceCondition1.dim; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'indepsamplesT'; >>> cfg.parameter = 'pow'; >>> cfg.correctm = 'cluster'; >>> cfg.numrandomization = 1000; >>> cfg.alpha = 0.01; >>> cfg.tail = 0; >>> cfg.design(1,:) = design; >>> cfg.ivar = 1; >>> >>> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = [];      clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >>> >>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>> "Precentral_L", "Precentral_R", etc/ >>> >>> cfg.avgoverroi  = 'yes'; >>> cfg.hemisphere  = 'both'; >>> cfg.inputcoord  = 'mni'; >>> >>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>> >>> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >>    Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 35, Issue 11 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Fri Oct 11 19:20:39 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Fri, 11 Oct 2013 17:20:39 +0000 Subject: [FieldTrip] ft_freqanalysis Message-ID: can someone please tell me if ft_freqanalysis averages trials before computing the frequency analysis? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Oct 11 19:31:29 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 11 Oct 2013 19:31:29 +0200 Subject: [FieldTrip] ft_freqanalysis In-Reply-To: References: Message-ID: Hi Keith, No, it doesn't. Best, Jan-Mathijs On Oct 11, 2013, at 7:20 PM, McConnell, Keith wrote: > can someone please tell me if ft_freqanalysis averages trials before computing the frequency analysis? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From instanton at gmail.com Fri Oct 11 23:03:55 2013 From: instanton at gmail.com (woun zoo) Date: Fri, 11 Oct 2013 14:03:55 -0700 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? Message-ID: Hi I'd like to know the way to keep each trial's time-frequency data (complex amplitude from fourier method). For example, if I have 20 trials and run ft_freqanalysis for time-frequency spectra, I end up having only final averaged result. Where can I see each individual trial's time-frequency complex amplitudes? Or what should I do to have TF data from all single trials? Thank you very much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Oct 11 23:43:27 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Fri, 11 Oct 2013 23:43:27 +0200 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Dear Woun, It is possible you may have already solved the problem. In case you didn't, let me tell you that: When doing timelocks or freqanalysis at the individual level you can set: - cfg.keeptrials = 'yes' and the output structure will have a field with each single trial in addition to the "avg" field that you already have. At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) the analogous option is - cfg.keepindividuals = 'yes' And the resulting structure will have an additional field called "individual". Keeptrials and keepindividuals are set to "no" by default. When "keeping" trials/individuals the output will be much bigger, depending on the number of channels, trials, time,... specially for TFanalysis you usually need to put an eye on that (load times are faster, space consuming, etc). It may be a good habit in order to keep good track of your processing but it can be a nuisance too Tip: look at the field "dimord". Now you have: chan_freq_time, what you want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. I hope I did not mislead your question. If this small talk actually solved your problem, let me suggest you to highlight your fieldtrip functions and press F1, and do it often, magic will happen., it will help learning much faster. Cheers, Tino 2013/10/11 woun zoo > Hi > > I'd like to know the way to keep each trial's time-frequency data (complex > amplitude from fourier method). For example, if I have 20 trials and run > ft_freqanalysis for time-frequency spectra, I end up having only final > averaged result. Where can I see each individual trial's time-frequency > complex amplitudes? Or what should I do to have TF data from all single > trials? > > Thank you very much. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Oct 11 23:46:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Fri, 11 Oct 2013 23:46:49 +0200 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Please notice that for the grandaverages is not spelled "individual*s*" but cfg.keepindividual = 'yes' without the 's' My bad, T 2013/10/11 Constantino Méndez Bértolo > Dear Woun, > > It is possible you may have already solved the problem. In case you > didn't, let me tell you that: > When doing timelocks or freqanalysis at the individual level you can set: > > - cfg.keeptrials = 'yes' > > > and the output structure will have a field with each single trial in > addition to the "avg" field that you already have. > At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) the > analogous option is > > - cfg.keepindividuals = 'yes' > > And the resulting structure will have an additional field called > "individual". > Keeptrials and keepindividuals are set to "no" by default. When "keeping" > trials/individuals the output will be much bigger, depending on the number > of channels, trials, time,... specially for TFanalysis you usually need to > put an eye on that (load times are faster, space consuming, etc). It may be > a good habit in order to keep good track of your processing but it can be a > nuisance too > Tip: look at the field "dimord". Now you have: chan_freq_time, what you > want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. > I hope I did not mislead your question. If this small talk actually solved > your problem, let me suggest you to highlight your fieldtrip functions and > press F1, and do it often, magic will happen., it will help learning much > faster. > Cheers, > Tino > > > 2013/10/11 woun zoo > >> Hi >> >> I'd like to know the way to keep each trial's time-frequency data >> (complex amplitude from fourier method). For example, if I have 20 trials >> and run ft_freqanalysis for time-frequency spectra, I end up having only >> final averaged result. Where can I see each individual trial's >> time-frequency complex amplitudes? Or what should I do to have TF data from >> all single trials? >> >> Thank you very much. >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From instanton at gmail.com Fri Oct 11 23:58:03 2013 From: instanton at gmail.com (woun zoo) Date: Fri, 11 Oct 2013 14:58:03 -0700 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Thank you so much. ^_^;; On Fri, Oct 11, 2013 at 2:46 PM, Constantino Méndez Bértolo < constantino.mendezbertolo at ctb.upm.es> wrote: > Please notice that for the grandaverages is not spelled "individual*s*" > but > > cfg.keepindividual = 'yes' > > without the 's' > > My bad, > T > > > 2013/10/11 Constantino Méndez Bértolo < > constantino.mendezbertolo at ctb.upm.es> > >> Dear Woun, >> >> It is possible you may have already solved the problem. In case you >> didn't, let me tell you that: >> When doing timelocks or freqanalysis at the individual level you can set: >> >> - cfg.keeptrials = 'yes' >> >> >> and the output structure will have a field with each single trial in >> addition to the "avg" field that you already have. >> At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) >> the analogous option is >> >> - cfg.keepindividuals = 'yes' >> >> And the resulting structure will have an additional field called >> "individual". >> Keeptrials and keepindividuals are set to "no" by default. When "keeping" >> trials/individuals the output will be much bigger, depending on the number >> of channels, trials, time,... specially for TFanalysis you usually need to >> put an eye on that (load times are faster, space consuming, etc). It may be >> a good habit in order to keep good track of your processing but it can be a >> nuisance too >> Tip: look at the field "dimord". Now you have: chan_freq_time, what you >> want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. >> I hope I did not mislead your question. If this small talk actually >> solved your problem, let me suggest you to highlight your fieldtrip >> functions and press F1, and do it often, magic will happen., it will help >> learning much faster. >> Cheers, >> Tino >> >> >> 2013/10/11 woun zoo >> >>> Hi >>> >>> I'd like to know the way to keep each trial's time-frequency data >>> (complex amplitude from fourier method). For example, if I have 20 trials >>> and run ft_freqanalysis for time-frequency spectra, I end up having only >>> final averaged result. Where can I see each individual trial's >>> time-frequency complex amplitudes? Or what should I do to have TF data from >>> all single trials? >>> >>> Thank you very much. >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> Constantino Méndez-Bértolo >> Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) >> >> Parque Científico y Tecnológico de la UPM, Campus de Montegancedo >> >> 28223 Pozuelo de Alarcón, Madrid, SPAIN >> >> >> > > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > > _______________________________________________ > 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 Heng-RuMay.Tan at glasgow.ac.uk Sat Oct 12 00:38:15 2013 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 11 Oct 2013 23:38:15 +0100 Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers Message-ID: <52587DD7.2080801@glasgow.ac.uk> Hi there, I am resending my question below to the Fieldtrip discussion. Many thanks in advance! > On 11/10/2013 20:10, Eric Maris wrote: >> Hi May, >> >> Could you post your question on thr Fieldtrip discussion list? In that way, many more people can participate in the discussion. Moreover, the discussion will be archived, allowing people with the same question to inform themselves. >> >> Best, >> >> Eric I wish to seek some insights into non-parametric statistical testing in the MEG data analysis I am planning to do at the source level. For the most part, I have an appreciation of the permutation strategy (concept of random partitioning) described in Maris & Oostenveld 2007, which is implemented in fieldtrip. I have however a concern regarding trial number differences between subject group for permutation statistics. The data I am looking at after preprocessing/artefact removal etc. looks roughly as follows: 2 subject groups: Controls (C) and Patients (P). For a particular experimental condition (A), on average, subjects within each group have the following number of trials: condA_Ntrials_C ~= 100 condA_Ntrials_P ~= 80 I plan to perform a 2-step statistics-test to test for differences between C and P groups on a particular experimental condition. Using a 1st level within subject t-test (or active-vs-baseline test) on baseline vs active period for each group, deriving subject-specific t-stats which are to be subsequently used in a 2nd level test between subject group contrast, using nonparametric test. Question 1) Does it matter if the average trials per subject in each group is different? Should I try to equalize the trial numbers by e.g. random removal of some trials before computing any statistics? Is this advisable? Question 2) Minimum trials required for source-level significance? The supplementary info. accompanying the 2007 paper illustrated some minimum trial numbers required for obtaining a significant effect at the sensor-level analysis, given some threshold (e.g. cluster>250 sensor-time pairs). Has anyone systematically shown what is the minimum number of trials required to obtain significant clusters/fdr stats at the source-level analysis? If not, is there a sensible way to find out? (presumably involving some form of bootstrapping and simulation?) This relates to another issue I have with regards to 'within-subjects' comparison for 2 experimental conditions A and B where there are average trial number differences both within and between subject groups: condA_Ntrials_C ~= 100 condB_Ntrials_C ~= 60 (min. =35) condA_Ntrials_P ~= 80 condB_Ntrials_P ~= 50 (min. =35) A similar concern of uneven trials arises if say I wish to perform a within subjects comparison between the experimental conditions. In general, Q: Would the intended 2-step statistical test (as described above) be appropriate, OR would it best to control for 'equal' number of trials for all subjects and conditions of interest? I would really appreciate it if someone could kindly comment or offer advise where appropriate. Thank you very much in advance for your time. Yours sincerely, May -- Heng-Ru/May/ Tan Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive Neuroimaging (CCNi)▫ University of Glasgow 58 Hillhead Street, Glasgow G12 8QB▫ +44 (0)141-330-5090▫ Heng-RuMay.Tan at glasgow.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Sat Oct 12 18:15:52 2013 From: michielb at tcd.ie (Bart Michiels) Date: Sat, 12 Oct 2013 17:15:52 +0100 Subject: [FieldTrip] problem ft_freqanalysis Message-ID: After using ft_freqanalysis for EEG resting-state data I am unable to see the whole spectrum of my data, which should show some content between 0 and 60 Hz. I only see some low-frequency content (between 0 and 8 Hz) when using plot(...). Pre-processing steps: Avg re-reference, BP filter 0.25-100, cut continuous data into 4s segments, resample data to 512 Hz, detrend, re-reference (after avg rereferencing) to the A1&A2 electrode, Artefact rejection (max=80,min=-80,range=160, default jump artefact algorithm), visual inspection of the data. There are three datasets of 1 patients (every dataset cut into 4s segments). After preprocessing, those data sets are merged with ft.appenddata. I tried everything (wavelet, multi-taper), I always have the same result, can someone tell me what I am doing wrong? Bart Michiels, Research Assistant. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehsan.sabri at gmail.com Sun Oct 13 16:29:03 2013 From: ehsan.sabri at gmail.com (Ehsan Sabri) Date: Sun, 13 Oct 2013 17:59:03 +0330 Subject: [FieldTrip] Neuroshare - nev file from Blackrock microsystems Message-ID: Dear all, I'm trying to import an event file from a blackrock microsystem setup using 'neuroshare' m files. I use 'Matlab Import Filter' (Neuroshare m file package) version 2.5 and Matlab 2012a. It seems that this mexprog.mexw is not compatible with nsNEVLibrary.dll. ------------------------------------------------------------------------------------------------------------------ K>> which(lib) C:\Users\WIN 7\Documents\Utah Data\Toolboxes\Matlab-Import-Filter_2_5\RequiredResources\nsNEVLibrary.dll K>> [a]=mexprog(18, which(lib)) Warning: Unable to load this DLL a = -1 ------------------------------------------------------------------------------------------------------------------ (see read_neuroshare.m line 82) Did anyone encounter such non compatibility? Is there any other version for nsNEVLibrary.dll? (I also tried the one with PowerNAP 0.7) Best, Ehsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Mon Oct 14 16:53:38 2013 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Mon, 14 Oct 2013 16:53:38 +0200 Subject: [FieldTrip] Warning 'nifti' class Message-ID: Dear all, when loading my source files I get two warnings in Matlab which say: 1. "Warning: Class 'nifti' is an unknown object class..." and 2. "Warning: Class 'file_array' is an unknown object class...". Can anyone tell me why Matlab gives me this warning and/or what I did wrong (if so)? Thanks a lot and best regards, Andreas Sauer -- Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Oct 14 17:00:43 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 14 Oct 2013 17:00:43 +0200 Subject: [FieldTrip] problem ft_freqanalysis In-Reply-To: References: Message-ID: <525C071B.1040505@donders.ru.nl> Hi Bart, it might help if you paste the code that you are using for computing the FFT and for plotting. Also, showing the structure (e.g. fieldnames and size of the content) might help. Generally, the problem could just be related to huge 1/f noise and that you need to zoom in to see modulations of higher frequencies. Hard to tell though without any further information on what you are exactly doing ;) Best, Jörn On 10/12/2013 6:15 PM, Bart Michiels wrote: > After using ft_freqanalysis for EEG resting-state data I am unable to > see the whole spectrum of my data, which should show some content > between 0 and 60 Hz. I only see some low-frequency content (between 0 > and 8 Hz) when using plot(...). > > Pre-processing steps: > Avg re-reference, BP filter 0.25-100, cut continuous data into 4s > segments, resample data to 512 Hz, detrend, re-reference (after avg > rereferencing) to the A1&A2 electrode, Artefact rejection > (max=80,min=-80,range=160, default jump artefact algorithm), visual > inspection of the data. There are three datasets of 1 patients (every > dataset cut into 4s segments). After preprocessing, those data sets > are merged with ft.appenddata. > > I tried everything (wavelet, multi-taper), I always have the same > result, can someone tell me what I am doing wrong? > > Bart Michiels, Research Assistant. > > > _______________________________________________ > 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 Keith.McConnell at cchmc.org Mon Oct 14 20:14:14 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Mon, 14 Oct 2013 18:14:14 +0000 Subject: [FieldTrip] source localization help Message-ID: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Oct 14 21:25:10 2013 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 14 Oct 2013 21:25:10 +0200 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: <033FAAB9-3BC8-4473-902D-2B5C5DB6DAD0@gmail.com> Hi Keith, you have a typo in your script. It should be 'avg.pow' instead of 'ave.pow'. good luck Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 14.10.2013 um 20:14 schrieb McConnell, Keith: > Hello, > > I am trying to run the beamformer source analysis. > > In the code: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > I am generating the error: > > Reference to non-existent field 'ave'. > > Any help? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > 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 Mon Oct 14 21:28:52 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 14 Oct 2013 13:28:52 -0600 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 Keith.McConnell at cchmc.org Mon Oct 14 21:56:00 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Mon, 14 Oct 2013 19:56:00 +0000 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 Mon Oct 14 22:12:25 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 14 Oct 2013 14:12:25 -0600 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 haristz at gmail.com Mon Oct 14 22:16:34 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Mon, 14 Oct 2013 15:16:34 -0500 Subject: [FieldTrip] Artifacts in sourceplot ortho? Message-ID: Hi There, I have been having some problems with the use of sourceplot: I am trying to display the results of ft_sourcestatistics where input is sources for 2 conditions coming from multiple subjects (individual subjects warped to MNI space). To begin with, I interpolate my results to the MNI mri in fieldtrip - eg for p values : templatefile = '~/fieldtrip/external/spm8/templates/T1.nii'; template_mri = ft_read_mri(templatefile); cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'prob'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; imgdat = ft_sourceinterpolate(cfg, dat, template_mri); This seems to work fine except (and this is my question) for some *stange artifactual voxels* appearing when I use the 'ortho' method (see screenshot here https://db.tt/W7fiVIWq ) Here is the actual call: cfg = []; cfg.coordsys = 'mni'; cfg.funparameter = 'prob'; cfg.maskparameter = cfg.funparameter; cfg.funcolorlim=[0 0.05]; cfg.opacitymap ='rampdown' cfg.opacitylim=[0 0.05] cfg.method='ortho'; cfg.interactive='yes'; cfg.atlas='~/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; ft_sourceplot(cfg,imgdat) I am referring to the "white voxels" that seem to have value of 1 (which I thought, based on the above call should not be displayed(?)). The same kind of problem appears when I use other parameters from "prob", eg "stat" . Those "strange" voxels are always the same. This problem is not present with eg method "slice" Any advice or insight you might have would be much appreciated. Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Tue Oct 15 14:21:01 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Tue, 15 Oct 2013 12:21:01 +0000 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Here you go. Thanks for the help. cfg = []; cfg.method = 'dics'; cfg.frequency = 8; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); save sourcePost_nocon sourcePost_nocon load sourcePost_nocon Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 4:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 julian.keil at gmail.com Tue Oct 15 14:32:27 2013 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 15 Oct 2013 14:32:27 +0200 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> Hi Keith, did you check if your output "sourcePost_nocon" contains the .avg-field (including the subfields avg.pow, avg.filter and so on)? If not, then something goes wrong in your source analysis. Have you checked your grid and vol? Especially, does your grid contain meaningful values, and not just NaNs? If your lead field is only NaNs, no data will be projected. Good Luck! ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 15.10.2013 um 14:21 schrieb McConnell, Keith: > Here you go. Thanks for the help. > > cfg = []; > cfg.method = 'dics'; > cfg.frequency = 8; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > > sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); > > save sourcePost_nocon sourcePost_nocon > > load sourcePost_nocon > > > > > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don > Sent: Monday, October 14, 2013 4:12 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source localization help > > Keith, > > I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? > > Don > > On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" wrote: > > > Ach. The solution may still prove to be simple, but I have made this change: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > and now receive this error: > > Reference to non-existent field 'avg'. > > Thanks for the help. > > Keith > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don > Sent: Monday, October 14, 2013 3:29 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source localization help > > I believe you should change cfg.parameter to read > > cfg.parameter = 'avg.pow' > > not > > cfg.parameter = 'ave.pow' > > > On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" wrote: > > > > Hello, > > I am trying to run the beamformer source analysis. > > In the code: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > I am generating the error: > > Reference to non-existent field 'ave'. > > Any help? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > 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 Keith.McConnell at cchmc.org Tue Oct 15 14:38:17 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Tue, 15 Oct 2013 12:38:17 +0000 Subject: [FieldTrip] source localization help In-Reply-To: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> References: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> Message-ID: What within grid and vol do I check? In grid.leadfield, for example, I do have some NaNs, but mostly *good* data. Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Julian Keil Sent: Tuesday, October 15, 2013 8:32 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Hi Keith, did you check if your output "sourcePost_nocon" contains the .avg-field (including the subfields avg.pow, avg.filter and so on)? If not, then something goes wrong in your source analysis. Have you checked your grid and vol? Especially, does your grid contain meaningful values, and not just NaNs? If your lead field is only NaNs, no data will be projected. Good Luck! ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 15.10.2013 um 14:21 schrieb McConnell, Keith: Here you go. Thanks for the help. cfg = []; cfg.method = 'dics'; cfg.frequency = 8; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); save sourcePost_nocon sourcePost_nocon load sourcePost_nocon Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 4:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 e.maris at psych.ru.nl Wed Oct 16 06:58:00 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Wed, 16 Oct 2013 06:58:00 +0200 (CEST) Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers In-Reply-To: <52587DD7.2080801@glasgow.ac.uk> References: <52587DD7.2080801@glasgow.ac.uk> Message-ID: <005d01ceca2c$4add4530$e097cf90$@maris@psych.ru.nl> Dear May, 2 subject groups: Controls (C) and Patients (P). For a particular experimental condition (A), on average, subjects within each group have the following number of trials: condA_Ntrials_C ~= 100 condA_Ntrials_P ~= 80 I plan to perform a 2-step statistics-test to test for differences between C and P groups on a particular experimental condition. Using a 1st level within subject t-test (or active-vs-baseline test) on baseline vs active period for each group, deriving subject-specific t-stats which are to be subsequently used in a 2nd level test between subject group contrast, using nonparametric test. Question 1) Does it matter if the average trials per subject in each group is different? Should I try to equalize the trial numbers by e.g. random removal of some trials before computing any statistics? Is this advisable? Performing a second level t-test (in your case, between different groups of subjects) on first level t-tests is very unusual. In fact, this would imply that you second level t-test is about an hypothesis that pertains to first level t-tests. Instead, one always performs a second level t-test on first-level averages (typically baseline-normalized to deal with individual differences in distance to the helmet or baseline power). Differences in number of trials per conditions is never a problem as long as your first-level measure (the baseline-normalized mean) is unbiased. Question 2) Minimum trials required for source-level significance? The supplementary info. accompanying the 2007 paper illustrated some minimum trial numbers required for obtaining a significant effect at the sensor-level analysis, given some threshold (e.g. cluster>250 sensor-time pairs). Has anyone systematically shown what is the minimum number of trials required to obtain significant clusters/fdr stats at the source-level analysis? If not, is there a sensible way to find out? (presumably involving some form of bootstrapping and simulation?) There is no sensible way to find out this minimum number of trials, because the true effect size is unknown. This relates to another issue I have with regards to 'within-subjects' comparison for 2 experimental conditions A and B where there are average trial number differences both within and between subject groups: condA_Ntrials_C ~= 100 condB_Ntrials_C ~= 60 (min. =35) condA_Ntrials_P ~= 80 condB_Ntrials_P ~= 50 (min. =35) A similar concern of uneven trials arises if say I wish to perform a within subjects comparison between the experimental conditions. I think I’ve dealt with this question. In general, Q: Would the intended 2-step statistical test (as described above) be appropriate, OR would it best to control for 'equal' number of trials for all subjects and conditions of interest? I think I’ve answered this. Best, Eric Maris I would really appreciate it if someone could kindly comment or offer advise where appropriate. Thank you very much in advance for your time. Yours sincerely, May -- Heng-Ru May Tan Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive Neuroimaging (CCNi) ▫ University of Glasgow 58 Hillhead Street, Glasgow G12 8QB ▫ +44 (0)141-330-5090 ▫ Heng-RuMay.Tan at glasgow.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Wed Oct 16 11:19:17 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Wed, 16 Oct 2013 11:19:17 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters Message-ID: <525E5A15.9080900@gmail.com> Dear all, I'm trying to run ft_sourcestatistics with a specified ROI. It's data (MNEs) averaged over time. If I run ft_sourcestatistics without an ROI, I get a cluster with prob = .178. It looks like this (figure attached), where I masked using the t-values. Since I'm dealing with an N400-like component, I've got good reasons to expect the effect to be localised (mainly) to left temporal areas. So I tried adding this to my cfg: cfgst.atlas = 'aal\ROI_MNI_V4.nii'; cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; cfgst.avgoverroi = 'yes'; cfgst.hemisphere = 'left'; cfgst.inputcoord = 'mni' ; stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); If cfgst.avgoverroi == 'yes'; I get the following error: ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 187 tmp(cfg.inside) = postailobs; Error in ==> ft_statistics_montecarlo at 326 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 298 [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); If cfgst.avgoverroi == 'no'; ft outputs "found positive clusters in observed data" and stat.posclusters/negclusters is only NaN. This is regardless of whether cfgst.roi is one label or a cell array. Does anyone know what I'm doing wrong? I've been completely stuck on source statistics for these MNEs for days, so /any/ help would be highly appreciated, even if it is to suggest another way to do the stats! Thanks a lot, Vitória -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figure.png Type: image/png Size: 111863 bytes Desc: not available URL: From Heng-RuMay.Tan at glasgow.ac.uk Wed Oct 16 12:06:28 2013 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Wed, 16 Oct 2013 11:06:28 +0100 Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers In-Reply-To: References: Message-ID: <525E6524.4070402@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From kgm at tf.uni-kiel.de Wed Oct 16 15:30:49 2013 From: kgm at tf.uni-kiel.de (kgm at tf.uni-kiel.de) Date: Wed, 16 Oct 2013 15:30:49 +0200 Subject: [FieldTrip] Question on forward modeling Message-ID: Hello, I am trying to do forward modeling using individual MRI and MEG from Neuromag306 system. I have three questions. I have performed the following steps: 1. ft_read_mri 2. ft_volumerealign 3. ft_volumesegment Q1. At this point I want to check if the segmentation fits the MRI correctly. So I used ft_sourceplot but I am getting the following message with an empty plot: the input is segmented volume data with dimensions [256 256 176] scaling anatomy to [0 1] no functional parameter no masking parameter the call to "ft_sourceplot" took 4 seconds 4. ft_prepare_headmodel, method: singleshell 5. ft_plot_sens and ft_plot_vol, after converting the units Q2. The plot shows that the sensors/electrodes are quiet far away from the brain. Is there a means to do some projection to lower them a bit? Or is the problem arising from the co-registration? I have attached the figure. Q3. I have also used 'localspheres' method to prepare the head model. The output of the plot (attached) gives me some rounded image which does not look like a brain. Is there another function used to plot the local spheres? Looking forward for the response. Best regards, Ms.c. Kidist G.Mideksa Department of Neurology, Uni-Klinikum, Kiel, Germany -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodel_singleshell.fig Type: application/octet-stream Size: 57187 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodel_localspheres.fig Type: application/octet-stream Size: 693817 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Wed Oct 16 15:53:24 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 16 Oct 2013 15:53:24 +0200 Subject: [FieldTrip] Question on forward modeling In-Reply-To: References: Message-ID: <525E9A53.70308@donders.ru.nl> Hi Kidist, On 10/16/2013 3:30 PM, kgm at tf.uni-kiel.de wrote: > Hello, > > I am trying to do forward modeling using individual MRI and MEG from > Neuromag306 system. I have three questions. > > I have performed the following steps: > > 1. ft_read_mri > 2. ft_volumerealign > 3. ft_volumesegment > Q1. At this point I want to check if the segmentation fits the MRI > correctly. So I used ft_sourceplot but I am getting the following > message with an empty plot: > the input is segmented volume data with dimensions [256 256 176] > scaling anatomy to [0 1] > no functional parameter > no masking parameter > the call to "ft_sourceplot" took 4 seconds Hard to tell, maybe post a snippet of your cfg? First, however, you might want to have a look at this tutorial and especially check how the segmented mri is plotted and what else is done: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#preparing_the_data_and_the_forward_and_inverse_model > 4. ft_prepare_headmodel, method: singleshell > 5. ft_plot_sens and ft_plot_vol, after converting the units > Q2. The plot shows that the sensors/electrodes are quiet far away from > the brain. Is there a means to do some projection to lower them a bit? > Or is the problem arising from the co-registration? I have attached the > figure. Most likely, this is indeed a problem with the co-registration, or the subject was just seated that way. You mustn't just project sensors to make the plot appeal better to you ;) > Q3. I have also used 'localspheres' method to prepare the head model. > The output of the plot (attached) gives me some rounded image which > does not look like a brain. Is there another function used to plot the > local spheres? My guess is that you need to reduce the radii of the localspheres. Looks like they are defined in cm while the rest of your anatomy is defined in mm. Best, Jörn > > Looking forward for the response. > > Best regards, > > Ms.c. Kidist G.Mideksa > Department of Neurology, > Uni-Klinikum, Kiel, Germany > > > _______________________________________________ > 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 Wed Oct 16 16:07:41 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 16 Oct 2013 16:07:41 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: <525E5A15.9080900@gmail.com> References: <525E5A15.9080900@gmail.com> Message-ID: <525E9DAD.7000107@donders.ru.nl> Hi Vitoria, I guess that is the same error that Roey Schurr described a few days back. There were some changes recently in the atlas lookup function (we replaced one function and made another more general). Apparently that broke some things, or you two just happen to do this as the first ever ;) The only thing I can think of is that you might need to interpolate to the MNI template so that the dimensions are matched between the atlas and your source structures. Could you give that a try and let us know whether that helps? Best, Jörn On 10/16/2013 11:19 AM, Vitória Magalhães Piai wrote: > Dear all, > > I'm trying to run ft_sourcestatistics with a specified ROI. It's data > (MNEs) averaged over time. > > If I run ft_sourcestatistics without an ROI, I get a cluster with prob > = .178. It looks like this (figure attached), where I masked using the > t-values. > Since I'm dealing with an N400-like component, I've got good reasons > to expect the effect to be localised (mainly) to left temporal areas. > > So I tried adding this to my cfg: > > cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' > 'Temporal_Inf_L' }; > cfgst.avgoverroi = 'yes'; > cfgst.hemisphere = 'left'; > cfgst.inputcoord = 'mni' ; > stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > > If cfgst.avgoverroi == 'yes'; I get the following error: > > ??? In an assignment A(:) = B, the number of elements in A and B > must be the same. > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > If cfgst.avgoverroi == 'no'; > ft outputs "found positive clusters in observed data" and > stat.posclusters/negclusters is only NaN. This is regardless of > whether cfgst.roi is one label or a cell array. > > Does anyone know what I'm doing wrong? > I've been completely stuck on source statistics for these MNEs for > days, so /any/ help would be highly appreciated, even if it is to > suggest another way to do the stats! > > Thanks a lot, Vitória > > > _______________________________________________ > 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 kgm at tf.uni-kiel.de Wed Oct 16 16:57:11 2013 From: kgm at tf.uni-kiel.de (kgm at tf.uni-kiel.de) Date: Wed, 16 Oct 2013 16:57:11 +0200 Subject: [FieldTrip] Question on forward modeling In-Reply-To: <525E9A53.70308@donders.ru.nl> References: <525E9A53.70308@donders.ru.nl> Message-ID: Hi Jörn, > Hard to tell, maybe post a snippet of your cfg? First, however, you > might want to have a look at this tutorial and especially check how the > segmented mri is plotted and what else is done: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#preparing_the_data_and_the_forward_and_inverse_model > I have exactly followed what is stated on the tutorial. The cfg for the ft_sourceplot function is: cfg.funparameter = 'gray'; The cfg for the ft_volumesegment function is: cfg.method = 'interactive'; cfg.coordsys = 'neuromag'; cfg.output = 'brain'; > My guess is that you need to reduce the radii of the localspheres. Looks > like they are defined in cm while the rest of your anatomy is defined in > mm. > I have also reduced from cm to mm but still it is the same. Best regards, Kidist From phyllis.mania at uni-hamburg.de Wed Oct 16 18:09:03 2013 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Wed, 16 Oct 2013 18:09:03 +0200 Subject: [FieldTrip] error with runica Message-ID: <004501ceca8a$08552b20$18ff8160$@uni-hamburg.de> Dear all, I have a problem with running an ICA in one of my subjects (EEG, 70 channels, 878 trials), even though it was preprocessed exactly like all others (same number of channels, similar number of trials). When calling ft_componentanalysis with 'runica' the learning rate gets as low as 3.09032e-05 before it actually starts with step 1. It takes up to 512 steps (very slowly) but the lrate never changes from 0 after the first few steps while the angledelta is constant at 22.3. In the the end I get the following warning: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.190323e-16. > In runica at 1430 In ft_componentanalysis at 463 When trying to plot the components with ft_topoplotTFR only one black & white head shows up and the following error: Error using surf (line 75) X, Y, Z, and C cannot be complex. Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 185) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_topoplotIC (line 148) ft_topoplotTFR(cfg, varargin{:}); Running 'fastica' seems to work fine. I read about the issue with some 64 bit computers but the workaround with pop_runica didn't work for me. Thank you in advance! Best, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Oct 16 18:20:33 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Wed, 16 Oct 2013 18:20:33 +0200 (CEST) Subject: [FieldTrip] error with runica In-Reply-To: <004501ceca8a$08552b20$18ff8160$@uni-hamburg.de> Message-ID: <1163701128.3323422.1381940433385.JavaMail.root@sculptor.zimbra.ru.nl> Hi Phyllis, This error occurs when the input data is rank deficient, see: http://fieldtrip.fcdonders.nl/faq/why_does_my_ica_output_contain_complex_numbers Try to exclude the reference channel of your EEG (which is a linear combination of other EEG channels and can produce the rank deficiency) or ask runinca N independent components being N the rank of your data best, Diego ----- Original Message ----- > From: "Phyllis Mania" > To: fieldtrip at science.ru.nl > Sent: Wednesday, 16 October, 2013 6:09:03 PM > Subject: [FieldTrip] error with runica > Dear all, > I have a problem with running an ICA in one of my subjects (EEG, 70 > channels, 878 trials), even though it was preprocessed exactly like > all others (same number of channels, similar number of trials). When > calling ft_componentanalysis with ‘runica’ the learning rate gets as > low as 3.09032e-05 before it actually starts with step 1. It takes up > to 512 steps (very slowly) but the lrate never changes from 0 after > the first few steps while the angledelta is constant at 22.3. > In the the end I get the following warning: > Warning: Matrix is close to singular or badly scaled. Results may be > inaccurate. RCOND = 1.190323e-16. > > In runica at 1430 > In ft_componentanalysis at 463 > When trying to plot the components with ft_topoplotTFR only one black > & white head shows up and the following error: > Error using surf (line 75) > X, Y, Z, and C cannot be complex. > Error in ft_plot_topo (line 251) > h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', > 'none', 'FaceColor', shading); > Error in topoplot_common (line 704) > ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... > Error in ft_topoplotTFR (line 185) > [cfg] = topoplot_common(cfg, varargin{:}); > Error in ft_topoplotIC (line 148) > ft_topoplotTFR(cfg, varargin{:}); > Running ‘fastica’ seems to work fine. I read about the issue with some > 64 bit computers but the workaround with pop_runica didn’t work for > me. > Thank you in advance! > Best, > Phyllis > _______________________________________________ > 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 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Wed Oct 16 19:06:13 2013 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Wed, 16 Oct 2013 19:06:13 +0200 Subject: [FieldTrip] error with runica Message-ID: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> Dear Diego, thank you for getting back to me so quickly! While the ref channel was actually excluded it still worked when I did N-1. Would you suggest this as a general rule for all subjects, to keep it constant? I do have different numbers of channels across subjects, because I sometimes need to exclude one that didn't record (usually Iz). Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Oct 16 19:10:20 2013 From: roeysc at gmail.com (Roey) Date: Wed, 16 Oct 2013 20:10:20 +0300 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: <525E9DAD.7000107@donders.ru.nl> References: <525E5A15.9080900@gmail.com> <525E9DAD.7000107@donders.ru.nl> Message-ID: Hi Vitoria and everyone else, I agree with Jörn (thank you!) , indeed it seems this is the same problem. Hopefully I'll get back to it next week and maybe figure it out. Right now it seems like the A side consists of all the inside-voxels, whereas the B side consists of the different ROIs, and hence the mismatch. A possible solution could be having the atlas we are using available to that function, and translating the B side to the voxel space. By the way, are you using an MNI grid per subject? Best, roey ב-16 באוק 2013, בשעה 17:07, "Jörn M. Horschig" כתב/ה: > Hi Vitoria, > > I guess that is the same error that Roey Schurr described a few days back. There were some changes recently in the atlas lookup function (we replaced one function and made another more general). Apparently that broke some things, or you two just happen to do this as the first ever ;) > The only thing I can think of is that you might need to interpolate to the MNI template so that the dimensions are matched between the atlas and your source structures. Could you give that a try and let us know whether that helps? > > Best, > Jörn > > > On 10/16/2013 11:19 AM, Vitória Magalhães Piai wrote: >> Dear all, >> >> I'm trying to run ft_sourcestatistics with a specified ROI. It's data (MNEs) averaged over time. >> >> If I run ft_sourcestatistics without an ROI, I get a cluster with prob = .178. It looks like this (figure attached), where I masked using the t-values. >> Since I'm dealing with an N400-like component, I've got good reasons to expect the effect to be localised (mainly) to left temporal areas. >> >> So I tried adding this to my cfg: >> >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; >> cfgst.avgoverroi = 'yes'; >> cfgst.hemisphere = 'left'; >> cfgst.inputcoord = 'mni' ; >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); >> >> If cfgst.avgoverroi == 'yes'; I get the following error: >> >> ??? In an assignment A(:) = B, the number of elements in A and B >> must be the same. >> Error in ==> clusterstat at 187 >> tmp(cfg.inside) = postailobs; >> Error in ==> ft_statistics_montecarlo at 326 >> [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); >> Error in ==> statistics_wrapper at 298 >> [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> If cfgst.avgoverroi == 'no'; >> ft outputs "found positive clusters in observed data" and stat.posclusters/negclusters is only NaN. This is regardless of whether cfgst.roi is one label or a cell array. >> >> Does anyone know what I'm doing wrong? >> I've been completely stuck on source statistics for these MNEs for days, so any help would be highly appreciated, even if it is to suggest another way to do the stats! >> >> Thanks a lot, Vitória >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From merhart at ucsd.edu Wed Oct 16 20:11:43 2013 From: merhart at ucsd.edu (Matt Erhart) Date: Wed, 16 Oct 2013 11:11:43 -0700 Subject: [FieldTrip] Elekta Neuromag306 Trigger Extraction Message-ID: Hello, For about 5 of my 20 subjects, the trigger channel STI101 is returning incorrect values probably because of noise in that channel. How can I use the digital triggers, i.e. [STI001:STI006] for one task and [STI001:STI008 STI011:STI012] for another, properly? How can I adjust the extraction from STI101 such that it might be more tolerant to noise in a given subject? What's the best practice for checking/changing triggers by hand if the above don't fully work? I've got some real trigger values < 5, will I break something if I turn off fixneuromag and allow them to be included by default? thanks! Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Oct 16 20:15:04 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Diego Lozano Soldevilla) Date: Wed, 16 Oct 2013 20:15:04 +0200 Subject: [FieldTrip] error with runica In-Reply-To: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> References: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> Message-ID: Hi Phyllis, If your participants differ in number of channels, I'd adjust individually the number of independent components computing the rank of the data before running ICA. best, Diego On 16 October 2013 19:06, Phyllis Mania wrote: > Dear Diego,**** > > ** ** > > thank you for getting back to me so quickly! While the ref channel was > actually excluded it still worked when I did N-1. Would you suggest this as > a general rule for all subjects, to keep it constant? I do have different > numbers of channels across subjects, because I sometimes need to exclude > one that didn’t record (usually Iz).**** > > ** ** > > Cheers, Phyllis**** > > _______________________________________________ > 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 hamid.mohseni at eng.ox.ac.uk Thu Oct 17 00:12:42 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Wed, 16 Oct 2013 23:12:42 +0100 Subject: [FieldTrip] Elekta Neuromag306 Trigger Extraction In-Reply-To: <7ccd2d77-b86d-4145-be98-568325be03c8@HUB06.ad.oak.ox.ac.uk> References: <7ccd2d77-b86d-4145-be98-568325be03c8@HUB06.ad.oak.ox.ac.uk> Message-ID: Hello Matt, Sometimes there is a binary coding problem in storing triggers value in Elekta system. For example instead of storing 1, 2, 3 it stores 257, 258, 259, respectively. In this case you need to use reminder operator rem(triggervalue, 256) to get the correct value. Is that what you are referring to? Hamid On 16 October 2013 19:11, Matt Erhart wrote: > Hello, > > For about 5 of my 20 subjects, the trigger channel STI101 is returning > incorrect values probably because of noise in that channel. > > How can I use the digital triggers, i.e. [STI001:STI006] for one task and > [STI001:STI008 STI011:STI012] for another, properly? > > How can I adjust the extraction from STI101 such that it might be more > tolerant to noise in a given subject? > > What's the best practice for checking/changing triggers by hand if the > above don't fully work? > > I've got some real trigger values < 5, will I break something if I turn > off fixneuromag and allow them to be included by default? > > thanks! > Matt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Fellow Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Thu Oct 17 10:30:46 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Thu, 17 Oct 2013 10:30:46 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters Message-ID: Hi Roey and Joern, Joern, my subjects' data are interpolated to the MNI template, as far as I understand. I'm using a code that Jan-Mathijs and I worked on some time ago, so what I'm doing should be really close to what's in the tutorial. The only thing I can tell that is in the tutorial but not in my code is the following: "After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the template_grid onto the subjects's source, which is thereby in MNI coordinates." In my code, we only copied .pos and .dim from the template to the subjects, but not .xgrid, .ygrid, .zgrid. Would that explain the error? I think I was using an FT version from the beginning of October when I got the error (running in my PC, so not the DCCN's... sorry, I cannot look that up now). When were the changes made you are referring to? I could look up which version I was using (sorry for missing this very crucial information in my last email), but it might as well be the case, as you mentioned, that Roey and I are the first ones to try it out in this particular way ;) Let me know if you need more info. Btw, I have these data in a hard disk at the DCCN if you need to have a look. Roey, yes, I'm using an MNI grid per subject (similar to the tutorial: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space> Make the individual subjects' grid). Cheers, Vitoria > ------------------------------ > > Message: 3 > Date: Wed, 16 Oct 2013 20:10:20 +0300 > From: Roey > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source statistics with ROI yields NaN > clusters > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Vitoria and everyone else, > > I agree with J?rn (thank you!) , indeed it seems this is the same > problem. Hopefully I'll get back to it next week and maybe figure it > out. Right now it seems like the A side consists of all the > inside-voxels, whereas the B side consists of the different ROIs, and > hence the mismatch. > > A possible solution could be having the atlas we are using available > to that function, and translating the B side to the voxel space. > > By the way, are you using an MNI grid per subject? > > Best, > roey > > > > ?-16 ???? 2013, ???? 17:07, "J?rn M. Horschig" > ???/?: > > > Hi Vitoria, > > > > I guess that is the same error that Roey Schurr described a few days > > back. There were some changes recently in the atlas lookup function > > (we replaced one function and made another more general). Apparently > > that broke some things, or you two just happen to do this as the > > first ever ;) > > The only thing I can think of is that you might need to interpolate > > to the MNI template so that the dimensions are matched between the > > atlas and your source structures. Could you give that a try and let > > us know whether that helps? > > > > Best, > > J?rn > > > > > > On 10/16/2013 11:19 AM, Vit?ria Magalh?es Piai wrote: > >> Dear all, > >> > >> I'm trying to run ft_sourcestatistics with a specified ROI. It's > >> data (MNEs) averaged over time. > >> > >> If I run ft_sourcestatistics without an ROI, I get a cluster with > >> prob = .178. It looks like this (figure attached), where I masked > >> using the t-values. > >> Since I'm dealing with an N400-like component, I've got good > >> reasons to expect the effect to be localised (mainly) to left > >> temporal areas. > >> > >> So I tried adding this to my cfg: > >> > >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; > >> cfgst.avgoverroi = 'yes'; > >> cfgst.hemisphere = 'left'; > >> cfgst.inputcoord = 'mni' ; > >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > >> > >> If cfgst.avgoverroi == 'yes'; I get the following error: > >> > >> ??? In an assignment A(:) = B, the number of elements in A and B > >> must be the same. > >> Error in ==> clusterstat at 187 > >> tmp(cfg.inside) = postailobs; > >> Error in ==> ft_statistics_montecarlo at 326 > >> [stat, cfg] = clusterstat(cfg, statrand, > >> statobs,'issource',issource); > >> Error in ==> statistics_wrapper at 298 > >> [stat, cfg] = statmethod(cfg, dat, design, > >> 'issource',issource); > >> Error in ==> ft_sourcestatistics at 107 > >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > >> > >> If cfgst.avgoverroi == 'no'; > >> ft outputs "found positive clusters in observed data" and > >> stat.posclusters/negclusters is only NaN. This is regardless of > >> whether cfgst.roi is one label or a cell array. > >> > >> Does anyone know what I'm doing wrong? > >> I've been completely stuck on source statistics for these MNEs for > >> days, so any help would be highly appreciated, even if it is to > >> suggest another way to do the stats! > >> > >> Thanks a lot, Vit?ria > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > J?rn M. Horschig > > PhD Student > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Neuronal Oscillations Group > > FieldTrip Development Team > > > > P.O. Box 9101 > > NL-6500 HB Nijmegen > > The Netherlands > > > > Contact: > > E-Mail: jm.horschig at donders.ru.nl > > Tel: +31-(0)24-36-68493 > > Web: http://www.ru.nl/donders > > > > Visiting address: > > Trigon, room 2.30 > > Kapittelweg 29 > > NL-6525 EN Nijmegen > > The Netherlands > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131016/239e9cf4/attachment.html > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 35, Issue 29 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 12:32:36 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 12:32:36 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: References: Message-ID: <525FBCC4.7050502@donders.ru.nl> Hi Vitoria, the change should be from September 24, when we had our last bug binge. the xgrid, ygrid and zgrid variables should not matter - actually that should be deleted from the tutorial. However, what I meant was not that you build the grids in MNI space, but interpolate the grid with a 1cm or0.8cm resolution to the full MNI template using ft_sourceinterpolate, just like you would before plotting. But, I have no clue what has changed in the code, so this is just a desperate idea :) I think it would be wise to check with JM when he is back, as he is the source-guru. Could you open up a new bug for this? Then it might be easier for us (i.e. JM) to work on this. Best, Jörn On 10/17/2013 10:30 AM, Vitória Piai wrote: > > Hi Roey and Joern, > > Joern, my subjects' data are interpolated to the MNI template, as far > as I understand. I'm using a code that Jan-Mathijs and I worked on > some time ago, so what I'm doing should be really close to what's in > the tutorial. The only thing I can tell that is in the tutorial but > not in my code is the following: > "After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field > from the template_grid onto the subjects's source, which is thereby in > MNI coordinates." > In my code, we only copied .pos and .dim from the template to the > subjects, but not .xgrid, .ygrid, .zgrid. Would that explain the error? > I think I was using an FT version from the beginning of October when I > got the error (running in my PC, so not the DCCN's... sorry, I cannot > look that up now). When were the changes made you are referring to? I > could look up which version I was using (sorry for missing this very > crucial information in my last email), but it might as well be the > case, as you mentioned, that Roey and I are the first ones to try it > out in this particular way ;) > Let me know if you need more info. Btw, I have these data in a hard > disk at the DCCN if you need to have a look. > > Roey, yes, I'm using an MNI grid per subject (similar to the tutorial: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Make the individual subjects' grid). > > Cheers, Vitoria > > > ------------------------------ > > > > Message: 3 > > Date: Wed, 16 Oct 2013 20:10:20 +0300 > > From: Roey > > > To: FieldTrip discussion list > > > Subject: Re: [FieldTrip] source statistics with ROI yields NaN > > clusters > > Message-ID: > > > Content-Type: text/plain; charset="utf-8" > > > > Hi Vitoria and everyone else, > > > > I agree with J?rn (thank you!) , indeed it seems this is the same > > problem. Hopefully I'll get back to it next week and maybe figure it > > out. Right now it seems like the A side consists of all the > > inside-voxels, whereas the B side consists of the different ROIs, and > > hence the mismatch. > > > > A possible solution could be having the atlas we are using available > > to that function, and translating the B side to the voxel space. > > > > By the way, are you using an MNI grid per subject? > > > > Best, > > roey > > > > > > > > ?-16 ???? 2013, ???? 17:07, "J?rn M. Horschig" > > > ???/?: > > > > > Hi Vitoria, > > > > > > I guess that is the same error that Roey Schurr described a few days > > > back. There were some changes recently in the atlas lookup function > > > (we replaced one function and made another more general). Apparently > > > that broke some things, or you two just happen to do this as the > > > first ever ;) > > > The only thing I can think of is that you might need to interpolate > > > to the MNI template so that the dimensions are matched between the > > > atlas and your source structures. Could you give that a try and let > > > us know whether that helps? > > > > > > Best, > > > J?rn > > > > > > > > > On 10/16/2013 11:19 AM, Vit?ria Magalh?es Piai wrote: > > >> Dear all, > > >> > > >> I'm trying to run ft_sourcestatistics with a specified ROI. It's > > >> data (MNEs) averaged over time. > > >> > > >> If I run ft_sourcestatistics without an ROI, I get a cluster with > > >> prob = .178. It looks like this (figure attached), where I masked > > >> using the t-values. > > >> Since I'm dealing with an N400-like component, I've got good > > >> reasons to expect the effect to be localised (mainly) to left > > >> temporal areas. > > >> > > >> So I tried adding this to my cfg: > > >> > > >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > > >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; > > >> cfgst.avgoverroi = 'yes'; > > >> cfgst.hemisphere = 'left'; > > >> cfgst.inputcoord = 'mni' ; > > >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > > >> > > >> If cfgst.avgoverroi == 'yes'; I get the following error: > > >> > > >> ??? In an assignment A(:) = B, the number of elements in A and B > > >> must be the same. > > >> Error in ==> clusterstat at 187 > > >> tmp(cfg.inside) = postailobs; > > >> Error in ==> ft_statistics_montecarlo at 326 > > >> [stat, cfg] = clusterstat(cfg, statrand, > > >> statobs,'issource',issource); > > >> Error in ==> statistics_wrapper at 298 > > >> [stat, cfg] = statmethod(cfg, dat, design, > > >> 'issource',issource); > > >> Error in ==> ft_sourcestatistics at 107 > > >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > >> > > >> If cfgst.avgoverroi == 'no'; > > >> ft outputs "found positive clusters in observed data" and > > >> stat.posclusters/negclusters is only NaN. This is regardless of > > >> whether cfgst.roi is one label or a cell array. > > >> > > >> Does anyone know what I'm doing wrong? > > >> I've been completely stuck on source statistics for these MNEs for > > >> days, so any help would be highly appreciated, even if it is to > > >> suggest another way to do the stats! > > >> > > >> Thanks a lot, Vit?ria > > >> > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > > -- > > > J?rn M. Horschig > > > PhD Student > > > Donders Institute for Brain, Cognition and Behaviour > > > Centre for Cognitive Neuroimaging > > > Radboud University Nijmegen > > > Neuronal Oscillations Group > > > FieldTrip Development Team > > > > > > P.O. Box 9101 > > > NL-6500 HB Nijmegen > > > The Netherlands > > > > > > Contact: > > > E-Mail: jm.horschig at donders.ru.nl > > > Tel: +31-(0)24-36-68493 > > > Web: http://www.ru.nl/donders > > > > > > Visiting address: > > > Trigon, room 2.30 > > > Kapittelweg 29 > > > NL-6525 EN Nijmegen > > > The Netherlands > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 35, Issue 29 > > ***************************************** > > > > _______________________________________________ > 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 tahere.toosi at gmail.com Thu Oct 17 15:07:18 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Thu, 17 Oct 2013 16:37:18 +0330 Subject: [FieldTrip] Problem using ft_multiplotER - warning about color Message-ID: Hi fieldtripers I am trying to perform event-related averaging on my EEG data. My problem is when I use ft_multiplotER to plot ERPs, the plot shows up but only the ERP curves can't be seen (everything else is ok) and I receive the following warning: Warning: do not know how to plot the lines in the appropriate color > In ft_plot_vector at 393 In ft_multiplotER at 635 Even when I try the fieldtrip example, I receive the same warning and still no ERP. %the code just like example cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; cfg.layout = 'CTF151.lay'; cfg.ylim = [-3e-13 3e-13]; ft_multiplotER(cfg, avgFIC); Could you please help me? Best, Tahereh -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 17 15:42:42 2013 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Thu, 17 Oct 2013 15:42:42 +0200 (CEST) Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: Message-ID: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> Hi Tahereh, Could you please provide information about what your data looks like? i.e. what is the data structure of avgFIC? Best, Nietzsche ----- Original Message ----- > From: "Tahereh Toosi" > To: "FieldTrip discussion list" > Sent: Thursday, 17 October, 2013 3:07:18 PM > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > Hi fieldtripers > > > I am trying to perform event-related averaging on my EEG data. > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > up but only the ERP curves can't be seen (everything else is ok) and I > receive the following warning: > > > > Warning: do not know how to plot the lines in the appropriate color > > In ft_plot_vector at 393 > In ft_multiplotER at 635 > > > Even when I try the fieldtrip example, I receive the same warning and > still no ERP. > > > %the code just like example > > cfg = []; > cfg.showlabels = 'yes'; > cfg.fontsize = 6; > cfg.layout = 'CTF151.lay'; > cfg.ylim = [-3e-13 3e-13]; > ft_multiplotER(cfg, avgFIC); > > > Could you please help me? > > > Best, > Tahereh > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From tahere.toosi at gmail.com Thu Oct 17 15:59:58 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Thu, 17 Oct 2013 17:29:58 +0330 Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> References: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hi Nietzsche, Thank you for your response. I have this problem even when I try the fieldtrip example here . So data structure avgFIC is exactly the same as example, like below: avgFIC = avg: [149x900 double] var: [149x900 double] time: [1x900 double] dof: [149x900 double] label: {149x1 cell} dimord: 'chan_time' grad: [1x1 struct] cfg: [1x1 struct] On Thu, Oct 17, 2013 at 5:12 PM, Lam, N.H.L. (Nietzsche) < n.lam at fcdonders.ru.nl> wrote: > Hi Tahereh, > > Could you please provide information about what your data looks like? i.e. > what is the data structure of avgFIC? > > Best, > Nietzsche > > ----- Original Message ----- > > From: "Tahereh Toosi" > > To: "FieldTrip discussion list" > > Sent: Thursday, 17 October, 2013 3:07:18 PM > > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > > Hi fieldtripers > > > > > > I am trying to perform event-related averaging on my EEG data. > > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > > up but only the ERP curves can't be seen (everything else is ok) and I > > receive the following warning: > > > > > > > > Warning: do not know how to plot the lines in the appropriate color > > > In ft_plot_vector at 393 > > In ft_multiplotER at 635 > > > > > > Even when I try the fieldtrip example, I receive the same warning and > > still no ERP. > > > > > > %the code just like example > > > > cfg = []; > > cfg.showlabels = 'yes'; > > cfg.fontsize = 6; > > cfg.layout = 'CTF151.lay'; > > cfg.ylim = [-3e-13 3e-13]; > > ft_multiplotER(cfg, avgFIC); > > > > > > Could you please help me? > > > > > > Best, > > Tahereh > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > 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 hweeling.lee at gmail.com Thu Oct 17 16:02:32 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:02:32 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue Message-ID: Hi! I'm using the command ft_artifact_zvalue, and would like to use the interactive mode. However, I keep getting an error message: Error using ft_artifact_zvalue (line 216) no channels selected. I wonder if I require to specify the channels manually. Thanks! Here's my script: clear all; close all; clc; warning off; fs = filesep; % loading eeg files for fieldtrip cfg = []; cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; % loading stimulus information cfg.trialfun = 'my_trialfun_name'; % self-made function located in D:\New_Scripts_2013\my_trialfun_name.m cfg.trialdef.pre = 1.0; cfg.trialdef.post = 1.0; cfg = ft_definetrial(cfg); [data] = ft_preprocessing(cfg); % loading eeg data into memory % to filter 50 Hz 'humming' of electric power supply cfg.bsfiler = 'yes'; cfg.bsfreq = [49 51; 99 100; 149 151]; [data] = ft_preprocessing(cfg); % loading eeg data into memory % automatic artifact rejection cfg.artfctdef.zvalue.channel = 'eeg'; cfg.artfctdef.zvalue.cutoff = 0.5; cfg.artfctdef.zvalue.trlpadding = 0; cfg.artfctdef.zvalue.fltpadding = 0; cfg.artfctdef.zvalue.artpadding = 0; [cfg, artifact] = ft_artifact_zvalue(cfg, data); -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 17 16:04:08 2013 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Thu, 17 Oct 2013 16:04:08 +0200 (CEST) Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: Message-ID: <527130139.3673130.1382018648204.JavaMail.root@indus.zimbra.ru.nl> Hi Tehareh, Actually it does seem that the issue is with the plotting function, and not so much what data type is being used. I've also managed to plot the figure, and have the axes plotted, but not ERP/ERF waveform. I will file a bug for our developement team, and then take a deeper look into it. Thanks for pointing this out to us! Best, Nietzsche ----- Original Message ----- > From: "Tahereh Toosi" > To: "FieldTrip discussion list" > Sent: Thursday, 17 October, 2013 3:07:18 PM > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > Hi fieldtripers > > > I am trying to perform event-related averaging on my EEG data. > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > up but only the ERP curves can't be seen (everything else is ok) and I > receive the following warning: > > > > Warning: do not know how to plot the lines in the appropriate color > > In ft_plot_vector at 393 > In ft_multiplotER at 635 > > > Even when I try the fieldtrip example, I receive the same warning and > still no ERP. > > > %the code just like example > > cfg = []; > cfg.showlabels = 'yes'; > cfg.fontsize = 6; > cfg.layout = 'CTF151.lay'; > cfg.ylim = [-3e-13 3e-13]; > ft_multiplotER(cfg, avgFIC); > > > Could you please help me? > > > Best, > Tahereh > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From zizlsperger at gmail.com Thu Oct 17 16:17:45 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Thu, 17 Oct 2013 16:17:45 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP Message-ID: Hi all, I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): In my example the two datasets have the structure: disp(EEG1_HC35_GA_JD_ICA_Coh5cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [314x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [314x32 double] cfg: [1x1 struct] disp(EEG1_HC35_GA_JD_ICA_Coh70cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [206x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [206x32 double] cfg: [1x1 struct] When I try to do the sourceanalysis by: cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); save source sourceCoh5 sourceCoh70; I get the error: the input is timelock data with 32 channels and 7000 timebins using headmodel specified in the configuration using electrodes specified in the configuration determining source compartment (3) projecting electrodes on skin surface combining electrode transfer and system matrix creating dipole grid based on user specified dipole positions using headmodel specified in the configuration using gradiometers specified in the configuration 8196 dipoles inside, 0 dipoles outside brain the call to "ft_prepare_sourcemodel" took 0 seconds estimating current density distribution for repetition 1 using pre-computed leadfields: some of the specified options will not have an effect Warning: computing a unregularised minimum norm solution. This typically does not work due to numerical accuracy problems > In minimumnormestimate at 150 In ft_sourceanalysis at 856 ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> minimumnormestimate at 226 mom = w * dat; Error in ==> ft_sourceanalysis at 856 dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Is this due to the different trial numbers of the datasets or does it point to another problem? Thanks in advance Best Leo RWTH Aachen Neurology -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Thu Oct 17 16:21:03 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Thu, 17 Oct 2013 16:21:03 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: References: Message-ID: I think "cfg.artfctdef.zvalue.channel" should be a SINGLE channel (use labels or ordinal numbers) cheers, T 2013/10/17 Hwee Ling Lee > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 16:28:54 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 16:28:54 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: References: Message-ID: <525FF426.6030200@donders.ru.nl> Hi, try using the upper-case abbreviation 'EEG'. Groetjes Jörn On 10/17/2013 4:02 PM, Hwee Ling Lee wrote: > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > > _______________________________________________ > 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 hweeling.lee at gmail.com Thu Oct 17 16:30:51 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:30:51 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: <525FF426.6030200@donders.ru.nl> References: <525FF426.6030200@donders.ru.nl> Message-ID: thanks to all, for helpful suggestions! On 17 October 2013 16:28, "Jörn M. Horschig" wrote: > Hi, > > try using the upper-case abbreviation 'EEG'. > > Groetjes > Jörn > > > On 10/17/2013 4:02 PM, Hwee Ling Lee wrote: > > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > > _______________________________________________ > 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 > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Thu Oct 17 16:48:49 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:48:49 +0200 Subject: [FieldTrip] another question regarding display of ICA results Message-ID: Hi all, My data has only 13 channels for ICA preprocessing, and I would like to display the components from the ICA preprocessing. I use this: cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blcoksize = 50; cfg.channels = [1:13]; ft_databrowser(cfg,ic_data); However, I was prompted an error message: cannot infer sensor type. Is it possible to display the components using a generic layout? How can I resolve this issue? Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 17:18:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 17:18:50 +0200 Subject: [FieldTrip] another question regarding display of ICA results In-Reply-To: References: Message-ID: <525FFFDA.6010806@donders.ru.nl> Dear Hweeling, for EEG data, you always need to specify a layout manually when plotting topographies. Layouts can be found in fieldtrip/template/layout. A generic layout is EEG1020.lay. For more information, check our wikipage: http://fieldtrip.fcdonders.nl/?do=search&id=layout Best, Jörn On 10/17/2013 4:48 PM, Hwee Ling Lee wrote: > > Hi all, > > My data has only 13 channels for ICA preprocessing, and I would like > to display the components from the ICA preprocessing. > > I use this: > > cfg.viewmode = 'component'; > cfg.continuous = 'no'; > cfg.blcoksize = 50; > cfg.channels = [1:13]; > ft_databrowser(cfg,ic_data); > > However, I was prompted an error message: cannot infer sensor type. > > Is it possible to display the components using a generic layout? > > How can I resolve this issue? > > Thanks. > > Best regards, > Hweeling > > > > _______________________________________________ > 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 ben.vanlier at bsse.ethz.ch Thu Oct 17 18:20:40 2013 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Thu, 17 Oct 2013 16:20:40 +0000 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there Message-ID: Hi all, I am trying to show an increase in gamma oscillations. According to literature they should be there without a doubt. But, I am not too sure about the actual recording - i have the feeling i was just recording noise. When i eyeball raw traces, i do not see a difference between condition 1 and 2. Same for the PSD and spectrograms, just the 1/f noise. My question is, could there still be (eg low amplitude) oscillation in the data that you just wont see by eye? what is your experience in this? Using freqstatistics, some channels do show significance but im a bit skeptical. I have been playing around with freqstatistics and simulated data from freqsimulation and the stats only made sense when i could clearly see it by eye in the spectrogram as well... Cheers, Ben From Don.Rojas at ucdenver.edu Thu Oct 17 19:04:22 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 17 Oct 2013 11:04:22 -0600 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there In-Reply-To: References: Message-ID: <4DCE7020-FA7C-4704-8AD9-52F24016CA10@ucdenver.edu> Ben, Gamma oscillations are tiny and the 1/f characteristic normally obscures them in fft plots. I don't think that gamma is a particularly convincing oscillation that you would expect to see in a raw waveform because 1) it is so small and 2) it is a rather broad band that doesn't look like a sinusoid. Since you have two conditions to compare, one of which you expect to see greater gamma for, use ft_math to create a difference spectrum, which will remove much of the 1/f characteristic and emphasize the condition differences. Also, if you don't see condition differences, you can try computing the same thing for post-stimulus vs. pre-stimulus fft. The same logic would apply to your spectrograms. Best, Don On Oct 17, 2013, at 10:20 AM, "van Lier Ben" wrote: > Hi all, > > I am trying to show an increase in gamma oscillations. According to literature they should be there without a doubt. But, I am not too sure about the actual recording - i have the feeling i was just recording noise. > > When i eyeball raw traces, i do not see a difference between condition 1 and 2. Same for the PSD and spectrograms, just the 1/f noise. > > My question is, could there still be (eg low amplitude) oscillation in the data that you just wont see by eye? what is your experience in this? > > Using freqstatistics, some channels do show significance but im a bit skeptical. I have been playing around with freqstatistics and simulated data from freqsimulation and the stats only made sense when i could clearly see it by eye in the spectrogram as well... > > Cheers, > Ben > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From poil.simonshlomo at gmail.com Fri Oct 18 10:52:21 2013 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Fri, 18 Oct 2013 10:52:21 +0200 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there In-Reply-To: References: Message-ID: Hi Ben, Eyeballing data is a good start. But sometimes your eyes see something which is not really there (i.e. significant), or they might miss something (such as gamma). I think these tutorials would be relevant for you to read: http://www.nbtwiki.net/doku.php?id=tutorial:amplitude_in_classical_frequency_bands#.UmD1liQmyIA http://www.nbtwiki.net/doku.php?id=tutorial:power_spectra_wavelet_analysis_and_coherence#.UmD1NiQmyIA http://www.nbtwiki.net/doku.php?id=tutorial:compute_statistics#.UmD2NSQmyIA Good luck Simon -- Simon-Shlomo Poil, Dr. 2013/10/17 van Lier Ben > Hi all, > > I am trying to show an increase in gamma oscillations. According to > literature they should be there without a doubt. But, I am not too sure > about the actual recording - i have the feeling i was just recording noise. > > When i eyeball raw traces, i do not see a difference between condition 1 > and 2. Same for the PSD and spectrograms, just the 1/f noise. > > My question is, could there still be (eg low amplitude) oscillation in the > data that you just wont see by eye? what is your experience in this? > > Using freqstatistics, some channels do show significance but im a bit > skeptical. I have been playing around with freqstatistics and simulated > data from freqsimulation and the stats only made sense when i could clearly > see it by eye in the spectrogram as well... > > Cheers, > Ben > > > > _______________________________________________ > 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 zizlsperger at gmail.com Mon Oct 21 11:52:30 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Mon, 21 Oct 2013 11:52:30 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: References: Message-ID: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Dear all, no suggestions so far? Am I missing something obvious? In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) Would love to hear your ideas... Best Leo On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > Hi all, > I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): > In my example the two datasets have the structure: > > disp(EEG1_HC35_GA_JD_ICA_Coh5cov); > avg: [32x7000 double] > var: [32x7000 double] > time: [1x7000 double] > dof: [32x7000 double] > label: {32x1 cell} > trial: [314x32x7000 double] > dimord: 'rpt_chan_time' > trialinfo: [314x32 double] > cfg: [1x1 struct] > > > disp(EEG1_HC35_GA_JD_ICA_Coh70cov); > avg: [32x7000 double] > var: [32x7000 double] > time: [1x7000 double] > dof: [32x7000 double] > label: {32x1 cell} > trial: [206x32x7000 double] > dimord: 'rpt_chan_time' > trialinfo: [206x32 double] > cfg: [1x1 struct] > > When I try to do the sourceanalysis by: > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); > sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); > > save source sourceCoh5 sourceCoh70; > > I get the error: > > the input is timelock data with 32 channels and 7000 timebins > using headmodel specified in the configuration > using electrodes specified in the configuration > determining source compartment (3) > projecting electrodes on skin surface > combining electrode transfer and system matrix > creating dipole grid based on user specified dipole positions > using headmodel specified in the configuration > using gradiometers specified in the configuration > 8196 dipoles inside, 0 dipoles outside brain > the call to "ft_prepare_sourcemodel" took 0 seconds > estimating current density distribution for repetition 1 > using pre-computed leadfields: some of the specified options will not have an effect > Warning: computing a unregularised minimum norm solution. This typically does not work > due to numerical accuracy problems > > In minimumnormestimate at 150 > In ft_sourceanalysis at 856 > ??? Error using ==> mtimes > Inner matrix dimensions must agree. > > Error in ==> minimumnormestimate at 226 > mom = w * dat; > > Error in ==> ft_sourceanalysis at 856 > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); > > > > Is this due to the different trial numbers of the datasets or does it point to another problem? > Thanks in advance > Best > > Leo > RWTH Aachen Neurology > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Mon Oct 21 12:31:49 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Mon, 21 Oct 2013 12:31:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Message-ID: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: > Dear all, > no suggestions so far? Am I missing something obvious? > In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) > Would love to hear your ideas... > Best > Leo > > > > > On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > >> Hi all, >> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >> In my example the two datasets have the structure: >> >> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [314x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [314x32 double] >> cfg: [1x1 struct] >> >> >> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [206x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [206x32 double] >> cfg: [1x1 struct] >> >> When I try to do the sourceanalysis by: >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >> >> save source sourceCoh5 sourceCoh70; >> >> I get the error: >> >> the input is timelock data with 32 channels and 7000 timebins >> using headmodel specified in the configuration >> using electrodes specified in the configuration >> determining source compartment (3) >> projecting electrodes on skin surface >> combining electrode transfer and system matrix >> creating dipole grid based on user specified dipole positions >> using headmodel specified in the configuration >> using gradiometers specified in the configuration >> 8196 dipoles inside, 0 dipoles outside brain >> the call to "ft_prepare_sourcemodel" took 0 seconds >> estimating current density distribution for repetition 1 >> using pre-computed leadfields: some of the specified options will not have an effect >> Warning: computing a unregularised minimum norm solution. This typically does not work >> due to numerical accuracy problems >> > In minimumnormestimate at 150 >> In ft_sourceanalysis at 856 >> ??? Error using ==> mtimes >> Inner matrix dimensions must agree. >> >> Error in ==> minimumnormestimate at 226 >> mom = w * dat; >> >> Error in ==> ft_sourceanalysis at 856 >> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >> >> >> >> Is this due to the different trial numbers of the datasets or does it point to another problem? >> Thanks in advance >> Best >> >> Leo >> RWTH Aachen Neurology >> >> >> >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Mon Oct 21 12:31:49 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Mon, 21 Oct 2013 12:31:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Message-ID: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: > Dear all, > no suggestions so far? Am I missing something obvious? > In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) > Would love to hear your ideas... > Best > Leo > > > > > On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > >> Hi all, >> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >> In my example the two datasets have the structure: >> >> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [314x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [314x32 double] >> cfg: [1x1 struct] >> >> >> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [206x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [206x32 double] >> cfg: [1x1 struct] >> >> When I try to do the sourceanalysis by: >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >> >> save source sourceCoh5 sourceCoh70; >> >> I get the error: >> >> the input is timelock data with 32 channels and 7000 timebins >> using headmodel specified in the configuration >> using electrodes specified in the configuration >> determining source compartment (3) >> projecting electrodes on skin surface >> combining electrode transfer and system matrix >> creating dipole grid based on user specified dipole positions >> using headmodel specified in the configuration >> using gradiometers specified in the configuration >> 8196 dipoles inside, 0 dipoles outside brain >> the call to "ft_prepare_sourcemodel" took 0 seconds >> estimating current density distribution for repetition 1 >> using pre-computed leadfields: some of the specified options will not have an effect >> Warning: computing a unregularised minimum norm solution. This typically does not work >> due to numerical accuracy problems >> > In minimumnormestimate at 150 >> In ft_sourceanalysis at 856 >> ??? Error using ==> mtimes >> Inner matrix dimensions must agree. >> >> Error in ==> minimumnormestimate at 226 >> mom = w * dat; >> >> Error in ==> ft_sourceanalysis at 856 >> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >> >> >> >> Is this due to the different trial numbers of the datasets or does it point to another problem? >> Thanks in advance >> Best >> >> Leo >> RWTH Aachen Neurology >> >> >> >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 21 14:07:56 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 21 Oct 2013 14:07:56 +0200 Subject: [FieldTrip] fieldtrip website down for maintenance on October 22nd Message-ID: <5222E964-0CC2-4573-9A6C-14EE79D00DE9@donders.ru.nl> Dear all, Tomorrow morning, October 22nd, general DCCN network maintenance is needed and the FieldTrip website, the ftp, svn and the bugzilla server will all be down between 6:30AM and 9:00AM (CET). Hopefully the maintenance will be without issues and the downtime will be a bit shorter than this. If you know that you are going to need certain documentation, please save the html page or print it to a pdf file. best regards, Robert From Don.Rojas at ucdenver.edu Mon Oct 21 17:18:57 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 21 Oct 2013 09:18:57 -0600 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Message-ID: Based on past experience, I'd think that Stephan's suggestion is a good one to resolve the inner matrix dimension agreement error. You may have a pre-prepared leadfield with a different number of channels than the number you supply for the source solution. Check your cfg.elec.label field and see if it is the same length as the 1st dimension of EEG1_HC35_GA_JD_ICA_Coh5cov.avg. You might have left an ECG, EMG or EOG channel in the call to ft_prepare_leadfield. On Oct 21, 2013, at 4:31 AM, "smoratti at psi.ucm.es" > wrote: Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: Dear all, no suggestions so far? Am I missing something obvious? In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) Would love to hear your ideas... Best Leo On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold > wrote: Hi all, I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): In my example the two datasets have the structure: disp(EEG1_HC35_GA_JD_ICA_Coh5cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [314x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [314x32 double] cfg: [1x1 struct] disp(EEG1_HC35_GA_JD_ICA_Coh70cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [206x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [206x32 double] cfg: [1x1 struct] When I try to do the sourceanalysis by: cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); save source sourceCoh5 sourceCoh70; I get the error: the input is timelock data with 32 channels and 7000 timebins using headmodel specified in the configuration using electrodes specified in the configuration determining source compartment (3) projecting electrodes on skin surface combining electrode transfer and system matrix creating dipole grid based on user specified dipole positions using headmodel specified in the configuration using gradiometers specified in the configuration 8196 dipoles inside, 0 dipoles outside brain the call to "ft_prepare_sourcemodel" took 0 seconds estimating current density distribution for repetition 1 using pre-computed leadfields: some of the specified options will not have an effect Warning: computing a unregularised minimum norm solution. This typically does not work due to numerical accuracy problems > In minimumnormestimate at 150 In ft_sourceanalysis at 856 ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> minimumnormestimate at 226 mom = w * dat; Error in ==> ft_sourceanalysis at 856 dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Is this due to the different trial numbers of the datasets or does it point to another problem? Thanks in advance Best Leo RWTH Aachen Neurology _______________________________________________ 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 m.stoica at uke.de Mon Oct 21 17:37:07 2013 From: m.stoica at uke.de (Stoica, Mircea) Date: Mon, 21 Oct 2013 15:37:07 +0000 Subject: [FieldTrip] Normality assumptions behind FT's statistics Message-ID: Dear all, does FieldTrip perform any transform on coherence/power spectra before ft_freqstatistics? If so, it should be documented so users would not apply the transform prior to the test. If not, t-tests cannot and should not be applied to this kind of data. Best regards, Mircea -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From annevanhoogmoed at email.arizona.edu Tue Oct 22 00:59:51 2013 From: annevanhoogmoed at email.arizona.edu (van Hoogmoed, Anne H - (annevanhoogmoed)) Date: Mon, 21 Oct 2013 22:59:51 +0000 Subject: [FieldTrip] question for using ft_timelockgrandaverage Message-ID: Dear all, I'm using ft_timelockgrandaverage to make a grand average of my ERP data. However, the order of the channels is different for some people I want to include in the average. Does ft_timelockgrandaverage take this into account (i.e. does it average on channel name or on channel order)? Or do the channels need to be ordered the same for each participant. And if so, how should I do this? Thanks for your help, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 22 02:20:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Tue, 22 Oct 2013 02:20:49 +0200 Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: Dear Anne, I think ft_timelockgrandaverage expects your individual average (iavg) data structures to have equal label fields. I know that trying to "grandaverage" iavgs with different channel labels led to grand averages data structures with empty-matrix as values. If fieldtrip find labels common to all the iavg data structures they will be averaged. They are averaged on a "label" name basis, not on an ordinal basis. If you set cfg.channel to, say 1:3, and the first three channels of all your iavg datas do not have exactly the same label names it will return an empty matrix or throw an error. Hence, if you want to grand average iavgs with different channel labels, you need to previously manually change the labels so they are the same (maybe there is a more elegant solution than this workaround). I hope it was helpful, and correct, otherwise, I wish I will be corrected; Always give it a try first. It may work, it may throw an error, but understanding it you will be nearer to the solution 2013/10/22 van Hoogmoed, Anne H - (annevanhoogmoed) < annevanhoogmoed at email.arizona.edu> > Dear all,**** > > ** ** > > I’m using ft_timelockgrandaverage to make a grand average of my ERP data. > However, the order of the channels is different for some people I want to > include in the average. Does ft_timelockgrandaverage take this into account > (i.e. does it average on channel name or on channel order)? Or do the > channels need to be ordered the same for each participant. And if so, how > should I do this?**** > > ** ** > > Thanks for your help,**** > > ** ** > > Anne**** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 22 02:20:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Tue, 22 Oct 2013 02:20:49 +0200 Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: Dear Anne, I think ft_timelockgrandaverage expects your individual average (iavg) data structures to have equal label fields. I know that trying to "grandaverage" iavgs with different channel labels led to grand averages data structures with empty-matrix as values. If fieldtrip find labels common to all the iavg data structures they will be averaged. They are averaged on a "label" name basis, not on an ordinal basis. If you set cfg.channel to, say 1:3, and the first three channels of all your iavg datas do not have exactly the same label names it will return an empty matrix or throw an error. Hence, if you want to grand average iavgs with different channel labels, you need to previously manually change the labels so they are the same (maybe there is a more elegant solution than this workaround). I hope it was helpful, and correct, otherwise, I wish I will be corrected; Always give it a try first. It may work, it may throw an error, but understanding it you will be nearer to the solution 2013/10/22 van Hoogmoed, Anne H - (annevanhoogmoed) < annevanhoogmoed at email.arizona.edu> > Dear all,**** > > ** ** > > I’m using ft_timelockgrandaverage to make a grand average of my ERP data. > However, the order of the channels is different for some people I want to > include in the average. Does ft_timelockgrandaverage take this into account > (i.e. does it average on channel name or on channel order)? Or do the > channels need to be ordered the same for each participant. And if so, how > should I do this?**** > > ** ** > > Thanks for your help,**** > > ** ** > > Anne**** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Tue Oct 22 09:09:20 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Tue, 22 Oct 2013 09:09:20 +0200 Subject: [FieldTrip] grad information lost after ICA Message-ID: Hi all, When I use the external 20131017FT version to do ICA analysis , the structure grad is gone . However , everything is OK if do it on the DCCN menta . Any ideas ? 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: From j.herring at fcdonders.ru.nl Tue Oct 22 09:13:27 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Tue, 22 Oct 2013 09:13:27 +0200 (CEST) Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: <010f01cecef6$33f2a620$9bd7f260$@herring@fcdonders.ru.nl> Hi Anne, Yes, ft_timelockgrandaverage takes this into account. This used to be a problem in earlier versions of Fieldtrip (~ a year ago) but has been fixed. If you want to make sure you can always specify cfg.keepindividual = 'yes'; and see whether the channels are ordered correctly. Alternatively you could replace the data for one channel in each subject with, for example, ones and see whether ft_timelockgrandaverage produces that channel with a mean of 1 with no variation as well. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of van Hoogmoed, Anne H - (annevanhoogmoed) Sent: dinsdag 22 oktober 2013 1:00 To: fieldtrip at donders.ru.nl Subject: [FieldTrip] question for using ft_timelockgrandaverage Dear all, I'm using ft_timelockgrandaverage to make a grand average of my ERP data. However, the order of the channels is different for some people I want to include in the average. Does ft_timelockgrandaverage take this into account (i.e. does it average on channel name or on channel order)? Or do the channels need to be ordered the same for each participant. And if so, how should I do this? Thanks for your help, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Tue Oct 22 09:23:01 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Tue, 22 Oct 2013 09:23:01 +0200 Subject: [FieldTrip] grad information lost after ICA (Haiteng Jiang) In-Reply-To: References: Message-ID: <526627D5.70705@gmail.com> Hi Haiteng, It's got to do with some recent changes to low-level functions. You have to run "runica" on the latest FT version, and then you'll get the grad structure back. It worked for me that way! Cheers, Vitória On 10/22/2013 9:13 AM, fieldtrip-request at science.ru.nl wrote: > Hi all, > When I use the external 20131017FT version to do ICA analysis , the > structure grad is gone . However , everything is OK if do it on the > DCCN menta . > Any ideas ? > Best, Haiteng > > > From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 14:48:45 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke van Dijk) Date: Tue, 22 Oct 2013 14:48:45 +0200 Subject: [FieldTrip] neuromag306 sources look vertically smeared. Message-ID: Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_vertical.jpg Type: image/jpeg Size: 95892 bytes Desc: not available URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 15:00:43 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke.vanDijk at med.uni-duesseldorf.de) Date: Tue, 22 Oct 2013 13:00:43 +0000 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? Message-ID: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke __________________________________________ Hanneke van Dijk, PhD http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html Institute for Clinical Neuroscience, Heinrich Heine Universität Düsseldorf, Germany Hanneke.vanDijk at med.uni-duesseldorf.de Tel. +49 (0) 211 81 13074 __________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 15:02:30 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke.vanDijk at med.uni-duesseldorf.de) Date: Tue, 22 Oct 2013 13:02:30 +0000 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> Message-ID: <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke __________________________________________ Hanneke van Dijk, PhD http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html Institute for Clinical Neuroscience, Heinrich Heine Universität Düsseldorf, Germany Hanneke.vanDijk at med.uni-duesseldorf.de Tel. +49 (0) 211 81 13074 __________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_vertical.jpg Type: image/jpeg Size: 95892 bytes Desc: source_vertical.jpg URL: From jan.schoffelen at donders.ru.nl Tue Oct 22 15:13:27 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 22 Oct 2013 15:13:27 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> Message-ID: <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Hi Hanneke, I don't know what you expect to see, but to me it is not clear what quantity you are visualizing here (given the units). Also, note that when you put precomputed spatial filters in the cfg, the lambda specified for the second round of ft_sourceanalysis is not going to change the spatial structure of the result, because the spatial filters are fixed. Also, note that specifying '0.05%' leads to a very tiny regularization. I think that you wanted to specify '5%', which translates to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol will not be used in the second round of ft_sourceanalysis (nor in the first one if you used precomputed leadfields) I don't see the point in fiddling around with the metric units (converting it to 'mm'), but then explicitly stating them to be in 'cm'. Did you not do this when actually computing the leadfields? I hope not. Best, Jan-Mathijs On Oct 22, 2013, at 3:02 PM, wrote: > Dear all, > > My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. > > The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... > > I am wondering if any of you has an idea where I should look to find a solution. > > Further information: > > I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). > > Then compute the fourier, and do sourceanalysis as follows: > > cfg = []; > cfg.method = 'dics'; > cfg.grid = mni_grid; > cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter > cfg.grid.leadfield = source.leadfield; > cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... > cfg.vol.unit = 'cm'; > cfg.frequency = 60; > cfg.latency = 3; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = '0.05%'; > cfg.dics.normalize = 'yes'; > cfg.keeptrials = 'yes'; > cfg.rawtrial = 'yes'; % project each single trial through the filter > s = ft_sourceanalysis(cfg, f); > > Thanks in advance for any suggestion! > > Groetjes Hanneke > > > __________________________________________ > > Hanneke van Dijk, PhD > http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html > Institute for Clinical Neuroscience, > Heinrich Heine Universität Düsseldorf, Germany > Hanneke.vanDijk at med.uni-duesseldorf.de > Tel. +49 (0) 211 81 13074 > __________________________________________ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From hanneke.p.van.dijk at gmail.com Tue Oct 22 16:53:56 2013 From: hanneke.p.van.dijk at gmail.com (Hanneke van Dijk) Date: Tue, 22 Oct 2013 16:53:56 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Thanks for your quick reply. I will go through your comments one by one: 1. The plot shows the nai, and in stead of these straight vertical lines going even into the center of the brain, I expected to see blobs. 2. In the precomputed filters I have used the same lambda, I should remove the cfg from this part. I have used cfg.dics.lambda from 0.05 to 50 and as I said this only changes the 'power' but not the structure of the data. 3. About the cfg.vol. I have been fidling around with the units for quite some time, but this is the only way the functional data will not end up the size of a pea in the anatomical data. I think this has to do with ctf/neuromag/spm coordinate system differences that are not yet fixed in FieldTrip? But it seems that there is no obvious thing that could be happening then? Groetjes Hanneke On Tue, Oct 22, 2013 at 3:13 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Hanneke, > > I don't know what you expect to see, but to me it is not clear what > quantity you are visualizing here (given the units). > Also, note that when you put precomputed spatial filters in the cfg, the > lambda specified for the second round of ft_sourceanalysis is not going to > change the spatial structure of the result, because the spatial filters are > fixed. Also, note that specifying '0.05%' leads to a very tiny > regularization. I think that you wanted to specify '5%', which translates > to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol > will not be used in the second round of ft_sourceanalysis (nor in the first > one if you used precomputed leadfields) I don't see the point in fiddling > around with the metric units (converting it to 'mm'), but then explicitly > stating them to be in 'cm'. Did you not do this when actually computing the > leadfields? I hope not. > > Best, > Jan-Mathijs > > > > On Oct 22, 2013, at 3:02 PM, < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > > Dear all,**** > ** ** > My data (that are recorded with a neuromag306 system) look vertically > smeared after sourceanalysis (see attached picture). The sources look like > columns. The location (when plotted with method 'surface') looks comparable > to the sensor analysis so I am not worried about that. **** > ** ** > The noise projection (cfg.dics.lambda) is something that I have been > playing around with, but other then 'nai amplitude' de- or increases, this > does not change the sources 'verticallness'. This indicates to me that this > might be the problem... **** > ** ** > I am wondering if any of you has an idea where I should look to find a > solution. **** > ** ** > Further information:**** > ** ** > I am using a mni-normalised headmodel such as described on the site: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but > adapted to the neuromag system (I will make changes to the specific site > :-) ).**** > ** ** > Then compute the fourier, and do sourceanalysis as follows:**** > ** ** > cfg = [];**** > cfg.method = 'dics';**** > cfg.grid = mni_grid;**** > cfg.grid.filter = source.avg.filter; % precomputed filter and > leadfield to project all trials through the same filter**** > cfg.grid.leadfield = source.leadfield;**** > cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is > needed somehow...**** > cfg.vol.unit = 'cm';**** > cfg.frequency = 60;**** > cfg.latency = 3;**** > cfg.dics.projectnoise = 'yes';**** > cfg.dics.lambda = '0.05%';**** > cfg.dics.normalize = 'yes';**** > cfg.keeptrials = 'yes';**** > cfg.rawtrial = 'yes'; % project each single trial through > the filter**** > s = ft_sourceanalysis(cfg, f);**** > ** ** > Thanks in advance for any suggestion!**** > ** ** > Groetjes Hanneke**** > ** ** > ** ** > __________________________________________**** > ** ** > Hanneke van Dijk, PhD**** > > http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html > **** > Institute for Clinical Neuroscience,**** > Heinrich Heine Universität Düsseldorf, Germany**** > Hanneke.vanDijk at med.uni-duesseldorf.de**** > Tel. +49 (0) 211 81 13074 **** > > __________________________________________ > **** > ** ** > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hanneke.p.van.dijk at gmail.com Tue Oct 22 17:08:28 2013 From: hanneke.p.van.dijk at gmail.com (Hanneke van Dijk) Date: Tue, 22 Oct 2013 17:08:28 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Message-ID: Hi Jan-Mathijs, schaam schaam, The unit thing must have been fixed! So problem fixed, thanks so much! Groetjes uit Duesseldorf! Hanneke Groetjes Hanneke On Tue, Oct 22, 2013 at 4:53 PM, Hanneke van Dijk < hanneke.p.van.dijk at gmail.com> wrote: > Hi Jan-Mathijs, > > Thanks for your quick reply. I will go through your comments one by one: > > 1. The plot shows the nai, and in stead of these straight vertical lines > going even into the center of the brain, I expected to see blobs. > 2. In the precomputed filters I have used the same lambda, I should remove > the cfg from this part. I have used cfg.dics.lambda from 0.05 to 50 and as > I said this only changes the 'power' but not the structure of the data. > 3. About the cfg.vol. I have been fidling around with the units for quite > some time, but this is the only way the functional data will not end up the > size of a pea in the anatomical data. I think this has to do with > ctf/neuromag/spm coordinate system differences that are not yet fixed in > FieldTrip? > > But it seems that there is no obvious thing that could be happening then? > > Groetjes Hanneke > > > > > > > On Tue, Oct 22, 2013 at 3:13 PM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Hanneke, >> >> I don't know what you expect to see, but to me it is not clear what >> quantity you are visualizing here (given the units). >> Also, note that when you put precomputed spatial filters in the cfg, the >> lambda specified for the second round of ft_sourceanalysis is not going to >> change the spatial structure of the result, because the spatial filters are >> fixed. Also, note that specifying '0.05%' leads to a very tiny >> regularization. I think that you wanted to specify '5%', which translates >> to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol >> will not be used in the second round of ft_sourceanalysis (nor in the first >> one if you used precomputed leadfields) I don't see the point in fiddling >> around with the metric units (converting it to 'mm'), but then explicitly >> stating them to be in 'cm'. Did you not do this when actually computing the >> leadfields? I hope not. >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 22, 2013, at 3:02 PM, < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >> Dear all,**** >> ** ** >> My data (that are recorded with a neuromag306 system) look vertically >> smeared after sourceanalysis (see attached picture). The sources look like >> columns. The location (when plotted with method 'surface') looks comparable >> to the sensor analysis so I am not worried about that. **** >> ** ** >> The noise projection (cfg.dics.lambda) is something that I have been >> playing around with, but other then 'nai amplitude' de- or increases, this >> does not change the sources 'verticallness'. This indicates to me that this >> might be the problem... **** >> ** ** >> I am wondering if any of you has an idea where I should look to find a >> solution. **** >> ** ** >> Further information:**** >> ** ** >> I am using a mni-normalised headmodel such as described on the site: >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but >> adapted to the neuromag system (I will make changes to the specific site >> :-) ).**** >> ** ** >> Then compute the fourier, and do sourceanalysis as follows:**** >> ** ** >> cfg = [];**** >> cfg.method = 'dics';**** >> cfg.grid = mni_grid;**** >> cfg.grid.filter = source.avg.filter; % precomputed filter and >> leadfield to project all trials through the same filter**** >> cfg.grid.leadfield = source.leadfield;**** >> cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is >> needed somehow...**** >> cfg.vol.unit = 'cm';**** >> cfg.frequency = 60;**** >> cfg.latency = 3;**** >> cfg.dics.projectnoise = 'yes';**** >> cfg.dics.lambda = '0.05%';**** >> cfg.dics.normalize = 'yes';**** >> cfg.keeptrials = 'yes';**** >> cfg.rawtrial = 'yes'; % project each single trial through >> the filter**** >> s = ft_sourceanalysis(cfg, f);**** >> ** ** >> Thanks in advance for any suggestion!**** >> ** ** >> Groetjes Hanneke**** >> ** ** >> ** ** >> __________________________________________**** >> ** ** >> Hanneke van Dijk, PhD**** >> >> http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html >> **** >> Institute for Clinical Neuroscience,**** >> Heinrich Heine Universität Düsseldorf, Germany**** >> Hanneke.vanDijk at med.uni-duesseldorf.de**** >> Tel. +49 (0) 211 81 13074 **** >> >> __________________________________________ >> **** >> ** ** >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haristz at gmail.com Wed Oct 23 02:00:01 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Tue, 22 Oct 2013 19:00:01 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS Message-ID: Hi There, I have a question regarding ft_sourceanalysis: I in fact seem to be getting conflicting results depending on the beamformer I use . In summary (and of course, provided I have not made an error somewhere!), for a given frequency band and a predefined filter LCMV seems to output results that look more as if they are based on the covariance matrix estimated on the evoked response (ie not the covariance matrix coming from averaging one way or the other the covariance matrices resulting from individual trials as is the case with the other beamformers). So in its "vanilla" form, when I test it against SAM and DICS, LCMV gives different results. When I comment out the part of the ft_sourceanalysis code that is executed for LCMV when a filter is input with cfg (this seems to be done to speed up the process), then the results are comparable for all 3 beamformers. More in detail (apologies for the rather lenthy post): We are using a motor task and studying beta descynchronisation. The images I link to are "gradnaveraged" relative changes in beta power between a period during baseline and a period during "task" over 10 subjects. I first deform the MNI grid to individual subjects' brains so everything takes place in MNI space.For all 3 beamformers the leadfield and headmodels are calculated in the same way (except for SAM where the singleshell model is unavailable and I used localspheres instead). All this was done with fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in the code for the beamformers or ft_sourceanalysis. We used DICS (centered on an appororiately chosen frequency), SAM and LCMV with the same data and intervals. For the latter 2 I first bandpass filter the data to the beta band during ft_preprocessing. For the DICS analysis I use exactly the same procedure as in the relevant tutorial. For SAM and LCMV I do the same with the minor change that the common filter is calculated over a much larger interval that includes the "baseline" and "task" intervals at its edges, instead of creating a dataset through concatenation of the "baseline" and "task" intervals compared. So code-wise (and per subject), for DICS this is: and then: cfg = []; cfg.frequency = freq_cmb.freq; cfg.grad = senscm; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freq_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; and for SAM and LCMV: cfg=[]; cfg.bpfilter='yes'; cfg.bpfreq =[freq-fsmth freq+fsmth]; cfg.channel=params.chan; datf=ft_preprocessing(cfg,dat); cfg = []; cfg.toilim = tb; dataPre = ft_redefinetrial(cfg, datf); cfg = []; cfg.toilim = ta; dataPost = ft_redefinetrial(cfg, datf); cfg=[]; cfg.toilim = [tb(1,1) ta(1,2)]; data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength = 2; further down but this would change the solution very little clear('dat'); cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); cfg = []; cfg.grad = senscm; cfg.method = 'lcmv';% (or 'sam') cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.lambda ='5%';%relevant code added to beamformer_sam to handle this cfg.keepfilter = 'yes'; cfg.fixedori = 'yes'; cfg.projectnoise='yes'; source = ft_sourceanalysis(cfg, d_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; The results for SAM (https://db.tt/fhvEAJN0) and DICS ( https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense physiologically). LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact similar to what you'd get if using the covariance matrix of the ERP average, ie: data_cmb = ft_timelockanalysis([], data_cmb); dataPre = ft_timelockanalysis([], dataPre); dataPost = ft_timelockanalysis([], dataPost); and then (as above) cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is similar to LCMV above. This is however not what we wanted. Going through the code in ft_sourceanalysis I see there is a part (only for LCMV and when a filter is provided) where the data and covariance matrix are treated differently. I can't say I fully understand the algorithm there but when I commented out that part my LCMV results are in very good agreement with DICS and SAM ( https://db.tt/aNz11ntb). I would as always be grateful for your feedback and opinions. Am I committing an error somewhere? - should the code behave differently there? With Thanks and Best Wishes, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center -------------- next part -------------- An HTML attachment was scrubbed... URL: From haristz at gmail.com Wed Oct 23 03:02:25 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Tue, 22 Oct 2013 20:02:25 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: ...sorry, forgot to add to my post that for SAM I use the option cfg.fixedori = 'robert'; Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 22 October 2013 19:00, Charidimos Tzagarakis wrote: > Hi There, > I have a question regarding ft_sourceanalysis: I in fact seem to be > getting conflicting results depending on the beamformer I use . > > In summary (and of course, provided I have not made an error somewhere!), > for a given frequency band and a predefined filter LCMV seems to output > results that look more as if they are based on the covariance matrix > estimated on the evoked response (ie not the covariance matrix coming from > averaging one way or the other the covariance matrices resulting from > individual trials as is the case with the other beamformers). So in its > "vanilla" form, when I test it against SAM and DICS, LCMV gives different > results. When I comment out the part of the ft_sourceanalysis code that is > executed for LCMV when a filter is input with cfg (this seems to be done to > speed up the process), then the results are comparable for all 3 > beamformers. > > More in detail (apologies for the rather lenthy post): > We are using a motor task and studying beta descynchronisation. The images > I link to are "gradnaveraged" relative changes in beta power between a > period during baseline and a period during "task" over 10 subjects. I first > deform the MNI grid to individual subjects' brains so everything takes > place in MNI space.For all 3 beamformers the leadfield and headmodels are > calculated in the same way (except for SAM where the singleshell model is > unavailable and I used localspheres instead). All this was done with > fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in > the code for the beamformers or ft_sourceanalysis. > > We used DICS (centered on an appororiately chosen frequency), SAM and LCMV > with the same data and intervals. For the latter 2 I first bandpass filter > the data to the beta band during ft_preprocessing. For the DICS analysis I > use exactly the same procedure as in the relevant tutorial. For SAM and > LCMV I do the same with the minor change that the common filter is > calculated over a much larger interval that includes the "baseline" and > "task" intervals at its edges, instead of creating a dataset through > concatenation of the "baseline" and "task" intervals compared. > So code-wise (and per subject), for DICS this is: > > > and then: > > cfg = []; > cfg.frequency = freq_cmb.freq; > cfg.grad = senscm; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf; > cfg.vol = volfcm; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > > source = ft_sourceanalysis(cfg, freq_cmb); > with source_Pre and source_Post calculated with the above cfg *plus* using > the filter estimated at "source". > cfg.grid.filter = source.avg.filter; > > and for SAM and LCMV: > cfg=[]; > > cfg.bpfilter='yes'; > cfg.bpfreq =[freq-fsmth freq+fsmth]; > cfg.channel=params.chan; > datf=ft_preprocessing(cfg,dat); > > > cfg = []; > cfg.toilim = tb; > dataPre = ft_redefinetrial(cfg, datf); > cfg = []; > cfg.toilim = ta; > dataPost = ft_redefinetrial(cfg, datf); > cfg=[]; > cfg.toilim = [tb(1,1) ta(1,2)]; > data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done > data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength > = 2; further down but this would change the solution very little > > clear('dat'); > > > cfg = []; > cfg.covariance = 'yes'; > cfg.channel = params.chan; > cfg.covariancewindow = 'all'; > cfg.removemean='no'; > cfg.keeptrials ='yes'; > %keyboard > d_cmb = ft_timelockanalysis(cfg, data_cmb); > d_Pre = ft_timelockanalysis(cfg, dataPre); > d_Post = ft_timelockanalysis(cfg, dataPost); > > > cfg = []; > cfg.grad = senscm; > cfg.method = 'lcmv';% (or 'sam') > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf; > cfg.vol = volfcm; > cfg.lambda ='5%';%relevant code added to beamformer_sam to handle > this > cfg.keepfilter = 'yes'; > cfg.fixedori = 'yes'; > cfg.projectnoise='yes'; > source = ft_sourceanalysis(cfg, d_cmb); > > with source_Pre and source_Post calculated with the above cfg *plus* using > the filter estimated at "source". > cfg.grid.filter = source.avg.filter; > > > The results for SAM (https://db.tt/fhvEAJN0) and DICS ( > https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense > physiologically). > LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact > similar to what you'd get if using the covariance matrix of the ERP > average, ie: > data_cmb = ft_timelockanalysis([], data_cmb); > dataPre = ft_timelockanalysis([], dataPre); > dataPost = ft_timelockanalysis([], dataPost); > and then (as above) > cfg = []; > cfg.covariance = 'yes'; > cfg.channel = params.chan; > cfg.covariancewindow = 'all'; > cfg.removemean='no'; > cfg.keeptrials ='yes'; > %keyboard > d_cmb = ft_timelockanalysis(cfg, data_cmb); > d_Pre = ft_timelockanalysis(cfg, dataPre); > d_Post = ft_timelockanalysis(cfg, dataPost); > > I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is > similar to LCMV above. > > This is however not what we wanted. Going through the code in > ft_sourceanalysis I see there is a part (only for LCMV and when a filter is > provided) where the data and covariance matrix are treated differently. I > can't say I fully understand the algorithm there but when I commented out > that part my LCMV results are in very good agreement with DICS and SAM ( > https://db.tt/aNz11ntb). > > I would as always be grateful for your feedback and opinions. Am I > committing an error somewhere? - should the code behave differently there? > With Thanks and Best Wishes, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Wed Oct 23 20:21:25 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 23 Oct 2013 12:21:25 -0600 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: <665BB2E0-A03D-4AE2-BF14-0F7F8A422E8E@ucdenver.edu> Haris, It is a lengthy post, so forgive me if I do not understand your question very well. I take it that you are somewhat confused by the LCMV result compared to the SAM and DICS beamformers. I think that you probably have a good grasp of what is happening though. The LCMV beamformer is a time-domain beamformer, not a frequency domain beamformer, and you would normally be using it to produce a source analysis of an averaged evoked field. The SAM and DICS beamformers are both operate in the frequency domain and are likely better able to pick up non-phase-locked, or induced changes, of the type you see associated with motor beta ERD/ERS. It seems to me that it would be possible to force most of these beamformers to produce similar results. The question I have is why? Is there something particular about the LCMV option that you want to use that isn't available with the other two that are producing better results with less tinkering? To me, it seems like the particular question you have lends itself quite well to the DICS or SAM approach, both of which have been used successfully to examine sources for beta ERD prior to movement onset. Since the ERD and ERS related to motor movement is induced (not phase-locked), beamforming the time locked average is not going to be a productive strategy whether or not you calculate the covariance matrix on individual trials or on the average response. In other words, if you average the response in the time-domain rather than the frequency domain, there will be very little power change evident in beta. Best, Don On Oct 22, 2013, at 7:02 PM, Charidimos Tzagarakis > wrote: ...sorry, forgot to add to my post that for SAM I use the option cfg.fixedori = 'robert'; Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 22 October 2013 19:00, Charidimos Tzagarakis > wrote: Hi There, I have a question regarding ft_sourceanalysis: I in fact seem to be getting conflicting results depending on the beamformer I use . In summary (and of course, provided I have not made an error somewhere!), for a given frequency band and a predefined filter LCMV seems to output results that look more as if they are based on the covariance matrix estimated on the evoked response (ie not the covariance matrix coming from averaging one way or the other the covariance matrices resulting from individual trials as is the case with the other beamformers). So in its "vanilla" form, when I test it against SAM and DICS, LCMV gives different results. When I comment out the part of the ft_sourceanalysis code that is executed for LCMV when a filter is input with cfg (this seems to be done to speed up the process), then the results are comparable for all 3 beamformers. More in detail (apologies for the rather lenthy post): We are using a motor task and studying beta descynchronisation. The images I link to are "gradnaveraged" relative changes in beta power between a period during baseline and a period during "task" over 10 subjects. I first deform the MNI grid to individual subjects' brains so everything takes place in MNI space.For all 3 beamformers the leadfield and headmodels are calculated in the same way (except for SAM where the singleshell model is unavailable and I used localspheres instead). All this was done with fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in the code for the beamformers or ft_sourceanalysis. We used DICS (centered on an appororiately chosen frequency), SAM and LCMV with the same data and intervals. For the latter 2 I first bandpass filter the data to the beta band during ft_preprocessing. For the DICS analysis I use exactly the same procedure as in the relevant tutorial. For SAM and LCMV I do the same with the minor change that the common filter is calculated over a much larger interval that includes the "baseline" and "task" intervals at its edges, instead of creating a dataset through concatenation of the "baseline" and "task" intervals compared. So code-wise (and per subject), for DICS this is: and then: cfg = []; cfg.frequency = freq_cmb.freq; cfg.grad = senscm; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freq_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; and for SAM and LCMV: cfg=[]; cfg.bpfilter='yes'; cfg.bpfreq =[freq-fsmth freq+fsmth]; cfg.channel=params.chan; datf=ft_preprocessing(cfg,dat); cfg = []; cfg.toilim = tb; dataPre = ft_redefinetrial(cfg, datf); cfg = []; cfg.toilim = ta; dataPost = ft_redefinetrial(cfg, datf); cfg=[]; cfg.toilim = [tb(1,1) ta(1,2)]; data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength = 2; further down but this would change the solution very little clear('dat'); cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); cfg = []; cfg.grad = senscm; cfg.method = 'lcmv';% (or 'sam') cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.lambda ='5%';%relevant code added to beamformer_sam to handle this cfg.keepfilter = 'yes'; cfg.fixedori = 'yes'; cfg.projectnoise='yes'; source = ft_sourceanalysis(cfg, d_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; The results for SAM (https://db.tt/fhvEAJN0) and DICS (https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense physiologically). LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact similar to what you'd get if using the covariance matrix of the ERP average, ie: data_cmb = ft_timelockanalysis([], data_cmb); dataPre = ft_timelockanalysis([], dataPre); dataPost = ft_timelockanalysis([], dataPost); and then (as above) cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is similar to LCMV above. This is however not what we wanted. Going through the code in ft_sourceanalysis I see there is a part (only for LCMV and when a filter is provided) where the data and covariance matrix are treated differently. I can't say I fully understand the algorithm there but when I commented out that part my LCMV results are in very good agreement with DICS and SAM (https://db.tt/aNz11ntb). I would as always be grateful for your feedback and opinions. Am I committing an error somewhere? - should the code behave differently there? With Thanks and Best Wishes, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center _______________________________________________ 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 Wed Oct 23 20:31:06 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 23 Oct 2013 12:31:06 -0600 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Haris, Sorry - In my last post, I mistakenly put DICS and the Fieldtrip implementation of SAM into the same frequency domain category. In Fieldtrip, SAM is a time-domain technique and is not the same as the implementation of SAM that has been used in the published literature for beta ERD. So, are you then wondering why the two time-domain approaches produce differing results? That probably does depend on how the covariance matrix is calculated. Although I still think it is a bad idea to use a time-domain beamformer on motor beta ERD/ERS. Best, Don From haristz at gmail.com Wed Oct 23 21:43:24 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Wed, 23 Oct 2013 14:43:24 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Don, Thanks for your reply. I do agree that some of these beamformers are probably better suited than others to study beta desynchronisation, or generally questions in the frequency domain. I in fact started from DICS. The reason I looked at LCMV and SAM is to be sure that I get consistent results (and also because my experiment can also address some additional time domain questions, so I wanted to see what happens when my data goes from one to the other). I therefore tried to set them up so I that the results from all 3 are similar. So you are correct in pointing out that my question is why SAM and LCMV produce different results. Based on their description within the fieldtrip website and mailing list (if I have interpreted these correctly) they should be treating the covariance matrix in the same way (to get a true evoked response covariance matrix you would normally need the extra call to ft_timelockanalysis that I show at the last piece of code in my post). Also , if the covariance matrix is indeed the issue, it seems that the change in how it is treated in the ft_sourceanalysis code (based on the "hack" I described) is unique to LCMV (none of the other beamformer options share that piece of code) and is active only when LCMV is given a precomputed filter which is (I think) unusual. Hence my question! Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 23 October 2013 13:31, Rojas, Don wrote: > Haris, > > Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > implementation of SAM into the same frequency domain category. In > Fieldtrip, SAM is a time-domain technique and is not the same as the > implementation of SAM that has been used in the published literature for > beta ERD. So, are you then wondering why the two time-domain approaches > produce differing results? That probably does depend on how the covariance > matrix is calculated. Although I still think it is a bad idea to use a > time-domain beamformer on motor beta ERD/ERS. > > Best, > > Don > > > > _______________________________________________ > 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 Thu Oct 24 10:08:44 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 24 Oct 2013 10:08:44 +0200 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Charidimos, Thanks for your elaborate e-mail. We discussed this issue in yesterday's FieldTrip meeting. It is very reasonable that you expect the three methods to produce the same results, and the code/interface indeed suggests that this would be the case. In other words, we need to clean up this part of the code to produce consistent results; however, this might take a while. We believe the discrepancy is caused by the fact that you compute the covariance while specifying cfg.keeptrials = 'yes', which is unnecessary while computing the filter. This results in a covariance matrix with dimensions trial X channel X channel, which then is subsequently averaged over trials during ft_sourceanalysis. Likely the filter is still in fact computed on the averaged covariance, as it should be. However, the subsequent projection of data through the filter will not first average the covariance, and will in essence only project the first trial through the filter. (This is because the dip{} fields will be struct arrays of dimension nTrial X 1, and in an assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so everything but the first element of a struct array is ignored in an assignment statement.) Could you try to compute the covariance with cfg.keeptrials = 'no' and then run LCMV again? This will still compute the covariance on the raw traces, not on the average. If our hunch is right, you should get the correct results then. As said, this is indeed messy and unclear, our apologies for that. Finally, could you tell us what part of the code you commented out to make the results consistent? We suspect it will be between lines 790 and 835, but it would be helpful to know for sure. Best, Eelke On 23 October 2013 21:43, Charidimos Tzagarakis wrote: > Hi Don, > Thanks for your reply. I do agree that some of these beamformers > are probably better suited than others to study beta desynchronisation, or > generally questions in the frequency domain. I in fact started from DICS. > The reason I looked at LCMV and SAM is to be sure that I get consistent > results (and also because my experiment can also address some additional > time domain questions, so I wanted to see what happens when my data goes > from one to the other). I therefore tried to set them up so I that the > results from all 3 are similar. So you are correct in pointing out that my > question is why SAM and LCMV produce different results. Based on their > description within the fieldtrip website and mailing list (if I have > interpreted these correctly) they should be treating the covariance matrix > in the same way (to get a true evoked response covariance matrix you would > normally need the extra call to ft_timelockanalysis that I show at the last > piece of code in my post). Also , if the covariance matrix is indeed the > issue, it seems that the change in how it is treated in the > ft_sourceanalysis code (based on the "hack" I described) is unique to LCMV > (none of the other beamformer options share that piece of code) and is > active only when LCMV is given a precomputed filter which is (I think) > unusual. > Hence my question! > Best, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > On 23 October 2013 13:31, Rojas, Don wrote: >> >> Haris, >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip >> implementation of SAM into the same frequency domain category. In Fieldtrip, >> SAM is a time-domain technique and is not the same as the implementation of >> SAM that has been used in the published literature for beta ERD. So, are you >> then wondering why the two time-domain approaches produce differing results? >> That probably does depend on how the covariance matrix is calculated. >> Although I still think it is a bad idea to use a time-domain beamformer on >> motor beta ERD/ERS. >> >> Best, >> >> Don >> >> >> >> _______________________________________________ >> 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 zizlsperger at gmail.com Thu Oct 24 13:32:49 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Thu, 24 Oct 2013 13:32:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Message-ID: <0DEFB7B6-FE48-43EF-88BC-3982D815F4F7@gmail.com> Hello thanks, Stephan and Don, that resolved the issue. Regularisation was good advice, too. Best Leo On Oct 21, 2013, at 5:18 PM, Rojas, Don wrote: > Based on past experience, I'd think that Stephan's suggestion is a good one to resolve the inner matrix dimension agreement error. You may have a pre-prepared leadfield with a different number of channels than the number you supply for the source solution. Check your cfg.elec.label field and see if it is the same length as the 1st dimension of EEG1_HC35_GA_JD_ICA_Coh5cov.avg. You might have left an ECG, EMG or EOG channel in the call to ft_prepare_leadfield. > > On Oct 21, 2013, at 4:31 AM, "smoratti at psi.ucm.es" wrote: > >> Dear Leopold, >> >> First, you have to regularise your MNE solution. Otherwise you get unstable results. >> Second, the error occurs in mom = w*dat; >> I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. >> >> >> ________________________________________________________ >> 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: >> >>> Dear all, >>> no suggestions so far? Am I missing something obvious? >>> In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) >>> Would love to hear your ideas... >>> Best >>> Leo >>> >>> >>> >>> >>> On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: >>> >>>> Hi all, >>>> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >>>> In my example the two datasets have the structure: >>>> >>>> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >>>> avg: [32x7000 double] >>>> var: [32x7000 double] >>>> time: [1x7000 double] >>>> dof: [32x7000 double] >>>> label: {32x1 cell} >>>> trial: [314x32x7000 double] >>>> dimord: 'rpt_chan_time' >>>> trialinfo: [314x32 double] >>>> cfg: [1x1 struct] >>>> >>>> >>>> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >>>> avg: [32x7000 double] >>>> var: [32x7000 double] >>>> time: [1x7000 double] >>>> dof: [32x7000 double] >>>> label: {32x1 cell} >>>> trial: [206x32x7000 double] >>>> dimord: 'rpt_chan_time' >>>> trialinfo: [206x32 double] >>>> cfg: [1x1 struct] >>>> >>>> When I try to do the sourceanalysis by: >>>> >>>> cfg = []; >>>> cfg.method = 'mne'; >>>> cfg.elec = elec_aligned; >>>> cfg.grid = leadfield; >>>> cfg.vol = vol; >>>> cfg.mne.prewhiten = 'yes'; >>>> cfg.mne.lambda = 3; >>>> cfg.mne.scalesourcecov = 'yes'; >>>> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >>>> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >>>> >>>> save source sourceCoh5 sourceCoh70; >>>> >>>> I get the error: >>>> >>>> the input is timelock data with 32 channels and 7000 timebins >>>> using headmodel specified in the configuration >>>> using electrodes specified in the configuration >>>> determining source compartment (3) >>>> projecting electrodes on skin surface >>>> combining electrode transfer and system matrix >>>> creating dipole grid based on user specified dipole positions >>>> using headmodel specified in the configuration >>>> using gradiometers specified in the configuration >>>> 8196 dipoles inside, 0 dipoles outside brain >>>> the call to "ft_prepare_sourcemodel" took 0 seconds >>>> estimating current density distribution for repetition 1 >>>> using pre-computed leadfields: some of the specified options will not have an effect >>>> Warning: computing a unregularised minimum norm solution. This typically does not work >>>> due to numerical accuracy problems >>>> > In minimumnormestimate at 150 >>>> In ft_sourceanalysis at 856 >>>> ??? Error using ==> mtimes >>>> Inner matrix dimensions must agree. >>>> >>>> Error in ==> minimumnormestimate at 226 >>>> mom = w * dat; >>>> >>>> Error in ==> ft_sourceanalysis at 856 >>>> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >>>> >>>> >>>> >>>> Is this due to the different trial numbers of the datasets or does it point to another problem? >>>> Thanks in advance >>>> Best >>>> >>>> Leo >>>> RWTH Aachen Neurology >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> _______________________________________________ >>> 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 vitoria.piai at gmail.com Thu Oct 24 13:40:51 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Thu, 24 Oct 2013 13:40:51 +0200 Subject: [FieldTrip] Rank deficiency in ft_regressconfound: worrisome? Message-ID: <52690743.6000806@gmail.com> Hi all, and maybe more specifically Arjen, I want to compare effects on 3 different tasks on the participant level. So I'm giving ft_regressconfound a try, following the tutorial, 'cause I thought that should improve the comparability of each participant's topographies across tasks. I'm just wondering how much I should worry about the warning of "Rank deficient" when running ft_regressconfound. Any thoughts on it and on what the consequences are of having a rank deficient model for the type of comparison I'm planning to make? Thanks a lot, groetjes, Vitória -- ** Please consider the environment - do you really need to print? ** From haristz at gmail.com Fri Oct 25 01:06:19 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Thu, 24 Oct 2013 18:06:19 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Eelke, Thank you for looking into this! The piece of code I commented out is indeed [790:836] (changing line 784 accordingly or alternatively adding a copy of 785-789 after 790). I did try running ft_timelockanalysis with keeptrials='no' for all 3 calls and that resulted in the same behaviour as before for LCMV (ie not the "correct" one). I also tried it setting keeptrials='no' in ft_sourceanalysis at the same time (ie keeptrials='no' for both ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I actually had run these tests before posting but wanted to 2ble check). I may however be confused here because there are some other possible combinations with keeptrials since for each subject there is a total of 6 calls to functions that accept it as an input and the filter is estimated with only 2 of them. Do let me know if there is another combination I should run and I will do that. Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 24 October 2013 03:08, Eelke Spaak wrote: > Hi Charidimos, > > Thanks for your elaborate e-mail. We discussed this issue in > yesterday's FieldTrip meeting. It is very reasonable that you expect > the three methods to produce the same results, and the code/interface > indeed suggests that this would be the case. In other words, we need > to clean up this part of the code to produce consistent results; > however, this might take a while. > > We believe the discrepancy is caused by the fact that you compute the > covariance while specifying cfg.keeptrials = 'yes', which is > unnecessary while computing the filter. This results in a covariance > matrix with dimensions trial X channel X channel, which then is > subsequently averaged over trials during ft_sourceanalysis. Likely the > filter is still in fact computed on the averaged covariance, as it > should be. However, the subsequent projection of data through the > filter will not first average the covariance, and will in essence only > project the first trial through the filter. (This is because the dip{} > fields will be struct arrays of dimension nTrial X 1, and in an > assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so > everything but the first element of a struct array is ignored in an > assignment statement.) > > Could you try to compute the covariance with cfg.keeptrials = 'no' and > then run LCMV again? This will still compute the covariance on the raw > traces, not on the average. If our hunch is right, you should get the > correct results then. > > As said, this is indeed messy and unclear, our apologies for that. > > Finally, could you tell us what part of the code you commented out to > make the results consistent? We suspect it will be between lines 790 > and 835, but it would be helpful to know for sure. > > Best, > Eelke > > > On 23 October 2013 21:43, Charidimos Tzagarakis wrote: > > Hi Don, > > Thanks for your reply. I do agree that some of these beamformers > > are probably better suited than others to study beta desynchronisation, > or > > generally questions in the frequency domain. I in fact started from DICS. > > The reason I looked at LCMV and SAM is to be sure that I get consistent > > results (and also because my experiment can also address some additional > > time domain questions, so I wanted to see what happens when my data goes > > from one to the other). I therefore tried to set them up so I that the > > results from all 3 are similar. So you are correct in pointing out that > my > > question is why SAM and LCMV produce different results. Based on their > > description within the fieldtrip website and mailing list (if I have > > interpreted these correctly) they should be treating the covariance > matrix > > in the same way (to get a true evoked response covariance matrix you > would > > normally need the extra call to ft_timelockanalysis that I show at the > last > > piece of code in my post). Also , if the covariance matrix is indeed the > > issue, it seems that the change in how it is treated in the > > ft_sourceanalysis code (based on the "hack" I described) is unique to > LCMV > > (none of the other beamformer options share that piece of code) and is > > active only when LCMV is given a precomputed filter which is (I think) > > unusual. > > Hence my question! > > Best, > > Haris > > > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > > > > > On 23 October 2013 13:31, Rojas, Don wrote: > >> > >> Haris, > >> > >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > >> implementation of SAM into the same frequency domain category. In > Fieldtrip, > >> SAM is a time-domain technique and is not the same as the > implementation of > >> SAM that has been used in the published literature for beta ERD. So, > are you > >> then wondering why the two time-domain approaches produce differing > results? > >> That probably does depend on how the covariance matrix is calculated. > >> Although I still think it is a bad idea to use a time-domain beamformer > on > >> motor beta ERD/ERS. > >> > >> Best, > >> > >> Don > >> > >> > >> > >> _______________________________________________ > >> 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 c.kung at donders.ru.nl Fri Oct 25 16:18:30 2013 From: c.kung at donders.ru.nl (Carmen Kung) Date: Fri, 25 Oct 2013 16:18:30 +0200 Subject: [FieldTrip] Reject components on unfiltered data Message-ID: <526A7DB6.2080405@donders.ru.nl> Dear all, I wonder if it is possible to first filter the data with a bandpass filter between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the ICA on filtered data to look for the components containing artefacts, then use the projection to reject the components in the original (unfiltered) data. Thank you very much in advance, Carmen -- Carmen Kung Donders Institute for Brain, Cognition, and Behaviour Radboud University Nijmegen P. O. Box 9104, 6500 HE Nijmegen, The Netherlands Tel: +31 24 36 12634 From eelke.spaak at donders.ru.nl Fri Oct 25 16:31:42 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 25 Oct 2013 16:31:42 +0200 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: <526A7DB6.2080405@donders.ru.nl> References: <526A7DB6.2080405@donders.ru.nl> Message-ID: Dear Carmen, Yes, that is possible; if you specify your original unfiltered data as the third input argument to ft_rejectcomponent this data will be projected through the unmixing matrix (and remixed after component rejection). Is that detailed enough to help you? Best, Eelke On 25 October 2013 16:18, Carmen Kung wrote: > Dear all, > > I wonder if it is possible to first filter the data with a bandpass filter > between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the > ICA on filtered data to look for the components containing artefacts, then > use the projection to reject the components in the original (unfiltered) > data. > > Thank you very much in advance, > Carmen > > > -- > Carmen Kung > Donders Institute for Brain, Cognition, and Behaviour > Radboud University Nijmegen > P. O. Box 9104, 6500 HE Nijmegen, The Netherlands > Tel: +31 24 36 12634 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Oct 28 11:26:14 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 28 Oct 2013 11:26:14 +0100 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Charidimos, If I understand you correctly, you specified cfg.keeptrials = 'no' in the calls to ft_timelockanalysis prior to the *first* call of ft_sourceanalysis, right? Could you try what happens when you specify it in ft_timelockanalysis prior to the second call to ft_sourceanalysis (so the step where the precomputed filter is applied)? Thanks, Eelke On 25 October 2013 01:06, Charidimos Tzagarakis wrote: > Hi Eelke, > Thank you for looking into this! > The piece of code I commented out is indeed [790:836] (changing line 784 > accordingly or alternatively adding a copy of 785-789 after 790). > I did try running ft_timelockanalysis with keeptrials='no' for all 3 calls > and that resulted in the same behaviour as before for LCMV (ie not the > "correct" one). I also tried it setting keeptrials='no' in > ft_sourceanalysis at the same time (ie keeptrials='no' for both > ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I > actually had run these tests before posting but wanted to 2ble check). > I may however be confused here because there are some other possible > combinations with keeptrials since for each subject there is a total of 6 > calls to functions that accept it as an input and the filter is estimated > with only 2 of them. > Do let me know if there is another combination I should run and I will do > that. > Best, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > On 24 October 2013 03:08, Eelke Spaak wrote: >> >> Hi Charidimos, >> >> Thanks for your elaborate e-mail. We discussed this issue in >> yesterday's FieldTrip meeting. It is very reasonable that you expect >> the three methods to produce the same results, and the code/interface >> indeed suggests that this would be the case. In other words, we need >> to clean up this part of the code to produce consistent results; >> however, this might take a while. >> >> We believe the discrepancy is caused by the fact that you compute the >> covariance while specifying cfg.keeptrials = 'yes', which is >> unnecessary while computing the filter. This results in a covariance >> matrix with dimensions trial X channel X channel, which then is >> subsequently averaged over trials during ft_sourceanalysis. Likely the >> filter is still in fact computed on the averaged covariance, as it >> should be. However, the subsequent projection of data through the >> filter will not first average the covariance, and will in essence only >> project the first trial through the filter. (This is because the dip{} >> fields will be struct arrays of dimension nTrial X 1, and in an >> assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so >> everything but the first element of a struct array is ignored in an >> assignment statement.) >> >> Could you try to compute the covariance with cfg.keeptrials = 'no' and >> then run LCMV again? This will still compute the covariance on the raw >> traces, not on the average. If our hunch is right, you should get the >> correct results then. >> >> As said, this is indeed messy and unclear, our apologies for that. >> >> Finally, could you tell us what part of the code you commented out to >> make the results consistent? We suspect it will be between lines 790 >> and 835, but it would be helpful to know for sure. >> >> Best, >> Eelke >> >> >> On 23 October 2013 21:43, Charidimos Tzagarakis wrote: >> > Hi Don, >> > Thanks for your reply. I do agree that some of these beamformers >> > are probably better suited than others to study beta desynchronisation, >> > or >> > generally questions in the frequency domain. I in fact started from >> > DICS. >> > The reason I looked at LCMV and SAM is to be sure that I get consistent >> > results (and also because my experiment can also address some additional >> > time domain questions, so I wanted to see what happens when my data goes >> > from one to the other). I therefore tried to set them up so I that the >> > results from all 3 are similar. So you are correct in pointing out that >> > my >> > question is why SAM and LCMV produce different results. Based on their >> > description within the fieldtrip website and mailing list (if I have >> > interpreted these correctly) they should be treating the covariance >> > matrix >> > in the same way (to get a true evoked response covariance matrix you >> > would >> > normally need the extra call to ft_timelockanalysis that I show at the >> > last >> > piece of code in my post). Also , if the covariance matrix is indeed the >> > issue, it seems that the change in how it is treated in the >> > ft_sourceanalysis code (based on the "hack" I described) is unique to >> > LCMV >> > (none of the other beamformer options share that piece of code) and is >> > active only when LCMV is given a precomputed filter which is (I think) >> > unusual. >> > Hence my question! >> > Best, >> > Haris >> > >> > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych >> > University of Minnesota Dept of Neuroscience and Brain Sciences Center >> > >> > >> > >> > On 23 October 2013 13:31, Rojas, Don wrote: >> >> >> >> Haris, >> >> >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip >> >> implementation of SAM into the same frequency domain category. In >> >> Fieldtrip, >> >> SAM is a time-domain technique and is not the same as the >> >> implementation of >> >> SAM that has been used in the published literature for beta ERD. So, >> >> are you >> >> then wondering why the two time-domain approaches produce differing >> >> results? >> >> That probably does depend on how the covariance matrix is calculated. >> >> Although I still think it is a bad idea to use a time-domain beamformer >> >> on >> >> motor beta ERD/ERS. >> >> >> >> Best, >> >> >> >> Don >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From c.kung at donders.ru.nl Mon Oct 28 12:39:52 2013 From: c.kung at donders.ru.nl (Carmen Kung) Date: Mon, 28 Oct 2013 12:39:52 +0100 Subject: [FieldTrip] Reject components on unfiltered data Message-ID: <526E4D08.4050600@donders.ru.nl> Hi Eelke, Thanks a lot for the info! That's specific enough. Cheers, Carmen -- Carmen Kung Donders Institute for Brain, Cognition, and Behaviour Radboud University Nijmegen P. O. Box 9104, 6500 HE Nijmegen, The Netherlands Tel: +31 24 36 12634 From tkietzma at uos.de Mon Oct 28 13:28:13 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Mon, 28 Oct 2013 13:28:13 +0100 Subject: [FieldTrip] repeated measures ANOVA (statfun_depsamplesF): dfdenom problems Message-ID: <1CE38208-EFC7-4AB0-A221-B5177D80CCFF@uos.de> Dear fieldtrip discussion list, We have recently run into problems using the implementation of a repeated measures ANOVA in statfun_depsamplesF.m. In our experiment, we have recorded data of 16 subjects, and the factor of the repeated-measures ANOVA has 37 levels (admittedly quite a few but that's just how it is). Now if I am not mistaken, then for a repeated measures ANOVA, the degrees of freedom in above case should be: df1 = 36 and df2 = 540 (this is in line with the results of SPSS, too). However, the statfun_depsamplesF.m function seems to compute dfdenom as nunits - ncontrasts (nunits is the number of subjects, and ncontrasts is nlevels-1). This of course leads to a different value as compared to SPSS and what I found in the literature, in which dfdenom is computed as (K-1)*(n-1), so in the current case as (nunits-1)*ncontrasts. For a one-factor repeated measures ANOVA, I could so far not find a principled reason why the number of levels should not exceed the number of subjects (which is the error message we get). In fact, SPSS works just fine in above scenario. Could someone please explain the logic behind the dfdenom computation in fieldtrip? Could it be that there is an error in how the degrees of freedom are computed, or am I missing something obvious here? For a MANOVA, the story would be different of course. I should add that we are currently interfacing fieldtrip from eeglab and get above error only if we choose the nonparametric fieldtrip statistics (with cluster correction), but the parametric tests implemented in eeglab work just fine. Thank you very much for your help, I am looking forward to your responses Tim From rajatthomas at gmail.com Mon Oct 28 14:39:23 2013 From: rajatthomas at gmail.com (Rajat Thomas) Date: Mon, 28 Oct 2013 14:39:23 +0100 Subject: [FieldTrip] Channel layout FT to EEGLAB Message-ID: Dear all, I made a layout file using the image of the ecog array I had, just like described in the tutorial. I would like to port this to EEGLAB, so that I can use the various ICA options to plot the components at the channel locations and so on. Could anyone either point me to a file that does this conversion? or Any way of using ICA within fieldtrip to plot the various components on the different channels using the layout file? I know it is used for channel rejection and so on but any help on plotting the components back on the ICA would be appreciated. Thanks a lot in advance. Rajat -- Rajat Mani Thomas Netherlands Institute for Neuroscience Amsterdam, The Netherlands http://www.cita.utoronto.ca/~thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 28 15:05:04 2013 From: mcantor at umich.edu (Max Cantor) Date: Mon, 28 Oct 2013 10:05:04 -0400 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: The fieldtrip tutorial has a section on ICA correction for both EOG and ECG. The ECG tutorial assumes you have an ECG channel, whereas the EOG channel uses ICA to find artifacts within your components, but obviously those can be reversed. http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Hopefully this helps, I can try to help if you have any specific questions since I was just working on this myself, but there may be somebody with greater expertise who can help you. On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like > described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on > the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting > the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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 bibi.raquel at gmail.com Mon Oct 28 15:36:18 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 28 Oct 2013 10:36:18 -0400 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: Hi Rajat, I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. Best, Raquel On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like > described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on > the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting > the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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 bibi.raquel at gmail.com Mon Oct 28 15:40:09 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 28 Oct 2013 10:40:09 -0400 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: <526E4D08.4050600@donders.ru.nl> References: <526E4D08.4050600@donders.ru.nl> Message-ID: Hi Eelke, I often wonder if it is better to filter or not filter prior to ICA. While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? Best, Raquel On Mon, Oct 28, 2013 at 7:39 AM, Carmen Kung wrote: > Hi Eelke, > > Thanks a lot for the info! That's specific enough. > > Cheers, > > Carmen > > -- > Carmen Kung > Donders Institute for Brain, Cognition, and Behaviour > Radboud University Nijmegen > P. O. Box 9104, 6500 HE Nijmegen, The Netherlands > Tel: +31 24 36 12634 > > ______________________________**_________________ > 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 mcantor at umich.edu Mon Oct 28 19:46:16 2013 From: mcantor at umich.edu (Max Cantor) Date: Mon, 28 Oct 2013 14:46:16 -0400 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526E4D08.4050600@donders.ru.nl> Message-ID: I can't speak for everyone, but we are filtering before ICA as of now. By having the data filtered, the components created should be a better representation of the actual effects rather than performing ICA on data not filtered, and thus more efficient. We also perform epoching and baselining, as well as a automatic artifact rejection of jump and muscle artifacts, and one visual artifact rejection check to get rid of any extremely noisy trials or channels. On Mon, Oct 28, 2013 at 10:40 AM, Raquel Bibi wrote: > Hi Eelke, > I often wonder if it is better to filter or not filter prior to ICA. > While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? > > Best, > > Raquel > > > On Mon, Oct 28, 2013 at 7:39 AM, Carmen Kung wrote: > >> Hi Eelke, >> >> Thanks a lot for the info! That's specific enough. >> >> Cheers, >> >> Carmen >> >> -- >> Carmen Kung >> Donders Institute for Brain, Cognition, and Behaviour >> Radboud University Nijmegen >> P. O. Box 9104, 6500 HE Nijmegen, The Netherlands >> Tel: +31 24 36 12634 >> >> ______________________________**_________________ >> 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 haristz at gmail.com Tue Oct 29 00:02:25 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Mon, 28 Oct 2013 18:02:25 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Eelke, I have now run a test which I think does what you describe. cfg.keeptrials='yes' for the calls to ft_timelockanalysis and ft_sourcenalysis that generate the filter. cfg.keeptrials='no' for all the other calls to these 2 functions (those that generate the 2 conditions to be compared). The result is still the same (ie not what I would call the 'correct' one, but rather what seems to be based on an evoked response covariance matrix). I should stress again that how I set keeptrials in ft_timelockanalysis is also how I set it for the "matched" call to ft_sourceanalysis (It didn't seem to me that this matters anyway as unless cfg.rawtrial='yes', ft_sourceanalysis handles both cases so that what is used further down is the same but I may be wrong in this) . Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 28 October 2013 05:26, Eelke Spaak wrote: > Hi Charidimos, > > If I understand you correctly, you specified cfg.keeptrials = 'no' in > the calls to ft_timelockanalysis prior to the *first* call of > ft_sourceanalysis, right? Could you try what happens when you specify > it in ft_timelockanalysis prior to the second call to > ft_sourceanalysis (so the step where the precomputed filter is > applied)? > > Thanks, > Eelke > > On 25 October 2013 01:06, Charidimos Tzagarakis wrote: > > Hi Eelke, > > Thank you for looking into this! > > The piece of code I commented out is indeed [790:836] (changing line 784 > > accordingly or alternatively adding a copy of 785-789 after 790). > > I did try running ft_timelockanalysis with keeptrials='no' for all 3 > calls > > and that resulted in the same behaviour as before for LCMV (ie not the > > "correct" one). I also tried it setting keeptrials='no' in > > ft_sourceanalysis at the same time (ie keeptrials='no' for both > > ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I > > actually had run these tests before posting but wanted to 2ble check). > > I may however be confused here because there are some other possible > > combinations with keeptrials since for each subject there is a total of 6 > > calls to functions that accept it as an input and the filter is estimated > > with only 2 of them. > > Do let me know if there is another combination I should run and I will do > > that. > > Best, > > Haris > > > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > > > On 24 October 2013 03:08, Eelke Spaak wrote: > >> > >> Hi Charidimos, > >> > >> Thanks for your elaborate e-mail. We discussed this issue in > >> yesterday's FieldTrip meeting. It is very reasonable that you expect > >> the three methods to produce the same results, and the code/interface > >> indeed suggests that this would be the case. In other words, we need > >> to clean up this part of the code to produce consistent results; > >> however, this might take a while. > >> > >> We believe the discrepancy is caused by the fact that you compute the > >> covariance while specifying cfg.keeptrials = 'yes', which is > >> unnecessary while computing the filter. This results in a covariance > >> matrix with dimensions trial X channel X channel, which then is > >> subsequently averaged over trials during ft_sourceanalysis. Likely the > >> filter is still in fact computed on the averaged covariance, as it > >> should be. However, the subsequent projection of data through the > >> filter will not first average the covariance, and will in essence only > >> project the first trial through the filter. (This is because the dip{} > >> fields will be struct arrays of dimension nTrial X 1, and in an > >> assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so > >> everything but the first element of a struct array is ignored in an > >> assignment statement.) > >> > >> Could you try to compute the covariance with cfg.keeptrials = 'no' and > >> then run LCMV again? This will still compute the covariance on the raw > >> traces, not on the average. If our hunch is right, you should get the > >> correct results then. > >> > >> As said, this is indeed messy and unclear, our apologies for that. > >> > >> Finally, could you tell us what part of the code you commented out to > >> make the results consistent? We suspect it will be between lines 790 > >> and 835, but it would be helpful to know for sure. > >> > >> Best, > >> Eelke > >> > >> > >> On 23 October 2013 21:43, Charidimos Tzagarakis > wrote: > >> > Hi Don, > >> > Thanks for your reply. I do agree that some of these beamformers > >> > are probably better suited than others to study beta > desynchronisation, > >> > or > >> > generally questions in the frequency domain. I in fact started from > >> > DICS. > >> > The reason I looked at LCMV and SAM is to be sure that I get > consistent > >> > results (and also because my experiment can also address some > additional > >> > time domain questions, so I wanted to see what happens when my data > goes > >> > from one to the other). I therefore tried to set them up so I that the > >> > results from all 3 are similar. So you are correct in pointing out > that > >> > my > >> > question is why SAM and LCMV produce different results. Based on their > >> > description within the fieldtrip website and mailing list (if I have > >> > interpreted these correctly) they should be treating the covariance > >> > matrix > >> > in the same way (to get a true evoked response covariance matrix you > >> > would > >> > normally need the extra call to ft_timelockanalysis that I show at the > >> > last > >> > piece of code in my post). Also , if the covariance matrix is indeed > the > >> > issue, it seems that the change in how it is treated in the > >> > ft_sourceanalysis code (based on the "hack" I described) is unique to > >> > LCMV > >> > (none of the other beamformer options share that piece of code) and is > >> > active only when LCMV is given a precomputed filter which is (I think) > >> > unusual. > >> > Hence my question! > >> > Best, > >> > Haris > >> > > >> > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > >> > University of Minnesota Dept of Neuroscience and Brain Sciences Center > >> > > >> > > >> > > >> > On 23 October 2013 13:31, Rojas, Don wrote: > >> >> > >> >> Haris, > >> >> > >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > >> >> implementation of SAM into the same frequency domain category. In > >> >> Fieldtrip, > >> >> SAM is a time-domain technique and is not the same as the > >> >> implementation of > >> >> SAM that has been used in the published literature for beta ERD. So, > >> >> are you > >> >> then wondering why the two time-domain approaches produce differing > >> >> results? > >> >> That probably does depend on how the covariance matrix is calculated. > >> >> Although I still think it is a bad idea to use a time-domain > beamformer > >> >> on > >> >> motor beta ERD/ERS. > >> >> > >> >> Best, > >> >> > >> >> Don > >> >> > >> >> > >> >> > >> >> _______________________________________________ > >> >> 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 -------------- An HTML attachment was scrubbed... URL: From arno at cerco.ups-tlse.fr Tue Oct 29 01:27:53 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Mon, 28 Oct 2013 17:27:53 -0700 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: Dear Rajat, this old function transforms EEG data contained in the Fieldtrip structure into an EEGLAB structure. After you have done that, to transform a channel location file, simply type in EEG.chanlocs = struct('labels', cfg.elec.label, 'X', mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', mattocell(cfg.elec.pnt(3,:))); EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); This code is untested. You might have to switch X, Y and Z to obtain the correct orientation for the electrode cap. Best, Arno On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > Hi Rajat, > I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. > > Best, > > Raquel > > > On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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: fieldtrip2eeglab.m Type: application/octet-stream Size: 1141 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From zizlsperger at gmail.com Tue Oct 29 10:30:42 2013 From: zizlsperger at gmail.com (Leopold Zizlsperger) Date: Tue, 29 Oct 2013 10:30:42 +0100 Subject: [FieldTrip] visualize source localization data Message-ID: Dear all, I have a question concerning source localization implementation. I need help in the very last step of visualizing a difference between 2 conditions over time: I get there by using the tutorial steps on single subject functional EEG data (*fieldtrip-20130914; *tried both WIN and MAC): *clear all;* *load('F:\fieldtrip-20130914\EEG1_HC35_GA_XY_ICA_rHFdemeanktkt.mat')* *load('F:\fieldtrip-20130914\EEG1_HC35_GA_XY_ICA_lHFdemeanktkt.mat')* *load leadfield;* *load vol;* *load elec_aligned;* * * * * *cfg = [];* * cfg.method = 'mne';* *cfg.elec = elec_aligned;* *cfg.grid = leadfield;* *cfg.vol = vol;* *cfg.mne.prewhiten = 'yes';* *cfg.mne.lambda = 3;* *cfg.mne.scalesourcecov = 'yes';* *cfg.mne.normalize = 'yes';* *sourcerHF = ft_sourceanalysis(cfg, EEG1_HC35_GA_XY_ICA_rHFdemeanktkt);* *sourcelHF = ft_sourceanalysis(cfg, EEG1_HC35_GA_XY_ICA_lHFdemeanktkt);* * * *save source sourcerHF sourcelHF;* * * *clear all;* *load source;* *load sourcespace;* * * *bnd.pnt = sourcespace.pnt;* *bnd.tri = sourcespace.tri;* *m=sourcerHF.avg.pow(:,1200);* *ft_plot_mesh(bnd, 'vertexcolor', m);* * * * * * * *> In ft_defaults at 74* * In ft_sourceanalysis at 146* *the input is timelock data with 32 channels and 7000 timebins* *using headmodel specified in the configuration* *using electrodes specified in the configuration* *determining source compartment (3)* *projecting electrodes on skin surface* *combining electrode transfer and system matrix* *creating dipole grid based on user specified dipole positions* *using headmodel specified in the configuration* *using gradiometers specified in the configuration* *8196 dipoles inside, 0 dipoles outside brain* *the call to "ft_prepare_sourcemodel" took 0 seconds* *estimating current density distribution for repetition 1* *using pre-computed leadfields: some of the specified options will not have an effect* *computing the solution where the noise covariance is used for regularisation* *prewhitening the leadfields using the noise covariance* *scaling the source covariance* *the call to "ft_sourceanalysis" took 10 seconds* *the input is timelock data with 32 channels and 7000 timebins* *using headmodel specified in the configuration* *using electrodes specified in the configuration* *determining source compartment (3)* *projecting electrodes on skin surface* *combining electrode transfer and system matrix* *creating dipole grid based on user specified dipole positions* *using headmodel specified in the configuration* *using gradiometers specified in the configuration* *8196 dipoles inside, 0 dipoles outside brain* *the call to "ft_prepare_sourcemodel" took 0 seconds* *estimating current density distribution for repetition 1* *using pre-computed leadfields: some of the specified options will not have an effect* *computing the solution where the noise covariance is used for regularisation* *prewhitening the leadfields using the noise covariance* *scaling the source covariance* *the call to "ft_sourceanalysis" took 87 seconds* *>> * * * *cfg = [];* *cfg.projectmom = 'yes';* *sdrHF = ft_sourcedescriptives(cfg,sourcerHF);* *sdlHF = ft_sourcedescriptives(cfg, sourcelHF);* * * *sdDIFF = sdrHF;* *sdDIFF.avg.pow = sdrHF.avg.pow - sdlHF.avg.pow;* *sdDIFF.tri = sourcespace.tri;* * * *save sd sdrHF sdlHF sdDIFF;* Then I tried different suggestions from the tutorial or the mailing list: *cfg = [];* *cfg.mask = 'avg.pow';* *ft_sourcemovie(cfg,sdDIFF);* * * *the input is source data with 8196 positions* *baseline correcting dipole moments [--------------------------------------\]* * projecting dipole moment [------------------------------------------------/]* *computing power [---------------------------------------------------------|]* *the call to "ft_sourcedescriptives" took 32 seconds* *the input is source data with 8196 positions* *baseline correcting dipole moments [---------------------------------------]* *projecting dipole moment [------------------------------------------------\]* *computing power [----------------------------------------------------------]* *the call to "ft_sourcedescriptives" took 33 seconds* *the input is source data with 8196 vertex positions and 16384 triangles* *Warning: use cfg.maskparameter instead of cfg.mask * *> In ft_checkconfig at 120* * In ft_sourcemovie at 48* *??? Error using ==> set* *Bad property value found.* *Object Name : axes* *Property Name : 'CLim'* *Values must be increasing and non-NaN.* * * *Error in ==> caxis at 80* * set(ax,'CLim',arg);* * * *Error in ==> ft_sourcemovie at 263* *caxis(cfg.zlim);* If I set a break before this point I can see that "arg" indeed contains two NaNs only. Do you have any suggestions why the script above fails to determine the axes properties? Alternatively I tried: *figure* *sdDIFF.tri = sourcespace.tri;* *cfg = [];* *cfg.alim = [0 0.5];* *cfg.zlim = [0 0.5];* *cfg.maskparameter = 'avg.pow';* *ft_sourcemovie(cfg,sdDIFF);* That results in a GUI that does seem to work but in the time course there is no activity displayed. Any advice how to visualize the difference properly? Thanks in advance. Best Leo RWTH Aachen Neurology P.S. structure of the difference *sdDIFF*: *time: [1x7000 double]* * pos: [8196x3 double]* * inside: [8196x1 double]* * outside: [1x0 double]* * method: 'average'* * avg: [1x1 struct]* * cfg: [1x1 struct]* * tri: [16384x3 int32]* -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Tue Oct 29 13:46:28 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Tue, 29 Oct 2013 13:46:28 +0100 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526E4D08.4050600@donders.ru.nl> Message-ID: <526FAE24.9040605@uni-leipzig.de> On 28/10/2013 15:40, Raquel Bibi wrote: > Hi Eelke, > I often wonder if it is better to filter or not filter prior to ICA. > While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? > > Best, > > Raquel > Hi Raquel, all, I can't speak for the Donders' view, but a high-pass filter (0.5 Hz, typically) before ICA often improves the quality of decompositions, since it improves the stationarity of the data by removing slow drifts. It's fine to then apply the weights from the resulting decomposition to the unfiltered dataset. I'd be cautious about applying too drastic a lowpass filter, as it tends to make the data from the various channels more similar and thus less independent from each other - it sometimes reduces the rank of the data, and ICA can behave a little weirdly with data which isn't full rank. Another handy thing to do is remove the mean of the whole epoch before running the ICA - see this paper from Groppe et al. (2009) http://dx.doi.org/10.1016/j.neuroimage.2008.12.038 Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Neumarkt 9-19, 04109 Leipzig, Germany Phone: +49 341 973 95 44 From anne.klepp at hhu.de Wed Oct 30 11:27:28 2013 From: anne.klepp at hhu.de (Anne Klepp) Date: Wed, 30 Oct 2013 11:27:28 +0100 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526A7DB6.2080405@donders.ru.nl> Message-ID: <5270DF10.1030506@hhu.de> Dear all, I will jump on the bandwagon here to ask what exactly the difference is between using the third input argument or not. With my data, using the data from the step right before ICA (so not actual raw/unfiltered data) as the third argument changes the output data.grad, but also changes the data itself. (This data is from after automatic artifact rejection, preprocessed including lp- and hp-filters, and has some repaired channels. Data is from a Neuromag306, with the gradiometers rejected during preprocessing, so there are 204 MEG channels plus 3 EOG/EMG.) I tried using fastica as well as specifying cfg.runica.pca=100 with runica. 2 components were rejected. To clarify what I mean by my data being changed I attached some files of what data look like in rejectvisual for all channels and in two example channels, for both ICA methods. I'm afraid I don't quite understand the consequences for my data by the information given in the FT help "In that case (3 arguments) componentanalysis will do a subspace projection of the input data onto the space which is spanned by the topographies in the unmixing matrix in comp, after removal of the artifact components. Please use this option of including data as input, if you wish to use the output data.grad in further computation, for example for leadfield computation." I suppose it makes sense data are different after (subspace) back projection, but what are the implications? If I don't want to do sourceanalysis, is there an advantage of sticking with 2 input arguments? I'd be thrilled if someone could offer some insight into this, best, Anne Am 25.10.2013 16:31, schrieb Eelke Spaak: > Dear Carmen, > > Yes, that is possible; if you specify your original unfiltered data as > the third input argument to ft_rejectcomponent this data will be > projected through the unmixing matrix (and remixed after component > rejection). > > Is that detailed enough to help you? > > Best, > Eelke > > On 25 October 2013 16:18, Carmen Kung wrote: >> Dear all, >> >> I wonder if it is possible to first filter the data with a bandpass filter >> between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the >> ICA on filtered data to look for the components containing artefacts, then >> use the projection to reject the components in the original (unfiltered) >> data. >> >> Thank you very much in advance, >> Carmen >> >> >> -- >> Carmen Kung >> Donders Institute for Brain, Cognition, and Behaviour >> Radboud University Nijmegen >> P. O. Box 9104, 6500 HE Nijmegen, The Netherlands >> Tel: +31 24 36 12634 >> >> _______________________________________________ >> 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 -- Anne Klepp (M.Sc. Psychologie) Institute of Clinical Neuroscience and Medical Psychology Heinrich-Heine-University Düsseldorf Universitätsstraße 1 40225 Düsseldorf, Germany Email: anne.klepp at hhu.de -------------- next part -------------- A non-text attachment was scrubbed... Name: ICA_data_2or3args.7z Type: application/octet-stream Size: 378658 bytes Desc: not available URL: From michielb at tcd.ie Wed Oct 30 13:22:56 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 30 Oct 2013 12:22:56 +0000 Subject: [FieldTrip] connectivity analysis Message-ID: Hi, I have 30 patients and 30 controls and I'm investigating their coherence (EEG, 128 electrodes). Every patient has ~30 trials resting state eyes open consisting of 7 frequency bins with 7 frequencies in each bin. My goal is to show connectivity differences between different brain regions in the control and patient group (doing electrode-level analysis now, source-level analysis is next step). - Is it more appropriate to keep the averaging step as the latest step (ie. calculate all coherence for all the different subjects, for all trials, for all different frequencies in frequency bins) or is it better to do the averaging asap (ie. average all frequencies in 1 frequency bin at the time-frequency analysis step, average all trials at the ft_freqdescriptives step, ...) - Is there any better way to do some statistics on the 128x128x7x7 (128 electrodes, 7 frequency bins, 7 frequencies in each bin) besides using the ttest2() matlab function? Any tips & tricks are more then welcome! Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.vanlier at bsse.ethz.ch Wed Oct 30 16:01:17 2013 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Wed, 30 Oct 2013 15:01:17 +0000 Subject: [FieldTrip] maximum statistic in cluster correction Message-ID: Hi all, I am trying to understand how the permutation test and cluster correction work. the Maris 2007 and 2012 papers along with the tutorials on the fieldtrip site helped a lot. However, i cant seem to grasp the idea behind the max stat very well. let me summarize how i think i understand things so far so you can see where i go wrong. Per channel per trial (a sample), we calculate the t statistic between conditions. This is the observed statistic. Next, we collect all the trials (or samples?) from both conditions and put them into 1 set. We randomly draw trials from this set and put them into subsets of the same size as the original condition sets, this is called a random partition. A t statistic is calculated on the difference between the two subsets. This process is repeated a large number of times and the results are put in a histogram. The histogram is called the permutation distribution. Find the proportion of random partitions that show a smaller t statistic than the observed t statistic. This is the monte carlo estimate. For example, if 97% of your draws from the permutation distribution show a smaller t statistic then the one you originally observed, you have a monte carlo p value of 0.03. Cluster based correction means that you take all the samples that show a t value that exceeds a certain threshold (ie the significant differences) and cluster them on the basis of temporal (and spatial) adjacency. The idea is that samples that are close together (in space or in time) show a similar effect. The next step is to sum the t values within each cluster and find the cluster with the largest sum (the maximum statistic). Here is where i don't understand the next step. You take the permutation distribution of the cluster with the maximum statistic? This means basically that you redo the permutation test but this time only with trials that fall within that cluster? Summing the t values from each partition would then give the permutation distribution of your max stat cluster. If you have other clusters, you plug their summed t value into that permutation distribution and compare the p value with your alpha value to see if they are significant as well. But if you do that for say 20 clusters you're still not controlling the FA rate? I'm at the point where the more i think about it the less things make sense, so i must be missing something upstream...? Best, Ben From ktyler at swin.edu.au Thu Oct 31 00:44:04 2013 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 30 Oct 2013 23:44:04 +0000 Subject: [FieldTrip] event related fields from source space Message-ID: FieldTripers, I am wanting to reconstruct event related fields from source space and have been beamforming with ft_sourceanalysis using cfg.method='lcmv'. I have not been able to find any clear instructors on this, but can any one tell me, does ft_sourceanalysis output 'data.avg.mom' contain the averaged ERPs reconstructed in source space? data.avg.mom appears to be a column of cells, one cell for each point in my 3d grid, with each cell containing 3 time series (ERFs), one for each 3d orientation??, x, y, z? Can any one tell me if this is indeed what I am looking at in data.avg.mom? Regards, Kaelasha Tyler PhD candidate Swinbunre University of Technology Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Oct 31 01:35:55 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 30 Oct 2013 18:35:55 -0600 Subject: [FieldTrip] event related fields from source space In-Reply-To: References: Message-ID: <72ECAF5C-D649-4C69-9AAA-A199E9F36452@ucdenver.edu> Kaelasha, That is exactly what you are looking at for data.avg.mom (x y and z dipole moments for your vector beamformer solution, for each grid point in your 3d source space). Best, Don ----------------------- Don Rojas, Ph.D. Associate Professor of Psychiatry U. of Colorado Denver Anschutz Medical Campus Director, UCD Magnetoencephalography Lab On Oct 30, 2013, at 5:44 PM, Kaelasha Tyler > wrote: FieldTripers, I am wanting to reconstruct event related fields from source space and have been beamforming with ft_sourceanalysis using cfg.method='lcmv'. I have not been able to find any clear instructors on this, but can any one tell me, does ft_sourceanalysis output 'data.avg.mom' contain the averaged ERPs reconstructed in source space? data.avg.mom appears to be a column of cells, one cell for each point in my 3d grid, with each cell containing 3 time series (ERFs), one for each 3d orientation??, x, y, z? Can any one tell me if this is indeed what I am looking at in data.avg.mom? Regards, Kaelasha Tyler PhD candidate Swinbunre University of Technology Australia _______________________________________________ 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 Oct 31 16:31:04 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Thu, 31 Oct 2013 16:31:04 +0100 (CET) Subject: [FieldTrip] maximum statistic in cluster correction In-Reply-To: References: Message-ID: <02b801ced64e$3615e200$a241a600$@maris@psych.ru.nl> Hi Ben, > I am trying to understand how the permutation test and cluster > correction work. the Maris 2007 and 2012 papers along with the > tutorials on the fieldtrip site helped a lot. However, i cant seem to > grasp the idea behind the max stat very well. let me summarize how i > think i understand things so far so you can see where i go wrong. > > Per channel per trial (a sample), we calculate the t statistic between > conditions. This is the observed statistic. Next, we collect all the > trials (or samples?) from both conditions and put them into 1 set. We > randomly draw trials from this set and put them into subsets of the > same size as the original condition sets, this is called a random > partition. A t statistic is calculated on the difference between the > two subsets. This process is repeated a large number of times and the > results are put in a histogram. The histogram is called the permutation > distribution. > > > Find the proportion of random partitions that show a smaller t > statistic than the observed t statistic. This is the monte carlo > estimate. For example, if 97% of your draws from the permutation > distribution show a smaller t statistic then the one you originally > observed, you have a monte carlo p value of 0.03. > > > Cluster based correction means that you take all the samples that show > a t value that exceeds a certain threshold (ie the significant > differences) and cluster them on the basis of temporal (and spatial) > adjacency. The idea is that samples that are close together (in space > or in time) show a similar effect. The next step is to sum the t values > within each cluster and find the cluster with the largest sum (the > maximum statistic). > > Here is where i don't understand the next step. You take the > permutation distribution of the cluster with the maximum statistic? > This means basically that you redo the permutation test but this time > only with trials that fall within that cluster? No. The relevant distribution is the permutation distribution of the "maximum cluster statistic". Over random permutations, the spatiotemporal extent of the cluster with largest cluster-level statistic varies. However, the only thing that we need is the value (one number) of the maximum cluster statistic. Best, Eric Maris Summing the t values > from each partition would then give the permutation distribution of > your max stat cluster. If you have other clusters, you plug their > summed t value into that permutation distribution and compare the p > value with your alpha value to see if they are significant as well. But > if you do that for say 20 clusters you're still not controlling the FA > rate? I'm at the point where the more i think about it the less things > make sense, so i must be missing something upstream...? > > > Best, > > Ben > From tkietzma at uos.de Thu Oct 31 16:34:10 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Thu, 31 Oct 2013 16:34:10 +0100 Subject: [FieldTrip] repeated measures ANOVA (statfun_depsamplesF): dfdenom problems Message-ID: <008D1219-3AC8-4011-985E-7396B0A9D64C@uos.de> Professor Maris asked me to repost this email to the list, so his response gets archived and accessible to everyone. Best regards and thanks Tim %% Dear fieldtrip discussion list, We have recently run into problems using the implementation of a repeated measures ANOVA in statfun_depsamplesF.m. In our experiment, we have recorded data of 16 subjects, and the factor of the repeated-measures ANOVA has 37 levels (admittedly quite a few but that's just how it is). Now if I am not mistaken, then for a repeated measures ANOVA, the degrees of freedom in above case should be: df1 = 36 and df2 = 540 (this is in line with the results of SPSS, too). However, the statfun_depsamplesF.m function seems to compute dfdenom as nunits - ncontrasts (nunits is the number of subjects, and ncontrasts is nlevels-1). This of course leads to a different value as compared to SPSS and what I found in the literature, in which dfdenom is computed as (K-1)*(n-1), so in the current case as (nunits-1)*ncontrasts. For a one-factor repeated measures ANOVA, I could so far not find a principled reason why the number of levels should not exceed the number of subjects (which is the error message we get). In fact, SPSS works just fine in above scenario. Could someone please explain the logic behind the dfdenom computation in fieldtrip? Could it be that there is an error in how the degrees of freedom are computed, or am I missing something obvious here? For a MANOVA, the story would be different of course. I should add that we are currently interfacing fieldtrip from eeglab and get above error only if we choose the nonparametric fieldtrip statistics (with cluster correction), but the parametric tests implemented in eeglab work just fine. Thank you very much for your help, I am looking forward to your responses Tim From aestnth at hum.au.dk Thu Oct 31 17:16:06 2013 From: aestnth at hum.au.dk (Niels Trusbak Haumann) Date: Thu, 31 Oct 2013 17:16:06 +0100 Subject: [FieldTrip] Reading data and trigger events from Neuromag fif dataset splitted into 2 files Message-ID: Dear FieldTrip community. Is it possible to read the data and trial events from a single continuous Neuromag fif dataset, which was automatically split into two separate fif files during recording, because it exceeeded the standard 2 GB file size limitation? The second of the two splitted fif files contains relevant information showing that the second file continues at the time in seconds at which the first file ended. However, if the two fif files are read separately into Field Trip format this information seems to be lost. FieldTrip seems to support reading in CTF datasets, which have been split into more files due to the 2 GB file size limitation, but I don't know whether there is a method for handling this problem with Neuromag fif data. ( [ http://fieldtrip.fcdonders.nl/getting_started/ctf?s[]=ctf ]http://fieldtrip.fcdonders.nl/getting_started/ctf?s[]=ctf ) I presume that it is a general problem that Neuromag fif datasets with 306 channel data sampled at 1 kHz 32 bit floats are splitted into more files, since only ca. 16-18 minutes raw data can be recorded before it is automatically splitted into two files. The large file size is not a problem after applying MaxFilter procedures to remove high frequency cHPI signals..., etc., and thereafter downsampling e.g. to 16 bit integers sampled at 250 Hz. I see from a previous discussion in another forum that it is not possible to merge (or append) the splitted files with the MaxFilter software. When reading triggers from splitted fif files there is usually one trial, which starts in the end of the first file and ends in the start of the second file, which cannot be correctly recognized, if the files are treated separately. This is however just a minor problem of loosing a single trial. I have a few wrong detections, probably because a few trials are both defined by up-going signals and down-going signals. Would ft_preprocessing (and the sub-routines that it calls) take this into consideration, if you e.g. specificy cfg.detectflank = 'up' ? I'm looking forward to hear any comments, suggestions or solutions. Greetings Niels. Niels Trusbak Haumann M.A. / PhD student Department of Aesthetic Studies / Center of Functionally Integrative Neuroscience Aarhus University / Aarhus University Hospital Denmark E-mail: aestnth at hum.au.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmuehl at gmail.com Thu Oct 31 16:31:30 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Thu, 31 Oct 2013 16:31:30 +0100 Subject: [FieldTrip] Call for Papers for BCI journal special issue on affective brain-computer interfaces Message-ID: -------------------------------------- Call for Papers - Special Issue on Affective Brain-Computer Interfaces (aBCI) Brain-Computer Interfaces Journal -------------------------------------- You are cordially invited to make a contribution to a special issue of Brain-Computer Interfaces (http://tinyurl.com/BCIjournal), entitled “ Affective Brain-Computer Interfaces”. The special issue is a follow-up to the successful 3rd aBCI workshop held at the ACII conference in Geneva, in September 2013 (http://hmi.ewi.utwente.nl/abci2013). But, this Call is open for every researcher working in the field of affective brain-computer interfacing and interested to contribute. Affective BCI aims at the detection of affective states, such as emotions or moods, from neuro-physiological signals. Such systems, allowing users to control computer games by their emotions, 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: encouraging affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. This special issue on aBCI explores the current possibilities and limitations of using neuro-physiological signals as a modality for the recognition of affective/cognitive states, and looks at visions for the use of this information about the user state in applications for domains like health, arts, and entertainment. We are seeking theoretical, methodological, and empirical papers dealing with different topics that include, but are not limited to: - novel methods and protocols for affective/cognitive state induction and data collection for aBCI, addressing challenges such as generalization/specificity of mental state classification; - the detection of affective/cognitive states via neurophysiological activity; - the incorporation of additional modalities, such as physiological sensors, video, or audio, to support the aBCI calibration and validation; - innovative concepts for communication or adaptive interfaces using aBCI. SCHEDULE FOR SUBMISSION - Deadline for Full Paper Submission: November 22, 2013 - Notification of 1st review outcome: December 15, 2013 - First Revision Due: January 15, 2014 - Notification of 2nd review outcome: February 01, 2014 - Camera-ready Papers due: February 15, 2014 - Expected publication: June 2014 Manuscripts should be submitted to abci at ewi.utwente.nl Manuscripts should follow the journal’s guidelines: http://www.tandfonline.com/action/authorSubmission?journalCode=tbci SPECIAL ISSUE GUEST EDITORS Authors are requested to inform the Special Issue Guest Editors about their intention to submit. Please direct any inquiries, including those about the suitability of your possible paper, to the Special-Issue Guest Editors via abci at ewi.utwente.nl : - Brendan Allison, University of California San Diego, USA - Guillaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland - Christian Mühl, INRIA Bordeaux - Sud-Ouest, France - Anton Nijholt, University of Twente, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Tue Oct 1 10:03:40 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 1 Oct 2013 10:03:40 +0200 Subject: [FieldTrip] ICA on elekta data In-Reply-To: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> References: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> Message-ID: <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> Hi Craig, I am CCing the FT mailing list, as there is a lot of expertise there as well (as well as interest in the answer probably). You would for sure combine the gradiometers. They have their signals expressed in the same units (fieldtrength/distance). But you would probably also benefit from including the magnetometers, as they reflect the same sources that linearly mix on the channel level. However, the magnetometers are expressed in another unit (fieldstrength) which results in them being potentially weighted differently. E.g. imagine that you express distance in mm, then the planar signals are 1000 times smaller than if you express distance in meter, whereas the magnetometer signals (the 102 rows of the same data matrix) don't change. If you were to do PCA, it would make a large difference since the channel-level variances are hugely different. But I think that if you do ICA, the "sphering" step that is done prior to the unmixing matrix estimation takes care of the different scaling and it would not matter if you were to to it in meter or milimeter. As I don't have the hands-on experience, it is something I would explicitly check by doing the ICA decomposition twice on differently scaled gradiometer data (keeping the magnetometer rows in the data the same). best regards, Robert On 30 Sep 2013, at 15:33, Richter, Craig wrote: > Hi Robert, > > How would you approach ICA on data from the Elekta system? I have the 102 chips with 1 magnetometer, and two orthogonal planar gradiometers, as you know. It seems to me that the magnetometers should be done separately, but how would you handle the gradiometers? Do these need to be combined? > > I wanted to see how you would proceed. > > Best, > > C. > From mluessi at nmr.mgh.harvard.edu Tue Oct 1 13:43:31 2013 From: mluessi at nmr.mgh.harvard.edu (Martin Luessi) Date: Tue, 01 Oct 2013 07:43:31 -0400 Subject: [FieldTrip] ICA on elekta data In-Reply-To: <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> References: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> Message-ID: <524AB563.1020403@nmr.mgh.harvard.edu> Hi Craig, What you could do to handle the different units is whiten the data using a noise covariance. I.e., you collect empty-room noise, compute a noise covariance "C" and then pre-multiply the data with "C^{-1/2}". This method is used in the MNE software to combine different sensor types (gradiometers, magnetometers, eeg) for ICA, minimum norm solutions etc. The ICA code is here: https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/ica.py The code is in Python, but it should be straight-forward to translate parts to Matlab. If you don't want to implement it yourself, you could also use MNE to clean the raw data, save it back as a raw .fif file and then continue your analysis in FT. There is an example here: http://martinos.org/mne/auto_examples/preprocessing/plot_ica_from_raw.html#example-preprocessing-plot-ica-from-raw-py I hope this helps, Martin PS: Robert, I hope you don't mind that I advertise MNE on this list ;). I felt that it was appropriate since whitening is very useful when working with an Elekta system. On 10/01/13 04:03, Robert Oostenveld wrote: > Hi Craig, > > I am CCing the FT mailing list, as there is a lot of expertise there as well (as well as interest in the answer probably). > > You would for sure combine the gradiometers. They have their signals expressed in the same units (fieldtrength/distance). But you would probably also benefit from including the magnetometers, as they reflect the same sources that linearly mix on the channel level. However, the magnetometers are expressed in another unit (fieldstrength) which results in them being potentially weighted differently. E.g. imagine that you express distance in mm, then the planar signals are 1000 times smaller than if you express distance in meter, whereas the magnetometer signals (the 102 rows of the same data matrix) don't change. > > If you were to do PCA, it would make a large difference since the channel-level variances are hugely different. But I think that if you do ICA, the "sphering" step that is done prior to the unmixing matrix estimation takes care of the different scaling and it would not matter if you were to to it in meter or milimeter. As I don't have the hands-on experience, it is something I would explicitly check by doing the ICA decomposition twice on differently scaled gradiometer data (keeping the magnetometer rows in the data the same). > > best regards, > Robert > > > > > > On 30 Sep 2013, at 15:33, Richter, Craig wrote: > >> Hi Robert, >> >> How would you approach ICA on data from the Elekta system? I have the 102 chips with 1 magnetometer, and two orthogonal planar gradiometers, as you know. It seems to me that the magnetometers should be done separately, but how would you handle the gradiometers? Do these need to be combined? >> >> I wanted to see how you would proceed. >> >> Best, >> >> C. >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Martin Luessi, Ph.D. Research Fellow Department of Radiology Athinoula A. Martinos Center for Biomedical Imaging Massachusetts General Hospital Harvard Medical School 149 13th Street Charlestown, MA 02129 Fax: +1 617 726-7422 The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. From styliadis at hotmail.com Wed Oct 2 12:39:32 2013 From: styliadis at hotmail.com (Haris Styliadis) Date: Wed, 2 Oct 2013 11:39:32 +0100 Subject: [FieldTrip] sloreta gamma band Message-ID: Dear Fieldtripers,Since there is no forum for the software sLORETA (http://www.uzh.ch/keyinst/loreta.htm), I have decided to post here to see if I can get any help.I am currently processing my data on sLORETA and I have noticed that the gamma band is excluded from the 'EEG to CROSS SPECTRA' module. However, there is a prompt for a user defined bands selection. I was not able to figure out if this file should be a text file (most probable) and hoe it should be written. Please help!With kind regards,Haris Styliadis -- Haris StyliadisM.Sc. Telecommunications & Computer Network EngineeringB.Eng. Electronic Engineering with Medical ElectronicsPhD Candidate - Research AssistantDepartment of MedicineSchool of Health SciencesAristotle University of Thessaloniki PO Box 376, 54124, Thessaloniki, Greece -------------- next part -------------- An HTML attachment was scrubbed... URL: From b.osuagwu.1 at research.gla.ac.uk Wed Oct 2 13:44:44 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Wed, 2 Oct 2013 12:44:44 +0100 Subject: [FieldTrip] sloreta gamma band In-Reply-To: References: Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BF3C8A53A@CMS07.campus.gla.ac.uk> Hi Haris see this link below has the answere you are after:Please not that this is a new sloreta forum under construction http://biomedsig.com/forum/viewtopic.php?f=2&t=3#p3 Hope that helps Bethel ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] On Behalf Of Haris Styliadis [styliadis at hotmail.com] Sent: 02 October 2013 11:39 To: fieldtrip at science.ru.nl Cc: Panagiotis Kartsidis Subject: [FieldTrip] sloreta gamma band Dear Fieldtripers, Since there is no forum for the software sLORETA (http://www.uzh.ch/keyinst/loreta.htm), I have decided to post here to see if I can get any help. I am currently processing my data on sLORETA and I have noticed that the gamma band is excluded from the 'EEG to CROSS SPECTRA' module. However, there is a prompt for a user defined bands selection. I was not able to figure out if this file should be a text file (most probable) and hoe it should be written. Please help! With kind regards, Haris Styliadis -- Haris Styliadis M.Sc. Telecommunications & Computer Network Engineering B.Eng. Electronic Engineering with Medical Electronics PhD Candidate - Research Assistant Department of Medicine School of Health Sciences Aristotle University of Thessaloniki PO Box 376, 54124, Thessaloniki, Greece From Lilla.Magyari at mpi.nl Wed Oct 2 15:12:45 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Wed, 2 Oct 2013 15:12:45 +0200 (CEST) Subject: [FieldTrip] EEG Source reconstruction: sourcespace and the volume conductor misaligned In-Reply-To: References: Message-ID: <1365.195.169.109.44.1380719565.squirrel@195.169.109.44> Dear all, I just would like to mention that I also went through again on the MNE tutorial and I managed to reproduce the results. I also had to convert the units of the volume conductor. However, it was not possible to convert the units of the volume conductor directly. I converted the units of the segmentation, and then I created the vol which got the same units as the segmentation. I do not if this is due to a difference between the FieldTrip versions. I was using the latest one. Best, Lilla > Hey Steve, > thanks, you are great, I tried that again and it basically fixed my > problem > (see picture). > For documentation and maybe others to profit from: > Going through the > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate > tutorial I had problems building the volume conduction model which I > solved > by going through the additional tutorial > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > > But after the combination of the matrices and aligning them I got a > considerable sizing problem, see 2nd picture > [[[ mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > > > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > % go to the Subject01/bem directory > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', > 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > > ... > > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight]]] > > So I included Steve's suggestion > > vol = ft_convert_units(vol, 'cm') > > and specified the location of the fiducials again > > [[[ cfg = []; > > > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > > with the preauricular points this time in front of the auditory canals > and it worked out well. > > > Thanks all > > > Leo > > > > > > > On Mon, Sep 30, 2013 at 1:12 PM, Stephen Politzer-Ahles < > politzerahless at gmail.com> wrote: > >> Hi Leo, >> >> If I am remembering correctly, I think the problem could still be >> related >> to ft_convert_units even if the volume conductor and head model look >> like >> they're similar in size. For example, in the images I sent out when I >> was >> having this problem earlier, the volume conductor and hte sourcespace >> are >> the same size but one is tilted more, and the solution was nevertheless >> related to ft_convert_units (I think). In my case, this was because the >> conversion had to happen at a different time than it does in the >> tutorial. >> (I had to insert ft_convert_units somewhere earlier in the pipeline than >> where it was happening in the tutorial.) I'm sorry I can't be more >> specific, but if it will help I could try to look through my old code >> and >> re-figure out what I changed at the time. >> >> Best, >> Steve >> >> >> >> Stephen Politzer-Ahles >> New York University, Abu Dhabi >> Neuroscience of Language Lab >> http://www.nyu.edu/projects/politzer-ahles/ >> >> >> >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Mon, 30 Sep 2013 12:53:06 +0200 >>> From: Leopold Zizlsperger >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] EEG Source reconstruction: sourcespace and >>> >>> the volume conductor misaligned >>> Message-ID: >>> >> WTe+T1PZO0jMb6KUvpHFyi-c0tFuG8Mc0m9um6vVdacA at mail.gmail.com> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> >>> Hello >>> thanks for your answers, in combination with the tutorial they were a >>> big >>> help. >>> I think I got closer but have a last issue: >>> @ Jan-Mathijs: I redid the headmodel and it looks better now as shown >>> on >>> the screenshots attached, thanks >>> @ Lilla and Stephen: the scaling in general should not be the problem I >>> think, the sizes seem to match, thank you >>> While both the volume conduction and the headmodel are expressed in CTF >>> coordinates, see second screenshot vol vs sourcespace, they don't align >>> very well > first screenshot >>> Is there a way to align them manually? Or would it be legitimate to >>> "cheat" >>> with the fiducials of the sourcemodel ? By changing the preauricular >>> points >>> I think I could align them, but I am not sure if that would cuase >>> problems >>> later on... >>> Thanks in advance >>> Leo >>> >>> >>> On Mon, Sep 30, 2013 at 12:43 PM, Leopold Zizlsperger < >>> zizlsperger at gmail.com >>> > wrote: >>> >>> > Hello >>> > thanks for your answers, in combination with the tutorial they were a >>> big >>> > help. >>> > I think I got closer but have a last issue: >>> > @ Jan-Mathijs: I redid the headmodel and it looks better now as shown >>> on >>> > the screenshots attached, thanks >>> > @ Lilla and Stephen: the scaling in general should not be the problem >>> I >>> > think, the sizes seem to match, thank you >>> > While both the volume conduction and the headmodel are expressed in >>> CTF >>> > coordinates, see third screenshot vol vs sourcespace, they don't >>> align >>> very >>> > well > first two screenshots >>> > Is there a way to align them manually? Or would it be legitimate to >>> > "cheat" with the fiducials of the sourcemodel ? By changing the >>> > preauricular points I think I could align them, but I am not sure if >>> that >>> > would cuase problems later on... >>> > Thanks in advance >>> > Leo >>> > >>> > >>> > >>> > On Mon, Sep 30, 2013 at 10:29 AM, jan-mathijs schoffelen < >>> > jan.schoffelen at donders.ru.nl> wrote: >>> > >>> >> Hi Leo, >>> >> >>> >> May I add to Lilla's comments that the reconstructed headmodel looks >>> >> quite bad to me. This suggests that the automatic anatomical >>> segmentation >>> >> did not work well. The most likely cause is that the coordinate >>> system >>> >> which you specified for the anatomical image in the input was >>> incorrect >>> >> (e.g. specifying 'spm', while it should have been 'ctf' or so), or >>> that the >>> >> transformation matrix mapping from voxels to head coordinates was >>> not >>> >> correct. >>> >> >>> >> Best, >>> >> Jan-Mathijs >>> >> >>> >> >>> >> On Sep 30, 2013, at 9:53 AM, lilla.magyari at mpi.nl wrote: >>> >> >>> >> Hello Leo and Stephen, >>> >> >>> >> yes, it is unfortunate, that there is still a problem with the MNE >>> >> tutorial. I think the main problem is the integration of the >>> pipeline >>> with >>> >> Freesurfer which requires a more careful look on the script. >>> >> I could not find the attached image from Leo. If the sourcespace and >>> the >>> >> volume conduction models are not well-aligned because one of them is >>> too >>> >> small compared to the other, then it will probably help if you >>> convert >>> the >>> >> units. >>> >> In Fieldtrip, the handling of the units of the volume conduction >>> model >>> has >>> >> changed, which means that they are not automatically converted to >>> 'cm' >>> >> anymore. >>> >> Lilla >>> >> >>> >> >>> >> Hello Leo, >>> >> >>> >> >>> >> This looks like the same problem I was having a few months ago, and >>> there >>> >> >>> >> should be some messages on the list about it. I am not able to look >>> at >>> my >>> >> >>> >> data and scripts right now, but if I remember correctly (you can >>> check >>> the >>> >> >>> >> lists for more) the problem had to do with the transformation >>> matrix, >>> and >>> >> >>> >> ft_convert_units. In my case, during the "volume conduction model" >>> step of >>> >> >>> >> the tutorial (the last step before you can plot the vol and >>> sourcespace >>> >> >>> >> together), I had to add an extra >>> >> >>> >> >>> >> vol = ft_convert_units(vol, 'cm') >>> >> >>> >> >>> >> before ft_transform_geometry. I don't remember if this alone will >>> solve >>> >> >>> >> the >>> >> >>> >> problem (unfortunately the the situation is kind of complicated >>> right >>> now, >>> >> >>> >> there is also a different version of the minimum norms tutorial that >>> is >>> >> >>> >> still in development--see the previous messages for links--and I >>> think >>> my >>> >> >>> >> processing pipeline ended up being a mixture of the two to get >>> things >>> >> >>> >> working. Which means that it's hard to track where exactly I solved >>> the >>> >> >>> >> problem.) >>> >> >>> >> >>> >> Best, >>> >> >>> >> Steve >>> >> >>> >> >>> >> >>> >> >>> >> Message: 1 >>> >> >>> >> Date: Sat, 28 Sep 2013 15:25:32 +0200 >>> >> >>> >> From: Zizlsperger Leopold >>> >> >>> >> To: >>> >> >>> >> Subject: [FieldTrip] EEG Source reconstruction: sourcespace and the >>> >> >>> >> volume conductor misaligned >>> >> >>> >> Message-ID: <06D14B0C-655A-4EF2-A69A-B735DBDBC504 at gmail.com> >>> >> >>> >> Content-Type: text/plain; charset="iso-8859-1" >>> >> >>> >> >>> >> Hi all, >>> >> >>> >> I am following the instructions in the "Source reconstruction of >>> >> >>> >> event-related fields using minimum-norm estimate" tutorial closely >>> to >>> do >>> >> >>> >> a >>> >> >>> >> source-analysis of EEG data using the example MRI. As I am following >>> the >>> >> >>> >> tutorial almost unchanged I am not including the script here. >>> >> >>> >> >>> >> When I re-align the volume conduction model to the sourcespace they >>> are >>> >> >>> >> not aligned very well, see screenshot attached. I remember a similar >>> >> >>> >> question in the mailing list a while ago but cannot find it... >>> >> >>> >> >>> >> Is there a way to interactively realign volume conduction model and >>> >> >>> >> sourcespace? Re-doing the fiducials did not change the aligment >>> >> >>> >> considerably. Also, my volume conduction model looks weird... >>> >> >>> >> I used ft_determine_coordsys on both the vol and the sourcespace, >>> see >>> >> >>> >> screenshots attached, too. >>> >> >>> >> Would be nice if you could point me in the right direction. >>> >> >>> >> Thanks in advance. >>> >> >>> >> Leo >>> >> >>> >> >>> >> ---- >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> Dr. med. Leopold Zizlsperger >>> >> >>> >> Klinik f?r Neurologie >>> >> >>> >> Uniklinik RWTH Aachen >>> >> >>> >> Pauwelsstrasse 30 >>> >> >>> >> 52074 Aachen >>> >> >>> >> Tel: +49 241 80 35465 >>> >> >>> >> lzizlsperger at ukaachen.de >>> >> >>> >> >>> >> Leopold Zizlsperger, MD >>> >> >>> >> Department of Neurology >>> >> >>> >> RWTH Aachen University >>> >> >>> >> Pauwelsstrasse 30 >>> >> >>> >> 52074 Aachen, Germany >>> >> >>> >> Tel: +49 241 80 35465 >>> >> >>> >> lzizlsperger at ukaachen.de >>> >> >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> An HTML attachment was scrubbed... >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment.html >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: align 2.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 200601 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: align.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 208103 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0001.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: vol.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 148045 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0002.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: sourcespace.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 122200 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0003.png >>> >> >>> >> >>> >> >>> >> ------------------------------ >>> >> >>> >> >>> >> _______________________________________________ >>> >> >>> >> fieldtrip mailing list >>> >> >>> >> fieldtrip at donders.ru.nl >>> >> >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> End of fieldtrip Digest, Vol 34, Issue 28 >>> >> >>> >> ***************************************** >>> >> >>> >> >>> >> _______________________________________________ >>> >> >>> >> 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 >>> >> >>> >> >>> >> Jan-Mathijs Schoffelen, MD PhD >>> >> >>> >> Donders Institute for Brain, Cognition and Behaviour, >>> >> Centre for Cognitive Neuroimaging, >>> >> Radboud University Nijmegen, The Netherlands >>> >> >>> >> Max Planck Institute for Psycholinguistics, >>> >> Nijmegen, The Netherlands >>> >> >>> >> J.Schoffelen at donders.ru.nl >>> >> Telephone: +31-24-3614793 >>> >> >>> >> http://www.hettaligebrein.nl >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> > >>> > >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment.html >>> > >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: source sourcespace mit vol.png >>> Type: image/png >>> Size: 307944 bytes >>> Desc: not available >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment.png >>> > >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: source sourcespace vs vol.png >>> Type: image/png >>> Size: 337423 bytes >>> Desc: not available >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment-0001.png >>> > >>> >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> End of fieldtrip Digest, Vol 34, Issue 31 >>> ***************************************** >>> >> >> >> _______________________________________________ >> 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 Keith.McConnell at cchmc.org Wed Oct 2 18:46:17 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Wed, 2 Oct 2013 16:46:17 +0000 Subject: [FieldTrip] ft_rejectartifact Message-ID: Hello, I have an experiment for which I have an extended stimulus for a very few number of trials (20). I would like to build a for loop to create TF plots for each trial individually. There are jump artifacts in the data. When a trial is rejected due to jump artifact my loop crashes: Error using ft_rejectartifact (line 491) No trials left after artifact rejection. I would like to create an if/then statement that will identify that the individual trial was rejected and return to running the for loop. I cannot find the flag that is generated that tells me that there are no trials left. Can someone help? Thanks, Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Thu Oct 3 11:24:08 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 3 Oct 2013 11:24:08 +0200 (CEST) Subject: [FieldTrip] ft_rejectartifact In-Reply-To: Message-ID: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> Dear Keith, What ft_rejectartifact does when rejecting trials completely is check the cfg.trl matrix (which contains the first, last, and offset sample with respect to the original data) for occurences of the artifact that you want to reject. If an artifact is present, it removes the line from this matrix. Then the artifact free data is read-in from disk or from memory. Basically line 491 checks whether cfg.trl is empty as that would indicate that no trials are left after rejection. Am I correct in assuming you are running ft_rejectartifact on each trial separately? If so, you could also run it on the entire dataset before going through your loop with the option cfg.artfctdef.feedback = 'yes'; .Doing this will remove the trials containing jump artifacts while preserving the other trials and it will give you feedback on which trials were removed. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "Keith McConnell" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 2 oktober 2013 18:46:17 > Onderwerp: [FieldTrip] ft_rejectartifact > Hello, > I have an experiment for which I have an extended stimulus for a very > few number of trials (20). I would like to build a for loop to create > TF plots for each trial individually. > There are jump artifacts in the data. > When a trial is rejected due to jump artifact my loop crashes: > Error using ft_rejectartifact (line 491) > No trials left after artifact rejection. > I would like to create an if/then statement that will identify that > the individual trial was rejected and return to running the for loop. > I cannot find the flag that is generated that tells me that there are > no trials left. > Can someone help? > Thanks, > Keith > Keith McConnell, M.S. > 513.636.0739 (desk) > 513.504.9907 (cell) > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Thu Oct 3 13:24:05 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Thu, 3 Oct 2013 11:24:05 +0000 Subject: [FieldTrip] ft_rejectartifact In-Reply-To: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> References: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> Message-ID: Thanks Jim. You're correct, I was trying to run ft_rejectartifact on each trial individually. Your strategy seems like a much more workable solution. Thanks. Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Thursday, October 03, 2013 5:24 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_rejectartifact Dear Keith, What ft_rejectartifact does when rejecting trials completely is check the cfg.trl matrix (which contains the first, last, and offset sample with respect to the original data) for occurences of the artifact that you want to reject. If an artifact is present, it removes the line from this matrix. Then the artifact free data is read-in from disk or from memory. Basically line 491 checks whether cfg.trl is empty as that would indicate that no trials are left after rejection. Am I correct in assuming you are running ft_rejectartifact on each trial separately? If so, you could also run it on the entire dataset before going through your loop with the option cfg.artfctdef.feedback = 'yes'; .Doing this will remove the trials containing jump artifacts while preserving the other trials and it will give you feedback on which trials were removed. Best, Jim ________________________________ Van: "Keith McConnell" > Aan: fieldtrip at science.ru.nl Verzonden: Woensdag 2 oktober 2013 18:46:17 Onderwerp: [FieldTrip] ft_rejectartifact Hello, I have an experiment for which I have an extended stimulus for a very few number of trials (20). I would like to build a for loop to create TF plots for each trial individually. There are jump artifacts in the data. When a trial is rejected due to jump artifact my loop crashes: Error using ft_rejectartifact (line 491) No trials left after artifact rejection. I would like to create an if/then statement that will identify that the individual trial was rejected and return to running the for loop. I cannot find the flag that is generated that tells me that there are no trials left. Can someone help? Thanks, Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From vnune at hunter.cuny.edu Thu Oct 3 16:22:53 2013 From: vnune at hunter.cuny.edu (Valerie Nunez) Date: Thu, 3 Oct 2013 10:22:53 -0400 (EDT) Subject: [FieldTrip] Cluster-level permutation test statistics Message-ID: <201310031422.041560@msa1.hunter.cuny.edu> Hello, I'm a little confused about the notion of unit of observation (UO) as subject or trial in the cluster_permutation_timelock tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock Specifically, I don't quite understand how the example of congruent and incongruent trials for a single subject is considered a between-trials design and therefore uses an independent t-test. If two trials have taken place for one subject, why isn't this considered a within-subject design, thereby requiring a dependent-samples t-test? What am I missing? Thanks, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Oct 3 16:39:14 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 3 Oct 2013 16:39:14 +0200 Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: <201310031422.041560@msa1.hunter.cuny.edu> References: <201310031422.041560@msa1.hunter.cuny.edu> Message-ID: Hi Valerie, The crucial thing to note here is that it does not make sense to pair any individual trial in condition A with another individual trial in condition B. There are no pairs, the design is between-units-of-observation, thus a two-sample (= independent) t-test is used. Note furthermore that when doing this test you are testing a hypothesis about a population of trials, and not about a population of people. If you want to test a hypothesis about a population of people, you would typically compute some average value for condition A and condition B for each subject, and then do a test over subjects. Note that here you would do a paired-sample (= dependent) t-test, since now it does make sense to pair each value in condition A with another value in condition B (namely, those belonging to the same subject). Now you have one value per condition per subject, and each subject was tested in two conditions. Does this help? Best, Eelke On 3 October 2013 16:22, Valerie Nunez wrote: > Hello, > > I'm a little confused about the notion of unit of observation (UO) as > subject or trial in the cluster_permutation_timelock tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock > > Specifically, I don't quite understand how the example of congruent and > incongruent trials for a single subject is considered a between-trials > design and therefore uses an independent t-test. If two trials have taken > place for one subject, why isn't this considered a within-subject design, > thereby requiring a dependent-samples t-test? > > What am I missing? > > Thanks, > > Valerie > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From vnune at hunter.cuny.edu Thu Oct 3 16:59:04 2013 From: vnune at hunter.cuny.edu (Valerie Nunez) Date: Thu, 3 Oct 2013 10:59:04 -0400 (EDT) Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: References: Message-ID: <201310031459.041567@msa1.hunter.cuny.edu> Hi Eelke, That makes much more sense. Thanks for your help, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Oct 4 06:53:30 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 4 Oct 2013 06:53:30 +0200 (CEST) Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: <201310031422.041560@msa1.hunter.cuny.edu> References: <201310031422.041560@msa1.hunter.cuny.edu> Message-ID: <03d301cec0bd$ae207e00$0a617a00$@maris@psych.ru.nl> Hi Valerie, A dependent samples t-test (also called paired-samples t-tests) involves pairs of observations. If you have 20 trials in one subject, 10 in condition A and 10 in condition B, what would be your pairs (i.e., in which natural way would you construct pairs)? It may good to also read one of our papers before starting with the tutorial. The concept of a UO is not specific to permutation-based statistics, and given that your problem seems to be with this concept, you could try Maris_Psychophysiology_2012, which starts out with classical statistical tests. For cluster-based permutation statistics itself, Maris&Oostenveld_JNM_2007 is the better choice. Best, Eric Maris From: Valerie Nunez [mailto:vnune at hunter.cuny.edu] Sent: donderdag 3 oktober 2013 16:23 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Cluster-level permutation test statistics Hello, I'm a little confused about the notion of unit of observation (UO) as subject or trial in the cluster_permutation_timelock tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock Specifically, I don't quite understand how the example of congruent and incongruent trials for a single subject is considered a between-trials design and therefore uses an independent t-test. If two trials have taken place for one subject, why isn't this considered a within-subject design, thereby requiring a dependent-samples t-test? What am I missing? Thanks, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From chan at med.uni-frankfurt.de Fri Oct 4 15:38:53 2013 From: chan at med.uni-frankfurt.de (Jason Chan) Date: Fri, 4 Oct 2013 15:38:53 +0200 Subject: [FieldTrip] 2IFC baseline-corrected TFR Message-ID: <002001cec107$11240c30$336c2490$@med.uni-frankfurt.de> Dear Fieldtripers, I ran a 2 interval force choice experiment (2-IFC) experiment in the MEG whereby participants indicated in which interval an event occurred. I am trying to do a baseline-corrected TFR analyses on Interval 2. I would like to keep the same baseline window for Interval 2 as Interval 1 (i.e., before Interval 1). I have tried to do this two different ways. 1. When preprocessing, specifying the cfg.baseline to the desired time. However, it appears that this will not append the specified baseline to the 'trial' time. 2. I preprocessed the entire length of the trial (baseline + Interval 1+Interval 2) and ran a TFR . However, trial lengths are obviously different between the two interval. This is a problem when I want to append Interval 1 and 2, based on participants' responses. Is there a way that I can specify a baseline window that is separate from the 'trial' duration? Kind regards, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Sat Oct 5 04:26:17 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Oct 2013 04:26:17 +0200 Subject: [FieldTrip] follow-up on grad fields with NaNs after ICA Message-ID: <524F78C9.4090002@gmail.com> Hi FT-ers, It took me a while to find some older posts that would answer my question, and this thread almost did the whole job: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006779.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006788.html Like Alex, I figured out that it was the ICA that left my grad.chanpos with NaNs only, and like Haiteng, I thought just replacing the grad field with a pre-ICA grad field would be one way to go. But just like Alex I was wondering whether this is the right way to go: "however, it feels somewhat dangerous to perform such "dirty" fixes, since that grad info is probably removed for a certain reason. We are oblivious to its impact subsequent steps like planar transform and source reconstruction." Talking to a knowledgeable colleague yesterday about this issue, he also had his question marks. But I don't see any follow-up on Alex's remark (I guess he further discussed this with colleagues while drinking coffee at the DCCN kitchen...! :-) SS So I still don't know the answer and maybe some other people may want to know it as well in the future. Any opinion on whether it's safe to use pre-ICA grad information for subsequent planar transformation and source analyses? Thanks a lot, Vitória -- ** Please consider the environment - do you really need to print? ** From vitoria.piai at gmail.com Sat Oct 5 15:39:13 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Oct 2013 15:39:13 +0200 Subject: [FieldTrip] follow-up on grad fields with NaNs after ICA In-Reply-To: <6CDC0300-2062-49CB-AAAD-BF28339F1EA1@gmail.com> References: <6CDC0300-2062-49CB-AAAD-BF28339F1EA1@gmail.com> Message-ID: <52501681.9090904@gmail.com> Dear Vitória, The short answer to your question would be: If in subsequent steps you do planar gradient transformation or data visualization it's safe to replace the grad. If in subsequent steps you want to do sourceanalysis, it's not safe to replace the grad. Reason: essential information that is needed for a correct forward computation (i.e. construction of the leadfields) is removed by replacing the grad. This information is represented in grad.tra. The explanation would be a bit technical, and it has been our intention for a while to document this on the FT-wiki as a FAQ, but we didn't get to it yet. For visualization and planar gradient transformation, only the grad.chanpos is needed, and this is correctly represented in an 'earlier-stage' grad-structure. Note that we have made some changes just this past week that actually addresses this NaN-issue. It will not work on backprojected data (i.e. data that has gone through ft_componentanalysis, followed by ft_rejectcomponent), but if you grab the most recent FT version and do ft_rejectcomponent, I believe the grad.chanpos will be reconstructed without NaNs. I haven't tried it myself, but rumour has it that this is the case. Would you be interested in contributing to the documentation, let me know... Best wishes, Jan-Mathijs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% On Oct 5, 2013, at 4:26 AM, Vitória Magalhães Piai wrote: > Hi FT-ers, > > It took me a while to find some older posts that would answer my > question, and this thread almost did the whole job: > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006779.html > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006788.html > > Like Alex, I figured out that it was the ICA that left my grad.chanpos > with NaNs only, and like Haiteng, I thought just replacing the grad > field with a pre-ICA grad field would be one way to go. > But just like Alex I was wondering whether this is the right way to > go: "however, it feels somewhat dangerous to perform such "dirty" > fixes, since that grad info is probably removed for a certain reason. > We are oblivious to its impact subsequent steps like planar transform > and source reconstruction." > Talking to a knowledgeable colleague yesterday about this issue, he > also had his question marks. But I don't see any follow-up on Alex's > remark (I guess he further discussed this with colleagues while > drinking coffee at the DCCN kitchen...! :-) > SS > So I still don't know the answer and maybe some other people may want > to know it as well in the future. > > Any opinion on whether it's safe to use pre-ICA grad information for > subsequent planar transformation and source analyses? > Thanks a lot, Vitória > > -- > ** Please consider the environment - do you really need to print? ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Mon Oct 7 23:54:40 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 00:54:40 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) Message-ID: Hello all, We are having some problems defining atlas-based ROIs using ft_sourcestatistics on two source structures obtained via ft_sourceanalysis (whose grid is later changed according to a precalculated MNI-warped grid). It seems like the function "statistics_wrapper" has changed between "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls "volumelookup" and not "ft_volumelookup", so we get the following error: ??? Undefined function or method 'volumelookup' for input arguments of type 'struct'. Error in ==> statistics_wrapper at 136 tmp = volumelookup(tmpcfg, varargin{1}); Using the older fieldtrip vesion we get this error: ??? Subscript indices must either be real positive integers or logicals. Error in ==> statistics_wrapper at 213 tmp(i,:) = mean(dat(roi,:), 1); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So it seems like we didn't define the ROIs correctly, however we are not sure why. Any suggestions would be greatly appreciated! The relevant pieceof code is attached. Thank you all, Aia and Roey Relevant code ============ % Convert sources units to mm, to fit the atlas's units sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); sourceCondition2 = ft_convert_units(sourceCondition2, ' design = [ ones(1,length(sourceCondition1.trial)), 2*ones(1,length(sourceCondition2.trial)) ]; cfg = []; cfg.dim = sourceCondition1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.01; cfg.tail = 0; cfg.design(1,:) = design; cfg.ivar = 1; % Load the Atlas templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory backslashIndices = find(templateDir=='\'); templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: "Precentral_L", "Precentral_R", etc/ cfg.avgoverroi = 'yes'; cfg.hemisphere = 'both'; cfg.inputcoord = 'mni'; stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 08:25:46 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 09:25:46 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: Message-ID: Hello again, Sorry, it seems like the older version (with ft_volumelookup) is just our mistake. However the problem is still relevant, for the function volumelookup is still undefinded in our case. Hopefully someone might know what we did wrong. Thank you once again! Aia and Roey On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > Hello all, > > We are having some problems defining atlas-based ROIs using > ft_sourcestatistics on two source structures obtained via ft_sourceanalysis > (whose grid is later changed according to a precalculated MNI-warped grid). > > It seems like the function "statistics_wrapper" has changed between > "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls > "volumelookup" and not "ft_volumelookup", so we get the following error: > > ??? Undefined function or method 'volumelookup' for input > arguments of type 'struct'. > > Error in ==> statistics_wrapper at 136 > tmp = volumelookup(tmpcfg, varargin{1}); > > Using the older fieldtrip vesion we get this error: > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > So it seems like we didn't define the ROIs correctly, however we are not > sure why. > > Any suggestions would be greatly appreciated! > The relevant pieceof code is attached. > > Thank you all, > Aia and Roey > > > > Relevant code > ============ > % Convert sources units to mm, to fit the atlas's units > sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); > sourceCondition2 = ft_convert_units(sourceCondition2, ' > design = [ ones(1,length(sourceCondition1.trial)), > 2*ones(1,length(sourceCondition2.trial)) ]; > > cfg = []; > cfg.dim = sourceCondition1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.01; > cfg.tail = 0; > cfg.design(1,:) = design; > cfg.ivar = 1; > > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) > to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; > > > cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: > "Precentral_L", "Precentral_R", etc/ > > cfg.avgoverroi = 'yes'; > cfg.hemisphere = 'both'; > cfg.inputcoord = 'mni'; > > stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Oct 8 08:38:33 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 8 Oct 2013 08:38:33 +0200 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: Message-ID: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Dear Roey and Aia, This indeed was our bad. We have fixed it in the current version of FieldTrip. The version will be available for download tonight (CET), but you can get an instantaneous update of the code repository by doing 'ft_version update' on the Matlab command line. This will update the fieldtrip copy you are using to the latest version. Note that if you want to keep a 'static' version, you need to back up the version with a fixed date, because all changes will be incorporated. A little note to the following piece of code: > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; The same can be achieved with the fullfile function (which deals with platform specific file-separators automatically): templateDir=which('ft_defaults'); cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); Best, Jan-Mathijs On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > Hello again, > > Sorry, it seems like the older version (with ft_volumelookup) is just our mistake. > However the problem is still relevant, for the function volumelookup is still undefinded in our case. > > Hopefully someone might know what we did wrong. > > Thank you once again! > Aia and Roey > > > On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > Hello all, > > We are having some problems defining atlas-based ROIs using ft_sourcestatistics on two source structures obtained via ft_sourceanalysis (whose grid is later changed according to a precalculated MNI-warped grid). > > It seems like the function "statistics_wrapper" has changed between "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls "volumelookup" and not "ft_volumelookup", so we get the following error: > > ??? Undefined function or method 'volumelookup' for input > arguments of type 'struct'. > > Error in ==> statistics_wrapper at 136 > tmp = volumelookup(tmpcfg, varargin{1}); > > Using the older fieldtrip vesion we get this error: > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > So it seems like we didn't define the ROIs correctly, however we are not sure why. > > Any suggestions would be greatly appreciated! > The relevant pieceof code is attached. > > Thank you all, > Aia and Roey > > > > Relevant code > ============ > % Convert sources units to mm, to fit the atlas's units > sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); > sourceCondition2 = ft_convert_units(sourceCondition2, ' > design = [ ones(1,length(sourceCondition1.trial)), 2*ones(1,length(sourceCondition2.trial)) ]; > > cfg = []; > cfg.dim = sourceCondition1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.01; > cfg.tail = 0; > cfg.design(1,:) = design; > cfg.ivar = 1; > > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; > > > cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: "Precentral_L", "Precentral_R", etc/ > > cfg.avgoverroi = 'yes'; > cfg.hemisphere = 'both'; > cfg.inputcoord = 'mni'; > > stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 08:43:14 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 09:43:14 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Thank you so much for your kind and quick answer! We do hope this will fix things up. We will check it asap. Best regards, Aia and Roey On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Roey and Aia, > > This indeed was our bad. We have fixed it in the current version of > FieldTrip. > The version will be available for download tonight (CET), but you can get > an instantaneous update of the code repository by doing 'ft_version update' > on the Matlab command line. > This will update the fieldtrip copy you are using to the latest version. > Note that if you want to keep a 'static' version, you need to back up the > version with a fixed date, because all changes will be incorporated. > > A little note to the following piece of code: > > % Load the Atlas >> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >> to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >> > > The same can be achieved with the fullfile function (which deals with > platform specific file-separators automatically): > > templateDir=which('ft_defaults'); > cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); > > > Best, > Jan-Mathijs > > > > On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > > Hello again, > > Sorry, it seems like the older version (with ft_volumelookup) is just our > mistake. > However the problem is still relevant, for the function volumelookup is > still undefinded in our case. > > Hopefully someone might know what we did wrong. > > Thank you once again! > Aia and Roey > > > On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > >> Hello all, >> >> We are having some problems defining atlas-based ROIs using >> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >> (whose grid is later changed according to a precalculated MNI-warped grid). >> >> It seems like the function "statistics_wrapper" has changed between >> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >> "volumelookup" and not "ft_volumelookup", so we get the following error: >> >> ??? Undefined function or method 'volumelookup' for input >> arguments of type 'struct'. >> >> Error in ==> statistics_wrapper at 136 >> tmp = volumelookup(tmpcfg, varargin{1}); >> >> Using the older fieldtrip vesion we get this error: >> ??? Subscript indices must either be real positive integers or >> logicals. >> >> Error in ==> statistics_wrapper at 213 >> tmp(i,:) = mean(dat(roi,:), 1); >> >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> So it seems like we didn't define the ROIs correctly, however we are not >> sure why. >> >> Any suggestions would be greatly appreciated! >> The relevant pieceof code is attached. >> >> Thank you all, >> Aia and Roey >> >> >> >> Relevant code >> ============ >> % Convert sources units to mm, to fit the atlas's units >> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >> sourceCondition2 = ft_convert_units(sourceCondition2, ' >> design = [ ones(1,length(sourceCondition1.trial)), >> 2*ones(1,length(sourceCondition2.trial)) ]; >> >> cfg = []; >> cfg.dim = sourceCondition1.dim; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'indepsamplesT'; >> cfg.parameter = 'pow'; >> cfg.correctm = 'cluster'; >> cfg.numrandomization = 1000; >> cfg.alpha = 0.01; >> cfg.tail = 0; >> cfg.design(1,:) = design; >> cfg.ivar = 1; >> >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >> to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >> >> >> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >> "Precentral_L", "Precentral_R", etc/ >> >> cfg.avgoverroi = 'yes'; >> cfg.hemisphere = 'both'; >> cfg.inputcoord = 'mni'; >> >> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tahere.toosi at gmail.com Tue Oct 8 08:54:26 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Tue, 8 Oct 2013 10:24:26 +0330 Subject: [FieldTrip] Layout for QuickCap 32 channel (Neuroscan) Message-ID: Hi Filedtripers, I have a problem making the layout file for Neuroscan 32 channel Quick Cap . I read the description on constructing layout for 128 channel Quick cap, but I encountered the same problem that Andre reported before : the electrodes seems to be shifted toward the back of the head. Could you please help me constructing the layout? Attached, please find the .sfp file. Thanks, Tahereh -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: QuickCap_32Custom.sfp Type: application/octet-stream Size: 1152 bytes Desc: not available URL: From MEpstein at NKI.RFMH.ORG Tue Oct 8 17:50:07 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Tue, 8 Oct 2013 15:50:07 +0000 Subject: [FieldTrip] definetrial with ANT .cnt files Message-ID: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> Hi all, I'm having a problem defining triggers using ft_definetrial with ANT .cnt files. Say I want to do a simple epoching around events with a trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get an error saying no trials are defined. However I figured out that if I put in cfg.trialdef.eventvalue =[1 char(0) char(0)]; then it works fine. The trigger files look totally normal, and other programs don't seem to have this issue. Anyone else ever have a problem like this? Thanks, -Michael IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From notthemindprobe at yahoo.com Tue Oct 8 15:01:11 2013 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Tue, 8 Oct 2013 06:01:11 -0700 (PDT) Subject: [FieldTrip] Automatically saving GDF using the realtime buffer Message-ID: <1381237271.38083.YahooMailNeo@web165005.mail.bf1.yahoo.com> Fieldtrip:   Hi, I am a new user of Fieldtrip, but our lab has a (pretty well working) real-time analysis of BioSemi EEG using two computers, matlab, and the FieldTrip buffer.  The buffer is used for communicating data between two machines: machine A collects and saves the data while also writingto the buffer, and machine B uses matlab to read the data off of the buffer (TCP/IP connection) and then run a soft real-time analysis of the EEG data.   Currently we manually start and stop the saving of a GDF file on machine A by hitting the S and D keys.   I would like to automatically start and stop the file saving, and was wondering if anyone had any suggestions?  I read that the OnlineDataManager (which interacts with our biosemi2ft code) handles the saving, and also does listen for ASCII messages on a TCP port for various commands, including "SAVE START/STOP".  Unfortunately, I'm not a programmer, and haven't been able to figure out how to write those commands to the port.  Is there a way to use the ft_write_data (or similar) to do that?  How do you make address the command to the specific port?   Any suggestions would be greatfully received.   Thanks!   Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 23:41:19 2013 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 9 Oct 2013 00:41:19 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: Dear fieldtrippers (Jan-Mathijs included), (This message seems long, but is actually quite simple) Having downloaded the latest fieldtrip version (20131008), we tried rerunning the code and got the following error: ??? Reference to non-existent field 'coordsys'. Error in ==> ft_volumelookup at 206 if strcmp(cfg.inputcoord, 'mni') && strcmp(atlas.coordsys, 'tal') Error in ==> statistics_wrapper at 136 tmp = ft_volumelookup(tmpcfg, varargin{1}); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); Since the spm8 MNI atlas indeed has no "coordsys" field. Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by hand, or by simply deleting that "if" line), we still get one of two errors: * * * * * (1) * * * * * If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the MNI atlas has to offer, we get an indices error: ??? Subscript indices must either be real positive integers or logicals. Error in ==> statistics_wrapper at 213 tmp(i,:) = mean(dat(roi,:), 1); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); * * * * * (2) * * * * * If we define "cfg.roi = AAL_names{1};" for example, we get a different error: ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 187 tmp(cfg.inside) = postailobs; Error in ==> ft_statistics_montecarlo at 326 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 298 [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); And in "cluserstat" appears this comment: "%this snippet is to support correct clustering of N-dimensional data, not fully tested yet". Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the variables vectors "postailobs" and "negtailobs" Any ideas on how to solve this atlas source statistics problem (defining the coordsys field, performing statistics across all ROIs, and using the postailobs/negtailobs vectors) would be greatly appreciated! Good night, Aia and Roey On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Dear Roey and Aia, >> >> This indeed was our bad. We have fixed it in the current version of >> FieldTrip. >> The version will be available for download tonight (CET), but you can get >> an instantaneous update of the code repository by doing 'ft_version update' >> on the Matlab command line. >> This will update the fieldtrip copy you are using to the latest version. >> Note that if you want to keep a 'static' version, you need to back up the >> version with a fixed date, because all changes will be incorporated. >> >> A little note to the following piece of code: >> >> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = []; clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >> >> The same can be achieved with the fullfile function (which deals with >> platform specific file-separators automatically): >> >> templateDir=which('ft_defaults'); >> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >> >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >> >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) is just >> our mistake. >> However the problem is still relevant, for the function volumelookup is >> still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >> >>> Hello all, >>> >>> We are having some problems defining atlas-based ROIs using >>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>> (whose grid is later changed according to a precalculated MNI-warped grid). >>> >>> It seems like the function "statistics_wrapper" has changed between >>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>> >>> ??? Undefined function or method 'volumelookup' for input >>> arguments of type 'struct'. >>> >>> Error in ==> statistics_wrapper at 136 >>> tmp = volumelookup(tmpcfg, varargin{1}); >>> >>> Using the older fieldtrip vesion we get this error: >>> ??? Subscript indices must either be real positive integers or >>> logicals. >>> >>> Error in ==> statistics_wrapper at 213 >>> tmp(i,:) = mean(dat(roi,:), 1); >>> >>> Error in ==> ft_sourcestatistics at 107 >>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> So it seems like we didn't define the ROIs correctly, however we are not >>> sure why. >>> >>> Any suggestions would be greatly appreciated! >>> The relevant pieceof code is attached. >>> >>> Thank you all, >>> Aia and Roey >>> >>> >>> >>> Relevant code >>> ============ >>> % Convert sources units to mm, to fit the atlas's units >>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>> design = [ ones(1,length(sourceCondition1.trial)), >>> 2*ones(1,length(sourceCondition2.trial)) ]; >>> >>> cfg = []; >>> cfg.dim = sourceCondition1.dim; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'indepsamplesT'; >>> cfg.parameter = 'pow'; >>> cfg.correctm = 'cluster'; >>> cfg.numrandomization = 1000; >>> cfg.alpha = 0.01; >>> cfg.tail = 0; >>> cfg.design(1,:) = design; >>> cfg.ivar = 1; >>> >>> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = []; clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >>> >>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>> "Precentral_L", "Precentral_R", etc/ >>> >>> cfg.avgoverroi = 'yes'; >>> cfg.hemisphere = 'both'; >>> cfg.inputcoord = 'mni'; >>> >>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>> >>> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Wed Oct 9 00:13:19 2013 From: octavian.lie at gmail.com (octavian lie) Date: Tue, 8 Oct 2013 17:13:19 -0500 Subject: [FieldTrip] error ft_version Message-ID: Dear All, I was trying to update fieldtrip code, I get the following: ft_version update comparing local and remote (latest) hashes, this might take a minute... the following new files will be added: ! 1. r7274 fileio/ft_read_mri.m 2. r7273 test/test_ft_datatype_sens.m ! 3. r7272 utilities/private/scalingfactor.m ! 4. r7272 forward/private/scalingfactor.m ! 5. r7272 fileio/private/scalingfactor.m ! 6. r7271 private/scalingfactor.m 7. r7271 test/test_bug1916.m ! 8. r7270 utilities/printstruct.m ! 9. r7267 plotting/ft_plot_text.m ! 10. r7264 plotting/private/ft_voltype.m ! 11. r7264 inverse/private/ft_voltype.m ! 12. r7264 fileio/private/ft_voltype.m ! 13. r7263 forward/ft_voltype.m the following files will be updated: 14. r7233-->r7276 ft_freqanalysis.m 15. r7220-->r7275 ft_volumesegment.m 16. r7133-->r7272 plotting/private/scalingfactor.m 17. r7209-->r7268 fileio/ft_read_data.m 18. r7208-->r7268 fileio/ft_chanunit.m 19. r7188-->r7266 ft_prepare_sourcemodel.m 20. r7261-->r7265 utilities/private/ft_postamble_debug.m 21. r7258-->r7263 forward/ft_headmodel_concentricspheres.m 22. r7258-->r7263 forward/ft_headmodel_localspheres.m 23. r7258-->r7263 forward/ft_headmodel_singlesphere.m !!NOTE: if you choose to include changes marked with a leading !, they will overwrite local changes or additions! which changes do you want to include? ([vector] for specific changes, 'all', or [] for none) ? all Undefined function or variable "status". Error in ft_version (line 344) if status && isnumeric(changesToInclude) && all(changesToInclude > 0)... Please advise, Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Oct 9 08:56:36 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 09 Oct 2013 08:56:36 +0200 Subject: [FieldTrip] definetrial with ANT .cnt files In-Reply-To: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> References: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> Message-ID: <5254FE24.8080209@donders.ru.nl> Hi Michael, it might help if you set cfg.trialdef.eventtype = '?' and check what triggervalues and -types FieldTrip actually detects. Maybe the triggers are not saved as numeric values but as characters, thus maybe you need to set eventvalue = '1' instead of =1? FieldTrip can be sensitive to those kind of things. For example, our BVA-files record triggers are stored as 'S 1', and you need to add the two white spaces between the 'S' and the '1' when defining cfg.trialdef.eventvalue, otherwise desired and actual triggervalues do not match. Best, Jörn On 10/8/2013 5:50 PM, Epstein, Michael wrote: > > Hi all, > > I'm having a problem defining triggers using ft_definetrial with ANT > .cnt files. Say I want to do a simple epoching around events with a > trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get > an error saying no trials are defined. However I figured out that if I > put in cfg.trialdef.eventvalue =[1char(0) char(0)]; then it works > fine. The trigger files look totally normal, and other programs don't > seem to have this issue. Anyone else ever have a problem like this? > > Thanks, > > -Michael > > IMPORTANT NOTICE: This e-mail is meant only for the use of the > intended recipient. It may contain confidential information which is > legally privileged or otherwise protected by law. If you received this > e-mail in error or from someone who is not authorized to send it to > you, you are strictly prohibited from reviewing, using, disseminating, > distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF > THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. > Thank you for your cooperation. > > > _______________________________________________ > 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 Wed Oct 9 09:15:54 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 09 Oct 2013 09:15:54 +0200 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: <525502AA.8000501@donders.ru.nl> Hi Roey, habe you tried the atlas that is shipped with FieldTrip? It can be found in fieldtrip/templates/atlas/AAL/ Best, Jörn On 10/8/2013 11:41 PM, Roey Schurr wrote: > Dear fieldtrippers (Jan-Mathijs included), > > (This message seems long, but is actually quite simple) > > Having downloaded the latest fieldtrip version (20131008), we tried > rerunning the code and got the following error: > > ??? Reference to non-existent field 'coordsys'. > > Error in ==> ft_volumelookup at 206 > if strcmp(cfg.inputcoord, 'mni') && > strcmp(atlas.coordsys, 'tal') > > Error in ==> statistics_wrapper at 136 > tmp = ft_volumelookup(tmpcfg, varargin{1}); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > Since the spm8 MNI atlas indeed has no "coordsys" field. > Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " > by hand, or by simply deleting that "if" line), we still get one of > two errors: > > * * * * * (1) * * * * * > If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs > the MNI atlas has to offer, we get an indices error: > > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > * * * * * (2) * * * * * > If we define "cfg.roi = AAL_names{1};" for example, we get a different > error: > > ??? In an assignment A(:) = B, the number of elements in A and > B must be the same. > > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, > statobs,'issource',issource); > > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, > 'issource',issource); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > And in "cluserstat" appears this comment: "%this snippet is to support > correct clustering of N-dimensional data, not fully tested yet". > Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 > to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but > misuses the variables vectors "postailobs" and "negtailobs" > > > Any ideas on how to solve this atlas source statistics problem > (defining the coordsys field, performing statistics across all ROIs, > and using the postailobs/negtailobs vectors) would be greatly appreciated! > > Good night, > Aia and Roey > > > On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr > wrote: > > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen > > wrote: > > Dear Roey and Aia, > > This indeed was our bad. We have fixed it in the current > version of FieldTrip. > The version will be available for download tonight (CET), but > you can get an instantaneous update of the code repository by > doing 'ft_version update' on the Matlab command line. > This will update the fieldtrip copy you are using to the > latest version. Note that if you want to keep a 'static' > version, you need to back up the version with a fixed date, > because all changes will be incorporated. > > A little note to the following piece of code: > >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known >> function (ft_defaults) to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, >> 'template\atlas\aal\ROI_MNI_V4.nii']; >> > > The same can be achieved with the fullfile function (which > deals with platform specific file-separators automatically): > > templateDir=which('ft_defaults'); > cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); > > > Best, > Jan-Mathijs > > > > On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) >> is just our mistake. >> However the problem is still relevant, for the function >> volumelookup is still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr >> > wrote: >> >> Hello all, >> >> We are having some problems defining atlas-based ROIs >> using ft_sourcestatistics on two source structures >> obtained via ft_sourceanalysis (whose grid is later >> changed according to a precalculated MNI-warped grid). >> >> It seems like the function "statistics_wrapper" has >> changed between "fieldtrip-20130822" and >> "fieldtrip-20131007": line 136 now calls "volumelookup" >> and not "ft_volumelookup", so we get the following error: >> >> ??? Undefined function or method 'volumelookup' for >> input >> arguments of type 'struct'. >> >> Error in ==> statistics_wrapper at 136 >> tmp = volumelookup(tmpcfg, varargin{1}); >> >> Using the older fieldtrip vesion we get this error: >> ??? Subscript indices must either be real positive >> integers or >> logicals. >> >> Error in ==> statistics_wrapper at 213 >> tmp(i,:) = mean(dat(roi,:), 1); >> >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> So it seems like we didn't define the ROIs correctly, >> however we are not sure why. >> >> Any suggestions would be greatly appreciated! >> The relevant pieceof code is attached. >> >> Thank you all, >> Aia and Roey >> >> >> >> Relevant code >> ============ >> % Convert sources units to mm, to fit the atlas's units >> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >> sourceCondition2 = ft_convert_units(sourceCondition2, ' >> design = [ ones(1,length(sourceCondition1.trial)), >> 2*ones(1,length(sourceCondition2.trial)) ]; >> >> cfg = []; >> cfg.dim = sourceCondition1.dim; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'indepsamplesT'; >> cfg.parameter = 'pow'; >> cfg.correctm = 'cluster'; >> cfg.numrandomization = 1000; >> cfg.alpha = 0.01; >> cfg.tail = 0; >> cfg.design(1,:) = design; >> cfg.ivar = 1; >> >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known >> function (ft_defaults) to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, >> 'template\atlas\aal\ROI_MNI_V4.nii']; >> >> >> cfg.roi = AAL_names; % This is a cell array of the >> atlas's ROIs: "Precentral_L", "Precentral_R", etc/ >> >> cfg.avgoverroi = 'yes'; >> cfg.hemisphere = 'both'; >> cfg.inputcoord = 'mni'; >> >> stat = ft_sourcestatistics(cfg, sourceCondition1, >> sourceCondition2); >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > 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 m.stoica at uke.de Wed Oct 9 15:59:50 2013 From: m.stoica at uke.de (Stoica, Mircea) Date: Wed, 9 Oct 2013 13:59:50 +0000 Subject: [FieldTrip] Problem reading data at the beginning of the buffer Message-ID: Dear fieldtrip users, my setup consists of a Biosemi amplifier with 32 channels, from which I stream data using the buffer (biosemi2ft.exe). At the full sampling rate of 2048 Hz, the buffer returns error 517 whenever I try reading data older than about 5 minutes. As expected, with lower sampling rates this time grows larger. While I could work around this, by reading smaller chunks of data, it is still quite frustrating and I couldn't find any info on how to fix this. Any suggestions would be highly appreciated. Best, Mircea -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Oct 9 16:41:33 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 9 Oct 2013 16:41:33 +0200 Subject: [FieldTrip] file imports Message-ID: Dear all, I've got a very simple question. How does one import files acquired in SIG/STS file formats and convert them into EDF or EEG files that most software supports? I've downloaded the browser from Stellate, and I can see the data, but I was not able to export the files to any other format. Please help! Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 10 10:43:38 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 10 Oct 2013 10:43:38 +0200 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> Message-ID: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Hi Craig, Let me forward this to the email discussion list. On 9 Oct 2013, at 23:27, CR wrote: > Hi Robert, > I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. > > Method 1: ICA > > I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. so a bit like http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts with the correlation method of http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > Method 2: PCA > > I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. > > Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. Option 1 is better, as it is less aggressive in removing brain components. If speed is a concern, you could do - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data - a combination of the two - try out anothe rica algorithm (fastica versus runica) - try out with the options of the ica algorithm, esp the stopping options - get a faster computer best regards Robert From alik.widge at gmail.com Thu Oct 10 11:50:13 2013 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 10 Oct 2013 05:50:13 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: Thank you for posting this, as I'm in the middle of this same processing step, and I've been pondering methods as well while following the tutorials. (In my case, 60-channel EEG plus one bipolar EOG in a diagonal configuration.) Your response to Craig contains something that's been bugging me a little bit: When doing the ICA on a test recording, I find (and it sounds like he finds as well) that there is not a single component that captures eyeblinks well (and I have tried various adjustments, such as altering number of components via pre-PCA, clipping or not clipping out epochs that look to me to have substantial slow eye-roll, turning runica.extended on/off). I do get components that have the classic "pair of eyeglasses" or "single eyeball" look... but I get four or five of them on a 58-component decomposition, and that's before we talk about the components that are almost pure 60-cycle noise or temporal EMG. You seem to be telling us, in your comment about orthogonality and percentage of variance captured, that this is actually a *good* thing, because it reduces the chance of removing activity from the frontal pole. Can you help me understand that a bit better? I've felt very nervous about the sheer number of components I'm removing; it feels as though I'm killing a big chunk of the dataset, and doing so somewhat blindly. Thanks, Alik Widge, MD, PhD Massachusetts General Hospital Charlestown, MA, USA alik.widge at gmail.com (206) 866-5435 On Thu, Oct 10, 2013 at 4:43 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Craig, > > Let me forward this to the email discussion list. > > > On 9 Oct 2013, at 23:27, CR wrote: > > > Hi Robert, > > I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > > > > Method 1: ICA > > > > I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there > something else that makes the data not compatible with the stationary > mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you use > the default cfg.demean=yes). Doing a low-pass filter on the continuous data > would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant components, > and reject these based on a threshold. > > so a bit like > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > with the correlation method of > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > > > Method 2: PCA > > > > I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > > > > Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of > the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > 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 hamid.mohseni at eng.ox.ac.uk Thu Oct 10 12:51:07 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Thu, 10 Oct 2013 11:51:07 +0100 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: This is an interesting question! I think PCA is better than ICA in eye-blink removal. Because what ICA does is first ESTIMATING the eye blink component and then linearly removing that component from the data set. However, in PCA approach, a better estimation of eyeblink component is employed (using for example eye-blink system) to linearly remove that component from the data set---note that this component also does not contain brain activity. In the cases when we do not have the direct eye-blink measurement ICA is better. Other ideas? Thanks On 10 October 2013 10:50, Alik Widge wrote: > Thank you for posting this, as I'm in the middle of this same processing > step, and I've been pondering methods as well while following the > tutorials. (In my case, 60-channel EEG plus one bipolar EOG in a diagonal > configuration.) Your response to Craig contains something that's been > bugging me a little bit: > > When doing the ICA on a test recording, I find (and it sounds like he > finds as well) that there is not a single component that captures eyeblinks > well (and I have tried various adjustments, such as altering number of > components via pre-PCA, clipping or not clipping out epochs that look to me > to have substantial slow eye-roll, turning runica.extended on/off). I do > get components that have the classic "pair of eyeglasses" or "single > eyeball" look... but I get four or five of them on a 58-component > decomposition, and that's before we talk about the components that are > almost pure 60-cycle noise or temporal EMG. > > You seem to be telling us, in your comment about orthogonality and > percentage of variance captured, that this is actually a *good* thing, > because it reduces the chance of removing activity from the frontal pole. > Can you help me understand that a bit better? I've felt very nervous about > the sheer number of components I'm removing; it feels as though I'm killing > a big chunk of the dataset, and doing so somewhat blindly. > > > Thanks, > > Alik Widge, MD, PhD > Massachusetts General Hospital > Charlestown, MA, USA > alik.widge at gmail.com > (206) 866-5435 > > > > On Thu, Oct 10, 2013 at 4:43 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Craig, >> >> Let me forward this to the email discussion list. >> >> >> On 9 Oct 2013, at 23:27, CR wrote: >> >> > Hi Robert, >> > I wanted to see what your thoughts were on the merits of 2 different >> methods of removing blinks. I have a 12 minute resting state segment of >> data, so it has required me to do some things a little differently. >> > >> > Method 1: ICA >> > >> > I break the 12 minute segment into 2 second intervals, since doing ICA >> on the whole segment gave a poor result. >> >> why does it give you a poor result? Has the subject been moving? Is there >> something else that makes the data not compatible with the stationary >> mixing assumption? >> >> Or is it the difference in the preprocessing? 12 minutes of data >> represented in one segment can have drift, whereas 12 minutes of data >> represented in 2 second snippets will not have the drift (assuming you use >> the default cfg.demean=yes). Doing a low-pass filter on the continuous data >> would have a similar effect as segmenting it and demeaning the 2 sec >> snippets. >> >> > I apply the resulting unmixing matrix to the 12 minute segment and >> correlate each component with the EOG to find the most relevant components, >> and reject these based on a threshold. >> >> so a bit like >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts >> with the correlation method of >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts >> >> >> > Method 2: PCA >> > >> > I do a timelock analysis based on the blink onset point returned by the >> eyelink system. I then PCA the resulting blink ERF. I then reject the >> component(s) that account for say 98% of the total variance. >> > >> > Obviously option 2 is much faster. What do you see as the relative >> merits/problems with the techniques? Technique 1 is largely what the FT >> tutorials suggest, so what about method 2? >> >> Option 2 makes the large variance component orthogonal to the remainder >> of the components, whereas in option 1 the eye component and frontal brain >> components are both estimated, not orthogonal, and removing of the eye >> component does not remove the frontal brain component. >> >> Option 1 is better, as it is less aggressive in removing brain components. >> >> If speed is a concern, you could do >> - ft_resampledata to e.g. 250 Hz or even less, estimate the components >> based on that and project them out of the original high Fsample data. >> - do ft_componentanalysis on a subset of the data (say every 4th data >> segment after cutting it in pieces), and project them out of the original >> segmented data >> - a combination of the two >> - try out anothe rica algorithm (fastica versus runica) >> - try out with the options of the ica algorithm, esp the stopping options >> - get a faster computer >> >> best regards >> Robert >> >> >> >> >> >> >> _______________________________________________ >> 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 > -- Hamid R. Mohseni, PhD Post-Doctoral Research Fellow Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Thu Oct 10 15:35:32 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 10 Oct 2013 09:35:32 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: Dear Robert, Over a year ago I tried to use the suggested method of the lower sample rate and project onto my original data. I had problems. Can you provide a little snippet of the projection? Best, Raquel Sent from my iPhone > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld wrote: > > Hi Craig, > > Let me forward this to the email discussion list. > > >> On 9 Oct 2013, at 23:27, CR wrote: >> >> Hi Robert, >> I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. >> >> Method 1: ICA >> >> I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > >> I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. > > so a bit like > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > with the correlation method of > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > >> Method 2: PCA >> >> I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. >> >> Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From j.herring at fcdonders.ru.nl Thu Oct 10 17:35:25 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 10 Oct 2013 17:35:25 +0200 (CEST) Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: <000f01cec5ce$5743f790$05cbe6b0$@herring@fcdonders.ru.nl> Dear Raquel, What you could do, for example, is: % Save your data to disk Save('data','data','-v7.3'); % Saves the variable data to the file data.mat. The '-v7.3' switch allows the file to be larger than 4gb, if necessary. % Resample your data cfg = []; cfg.resamplefs = 250; % Or less data_resampled = ft_resampledata(cfg, data); % Clear original data from memory Clear data % Perform ICA on resampled data cfg = []; cfg.method = 'runica'; % or 'fastica', for example. comp = ft_componentanalysis(cfg, data_resampled); % clear resampled data Clear data_resampled % load original data Load('data.mat'); % Use previously calculated unmixing matrix on original data cfg = []; cfg.unmixing = comp.unmixing; % copy unmixing matrix to new configuration structure cfg.topolabel = comp.topolabel; % copy channel labels to new config structure. comp = ft_componentanalysis(cfg, data); All the saving and clearing in between might not be necessary depending on how much RAM you have and on the size of your data. Best, Jim -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi Sent: donderdag 10 oktober 2013 15:36 To: FieldTrip discussion list Cc: FieldTrip discussion list; CR Subject: Re: [FieldTrip] ICA/PCA EOG artifact removal Dear Robert, Over a year ago I tried to use the suggested method of the lower sample rate and project onto my original data. I had problems. Can you provide a little snippet of the projection? Best, Raquel Sent from my iPhone > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld wrote: > > Hi Craig, > > Let me forward this to the email discussion list. > > >> On 9 Oct 2013, at 23:27, CR wrote: >> >> Hi Robert, >> I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. >> >> Method 1: ICA >> >> I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > >> I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. > > so a bit like > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i ca_to_remove_eog_artifacts > with the correlation method of > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i ca_to_remove_ecg_artifacts > > >> Method 2: PCA >> >> I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. >> >> Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > 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 mcantor at umich.edu Thu Oct 10 17:29:52 2013 From: mcantor at umich.edu (Max Cantor) Date: Thu, 10 Oct 2013 11:29:52 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: My lab is trying to sort out a very similar issue, this was a very convenient coincidence. Anyway, my PI probably understands this issue better, but for my sake, there seems to be some disagreement here about whether ICA or PCA is better? We have a dedicated VEOG channel, but no dedicated ECG channel, so according to Hamid, we would be better off using ICA for removing ECG artifacts and PCA for EOG artifacts? Also, I'm looking at ft_componentanalysis and ft_denoise_pca, and I'm wondering if there is a simple explanation for what the difference between using ft_componentanalysis with, for instance, cfg.runica.pca, and just using ft_denoise_pca is for PCA? Finally, I noticed ft_componentanalysis has an option for a displaymode and interactivepca, and I'm wondering if this essentially turns the inputting of components to be rejected into a gui? I'm trying to create functions for our muscle, EOG, and ECG artifact rejections, but because the components to be removed seem to need to be added into the script itself, trying to run it as a function within our analysis script obviously leads to it not rejecting any components. On Thu, Oct 10, 2013 at 9:35 AM, Raquel Bibi wrote: > Dear Robert, > Over a year ago I tried to use the suggested method of the lower sample > rate and project onto my original data. I had problems. Can you provide a > little snippet of the projection? > > Best, > > Raquel > Sent from my iPhone > > > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > > > > Hi Craig, > > > > Let me forward this to the email discussion list. > > > > > >> On 9 Oct 2013, at 23:27, CR wrote: > >> > >> Hi Robert, > >> I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > >> > >> Method 1: ICA > >> > >> I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > > > why does it give you a poor result? Has the subject been moving? Is > there something else that makes the data not compatible with the stationary > mixing assumption? > > > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you use > the default cfg.demean=yes). Doing a low-pass filter on the continuous data > would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > >> I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant components, > and reject these based on a threshold. > > > > so a bit like > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > > with the correlation method of > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > > > > >> Method 2: PCA > >> > >> I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > >> > >> Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > > > Option 2 makes the large variance component orthogonal to the remainder > of the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > > > Option 1 is better, as it is less aggressive in removing brain > components. > > > > If speed is a concern, you could do > > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > > - a combination of the two > > - try out anothe rica algorithm (fastica versus runica) > > - try out with the options of the ica algorithm, esp the stopping options > > - get a faster computer > > > > best regards > > Robert > > > > > > > > > > > > > > _______________________________________________ > > 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 bibi.raquel at gmail.com Thu Oct 10 19:58:45 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 10 Oct 2013 13:58:45 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <5256c967.070a0e0a.7aea.6d36SMTPIN_ADDED_BROKEN@mx.google.com> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> <5256c967.070a0e0a.7aea.6d36SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Thanks Jim and Craig! On Thu, Oct 10, 2013 at 11:35 AM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Dear Raquel, > > What you could do, for example, is: > > > > % Save your data to disk > Save('data','data','-v7.3'); % Saves the variable data to the file > data.mat. The '-v7.3' switch allows the file to be larger than 4gb, if > necessary. > > % Resample your data > cfg = []; > cfg.resamplefs = 250; % Or less > > data_resampled = ft_resampledata(cfg, data); > > % Clear original data from memory > Clear data > > > % Perform ICA on resampled data > cfg = []; > cfg.method = 'runica'; % or 'fastica', for example. > > comp = ft_componentanalysis(cfg, data_resampled); > > % clear resampled data > Clear data_resampled > > % load original data > Load('data.mat'); > > % Use previously calculated unmixing matrix on original data > cfg = []; > cfg.unmixing = comp.unmixing; % copy unmixing matrix to new configuration > structure > cfg.topolabel = comp.topolabel; % copy channel labels to new config > structure. > > comp = ft_componentanalysis(cfg, data); > > > > All the saving and clearing in between might not be necessary depending on > how much RAM you have and on the size of your data. > > Best, > > Jim > > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi > Sent: donderdag 10 oktober 2013 15:36 > To: FieldTrip discussion list > Cc: FieldTrip discussion list; CR > Subject: Re: [FieldTrip] ICA/PCA EOG artifact removal > > Dear Robert, > Over a year ago I tried to use the suggested method of the lower sample > rate and project onto my original data. I had problems. Can you provide a > little snippet of the projection? > > Best, > > Raquel > Sent from my iPhone > > > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld > wrote: > > > > Hi Craig, > > > > Let me forward this to the email discussion list. > > > > > >> On 9 Oct 2013, at 23:27, CR wrote: > >> > >> Hi Robert, > >> I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > >> > >> Method 1: ICA > >> > >> I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > > > why does it give you a poor result? Has the subject been moving? Is > there something else that makes the data not compatible with the > stationary mixing assumption? > > > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you > use the default cfg.demean=yes). Doing a low-pass filter on the continuous > data would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > >> I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant > components, and reject these based on a threshold. > > > > so a bit like > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_eog_artifacts > > with the correlation method of > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_ecg_artifacts > > > > > >> Method 2: PCA > >> > >> I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > >> > >> Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > > > Option 2 makes the large variance component orthogonal to the remainder > of the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > > > Option 1 is better, as it is less aggressive in removing brain > components. > > > > If speed is a concern, you could do > > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > > - a combination of the two > > - try out anothe rica algorithm (fastica versus runica) > > - try out with the options of the ica algorithm, esp the stopping > options > > - get a faster computer > > > > best regards > > Robert > > > > > > > > > > > > > > _______________________________________________ > > 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 roeysc at gmail.com Thu Oct 10 20:48:05 2013 From: roeysc at gmail.com (Roey Schurr) Date: Thu, 10 Oct 2013 21:48:05 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: <525502AA.8000501@donders.ru.nl> References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> <525502AA.8000501@donders.ru.nl> Message-ID: Hello again, Thanks Jörn, indeed we are using the atlas you mentioned. We also found out one of the problems was that ft_read_atlas was taken from an EEGLAB directory and not a FT one. Yet the problems persist in the function clusterstat, when using cfg.avgoverroi = 'yes': ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 210 tmp(cfg.inside) = postailobs; Some dimensions in our code: The template sourcemodel gris for the singlesphere is 17 X 17 X 17 Hence the subject's sourcemodel grid for the singlesphere is 17 X 17 X 17 Hence the source reconstruction is also 17 X 17 X 17 The MNI MRI is 91 X 109 X 91 The AAL atlas is also 91 X 109 X 91 We don't understane how come "poastailobs" is 232 (twice the number of ROIs defined in the atlas). But still, " cfg.inside " defined all voxel that are inside the brain in the source space, so it is clear that an assignment as that demanded by line 210 in clusterstat would not work, We thought we could use ft_volumelookup in order to find those voxels that correspond to the areas that got 1 in "postailobs", but that won't work, since we do not have the source struct available at that point in the code. Are we using structures of insuitable dimensions? Are we doing anything wrong? Or is there a problem with the firldtrip code itself? Any help would be greatly appreciated! Aia and Roey On Wed, Oct 9, 2013 at 10:15 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Roey, > > habe you tried the atlas that is shipped with FieldTrip? It can be found > in fieldtrip/templates/atlas/AAL/ > > Best, > Jörn > > > On 10/8/2013 11:41 PM, Roey Schurr wrote: > > Dear fieldtrippers (Jan-Mathijs included), > > (This message seems long, but is actually quite simple) > > Having downloaded the latest fieldtrip version (20131008), we tried > rerunning the code and got the following error: > > ??? Reference to non-existent field 'coordsys'. > > Error in ==> ft_volumelookup at 206 > if strcmp(cfg.inputcoord, 'mni') && > strcmp(atlas.coordsys, 'tal') > > Error in ==> statistics_wrapper at 136 > tmp = ft_volumelookup(tmpcfg, varargin{1}); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > Since the spm8 MNI atlas indeed has no "coordsys" field. > Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by > hand, or by simply deleting that "if" line), we still get one of two errors: > > * * * * * (1) * * * * * > If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the > MNI atlas has to offer, we get an indices error: > > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > * * * * * (2) * * * * * > If we define "cfg.roi = AAL_names{1};" for example, we get a different > error: > > ??? In an assignment A(:) = B, the number of elements in A and > B must be the same. > > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, > statobs,'issource',issource); > > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, > 'issource',issource); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > And in "cluserstat" appears this comment: "%this snippet is to support > correct clustering of N-dimensional data, not fully tested yet". > Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to > "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the > variables vectors "postailobs" and "negtailobs" > > > Any ideas on how to solve this atlas source statistics problem (defining > the coordsys field, performing statistics across all ROIs, and using the > postailobs/negtailobs vectors) would be greatly appreciated! > > Good night, > Aia and Roey > > > On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > >> Dear Jan-Mathijs, >> >> Thank you so much for your kind and quick answer! >> We do hope this will fix things up. We will check it asap. >> >> Best regards, >> Aia and Roey >> >> >> >> >> On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Dear Roey and Aia, >>> >>> This indeed was our bad. We have fixed it in the current version of >>> FieldTrip. >>> The version will be available for download tonight (CET), but you can >>> get an instantaneous update of the code repository by doing 'ft_version >>> update' on the Matlab command line. >>> This will update the fieldtrip copy you are using to the latest version. >>> Note that if you want to keep a 'static' version, you need to back up the >>> version with a fixed date, because all changes will be incorporated. >>> >>> A little note to the following piece of code: >>> >>> % Load the Atlas >>>> templateDir = which('ft_defaults'); % use a known function >>>> (ft_defaults) to find FieldTrip's directory >>>> backslashIndices = find(templateDir=='\'); >>>> templateDir(backslashIndices(end)+1:end) = []; clear >>>> backslashIndices; >>>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>>> >>> >>> The same can be achieved with the fullfile function (which deals with >>> platform specific file-separators automatically): >>> >>> templateDir=which('ft_defaults'); >>> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >>> >>> >>> Best, >>> Jan-Mathijs >>> >>> >>> >>> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >>> >>> Hello again, >>> >>> Sorry, it seems like the older version (with ft_volumelookup) is just >>> our mistake. >>> However the problem is still relevant, for the function volumelookup is >>> still undefinded in our case. >>> >>> Hopefully someone might know what we did wrong. >>> >>> Thank you once again! >>> Aia and Roey >>> >>> >>> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >>> >>>> Hello all, >>>> >>>> We are having some problems defining atlas-based ROIs using >>>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>>> (whose grid is later changed according to a precalculated MNI-warped grid). >>>> >>>> It seems like the function "statistics_wrapper" has changed between >>>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>>> >>>> ??? Undefined function or method 'volumelookup' for input >>>> arguments of type 'struct'. >>>> >>>> Error in ==> statistics_wrapper at 136 >>>> tmp = volumelookup(tmpcfg, varargin{1}); >>>> >>>> Using the older fieldtrip vesion we get this error: >>>> ??? Subscript indices must either be real positive integers or >>>> logicals. >>>> >>>> Error in ==> statistics_wrapper at 213 >>>> tmp(i,:) = mean(dat(roi,:), 1); >>>> >>>> Error in ==> ft_sourcestatistics at 107 >>>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>>> >>>> So it seems like we didn't define the ROIs correctly, however we are >>>> not sure why. >>>> >>>> Any suggestions would be greatly appreciated! >>>> The relevant pieceof code is attached. >>>> >>>> Thank you all, >>>> Aia and Roey >>>> >>>> >>>> >>>> Relevant code >>>> ============ >>>> % Convert sources units to mm, to fit the atlas's units >>>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>>> design = [ ones(1,length(sourceCondition1.trial)), >>>> 2*ones(1,length(sourceCondition2.trial)) ]; >>>> >>>> cfg = []; >>>> cfg.dim = sourceCondition1.dim; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'indepsamplesT'; >>>> cfg.parameter = 'pow'; >>>> cfg.correctm = 'cluster'; >>>> cfg.numrandomization = 1000; >>>> cfg.alpha = 0.01; >>>> cfg.tail = 0; >>>> cfg.design(1,:) = design; >>>> cfg.ivar = 1; >>>> >>>> % Load the Atlas >>>> templateDir = which('ft_defaults'); % use a known function >>>> (ft_defaults) to find FieldTrip's directory >>>> backslashIndices = find(templateDir=='\'); >>>> templateDir(backslashIndices(end)+1:end) = []; clear >>>> backslashIndices; >>>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>>> >>>> >>>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>>> "Precentral_L", "Precentral_R", etc/ >>>> >>>> cfg.avgoverroi = 'yes'; >>>> cfg.hemisphere = 'both'; >>>> cfg.inputcoord = 'mni'; >>>> >>>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>>> >>>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> Jan-Mathijs Schoffelen, MD PhD >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Cognitive Neuroimaging, >>> Radboud University Nijmegen, The Netherlands >>> >>> Max Planck Institute for Psycholinguistics, >>> Nijmegen, The Netherlands >>> >>> J.Schoffelen at donders.ru.nl >>> Telephone: +31-24-3614793 >>> >>> http://www.hettaligebrein.nl >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > _______________________________________________ > 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 notthemindprobe at yahoo.com Thu Oct 10 21:39:00 2013 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Thu, 10 Oct 2013 12:39:00 -0700 (PDT) Subject: [FieldTrip] Automatically saving GDF using the realtime buffer In-Reply-To: References: Message-ID: <1381433940.31104.YahooMailNeo@web165003.mail.bf1.yahoo.com> Fieldtrip users:   Well, I managed to get the remote start/stop of GDF files working via the TCP/IP port.  It is not that complicated, but there are some ambiguities in the documentation, so I thought I would post the solution in case it helped anyone else.    Apparently there is a fifth argument that can be given to the biosemi2ft code.  I had seen the listing of the command as:   biosemi2ft   However, if you give it a 5th argument, that works as the port to which to control the ODM, if not specified the control port is 8000, since I had been trying to use the local default port (1972) that is why I was having issues.  At some spoint someone may want to update the documentation to specify that the control port default is 8000, and not the port used for the buffer.  I was able to control the saving of the GDF files by just using the matlab tcp_udp_ip toolbox:   host = 'localhost'; port = 8000;   con=pnet('tcpconnect',host,port) pnet(con,'setwritetimeout',2) [ip,port]=pnet(con,'gethost') stat=pnet(con,'status')   msg = 'SAVE START'; pnet(con,'printf','\n%s\n',msg); pause(5) msg = 'SAVE STOP'; pnet(con,'printf','\n%s\n',msg); pause(5) % pnet(con,'close')     Best, Eric ________________________________ From: "fieldtrip-request at science.ru.nl" To: fieldtrip at science.ru.nl Sent: Tuesday, October 8, 2013 5:41 PM Subject: fieldtrip Digest, Vol 35, Issue 11 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. definetrial with ANT .cnt files (Epstein, Michael)   2. Automatically saving GDF using the realtime buffer       (Eric Pohlmeyer)   3. Re: Using Atlas ROIs in EEG Source Statistics       (ft_sourcestatistics) (Roey Schurr) ---------------------------------------------------------------------- Message: 1 Date: Tue, 8 Oct 2013 15:50:07 +0000 From: "Epstein, Michael" To: FieldTrip discussion list Subject: [FieldTrip] definetrial with ANT .cnt files Message-ID: <3E54C3C165B1F2428D0A866C8A04ADBD011246 at nki-exchdb2> Content-Type: text/plain; charset="us-ascii" Hi all, I'm having a problem defining triggers using ft_definetrial  with ANT .cnt files. Say I want to do a simple epoching around events with a trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get an error saying no trials are defined. However I figured out that if I put in cfg.trialdef.eventvalue =[1 char(0) char(0)]; then it works fine. The trigger files look totally normal, and other programs don't seem to have this issue. Anyone else ever have a problem like this? Thanks, -Michael IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 8 Oct 2013 06:01:11 -0700 (PDT) From: Eric Pohlmeyer To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] Automatically saving GDF using the realtime     buffer Message-ID:     <1381237271.38083.YahooMailNeo at web165005.mail.bf1.yahoo.com> Content-Type: text/plain; charset="iso-8859-1" Fieldtrip: ? Hi, I am a new user of Fieldtrip, but our lab has a (pretty well working) real-time analysis of BioSemi EEG using?two computers, matlab, and the FieldTrip buffer.? The buffer is used for communicating?data between two machines: machine A?collects and saves?the data while also writingto the buffer, and machine B uses matlab to read the data off of the buffer (TCP/IP connection) and then run a soft real-time analysis of the EEG data. ? Currently we manually start and stop?the saving of a GDF file on?machine A by hitting the S and D keys. ? I would like to automatically start and stop the file saving, and was wondering if anyone had any suggestions?? I read that the OnlineDataManager (which interacts with our biosemi2ft code) handles the saving, and also does listen for ASCII messages on a TCP port for various commands, including "SAVE START/STOP".? Unfortunately, I'm not a programmer, and haven't been able to figure out how to write those commands to the port.? Is there a way to use the ft_write_data (or similar) to do that?? How do you make address the command to the specific port? ? Any suggestions would be greatfully received. ? Thanks! ? Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Wed, 9 Oct 2013 00:41:19 +0300 From: Roey Schurr To: FieldTrip discussion list Subject: Re: [FieldTrip] Using Atlas ROIs in EEG Source Statistics     (ft_sourcestatistics) Message-ID:     Content-Type: text/plain; charset="iso-8859-1" Dear fieldtrippers (Jan-Mathijs included), (This message seems long, but is actually quite simple) Having downloaded the latest fieldtrip version (20131008), we tried rerunning the code and got the following error:     ??? Reference to non-existent field 'coordsys'.     Error in ==> ft_volumelookup at 206           if    strcmp(cfg.inputcoord, 'mni') &&           strcmp(atlas.coordsys, 'tal')     Error in ==> statistics_wrapper at 136             tmp = ft_volumelookup(tmpcfg, varargin{1});     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); Since the spm8 MNI atlas indeed has no "coordsys" field. Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by hand, or by simply deleting that "if" line), we still get one of two errors: * * * * * (1) * * * * * If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the MNI atlas has to offer, we get an indices error:     ??? Subscript indices must either be real positive integers or     logicals.     Error in ==> statistics_wrapper at 213           tmp(i,:) = mean(dat(roi,:), 1);     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); * * * * * (2) * * * * * If we define "cfg.roi = AAL_names{1};" for example, we get a different error:     ??? In an assignment  A(:) = B, the number of elements in A and     B must be the same.     Error in ==> clusterstat at 187         tmp(cfg.inside) = postailobs;     Error in ==> ft_statistics_montecarlo at 326       [stat, cfg] = clusterstat(cfg, statrand,       statobs,'issource',issource);     Error in ==> statistics_wrapper at 298         [stat, cfg] = statmethod(cfg, dat, design,         'issource',issource);     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); And in "cluserstat" appears this comment: "%this snippet is to support correct clustering of N-dimensional data, not fully tested yet". Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the variables vectors "postailobs" and "negtailobs" Any ideas on how to solve this atlas source statistics problem (defining the coordsys field, performing statistics across all ROIs, and using the postailobs/negtailobs vectors) would be greatly appreciated! Good night, Aia and Roey On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Dear Roey and Aia, >> >> This indeed was our bad. We have fixed it in the current version of >> FieldTrip. >> The version will be available for download tonight (CET), but you can get >> an instantaneous update of the code repository by doing 'ft_version update' >> on the Matlab command line. >> This will update the fieldtrip copy you are using to the latest version. >> Note that if you want to keep a 'static' version, you need to back up the >> version with a fixed date, because all changes will be incorporated. >> >> A little note to the following piece of code: >> >> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = [];      clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >> >> The same can be achieved with the fullfile function (which deals with >> platform specific file-separators automatically): >> >> templateDir=which('ft_defaults'); >> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >> >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >> >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) is just >> our mistake. >> However the problem is still relevant, for the function volumelookup is >> still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >> >>> Hello all, >>> >>> We are having some problems defining atlas-based ROIs using >>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>> (whose grid is later changed according to a precalculated MNI-warped grid). >>> >>> It seems like the function "statistics_wrapper" has changed between >>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>> >>>      ??? Undefined function or method 'volumelookup' for input >>>      arguments of type 'struct'. >>> >>>      Error in ==> statistics_wrapper at 136 >>>              tmp = volumelookup(tmpcfg, varargin{1}); >>> >>> Using the older fieldtrip vesion we get this error: >>>    ??? Subscript indices must either be real positive integers or >>>    logicals. >>> >>>      Error in ==> statistics_wrapper at 213 >>>            tmp(i,:) = mean(dat(roi,:), 1); >>> >>>      Error in ==> ft_sourcestatistics at 107 >>>          [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> So it seems like we didn't define the ROIs correctly, however we are not >>> sure why. >>> >>> Any suggestions would be greatly appreciated! >>> The relevant pieceof code is attached. >>> >>> Thank you all, >>> Aia and Roey >>> >>> >>> >>> Relevant code >>> ============ >>> % Convert sources units to mm, to fit the atlas's units >>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>> design = [ ones(1,length(sourceCondition1.trial)), >>> 2*ones(1,length(sourceCondition2.trial)) ]; >>> >>> cfg = []; >>> cfg.dim = sourceCondition1.dim; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'indepsamplesT'; >>> cfg.parameter = 'pow'; >>> cfg.correctm = 'cluster'; >>> cfg.numrandomization = 1000; >>> cfg.alpha = 0.01; >>> cfg.tail = 0; >>> cfg.design(1,:) = design; >>> cfg.ivar = 1; >>> >>> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = [];      clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >>> >>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>> "Precentral_L", "Precentral_R", etc/ >>> >>> cfg.avgoverroi  = 'yes'; >>> cfg.hemisphere  = 'both'; >>> cfg.inputcoord  = 'mni'; >>> >>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>> >>> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >>    Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 35, Issue 11 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Fri Oct 11 19:20:39 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Fri, 11 Oct 2013 17:20:39 +0000 Subject: [FieldTrip] ft_freqanalysis Message-ID: can someone please tell me if ft_freqanalysis averages trials before computing the frequency analysis? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Oct 11 19:31:29 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 11 Oct 2013 19:31:29 +0200 Subject: [FieldTrip] ft_freqanalysis In-Reply-To: References: Message-ID: Hi Keith, No, it doesn't. Best, Jan-Mathijs On Oct 11, 2013, at 7:20 PM, McConnell, Keith wrote: > can someone please tell me if ft_freqanalysis averages trials before computing the frequency analysis? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From instanton at gmail.com Fri Oct 11 23:03:55 2013 From: instanton at gmail.com (woun zoo) Date: Fri, 11 Oct 2013 14:03:55 -0700 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? Message-ID: Hi I'd like to know the way to keep each trial's time-frequency data (complex amplitude from fourier method). For example, if I have 20 trials and run ft_freqanalysis for time-frequency spectra, I end up having only final averaged result. Where can I see each individual trial's time-frequency complex amplitudes? Or what should I do to have TF data from all single trials? Thank you very much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Oct 11 23:43:27 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Fri, 11 Oct 2013 23:43:27 +0200 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Dear Woun, It is possible you may have already solved the problem. In case you didn't, let me tell you that: When doing timelocks or freqanalysis at the individual level you can set: - cfg.keeptrials = 'yes' and the output structure will have a field with each single trial in addition to the "avg" field that you already have. At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) the analogous option is - cfg.keepindividuals = 'yes' And the resulting structure will have an additional field called "individual". Keeptrials and keepindividuals are set to "no" by default. When "keeping" trials/individuals the output will be much bigger, depending on the number of channels, trials, time,... specially for TFanalysis you usually need to put an eye on that (load times are faster, space consuming, etc). It may be a good habit in order to keep good track of your processing but it can be a nuisance too Tip: look at the field "dimord". Now you have: chan_freq_time, what you want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. I hope I did not mislead your question. If this small talk actually solved your problem, let me suggest you to highlight your fieldtrip functions and press F1, and do it often, magic will happen., it will help learning much faster. Cheers, Tino 2013/10/11 woun zoo > Hi > > I'd like to know the way to keep each trial's time-frequency data (complex > amplitude from fourier method). For example, if I have 20 trials and run > ft_freqanalysis for time-frequency spectra, I end up having only final > averaged result. Where can I see each individual trial's time-frequency > complex amplitudes? Or what should I do to have TF data from all single > trials? > > Thank you very much. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Oct 11 23:46:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Fri, 11 Oct 2013 23:46:49 +0200 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Please notice that for the grandaverages is not spelled "individual*s*" but cfg.keepindividual = 'yes' without the 's' My bad, T 2013/10/11 Constantino Méndez Bértolo > Dear Woun, > > It is possible you may have already solved the problem. In case you > didn't, let me tell you that: > When doing timelocks or freqanalysis at the individual level you can set: > > - cfg.keeptrials = 'yes' > > > and the output structure will have a field with each single trial in > addition to the "avg" field that you already have. > At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) the > analogous option is > > - cfg.keepindividuals = 'yes' > > And the resulting structure will have an additional field called > "individual". > Keeptrials and keepindividuals are set to "no" by default. When "keeping" > trials/individuals the output will be much bigger, depending on the number > of channels, trials, time,... specially for TFanalysis you usually need to > put an eye on that (load times are faster, space consuming, etc). It may be > a good habit in order to keep good track of your processing but it can be a > nuisance too > Tip: look at the field "dimord". Now you have: chan_freq_time, what you > want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. > I hope I did not mislead your question. If this small talk actually solved > your problem, let me suggest you to highlight your fieldtrip functions and > press F1, and do it often, magic will happen., it will help learning much > faster. > Cheers, > Tino > > > 2013/10/11 woun zoo > >> Hi >> >> I'd like to know the way to keep each trial's time-frequency data >> (complex amplitude from fourier method). For example, if I have 20 trials >> and run ft_freqanalysis for time-frequency spectra, I end up having only >> final averaged result. Where can I see each individual trial's >> time-frequency complex amplitudes? Or what should I do to have TF data from >> all single trials? >> >> Thank you very much. >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From instanton at gmail.com Fri Oct 11 23:58:03 2013 From: instanton at gmail.com (woun zoo) Date: Fri, 11 Oct 2013 14:58:03 -0700 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Thank you so much. ^_^;; On Fri, Oct 11, 2013 at 2:46 PM, Constantino Méndez Bértolo < constantino.mendezbertolo at ctb.upm.es> wrote: > Please notice that for the grandaverages is not spelled "individual*s*" > but > > cfg.keepindividual = 'yes' > > without the 's' > > My bad, > T > > > 2013/10/11 Constantino Méndez Bértolo < > constantino.mendezbertolo at ctb.upm.es> > >> Dear Woun, >> >> It is possible you may have already solved the problem. In case you >> didn't, let me tell you that: >> When doing timelocks or freqanalysis at the individual level you can set: >> >> - cfg.keeptrials = 'yes' >> >> >> and the output structure will have a field with each single trial in >> addition to the "avg" field that you already have. >> At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) >> the analogous option is >> >> - cfg.keepindividuals = 'yes' >> >> And the resulting structure will have an additional field called >> "individual". >> Keeptrials and keepindividuals are set to "no" by default. When "keeping" >> trials/individuals the output will be much bigger, depending on the number >> of channels, trials, time,... specially for TFanalysis you usually need to >> put an eye on that (load times are faster, space consuming, etc). It may be >> a good habit in order to keep good track of your processing but it can be a >> nuisance too >> Tip: look at the field "dimord". Now you have: chan_freq_time, what you >> want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. >> I hope I did not mislead your question. If this small talk actually >> solved your problem, let me suggest you to highlight your fieldtrip >> functions and press F1, and do it often, magic will happen., it will help >> learning much faster. >> Cheers, >> Tino >> >> >> 2013/10/11 woun zoo >> >>> Hi >>> >>> I'd like to know the way to keep each trial's time-frequency data >>> (complex amplitude from fourier method). For example, if I have 20 trials >>> and run ft_freqanalysis for time-frequency spectra, I end up having only >>> final averaged result. Where can I see each individual trial's >>> time-frequency complex amplitudes? Or what should I do to have TF data from >>> all single trials? >>> >>> Thank you very much. >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> Constantino Méndez-Bértolo >> Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) >> >> Parque Científico y Tecnológico de la UPM, Campus de Montegancedo >> >> 28223 Pozuelo de Alarcón, Madrid, SPAIN >> >> >> > > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > > _______________________________________________ > 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 Heng-RuMay.Tan at glasgow.ac.uk Sat Oct 12 00:38:15 2013 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 11 Oct 2013 23:38:15 +0100 Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers Message-ID: <52587DD7.2080801@glasgow.ac.uk> Hi there, I am resending my question below to the Fieldtrip discussion. Many thanks in advance! > On 11/10/2013 20:10, Eric Maris wrote: >> Hi May, >> >> Could you post your question on thr Fieldtrip discussion list? In that way, many more people can participate in the discussion. Moreover, the discussion will be archived, allowing people with the same question to inform themselves. >> >> Best, >> >> Eric I wish to seek some insights into non-parametric statistical testing in the MEG data analysis I am planning to do at the source level. For the most part, I have an appreciation of the permutation strategy (concept of random partitioning) described in Maris & Oostenveld 2007, which is implemented in fieldtrip. I have however a concern regarding trial number differences between subject group for permutation statistics. The data I am looking at after preprocessing/artefact removal etc. looks roughly as follows: 2 subject groups: Controls (C) and Patients (P). For a particular experimental condition (A), on average, subjects within each group have the following number of trials: condA_Ntrials_C ~= 100 condA_Ntrials_P ~= 80 I plan to perform a 2-step statistics-test to test for differences between C and P groups on a particular experimental condition. Using a 1st level within subject t-test (or active-vs-baseline test) on baseline vs active period for each group, deriving subject-specific t-stats which are to be subsequently used in a 2nd level test between subject group contrast, using nonparametric test. Question 1) Does it matter if the average trials per subject in each group is different? Should I try to equalize the trial numbers by e.g. random removal of some trials before computing any statistics? Is this advisable? Question 2) Minimum trials required for source-level significance? The supplementary info. accompanying the 2007 paper illustrated some minimum trial numbers required for obtaining a significant effect at the sensor-level analysis, given some threshold (e.g. cluster>250 sensor-time pairs). Has anyone systematically shown what is the minimum number of trials required to obtain significant clusters/fdr stats at the source-level analysis? If not, is there a sensible way to find out? (presumably involving some form of bootstrapping and simulation?) This relates to another issue I have with regards to 'within-subjects' comparison for 2 experimental conditions A and B where there are average trial number differences both within and between subject groups: condA_Ntrials_C ~= 100 condB_Ntrials_C ~= 60 (min. =35) condA_Ntrials_P ~= 80 condB_Ntrials_P ~= 50 (min. =35) A similar concern of uneven trials arises if say I wish to perform a within subjects comparison between the experimental conditions. In general, Q: Would the intended 2-step statistical test (as described above) be appropriate, OR would it best to control for 'equal' number of trials for all subjects and conditions of interest? I would really appreciate it if someone could kindly comment or offer advise where appropriate. Thank you very much in advance for your time. Yours sincerely, May -- Heng-Ru/May/ Tan Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive Neuroimaging (CCNi)▫ University of Glasgow 58 Hillhead Street, Glasgow G12 8QB▫ +44 (0)141-330-5090▫ Heng-RuMay.Tan at glasgow.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Sat Oct 12 18:15:52 2013 From: michielb at tcd.ie (Bart Michiels) Date: Sat, 12 Oct 2013 17:15:52 +0100 Subject: [FieldTrip] problem ft_freqanalysis Message-ID: After using ft_freqanalysis for EEG resting-state data I am unable to see the whole spectrum of my data, which should show some content between 0 and 60 Hz. I only see some low-frequency content (between 0 and 8 Hz) when using plot(...). Pre-processing steps: Avg re-reference, BP filter 0.25-100, cut continuous data into 4s segments, resample data to 512 Hz, detrend, re-reference (after avg rereferencing) to the A1&A2 electrode, Artefact rejection (max=80,min=-80,range=160, default jump artefact algorithm), visual inspection of the data. There are three datasets of 1 patients (every dataset cut into 4s segments). After preprocessing, those data sets are merged with ft.appenddata. I tried everything (wavelet, multi-taper), I always have the same result, can someone tell me what I am doing wrong? Bart Michiels, Research Assistant. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehsan.sabri at gmail.com Sun Oct 13 16:29:03 2013 From: ehsan.sabri at gmail.com (Ehsan Sabri) Date: Sun, 13 Oct 2013 17:59:03 +0330 Subject: [FieldTrip] Neuroshare - nev file from Blackrock microsystems Message-ID: Dear all, I'm trying to import an event file from a blackrock microsystem setup using 'neuroshare' m files. I use 'Matlab Import Filter' (Neuroshare m file package) version 2.5 and Matlab 2012a. It seems that this mexprog.mexw is not compatible with nsNEVLibrary.dll. ------------------------------------------------------------------------------------------------------------------ K>> which(lib) C:\Users\WIN 7\Documents\Utah Data\Toolboxes\Matlab-Import-Filter_2_5\RequiredResources\nsNEVLibrary.dll K>> [a]=mexprog(18, which(lib)) Warning: Unable to load this DLL a = -1 ------------------------------------------------------------------------------------------------------------------ (see read_neuroshare.m line 82) Did anyone encounter such non compatibility? Is there any other version for nsNEVLibrary.dll? (I also tried the one with PowerNAP 0.7) Best, Ehsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Mon Oct 14 16:53:38 2013 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Mon, 14 Oct 2013 16:53:38 +0200 Subject: [FieldTrip] Warning 'nifti' class Message-ID: Dear all, when loading my source files I get two warnings in Matlab which say: 1. "Warning: Class 'nifti' is an unknown object class..." and 2. "Warning: Class 'file_array' is an unknown object class...". Can anyone tell me why Matlab gives me this warning and/or what I did wrong (if so)? Thanks a lot and best regards, Andreas Sauer -- Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Oct 14 17:00:43 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 14 Oct 2013 17:00:43 +0200 Subject: [FieldTrip] problem ft_freqanalysis In-Reply-To: References: Message-ID: <525C071B.1040505@donders.ru.nl> Hi Bart, it might help if you paste the code that you are using for computing the FFT and for plotting. Also, showing the structure (e.g. fieldnames and size of the content) might help. Generally, the problem could just be related to huge 1/f noise and that you need to zoom in to see modulations of higher frequencies. Hard to tell though without any further information on what you are exactly doing ;) Best, Jörn On 10/12/2013 6:15 PM, Bart Michiels wrote: > After using ft_freqanalysis for EEG resting-state data I am unable to > see the whole spectrum of my data, which should show some content > between 0 and 60 Hz. I only see some low-frequency content (between 0 > and 8 Hz) when using plot(...). > > Pre-processing steps: > Avg re-reference, BP filter 0.25-100, cut continuous data into 4s > segments, resample data to 512 Hz, detrend, re-reference (after avg > rereferencing) to the A1&A2 electrode, Artefact rejection > (max=80,min=-80,range=160, default jump artefact algorithm), visual > inspection of the data. There are three datasets of 1 patients (every > dataset cut into 4s segments). After preprocessing, those data sets > are merged with ft.appenddata. > > I tried everything (wavelet, multi-taper), I always have the same > result, can someone tell me what I am doing wrong? > > Bart Michiels, Research Assistant. > > > _______________________________________________ > 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 Keith.McConnell at cchmc.org Mon Oct 14 20:14:14 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Mon, 14 Oct 2013 18:14:14 +0000 Subject: [FieldTrip] source localization help Message-ID: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Oct 14 21:25:10 2013 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 14 Oct 2013 21:25:10 +0200 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: <033FAAB9-3BC8-4473-902D-2B5C5DB6DAD0@gmail.com> Hi Keith, you have a typo in your script. It should be 'avg.pow' instead of 'ave.pow'. good luck Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 14.10.2013 um 20:14 schrieb McConnell, Keith: > Hello, > > I am trying to run the beamformer source analysis. > > In the code: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > I am generating the error: > > Reference to non-existent field 'ave'. > > Any help? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > 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 Mon Oct 14 21:28:52 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 14 Oct 2013 13:28:52 -0600 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 Keith.McConnell at cchmc.org Mon Oct 14 21:56:00 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Mon, 14 Oct 2013 19:56:00 +0000 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 Mon Oct 14 22:12:25 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 14 Oct 2013 14:12:25 -0600 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 haristz at gmail.com Mon Oct 14 22:16:34 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Mon, 14 Oct 2013 15:16:34 -0500 Subject: [FieldTrip] Artifacts in sourceplot ortho? Message-ID: Hi There, I have been having some problems with the use of sourceplot: I am trying to display the results of ft_sourcestatistics where input is sources for 2 conditions coming from multiple subjects (individual subjects warped to MNI space). To begin with, I interpolate my results to the MNI mri in fieldtrip - eg for p values : templatefile = '~/fieldtrip/external/spm8/templates/T1.nii'; template_mri = ft_read_mri(templatefile); cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'prob'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; imgdat = ft_sourceinterpolate(cfg, dat, template_mri); This seems to work fine except (and this is my question) for some *stange artifactual voxels* appearing when I use the 'ortho' method (see screenshot here https://db.tt/W7fiVIWq ) Here is the actual call: cfg = []; cfg.coordsys = 'mni'; cfg.funparameter = 'prob'; cfg.maskparameter = cfg.funparameter; cfg.funcolorlim=[0 0.05]; cfg.opacitymap ='rampdown' cfg.opacitylim=[0 0.05] cfg.method='ortho'; cfg.interactive='yes'; cfg.atlas='~/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; ft_sourceplot(cfg,imgdat) I am referring to the "white voxels" that seem to have value of 1 (which I thought, based on the above call should not be displayed(?)). The same kind of problem appears when I use other parameters from "prob", eg "stat" . Those "strange" voxels are always the same. This problem is not present with eg method "slice" Any advice or insight you might have would be much appreciated. Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Tue Oct 15 14:21:01 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Tue, 15 Oct 2013 12:21:01 +0000 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Here you go. Thanks for the help. cfg = []; cfg.method = 'dics'; cfg.frequency = 8; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); save sourcePost_nocon sourcePost_nocon load sourcePost_nocon Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 4:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 julian.keil at gmail.com Tue Oct 15 14:32:27 2013 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 15 Oct 2013 14:32:27 +0200 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> Hi Keith, did you check if your output "sourcePost_nocon" contains the .avg-field (including the subfields avg.pow, avg.filter and so on)? If not, then something goes wrong in your source analysis. Have you checked your grid and vol? Especially, does your grid contain meaningful values, and not just NaNs? If your lead field is only NaNs, no data will be projected. Good Luck! ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 15.10.2013 um 14:21 schrieb McConnell, Keith: > Here you go. Thanks for the help. > > cfg = []; > cfg.method = 'dics'; > cfg.frequency = 8; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > > sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); > > save sourcePost_nocon sourcePost_nocon > > load sourcePost_nocon > > > > > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don > Sent: Monday, October 14, 2013 4:12 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source localization help > > Keith, > > I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? > > Don > > On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" wrote: > > > Ach. The solution may still prove to be simple, but I have made this change: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > and now receive this error: > > Reference to non-existent field 'avg'. > > Thanks for the help. > > Keith > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don > Sent: Monday, October 14, 2013 3:29 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source localization help > > I believe you should change cfg.parameter to read > > cfg.parameter = 'avg.pow' > > not > > cfg.parameter = 'ave.pow' > > > On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" wrote: > > > > Hello, > > I am trying to run the beamformer source analysis. > > In the code: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > I am generating the error: > > Reference to non-existent field 'ave'. > > Any help? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > 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 Keith.McConnell at cchmc.org Tue Oct 15 14:38:17 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Tue, 15 Oct 2013 12:38:17 +0000 Subject: [FieldTrip] source localization help In-Reply-To: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> References: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> Message-ID: What within grid and vol do I check? In grid.leadfield, for example, I do have some NaNs, but mostly *good* data. Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Julian Keil Sent: Tuesday, October 15, 2013 8:32 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Hi Keith, did you check if your output "sourcePost_nocon" contains the .avg-field (including the subfields avg.pow, avg.filter and so on)? If not, then something goes wrong in your source analysis. Have you checked your grid and vol? Especially, does your grid contain meaningful values, and not just NaNs? If your lead field is only NaNs, no data will be projected. Good Luck! ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 15.10.2013 um 14:21 schrieb McConnell, Keith: Here you go. Thanks for the help. cfg = []; cfg.method = 'dics'; cfg.frequency = 8; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); save sourcePost_nocon sourcePost_nocon load sourcePost_nocon Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 4:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 e.maris at psych.ru.nl Wed Oct 16 06:58:00 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Wed, 16 Oct 2013 06:58:00 +0200 (CEST) Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers In-Reply-To: <52587DD7.2080801@glasgow.ac.uk> References: <52587DD7.2080801@glasgow.ac.uk> Message-ID: <005d01ceca2c$4add4530$e097cf90$@maris@psych.ru.nl> Dear May, 2 subject groups: Controls (C) and Patients (P). For a particular experimental condition (A), on average, subjects within each group have the following number of trials: condA_Ntrials_C ~= 100 condA_Ntrials_P ~= 80 I plan to perform a 2-step statistics-test to test for differences between C and P groups on a particular experimental condition. Using a 1st level within subject t-test (or active-vs-baseline test) on baseline vs active period for each group, deriving subject-specific t-stats which are to be subsequently used in a 2nd level test between subject group contrast, using nonparametric test. Question 1) Does it matter if the average trials per subject in each group is different? Should I try to equalize the trial numbers by e.g. random removal of some trials before computing any statistics? Is this advisable? Performing a second level t-test (in your case, between different groups of subjects) on first level t-tests is very unusual. In fact, this would imply that you second level t-test is about an hypothesis that pertains to first level t-tests. Instead, one always performs a second level t-test on first-level averages (typically baseline-normalized to deal with individual differences in distance to the helmet or baseline power). Differences in number of trials per conditions is never a problem as long as your first-level measure (the baseline-normalized mean) is unbiased. Question 2) Minimum trials required for source-level significance? The supplementary info. accompanying the 2007 paper illustrated some minimum trial numbers required for obtaining a significant effect at the sensor-level analysis, given some threshold (e.g. cluster>250 sensor-time pairs). Has anyone systematically shown what is the minimum number of trials required to obtain significant clusters/fdr stats at the source-level analysis? If not, is there a sensible way to find out? (presumably involving some form of bootstrapping and simulation?) There is no sensible way to find out this minimum number of trials, because the true effect size is unknown. This relates to another issue I have with regards to 'within-subjects' comparison for 2 experimental conditions A and B where there are average trial number differences both within and between subject groups: condA_Ntrials_C ~= 100 condB_Ntrials_C ~= 60 (min. =35) condA_Ntrials_P ~= 80 condB_Ntrials_P ~= 50 (min. =35) A similar concern of uneven trials arises if say I wish to perform a within subjects comparison between the experimental conditions. I think I’ve dealt with this question. In general, Q: Would the intended 2-step statistical test (as described above) be appropriate, OR would it best to control for 'equal' number of trials for all subjects and conditions of interest? I think I’ve answered this. Best, Eric Maris I would really appreciate it if someone could kindly comment or offer advise where appropriate. Thank you very much in advance for your time. Yours sincerely, May -- Heng-Ru May Tan Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive Neuroimaging (CCNi) ▫ University of Glasgow 58 Hillhead Street, Glasgow G12 8QB ▫ +44 (0)141-330-5090 ▫ Heng-RuMay.Tan at glasgow.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Wed Oct 16 11:19:17 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Wed, 16 Oct 2013 11:19:17 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters Message-ID: <525E5A15.9080900@gmail.com> Dear all, I'm trying to run ft_sourcestatistics with a specified ROI. It's data (MNEs) averaged over time. If I run ft_sourcestatistics without an ROI, I get a cluster with prob = .178. It looks like this (figure attached), where I masked using the t-values. Since I'm dealing with an N400-like component, I've got good reasons to expect the effect to be localised (mainly) to left temporal areas. So I tried adding this to my cfg: cfgst.atlas = 'aal\ROI_MNI_V4.nii'; cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; cfgst.avgoverroi = 'yes'; cfgst.hemisphere = 'left'; cfgst.inputcoord = 'mni' ; stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); If cfgst.avgoverroi == 'yes'; I get the following error: ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 187 tmp(cfg.inside) = postailobs; Error in ==> ft_statistics_montecarlo at 326 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 298 [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); If cfgst.avgoverroi == 'no'; ft outputs "found positive clusters in observed data" and stat.posclusters/negclusters is only NaN. This is regardless of whether cfgst.roi is one label or a cell array. Does anyone know what I'm doing wrong? I've been completely stuck on source statistics for these MNEs for days, so /any/ help would be highly appreciated, even if it is to suggest another way to do the stats! Thanks a lot, Vitória -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figure.png Type: image/png Size: 111863 bytes Desc: not available URL: From Heng-RuMay.Tan at glasgow.ac.uk Wed Oct 16 12:06:28 2013 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Wed, 16 Oct 2013 11:06:28 +0100 Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers In-Reply-To: References: Message-ID: <525E6524.4070402@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From kgm at tf.uni-kiel.de Wed Oct 16 15:30:49 2013 From: kgm at tf.uni-kiel.de (kgm at tf.uni-kiel.de) Date: Wed, 16 Oct 2013 15:30:49 +0200 Subject: [FieldTrip] Question on forward modeling Message-ID: Hello, I am trying to do forward modeling using individual MRI and MEG from Neuromag306 system. I have three questions. I have performed the following steps: 1. ft_read_mri 2. ft_volumerealign 3. ft_volumesegment Q1. At this point I want to check if the segmentation fits the MRI correctly. So I used ft_sourceplot but I am getting the following message with an empty plot: the input is segmented volume data with dimensions [256 256 176] scaling anatomy to [0 1] no functional parameter no masking parameter the call to "ft_sourceplot" took 4 seconds 4. ft_prepare_headmodel, method: singleshell 5. ft_plot_sens and ft_plot_vol, after converting the units Q2. The plot shows that the sensors/electrodes are quiet far away from the brain. Is there a means to do some projection to lower them a bit? Or is the problem arising from the co-registration? I have attached the figure. Q3. I have also used 'localspheres' method to prepare the head model. The output of the plot (attached) gives me some rounded image which does not look like a brain. Is there another function used to plot the local spheres? Looking forward for the response. Best regards, Ms.c. Kidist G.Mideksa Department of Neurology, Uni-Klinikum, Kiel, Germany -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodel_singleshell.fig Type: application/octet-stream Size: 57187 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodel_localspheres.fig Type: application/octet-stream Size: 693817 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Wed Oct 16 15:53:24 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 16 Oct 2013 15:53:24 +0200 Subject: [FieldTrip] Question on forward modeling In-Reply-To: References: Message-ID: <525E9A53.70308@donders.ru.nl> Hi Kidist, On 10/16/2013 3:30 PM, kgm at tf.uni-kiel.de wrote: > Hello, > > I am trying to do forward modeling using individual MRI and MEG from > Neuromag306 system. I have three questions. > > I have performed the following steps: > > 1. ft_read_mri > 2. ft_volumerealign > 3. ft_volumesegment > Q1. At this point I want to check if the segmentation fits the MRI > correctly. So I used ft_sourceplot but I am getting the following > message with an empty plot: > the input is segmented volume data with dimensions [256 256 176] > scaling anatomy to [0 1] > no functional parameter > no masking parameter > the call to "ft_sourceplot" took 4 seconds Hard to tell, maybe post a snippet of your cfg? First, however, you might want to have a look at this tutorial and especially check how the segmented mri is plotted and what else is done: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#preparing_the_data_and_the_forward_and_inverse_model > 4. ft_prepare_headmodel, method: singleshell > 5. ft_plot_sens and ft_plot_vol, after converting the units > Q2. The plot shows that the sensors/electrodes are quiet far away from > the brain. Is there a means to do some projection to lower them a bit? > Or is the problem arising from the co-registration? I have attached the > figure. Most likely, this is indeed a problem with the co-registration, or the subject was just seated that way. You mustn't just project sensors to make the plot appeal better to you ;) > Q3. I have also used 'localspheres' method to prepare the head model. > The output of the plot (attached) gives me some rounded image which > does not look like a brain. Is there another function used to plot the > local spheres? My guess is that you need to reduce the radii of the localspheres. Looks like they are defined in cm while the rest of your anatomy is defined in mm. Best, Jörn > > Looking forward for the response. > > Best regards, > > Ms.c. Kidist G.Mideksa > Department of Neurology, > Uni-Klinikum, Kiel, Germany > > > _______________________________________________ > 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 Wed Oct 16 16:07:41 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 16 Oct 2013 16:07:41 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: <525E5A15.9080900@gmail.com> References: <525E5A15.9080900@gmail.com> Message-ID: <525E9DAD.7000107@donders.ru.nl> Hi Vitoria, I guess that is the same error that Roey Schurr described a few days back. There were some changes recently in the atlas lookup function (we replaced one function and made another more general). Apparently that broke some things, or you two just happen to do this as the first ever ;) The only thing I can think of is that you might need to interpolate to the MNI template so that the dimensions are matched between the atlas and your source structures. Could you give that a try and let us know whether that helps? Best, Jörn On 10/16/2013 11:19 AM, Vitória Magalhães Piai wrote: > Dear all, > > I'm trying to run ft_sourcestatistics with a specified ROI. It's data > (MNEs) averaged over time. > > If I run ft_sourcestatistics without an ROI, I get a cluster with prob > = .178. It looks like this (figure attached), where I masked using the > t-values. > Since I'm dealing with an N400-like component, I've got good reasons > to expect the effect to be localised (mainly) to left temporal areas. > > So I tried adding this to my cfg: > > cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' > 'Temporal_Inf_L' }; > cfgst.avgoverroi = 'yes'; > cfgst.hemisphere = 'left'; > cfgst.inputcoord = 'mni' ; > stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > > If cfgst.avgoverroi == 'yes'; I get the following error: > > ??? In an assignment A(:) = B, the number of elements in A and B > must be the same. > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > If cfgst.avgoverroi == 'no'; > ft outputs "found positive clusters in observed data" and > stat.posclusters/negclusters is only NaN. This is regardless of > whether cfgst.roi is one label or a cell array. > > Does anyone know what I'm doing wrong? > I've been completely stuck on source statistics for these MNEs for > days, so /any/ help would be highly appreciated, even if it is to > suggest another way to do the stats! > > Thanks a lot, Vitória > > > _______________________________________________ > 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 kgm at tf.uni-kiel.de Wed Oct 16 16:57:11 2013 From: kgm at tf.uni-kiel.de (kgm at tf.uni-kiel.de) Date: Wed, 16 Oct 2013 16:57:11 +0200 Subject: [FieldTrip] Question on forward modeling In-Reply-To: <525E9A53.70308@donders.ru.nl> References: <525E9A53.70308@donders.ru.nl> Message-ID: Hi Jörn, > Hard to tell, maybe post a snippet of your cfg? First, however, you > might want to have a look at this tutorial and especially check how the > segmented mri is plotted and what else is done: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#preparing_the_data_and_the_forward_and_inverse_model > I have exactly followed what is stated on the tutorial. The cfg for the ft_sourceplot function is: cfg.funparameter = 'gray'; The cfg for the ft_volumesegment function is: cfg.method = 'interactive'; cfg.coordsys = 'neuromag'; cfg.output = 'brain'; > My guess is that you need to reduce the radii of the localspheres. Looks > like they are defined in cm while the rest of your anatomy is defined in > mm. > I have also reduced from cm to mm but still it is the same. Best regards, Kidist From phyllis.mania at uni-hamburg.de Wed Oct 16 18:09:03 2013 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Wed, 16 Oct 2013 18:09:03 +0200 Subject: [FieldTrip] error with runica Message-ID: <004501ceca8a$08552b20$18ff8160$@uni-hamburg.de> Dear all, I have a problem with running an ICA in one of my subjects (EEG, 70 channels, 878 trials), even though it was preprocessed exactly like all others (same number of channels, similar number of trials). When calling ft_componentanalysis with 'runica' the learning rate gets as low as 3.09032e-05 before it actually starts with step 1. It takes up to 512 steps (very slowly) but the lrate never changes from 0 after the first few steps while the angledelta is constant at 22.3. In the the end I get the following warning: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.190323e-16. > In runica at 1430 In ft_componentanalysis at 463 When trying to plot the components with ft_topoplotTFR only one black & white head shows up and the following error: Error using surf (line 75) X, Y, Z, and C cannot be complex. Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 185) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_topoplotIC (line 148) ft_topoplotTFR(cfg, varargin{:}); Running 'fastica' seems to work fine. I read about the issue with some 64 bit computers but the workaround with pop_runica didn't work for me. Thank you in advance! Best, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Oct 16 18:20:33 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Wed, 16 Oct 2013 18:20:33 +0200 (CEST) Subject: [FieldTrip] error with runica In-Reply-To: <004501ceca8a$08552b20$18ff8160$@uni-hamburg.de> Message-ID: <1163701128.3323422.1381940433385.JavaMail.root@sculptor.zimbra.ru.nl> Hi Phyllis, This error occurs when the input data is rank deficient, see: http://fieldtrip.fcdonders.nl/faq/why_does_my_ica_output_contain_complex_numbers Try to exclude the reference channel of your EEG (which is a linear combination of other EEG channels and can produce the rank deficiency) or ask runinca N independent components being N the rank of your data best, Diego ----- Original Message ----- > From: "Phyllis Mania" > To: fieldtrip at science.ru.nl > Sent: Wednesday, 16 October, 2013 6:09:03 PM > Subject: [FieldTrip] error with runica > Dear all, > I have a problem with running an ICA in one of my subjects (EEG, 70 > channels, 878 trials), even though it was preprocessed exactly like > all others (same number of channels, similar number of trials). When > calling ft_componentanalysis with ‘runica’ the learning rate gets as > low as 3.09032e-05 before it actually starts with step 1. It takes up > to 512 steps (very slowly) but the lrate never changes from 0 after > the first few steps while the angledelta is constant at 22.3. > In the the end I get the following warning: > Warning: Matrix is close to singular or badly scaled. Results may be > inaccurate. RCOND = 1.190323e-16. > > In runica at 1430 > In ft_componentanalysis at 463 > When trying to plot the components with ft_topoplotTFR only one black > & white head shows up and the following error: > Error using surf (line 75) > X, Y, Z, and C cannot be complex. > Error in ft_plot_topo (line 251) > h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', > 'none', 'FaceColor', shading); > Error in topoplot_common (line 704) > ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... > Error in ft_topoplotTFR (line 185) > [cfg] = topoplot_common(cfg, varargin{:}); > Error in ft_topoplotIC (line 148) > ft_topoplotTFR(cfg, varargin{:}); > Running ‘fastica’ seems to work fine. I read about the issue with some > 64 bit computers but the workaround with pop_runica didn’t work for > me. > Thank you in advance! > Best, > Phyllis > _______________________________________________ > 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 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Wed Oct 16 19:06:13 2013 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Wed, 16 Oct 2013 19:06:13 +0200 Subject: [FieldTrip] error with runica Message-ID: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> Dear Diego, thank you for getting back to me so quickly! While the ref channel was actually excluded it still worked when I did N-1. Would you suggest this as a general rule for all subjects, to keep it constant? I do have different numbers of channels across subjects, because I sometimes need to exclude one that didn't record (usually Iz). Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Oct 16 19:10:20 2013 From: roeysc at gmail.com (Roey) Date: Wed, 16 Oct 2013 20:10:20 +0300 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: <525E9DAD.7000107@donders.ru.nl> References: <525E5A15.9080900@gmail.com> <525E9DAD.7000107@donders.ru.nl> Message-ID: Hi Vitoria and everyone else, I agree with Jörn (thank you!) , indeed it seems this is the same problem. Hopefully I'll get back to it next week and maybe figure it out. Right now it seems like the A side consists of all the inside-voxels, whereas the B side consists of the different ROIs, and hence the mismatch. A possible solution could be having the atlas we are using available to that function, and translating the B side to the voxel space. By the way, are you using an MNI grid per subject? Best, roey ב-16 באוק 2013, בשעה 17:07, "Jörn M. Horschig" כתב/ה: > Hi Vitoria, > > I guess that is the same error that Roey Schurr described a few days back. There were some changes recently in the atlas lookup function (we replaced one function and made another more general). Apparently that broke some things, or you two just happen to do this as the first ever ;) > The only thing I can think of is that you might need to interpolate to the MNI template so that the dimensions are matched between the atlas and your source structures. Could you give that a try and let us know whether that helps? > > Best, > Jörn > > > On 10/16/2013 11:19 AM, Vitória Magalhães Piai wrote: >> Dear all, >> >> I'm trying to run ft_sourcestatistics with a specified ROI. It's data (MNEs) averaged over time. >> >> If I run ft_sourcestatistics without an ROI, I get a cluster with prob = .178. It looks like this (figure attached), where I masked using the t-values. >> Since I'm dealing with an N400-like component, I've got good reasons to expect the effect to be localised (mainly) to left temporal areas. >> >> So I tried adding this to my cfg: >> >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; >> cfgst.avgoverroi = 'yes'; >> cfgst.hemisphere = 'left'; >> cfgst.inputcoord = 'mni' ; >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); >> >> If cfgst.avgoverroi == 'yes'; I get the following error: >> >> ??? In an assignment A(:) = B, the number of elements in A and B >> must be the same. >> Error in ==> clusterstat at 187 >> tmp(cfg.inside) = postailobs; >> Error in ==> ft_statistics_montecarlo at 326 >> [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); >> Error in ==> statistics_wrapper at 298 >> [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> If cfgst.avgoverroi == 'no'; >> ft outputs "found positive clusters in observed data" and stat.posclusters/negclusters is only NaN. This is regardless of whether cfgst.roi is one label or a cell array. >> >> Does anyone know what I'm doing wrong? >> I've been completely stuck on source statistics for these MNEs for days, so any help would be highly appreciated, even if it is to suggest another way to do the stats! >> >> Thanks a lot, Vitória >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From merhart at ucsd.edu Wed Oct 16 20:11:43 2013 From: merhart at ucsd.edu (Matt Erhart) Date: Wed, 16 Oct 2013 11:11:43 -0700 Subject: [FieldTrip] Elekta Neuromag306 Trigger Extraction Message-ID: Hello, For about 5 of my 20 subjects, the trigger channel STI101 is returning incorrect values probably because of noise in that channel. How can I use the digital triggers, i.e. [STI001:STI006] for one task and [STI001:STI008 STI011:STI012] for another, properly? How can I adjust the extraction from STI101 such that it might be more tolerant to noise in a given subject? What's the best practice for checking/changing triggers by hand if the above don't fully work? I've got some real trigger values < 5, will I break something if I turn off fixneuromag and allow them to be included by default? thanks! Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Oct 16 20:15:04 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Diego Lozano Soldevilla) Date: Wed, 16 Oct 2013 20:15:04 +0200 Subject: [FieldTrip] error with runica In-Reply-To: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> References: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> Message-ID: Hi Phyllis, If your participants differ in number of channels, I'd adjust individually the number of independent components computing the rank of the data before running ICA. best, Diego On 16 October 2013 19:06, Phyllis Mania wrote: > Dear Diego,**** > > ** ** > > thank you for getting back to me so quickly! While the ref channel was > actually excluded it still worked when I did N-1. Would you suggest this as > a general rule for all subjects, to keep it constant? I do have different > numbers of channels across subjects, because I sometimes need to exclude > one that didn’t record (usually Iz).**** > > ** ** > > Cheers, Phyllis**** > > _______________________________________________ > 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 hamid.mohseni at eng.ox.ac.uk Thu Oct 17 00:12:42 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Wed, 16 Oct 2013 23:12:42 +0100 Subject: [FieldTrip] Elekta Neuromag306 Trigger Extraction In-Reply-To: <7ccd2d77-b86d-4145-be98-568325be03c8@HUB06.ad.oak.ox.ac.uk> References: <7ccd2d77-b86d-4145-be98-568325be03c8@HUB06.ad.oak.ox.ac.uk> Message-ID: Hello Matt, Sometimes there is a binary coding problem in storing triggers value in Elekta system. For example instead of storing 1, 2, 3 it stores 257, 258, 259, respectively. In this case you need to use reminder operator rem(triggervalue, 256) to get the correct value. Is that what you are referring to? Hamid On 16 October 2013 19:11, Matt Erhart wrote: > Hello, > > For about 5 of my 20 subjects, the trigger channel STI101 is returning > incorrect values probably because of noise in that channel. > > How can I use the digital triggers, i.e. [STI001:STI006] for one task and > [STI001:STI008 STI011:STI012] for another, properly? > > How can I adjust the extraction from STI101 such that it might be more > tolerant to noise in a given subject? > > What's the best practice for checking/changing triggers by hand if the > above don't fully work? > > I've got some real trigger values < 5, will I break something if I turn > off fixneuromag and allow them to be included by default? > > thanks! > Matt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Fellow Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Thu Oct 17 10:30:46 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Thu, 17 Oct 2013 10:30:46 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters Message-ID: Hi Roey and Joern, Joern, my subjects' data are interpolated to the MNI template, as far as I understand. I'm using a code that Jan-Mathijs and I worked on some time ago, so what I'm doing should be really close to what's in the tutorial. The only thing I can tell that is in the tutorial but not in my code is the following: "After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the template_grid onto the subjects's source, which is thereby in MNI coordinates." In my code, we only copied .pos and .dim from the template to the subjects, but not .xgrid, .ygrid, .zgrid. Would that explain the error? I think I was using an FT version from the beginning of October when I got the error (running in my PC, so not the DCCN's... sorry, I cannot look that up now). When were the changes made you are referring to? I could look up which version I was using (sorry for missing this very crucial information in my last email), but it might as well be the case, as you mentioned, that Roey and I are the first ones to try it out in this particular way ;) Let me know if you need more info. Btw, I have these data in a hard disk at the DCCN if you need to have a look. Roey, yes, I'm using an MNI grid per subject (similar to the tutorial: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space> Make the individual subjects' grid). Cheers, Vitoria > ------------------------------ > > Message: 3 > Date: Wed, 16 Oct 2013 20:10:20 +0300 > From: Roey > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source statistics with ROI yields NaN > clusters > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Vitoria and everyone else, > > I agree with J?rn (thank you!) , indeed it seems this is the same > problem. Hopefully I'll get back to it next week and maybe figure it > out. Right now it seems like the A side consists of all the > inside-voxels, whereas the B side consists of the different ROIs, and > hence the mismatch. > > A possible solution could be having the atlas we are using available > to that function, and translating the B side to the voxel space. > > By the way, are you using an MNI grid per subject? > > Best, > roey > > > > ?-16 ???? 2013, ???? 17:07, "J?rn M. Horschig" > ???/?: > > > Hi Vitoria, > > > > I guess that is the same error that Roey Schurr described a few days > > back. There were some changes recently in the atlas lookup function > > (we replaced one function and made another more general). Apparently > > that broke some things, or you two just happen to do this as the > > first ever ;) > > The only thing I can think of is that you might need to interpolate > > to the MNI template so that the dimensions are matched between the > > atlas and your source structures. Could you give that a try and let > > us know whether that helps? > > > > Best, > > J?rn > > > > > > On 10/16/2013 11:19 AM, Vit?ria Magalh?es Piai wrote: > >> Dear all, > >> > >> I'm trying to run ft_sourcestatistics with a specified ROI. It's > >> data (MNEs) averaged over time. > >> > >> If I run ft_sourcestatistics without an ROI, I get a cluster with > >> prob = .178. It looks like this (figure attached), where I masked > >> using the t-values. > >> Since I'm dealing with an N400-like component, I've got good > >> reasons to expect the effect to be localised (mainly) to left > >> temporal areas. > >> > >> So I tried adding this to my cfg: > >> > >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; > >> cfgst.avgoverroi = 'yes'; > >> cfgst.hemisphere = 'left'; > >> cfgst.inputcoord = 'mni' ; > >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > >> > >> If cfgst.avgoverroi == 'yes'; I get the following error: > >> > >> ??? In an assignment A(:) = B, the number of elements in A and B > >> must be the same. > >> Error in ==> clusterstat at 187 > >> tmp(cfg.inside) = postailobs; > >> Error in ==> ft_statistics_montecarlo at 326 > >> [stat, cfg] = clusterstat(cfg, statrand, > >> statobs,'issource',issource); > >> Error in ==> statistics_wrapper at 298 > >> [stat, cfg] = statmethod(cfg, dat, design, > >> 'issource',issource); > >> Error in ==> ft_sourcestatistics at 107 > >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > >> > >> If cfgst.avgoverroi == 'no'; > >> ft outputs "found positive clusters in observed data" and > >> stat.posclusters/negclusters is only NaN. This is regardless of > >> whether cfgst.roi is one label or a cell array. > >> > >> Does anyone know what I'm doing wrong? > >> I've been completely stuck on source statistics for these MNEs for > >> days, so any help would be highly appreciated, even if it is to > >> suggest another way to do the stats! > >> > >> Thanks a lot, Vit?ria > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > J?rn M. Horschig > > PhD Student > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Neuronal Oscillations Group > > FieldTrip Development Team > > > > P.O. Box 9101 > > NL-6500 HB Nijmegen > > The Netherlands > > > > Contact: > > E-Mail: jm.horschig at donders.ru.nl > > Tel: +31-(0)24-36-68493 > > Web: http://www.ru.nl/donders > > > > Visiting address: > > Trigon, room 2.30 > > Kapittelweg 29 > > NL-6525 EN Nijmegen > > The Netherlands > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131016/239e9cf4/attachment.html > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 35, Issue 29 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 12:32:36 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 12:32:36 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: References: Message-ID: <525FBCC4.7050502@donders.ru.nl> Hi Vitoria, the change should be from September 24, when we had our last bug binge. the xgrid, ygrid and zgrid variables should not matter - actually that should be deleted from the tutorial. However, what I meant was not that you build the grids in MNI space, but interpolate the grid with a 1cm or0.8cm resolution to the full MNI template using ft_sourceinterpolate, just like you would before plotting. But, I have no clue what has changed in the code, so this is just a desperate idea :) I think it would be wise to check with JM when he is back, as he is the source-guru. Could you open up a new bug for this? Then it might be easier for us (i.e. JM) to work on this. Best, Jörn On 10/17/2013 10:30 AM, Vitória Piai wrote: > > Hi Roey and Joern, > > Joern, my subjects' data are interpolated to the MNI template, as far > as I understand. I'm using a code that Jan-Mathijs and I worked on > some time ago, so what I'm doing should be really close to what's in > the tutorial. The only thing I can tell that is in the tutorial but > not in my code is the following: > "After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field > from the template_grid onto the subjects's source, which is thereby in > MNI coordinates." > In my code, we only copied .pos and .dim from the template to the > subjects, but not .xgrid, .ygrid, .zgrid. Would that explain the error? > I think I was using an FT version from the beginning of October when I > got the error (running in my PC, so not the DCCN's... sorry, I cannot > look that up now). When were the changes made you are referring to? I > could look up which version I was using (sorry for missing this very > crucial information in my last email), but it might as well be the > case, as you mentioned, that Roey and I are the first ones to try it > out in this particular way ;) > Let me know if you need more info. Btw, I have these data in a hard > disk at the DCCN if you need to have a look. > > Roey, yes, I'm using an MNI grid per subject (similar to the tutorial: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Make the individual subjects' grid). > > Cheers, Vitoria > > > ------------------------------ > > > > Message: 3 > > Date: Wed, 16 Oct 2013 20:10:20 +0300 > > From: Roey > > > To: FieldTrip discussion list > > > Subject: Re: [FieldTrip] source statistics with ROI yields NaN > > clusters > > Message-ID: > > > Content-Type: text/plain; charset="utf-8" > > > > Hi Vitoria and everyone else, > > > > I agree with J?rn (thank you!) , indeed it seems this is the same > > problem. Hopefully I'll get back to it next week and maybe figure it > > out. Right now it seems like the A side consists of all the > > inside-voxels, whereas the B side consists of the different ROIs, and > > hence the mismatch. > > > > A possible solution could be having the atlas we are using available > > to that function, and translating the B side to the voxel space. > > > > By the way, are you using an MNI grid per subject? > > > > Best, > > roey > > > > > > > > ?-16 ???? 2013, ???? 17:07, "J?rn M. Horschig" > > > ???/?: > > > > > Hi Vitoria, > > > > > > I guess that is the same error that Roey Schurr described a few days > > > back. There were some changes recently in the atlas lookup function > > > (we replaced one function and made another more general). Apparently > > > that broke some things, or you two just happen to do this as the > > > first ever ;) > > > The only thing I can think of is that you might need to interpolate > > > to the MNI template so that the dimensions are matched between the > > > atlas and your source structures. Could you give that a try and let > > > us know whether that helps? > > > > > > Best, > > > J?rn > > > > > > > > > On 10/16/2013 11:19 AM, Vit?ria Magalh?es Piai wrote: > > >> Dear all, > > >> > > >> I'm trying to run ft_sourcestatistics with a specified ROI. It's > > >> data (MNEs) averaged over time. > > >> > > >> If I run ft_sourcestatistics without an ROI, I get a cluster with > > >> prob = .178. It looks like this (figure attached), where I masked > > >> using the t-values. > > >> Since I'm dealing with an N400-like component, I've got good > > >> reasons to expect the effect to be localised (mainly) to left > > >> temporal areas. > > >> > > >> So I tried adding this to my cfg: > > >> > > >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > > >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; > > >> cfgst.avgoverroi = 'yes'; > > >> cfgst.hemisphere = 'left'; > > >> cfgst.inputcoord = 'mni' ; > > >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > > >> > > >> If cfgst.avgoverroi == 'yes'; I get the following error: > > >> > > >> ??? In an assignment A(:) = B, the number of elements in A and B > > >> must be the same. > > >> Error in ==> clusterstat at 187 > > >> tmp(cfg.inside) = postailobs; > > >> Error in ==> ft_statistics_montecarlo at 326 > > >> [stat, cfg] = clusterstat(cfg, statrand, > > >> statobs,'issource',issource); > > >> Error in ==> statistics_wrapper at 298 > > >> [stat, cfg] = statmethod(cfg, dat, design, > > >> 'issource',issource); > > >> Error in ==> ft_sourcestatistics at 107 > > >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > >> > > >> If cfgst.avgoverroi == 'no'; > > >> ft outputs "found positive clusters in observed data" and > > >> stat.posclusters/negclusters is only NaN. This is regardless of > > >> whether cfgst.roi is one label or a cell array. > > >> > > >> Does anyone know what I'm doing wrong? > > >> I've been completely stuck on source statistics for these MNEs for > > >> days, so any help would be highly appreciated, even if it is to > > >> suggest another way to do the stats! > > >> > > >> Thanks a lot, Vit?ria > > >> > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > > -- > > > J?rn M. Horschig > > > PhD Student > > > Donders Institute for Brain, Cognition and Behaviour > > > Centre for Cognitive Neuroimaging > > > Radboud University Nijmegen > > > Neuronal Oscillations Group > > > FieldTrip Development Team > > > > > > P.O. Box 9101 > > > NL-6500 HB Nijmegen > > > The Netherlands > > > > > > Contact: > > > E-Mail: jm.horschig at donders.ru.nl > > > Tel: +31-(0)24-36-68493 > > > Web: http://www.ru.nl/donders > > > > > > Visiting address: > > > Trigon, room 2.30 > > > Kapittelweg 29 > > > NL-6525 EN Nijmegen > > > The Netherlands > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 35, Issue 29 > > ***************************************** > > > > _______________________________________________ > 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 tahere.toosi at gmail.com Thu Oct 17 15:07:18 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Thu, 17 Oct 2013 16:37:18 +0330 Subject: [FieldTrip] Problem using ft_multiplotER - warning about color Message-ID: Hi fieldtripers I am trying to perform event-related averaging on my EEG data. My problem is when I use ft_multiplotER to plot ERPs, the plot shows up but only the ERP curves can't be seen (everything else is ok) and I receive the following warning: Warning: do not know how to plot the lines in the appropriate color > In ft_plot_vector at 393 In ft_multiplotER at 635 Even when I try the fieldtrip example, I receive the same warning and still no ERP. %the code just like example cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; cfg.layout = 'CTF151.lay'; cfg.ylim = [-3e-13 3e-13]; ft_multiplotER(cfg, avgFIC); Could you please help me? Best, Tahereh -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 17 15:42:42 2013 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Thu, 17 Oct 2013 15:42:42 +0200 (CEST) Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: Message-ID: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> Hi Tahereh, Could you please provide information about what your data looks like? i.e. what is the data structure of avgFIC? Best, Nietzsche ----- Original Message ----- > From: "Tahereh Toosi" > To: "FieldTrip discussion list" > Sent: Thursday, 17 October, 2013 3:07:18 PM > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > Hi fieldtripers > > > I am trying to perform event-related averaging on my EEG data. > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > up but only the ERP curves can't be seen (everything else is ok) and I > receive the following warning: > > > > Warning: do not know how to plot the lines in the appropriate color > > In ft_plot_vector at 393 > In ft_multiplotER at 635 > > > Even when I try the fieldtrip example, I receive the same warning and > still no ERP. > > > %the code just like example > > cfg = []; > cfg.showlabels = 'yes'; > cfg.fontsize = 6; > cfg.layout = 'CTF151.lay'; > cfg.ylim = [-3e-13 3e-13]; > ft_multiplotER(cfg, avgFIC); > > > Could you please help me? > > > Best, > Tahereh > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From tahere.toosi at gmail.com Thu Oct 17 15:59:58 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Thu, 17 Oct 2013 17:29:58 +0330 Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> References: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hi Nietzsche, Thank you for your response. I have this problem even when I try the fieldtrip example here . So data structure avgFIC is exactly the same as example, like below: avgFIC = avg: [149x900 double] var: [149x900 double] time: [1x900 double] dof: [149x900 double] label: {149x1 cell} dimord: 'chan_time' grad: [1x1 struct] cfg: [1x1 struct] On Thu, Oct 17, 2013 at 5:12 PM, Lam, N.H.L. (Nietzsche) < n.lam at fcdonders.ru.nl> wrote: > Hi Tahereh, > > Could you please provide information about what your data looks like? i.e. > what is the data structure of avgFIC? > > Best, > Nietzsche > > ----- Original Message ----- > > From: "Tahereh Toosi" > > To: "FieldTrip discussion list" > > Sent: Thursday, 17 October, 2013 3:07:18 PM > > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > > Hi fieldtripers > > > > > > I am trying to perform event-related averaging on my EEG data. > > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > > up but only the ERP curves can't be seen (everything else is ok) and I > > receive the following warning: > > > > > > > > Warning: do not know how to plot the lines in the appropriate color > > > In ft_plot_vector at 393 > > In ft_multiplotER at 635 > > > > > > Even when I try the fieldtrip example, I receive the same warning and > > still no ERP. > > > > > > %the code just like example > > > > cfg = []; > > cfg.showlabels = 'yes'; > > cfg.fontsize = 6; > > cfg.layout = 'CTF151.lay'; > > cfg.ylim = [-3e-13 3e-13]; > > ft_multiplotER(cfg, avgFIC); > > > > > > Could you please help me? > > > > > > Best, > > Tahereh > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > 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 hweeling.lee at gmail.com Thu Oct 17 16:02:32 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:02:32 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue Message-ID: Hi! I'm using the command ft_artifact_zvalue, and would like to use the interactive mode. However, I keep getting an error message: Error using ft_artifact_zvalue (line 216) no channels selected. I wonder if I require to specify the channels manually. Thanks! Here's my script: clear all; close all; clc; warning off; fs = filesep; % loading eeg files for fieldtrip cfg = []; cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; % loading stimulus information cfg.trialfun = 'my_trialfun_name'; % self-made function located in D:\New_Scripts_2013\my_trialfun_name.m cfg.trialdef.pre = 1.0; cfg.trialdef.post = 1.0; cfg = ft_definetrial(cfg); [data] = ft_preprocessing(cfg); % loading eeg data into memory % to filter 50 Hz 'humming' of electric power supply cfg.bsfiler = 'yes'; cfg.bsfreq = [49 51; 99 100; 149 151]; [data] = ft_preprocessing(cfg); % loading eeg data into memory % automatic artifact rejection cfg.artfctdef.zvalue.channel = 'eeg'; cfg.artfctdef.zvalue.cutoff = 0.5; cfg.artfctdef.zvalue.trlpadding = 0; cfg.artfctdef.zvalue.fltpadding = 0; cfg.artfctdef.zvalue.artpadding = 0; [cfg, artifact] = ft_artifact_zvalue(cfg, data); -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 17 16:04:08 2013 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Thu, 17 Oct 2013 16:04:08 +0200 (CEST) Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: Message-ID: <527130139.3673130.1382018648204.JavaMail.root@indus.zimbra.ru.nl> Hi Tehareh, Actually it does seem that the issue is with the plotting function, and not so much what data type is being used. I've also managed to plot the figure, and have the axes plotted, but not ERP/ERF waveform. I will file a bug for our developement team, and then take a deeper look into it. Thanks for pointing this out to us! Best, Nietzsche ----- Original Message ----- > From: "Tahereh Toosi" > To: "FieldTrip discussion list" > Sent: Thursday, 17 October, 2013 3:07:18 PM > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > Hi fieldtripers > > > I am trying to perform event-related averaging on my EEG data. > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > up but only the ERP curves can't be seen (everything else is ok) and I > receive the following warning: > > > > Warning: do not know how to plot the lines in the appropriate color > > In ft_plot_vector at 393 > In ft_multiplotER at 635 > > > Even when I try the fieldtrip example, I receive the same warning and > still no ERP. > > > %the code just like example > > cfg = []; > cfg.showlabels = 'yes'; > cfg.fontsize = 6; > cfg.layout = 'CTF151.lay'; > cfg.ylim = [-3e-13 3e-13]; > ft_multiplotER(cfg, avgFIC); > > > Could you please help me? > > > Best, > Tahereh > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From zizlsperger at gmail.com Thu Oct 17 16:17:45 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Thu, 17 Oct 2013 16:17:45 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP Message-ID: Hi all, I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): In my example the two datasets have the structure: disp(EEG1_HC35_GA_JD_ICA_Coh5cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [314x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [314x32 double] cfg: [1x1 struct] disp(EEG1_HC35_GA_JD_ICA_Coh70cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [206x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [206x32 double] cfg: [1x1 struct] When I try to do the sourceanalysis by: cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); save source sourceCoh5 sourceCoh70; I get the error: the input is timelock data with 32 channels and 7000 timebins using headmodel specified in the configuration using electrodes specified in the configuration determining source compartment (3) projecting electrodes on skin surface combining electrode transfer and system matrix creating dipole grid based on user specified dipole positions using headmodel specified in the configuration using gradiometers specified in the configuration 8196 dipoles inside, 0 dipoles outside brain the call to "ft_prepare_sourcemodel" took 0 seconds estimating current density distribution for repetition 1 using pre-computed leadfields: some of the specified options will not have an effect Warning: computing a unregularised minimum norm solution. This typically does not work due to numerical accuracy problems > In minimumnormestimate at 150 In ft_sourceanalysis at 856 ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> minimumnormestimate at 226 mom = w * dat; Error in ==> ft_sourceanalysis at 856 dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Is this due to the different trial numbers of the datasets or does it point to another problem? Thanks in advance Best Leo RWTH Aachen Neurology -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Thu Oct 17 16:21:03 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Thu, 17 Oct 2013 16:21:03 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: References: Message-ID: I think "cfg.artfctdef.zvalue.channel" should be a SINGLE channel (use labels or ordinal numbers) cheers, T 2013/10/17 Hwee Ling Lee > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 16:28:54 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 16:28:54 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: References: Message-ID: <525FF426.6030200@donders.ru.nl> Hi, try using the upper-case abbreviation 'EEG'. Groetjes Jörn On 10/17/2013 4:02 PM, Hwee Ling Lee wrote: > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > > _______________________________________________ > 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 hweeling.lee at gmail.com Thu Oct 17 16:30:51 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:30:51 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: <525FF426.6030200@donders.ru.nl> References: <525FF426.6030200@donders.ru.nl> Message-ID: thanks to all, for helpful suggestions! On 17 October 2013 16:28, "Jörn M. Horschig" wrote: > Hi, > > try using the upper-case abbreviation 'EEG'. > > Groetjes > Jörn > > > On 10/17/2013 4:02 PM, Hwee Ling Lee wrote: > > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > > _______________________________________________ > 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 > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Thu Oct 17 16:48:49 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:48:49 +0200 Subject: [FieldTrip] another question regarding display of ICA results Message-ID: Hi all, My data has only 13 channels for ICA preprocessing, and I would like to display the components from the ICA preprocessing. I use this: cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blcoksize = 50; cfg.channels = [1:13]; ft_databrowser(cfg,ic_data); However, I was prompted an error message: cannot infer sensor type. Is it possible to display the components using a generic layout? How can I resolve this issue? Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 17:18:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 17:18:50 +0200 Subject: [FieldTrip] another question regarding display of ICA results In-Reply-To: References: Message-ID: <525FFFDA.6010806@donders.ru.nl> Dear Hweeling, for EEG data, you always need to specify a layout manually when plotting topographies. Layouts can be found in fieldtrip/template/layout. A generic layout is EEG1020.lay. For more information, check our wikipage: http://fieldtrip.fcdonders.nl/?do=search&id=layout Best, Jörn On 10/17/2013 4:48 PM, Hwee Ling Lee wrote: > > Hi all, > > My data has only 13 channels for ICA preprocessing, and I would like > to display the components from the ICA preprocessing. > > I use this: > > cfg.viewmode = 'component'; > cfg.continuous = 'no'; > cfg.blcoksize = 50; > cfg.channels = [1:13]; > ft_databrowser(cfg,ic_data); > > However, I was prompted an error message: cannot infer sensor type. > > Is it possible to display the components using a generic layout? > > How can I resolve this issue? > > Thanks. > > Best regards, > Hweeling > > > > _______________________________________________ > 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 ben.vanlier at bsse.ethz.ch Thu Oct 17 18:20:40 2013 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Thu, 17 Oct 2013 16:20:40 +0000 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there Message-ID: Hi all, I am trying to show an increase in gamma oscillations. According to literature they should be there without a doubt. But, I am not too sure about the actual recording - i have the feeling i was just recording noise. When i eyeball raw traces, i do not see a difference between condition 1 and 2. Same for the PSD and spectrograms, just the 1/f noise. My question is, could there still be (eg low amplitude) oscillation in the data that you just wont see by eye? what is your experience in this? Using freqstatistics, some channels do show significance but im a bit skeptical. I have been playing around with freqstatistics and simulated data from freqsimulation and the stats only made sense when i could clearly see it by eye in the spectrogram as well... Cheers, Ben From Don.Rojas at ucdenver.edu Thu Oct 17 19:04:22 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 17 Oct 2013 11:04:22 -0600 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there In-Reply-To: References: Message-ID: <4DCE7020-FA7C-4704-8AD9-52F24016CA10@ucdenver.edu> Ben, Gamma oscillations are tiny and the 1/f characteristic normally obscures them in fft plots. I don't think that gamma is a particularly convincing oscillation that you would expect to see in a raw waveform because 1) it is so small and 2) it is a rather broad band that doesn't look like a sinusoid. Since you have two conditions to compare, one of which you expect to see greater gamma for, use ft_math to create a difference spectrum, which will remove much of the 1/f characteristic and emphasize the condition differences. Also, if you don't see condition differences, you can try computing the same thing for post-stimulus vs. pre-stimulus fft. The same logic would apply to your spectrograms. Best, Don On Oct 17, 2013, at 10:20 AM, "van Lier Ben" wrote: > Hi all, > > I am trying to show an increase in gamma oscillations. According to literature they should be there without a doubt. But, I am not too sure about the actual recording - i have the feeling i was just recording noise. > > When i eyeball raw traces, i do not see a difference between condition 1 and 2. Same for the PSD and spectrograms, just the 1/f noise. > > My question is, could there still be (eg low amplitude) oscillation in the data that you just wont see by eye? what is your experience in this? > > Using freqstatistics, some channels do show significance but im a bit skeptical. I have been playing around with freqstatistics and simulated data from freqsimulation and the stats only made sense when i could clearly see it by eye in the spectrogram as well... > > Cheers, > Ben > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From poil.simonshlomo at gmail.com Fri Oct 18 10:52:21 2013 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Fri, 18 Oct 2013 10:52:21 +0200 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there In-Reply-To: References: Message-ID: Hi Ben, Eyeballing data is a good start. But sometimes your eyes see something which is not really there (i.e. significant), or they might miss something (such as gamma). I think these tutorials would be relevant for you to read: http://www.nbtwiki.net/doku.php?id=tutorial:amplitude_in_classical_frequency_bands#.UmD1liQmyIA http://www.nbtwiki.net/doku.php?id=tutorial:power_spectra_wavelet_analysis_and_coherence#.UmD1NiQmyIA http://www.nbtwiki.net/doku.php?id=tutorial:compute_statistics#.UmD2NSQmyIA Good luck Simon -- Simon-Shlomo Poil, Dr. 2013/10/17 van Lier Ben > Hi all, > > I am trying to show an increase in gamma oscillations. According to > literature they should be there without a doubt. But, I am not too sure > about the actual recording - i have the feeling i was just recording noise. > > When i eyeball raw traces, i do not see a difference between condition 1 > and 2. Same for the PSD and spectrograms, just the 1/f noise. > > My question is, could there still be (eg low amplitude) oscillation in the > data that you just wont see by eye? what is your experience in this? > > Using freqstatistics, some channels do show significance but im a bit > skeptical. I have been playing around with freqstatistics and simulated > data from freqsimulation and the stats only made sense when i could clearly > see it by eye in the spectrogram as well... > > Cheers, > Ben > > > > _______________________________________________ > 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 zizlsperger at gmail.com Mon Oct 21 11:52:30 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Mon, 21 Oct 2013 11:52:30 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: References: Message-ID: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Dear all, no suggestions so far? Am I missing something obvious? In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) Would love to hear your ideas... Best Leo On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > Hi all, > I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): > In my example the two datasets have the structure: > > disp(EEG1_HC35_GA_JD_ICA_Coh5cov); > avg: [32x7000 double] > var: [32x7000 double] > time: [1x7000 double] > dof: [32x7000 double] > label: {32x1 cell} > trial: [314x32x7000 double] > dimord: 'rpt_chan_time' > trialinfo: [314x32 double] > cfg: [1x1 struct] > > > disp(EEG1_HC35_GA_JD_ICA_Coh70cov); > avg: [32x7000 double] > var: [32x7000 double] > time: [1x7000 double] > dof: [32x7000 double] > label: {32x1 cell} > trial: [206x32x7000 double] > dimord: 'rpt_chan_time' > trialinfo: [206x32 double] > cfg: [1x1 struct] > > When I try to do the sourceanalysis by: > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); > sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); > > save source sourceCoh5 sourceCoh70; > > I get the error: > > the input is timelock data with 32 channels and 7000 timebins > using headmodel specified in the configuration > using electrodes specified in the configuration > determining source compartment (3) > projecting electrodes on skin surface > combining electrode transfer and system matrix > creating dipole grid based on user specified dipole positions > using headmodel specified in the configuration > using gradiometers specified in the configuration > 8196 dipoles inside, 0 dipoles outside brain > the call to "ft_prepare_sourcemodel" took 0 seconds > estimating current density distribution for repetition 1 > using pre-computed leadfields: some of the specified options will not have an effect > Warning: computing a unregularised minimum norm solution. This typically does not work > due to numerical accuracy problems > > In minimumnormestimate at 150 > In ft_sourceanalysis at 856 > ??? Error using ==> mtimes > Inner matrix dimensions must agree. > > Error in ==> minimumnormestimate at 226 > mom = w * dat; > > Error in ==> ft_sourceanalysis at 856 > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); > > > > Is this due to the different trial numbers of the datasets or does it point to another problem? > Thanks in advance > Best > > Leo > RWTH Aachen Neurology > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Mon Oct 21 12:31:49 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Mon, 21 Oct 2013 12:31:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Message-ID: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: > Dear all, > no suggestions so far? Am I missing something obvious? > In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) > Would love to hear your ideas... > Best > Leo > > > > > On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > >> Hi all, >> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >> In my example the two datasets have the structure: >> >> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [314x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [314x32 double] >> cfg: [1x1 struct] >> >> >> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [206x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [206x32 double] >> cfg: [1x1 struct] >> >> When I try to do the sourceanalysis by: >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >> >> save source sourceCoh5 sourceCoh70; >> >> I get the error: >> >> the input is timelock data with 32 channels and 7000 timebins >> using headmodel specified in the configuration >> using electrodes specified in the configuration >> determining source compartment (3) >> projecting electrodes on skin surface >> combining electrode transfer and system matrix >> creating dipole grid based on user specified dipole positions >> using headmodel specified in the configuration >> using gradiometers specified in the configuration >> 8196 dipoles inside, 0 dipoles outside brain >> the call to "ft_prepare_sourcemodel" took 0 seconds >> estimating current density distribution for repetition 1 >> using pre-computed leadfields: some of the specified options will not have an effect >> Warning: computing a unregularised minimum norm solution. This typically does not work >> due to numerical accuracy problems >> > In minimumnormestimate at 150 >> In ft_sourceanalysis at 856 >> ??? Error using ==> mtimes >> Inner matrix dimensions must agree. >> >> Error in ==> minimumnormestimate at 226 >> mom = w * dat; >> >> Error in ==> ft_sourceanalysis at 856 >> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >> >> >> >> Is this due to the different trial numbers of the datasets or does it point to another problem? >> Thanks in advance >> Best >> >> Leo >> RWTH Aachen Neurology >> >> >> >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Mon Oct 21 12:31:49 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Mon, 21 Oct 2013 12:31:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Message-ID: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: > Dear all, > no suggestions so far? Am I missing something obvious? > In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) > Would love to hear your ideas... > Best > Leo > > > > > On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > >> Hi all, >> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >> In my example the two datasets have the structure: >> >> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [314x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [314x32 double] >> cfg: [1x1 struct] >> >> >> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [206x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [206x32 double] >> cfg: [1x1 struct] >> >> When I try to do the sourceanalysis by: >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >> >> save source sourceCoh5 sourceCoh70; >> >> I get the error: >> >> the input is timelock data with 32 channels and 7000 timebins >> using headmodel specified in the configuration >> using electrodes specified in the configuration >> determining source compartment (3) >> projecting electrodes on skin surface >> combining electrode transfer and system matrix >> creating dipole grid based on user specified dipole positions >> using headmodel specified in the configuration >> using gradiometers specified in the configuration >> 8196 dipoles inside, 0 dipoles outside brain >> the call to "ft_prepare_sourcemodel" took 0 seconds >> estimating current density distribution for repetition 1 >> using pre-computed leadfields: some of the specified options will not have an effect >> Warning: computing a unregularised minimum norm solution. This typically does not work >> due to numerical accuracy problems >> > In minimumnormestimate at 150 >> In ft_sourceanalysis at 856 >> ??? Error using ==> mtimes >> Inner matrix dimensions must agree. >> >> Error in ==> minimumnormestimate at 226 >> mom = w * dat; >> >> Error in ==> ft_sourceanalysis at 856 >> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >> >> >> >> Is this due to the different trial numbers of the datasets or does it point to another problem? >> Thanks in advance >> Best >> >> Leo >> RWTH Aachen Neurology >> >> >> >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 21 14:07:56 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 21 Oct 2013 14:07:56 +0200 Subject: [FieldTrip] fieldtrip website down for maintenance on October 22nd Message-ID: <5222E964-0CC2-4573-9A6C-14EE79D00DE9@donders.ru.nl> Dear all, Tomorrow morning, October 22nd, general DCCN network maintenance is needed and the FieldTrip website, the ftp, svn and the bugzilla server will all be down between 6:30AM and 9:00AM (CET). Hopefully the maintenance will be without issues and the downtime will be a bit shorter than this. If you know that you are going to need certain documentation, please save the html page or print it to a pdf file. best regards, Robert From Don.Rojas at ucdenver.edu Mon Oct 21 17:18:57 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 21 Oct 2013 09:18:57 -0600 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Message-ID: Based on past experience, I'd think that Stephan's suggestion is a good one to resolve the inner matrix dimension agreement error. You may have a pre-prepared leadfield with a different number of channels than the number you supply for the source solution. Check your cfg.elec.label field and see if it is the same length as the 1st dimension of EEG1_HC35_GA_JD_ICA_Coh5cov.avg. You might have left an ECG, EMG or EOG channel in the call to ft_prepare_leadfield. On Oct 21, 2013, at 4:31 AM, "smoratti at psi.ucm.es" > wrote: Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: Dear all, no suggestions so far? Am I missing something obvious? In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) Would love to hear your ideas... Best Leo On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold > wrote: Hi all, I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): In my example the two datasets have the structure: disp(EEG1_HC35_GA_JD_ICA_Coh5cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [314x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [314x32 double] cfg: [1x1 struct] disp(EEG1_HC35_GA_JD_ICA_Coh70cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [206x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [206x32 double] cfg: [1x1 struct] When I try to do the sourceanalysis by: cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); save source sourceCoh5 sourceCoh70; I get the error: the input is timelock data with 32 channels and 7000 timebins using headmodel specified in the configuration using electrodes specified in the configuration determining source compartment (3) projecting electrodes on skin surface combining electrode transfer and system matrix creating dipole grid based on user specified dipole positions using headmodel specified in the configuration using gradiometers specified in the configuration 8196 dipoles inside, 0 dipoles outside brain the call to "ft_prepare_sourcemodel" took 0 seconds estimating current density distribution for repetition 1 using pre-computed leadfields: some of the specified options will not have an effect Warning: computing a unregularised minimum norm solution. This typically does not work due to numerical accuracy problems > In minimumnormestimate at 150 In ft_sourceanalysis at 856 ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> minimumnormestimate at 226 mom = w * dat; Error in ==> ft_sourceanalysis at 856 dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Is this due to the different trial numbers of the datasets or does it point to another problem? Thanks in advance Best Leo RWTH Aachen Neurology _______________________________________________ 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 m.stoica at uke.de Mon Oct 21 17:37:07 2013 From: m.stoica at uke.de (Stoica, Mircea) Date: Mon, 21 Oct 2013 15:37:07 +0000 Subject: [FieldTrip] Normality assumptions behind FT's statistics Message-ID: Dear all, does FieldTrip perform any transform on coherence/power spectra before ft_freqstatistics? If so, it should be documented so users would not apply the transform prior to the test. If not, t-tests cannot and should not be applied to this kind of data. Best regards, Mircea -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From annevanhoogmoed at email.arizona.edu Tue Oct 22 00:59:51 2013 From: annevanhoogmoed at email.arizona.edu (van Hoogmoed, Anne H - (annevanhoogmoed)) Date: Mon, 21 Oct 2013 22:59:51 +0000 Subject: [FieldTrip] question for using ft_timelockgrandaverage Message-ID: Dear all, I'm using ft_timelockgrandaverage to make a grand average of my ERP data. However, the order of the channels is different for some people I want to include in the average. Does ft_timelockgrandaverage take this into account (i.e. does it average on channel name or on channel order)? Or do the channels need to be ordered the same for each participant. And if so, how should I do this? Thanks for your help, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 22 02:20:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Tue, 22 Oct 2013 02:20:49 +0200 Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: Dear Anne, I think ft_timelockgrandaverage expects your individual average (iavg) data structures to have equal label fields. I know that trying to "grandaverage" iavgs with different channel labels led to grand averages data structures with empty-matrix as values. If fieldtrip find labels common to all the iavg data structures they will be averaged. They are averaged on a "label" name basis, not on an ordinal basis. If you set cfg.channel to, say 1:3, and the first three channels of all your iavg datas do not have exactly the same label names it will return an empty matrix or throw an error. Hence, if you want to grand average iavgs with different channel labels, you need to previously manually change the labels so they are the same (maybe there is a more elegant solution than this workaround). I hope it was helpful, and correct, otherwise, I wish I will be corrected; Always give it a try first. It may work, it may throw an error, but understanding it you will be nearer to the solution 2013/10/22 van Hoogmoed, Anne H - (annevanhoogmoed) < annevanhoogmoed at email.arizona.edu> > Dear all,**** > > ** ** > > I’m using ft_timelockgrandaverage to make a grand average of my ERP data. > However, the order of the channels is different for some people I want to > include in the average. Does ft_timelockgrandaverage take this into account > (i.e. does it average on channel name or on channel order)? Or do the > channels need to be ordered the same for each participant. And if so, how > should I do this?**** > > ** ** > > Thanks for your help,**** > > ** ** > > Anne**** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 22 02:20:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Tue, 22 Oct 2013 02:20:49 +0200 Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: Dear Anne, I think ft_timelockgrandaverage expects your individual average (iavg) data structures to have equal label fields. I know that trying to "grandaverage" iavgs with different channel labels led to grand averages data structures with empty-matrix as values. If fieldtrip find labels common to all the iavg data structures they will be averaged. They are averaged on a "label" name basis, not on an ordinal basis. If you set cfg.channel to, say 1:3, and the first three channels of all your iavg datas do not have exactly the same label names it will return an empty matrix or throw an error. Hence, if you want to grand average iavgs with different channel labels, you need to previously manually change the labels so they are the same (maybe there is a more elegant solution than this workaround). I hope it was helpful, and correct, otherwise, I wish I will be corrected; Always give it a try first. It may work, it may throw an error, but understanding it you will be nearer to the solution 2013/10/22 van Hoogmoed, Anne H - (annevanhoogmoed) < annevanhoogmoed at email.arizona.edu> > Dear all,**** > > ** ** > > I’m using ft_timelockgrandaverage to make a grand average of my ERP data. > However, the order of the channels is different for some people I want to > include in the average. Does ft_timelockgrandaverage take this into account > (i.e. does it average on channel name or on channel order)? Or do the > channels need to be ordered the same for each participant. And if so, how > should I do this?**** > > ** ** > > Thanks for your help,**** > > ** ** > > Anne**** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Tue Oct 22 09:09:20 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Tue, 22 Oct 2013 09:09:20 +0200 Subject: [FieldTrip] grad information lost after ICA Message-ID: Hi all, When I use the external 20131017FT version to do ICA analysis , the structure grad is gone . However , everything is OK if do it on the DCCN menta . Any ideas ? 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: From j.herring at fcdonders.ru.nl Tue Oct 22 09:13:27 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Tue, 22 Oct 2013 09:13:27 +0200 (CEST) Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: <010f01cecef6$33f2a620$9bd7f260$@herring@fcdonders.ru.nl> Hi Anne, Yes, ft_timelockgrandaverage takes this into account. This used to be a problem in earlier versions of Fieldtrip (~ a year ago) but has been fixed. If you want to make sure you can always specify cfg.keepindividual = 'yes'; and see whether the channels are ordered correctly. Alternatively you could replace the data for one channel in each subject with, for example, ones and see whether ft_timelockgrandaverage produces that channel with a mean of 1 with no variation as well. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of van Hoogmoed, Anne H - (annevanhoogmoed) Sent: dinsdag 22 oktober 2013 1:00 To: fieldtrip at donders.ru.nl Subject: [FieldTrip] question for using ft_timelockgrandaverage Dear all, I'm using ft_timelockgrandaverage to make a grand average of my ERP data. However, the order of the channels is different for some people I want to include in the average. Does ft_timelockgrandaverage take this into account (i.e. does it average on channel name or on channel order)? Or do the channels need to be ordered the same for each participant. And if so, how should I do this? Thanks for your help, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Tue Oct 22 09:23:01 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Tue, 22 Oct 2013 09:23:01 +0200 Subject: [FieldTrip] grad information lost after ICA (Haiteng Jiang) In-Reply-To: References: Message-ID: <526627D5.70705@gmail.com> Hi Haiteng, It's got to do with some recent changes to low-level functions. You have to run "runica" on the latest FT version, and then you'll get the grad structure back. It worked for me that way! Cheers, Vitória On 10/22/2013 9:13 AM, fieldtrip-request at science.ru.nl wrote: > Hi all, > When I use the external 20131017FT version to do ICA analysis , the > structure grad is gone . However , everything is OK if do it on the > DCCN menta . > Any ideas ? > Best, Haiteng > > > From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 14:48:45 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke van Dijk) Date: Tue, 22 Oct 2013 14:48:45 +0200 Subject: [FieldTrip] neuromag306 sources look vertically smeared. Message-ID: Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_vertical.jpg Type: image/jpeg Size: 95892 bytes Desc: not available URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 15:00:43 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke.vanDijk at med.uni-duesseldorf.de) Date: Tue, 22 Oct 2013 13:00:43 +0000 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? Message-ID: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke __________________________________________ Hanneke van Dijk, PhD http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html Institute for Clinical Neuroscience, Heinrich Heine Universität Düsseldorf, Germany Hanneke.vanDijk at med.uni-duesseldorf.de Tel. +49 (0) 211 81 13074 __________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 15:02:30 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke.vanDijk at med.uni-duesseldorf.de) Date: Tue, 22 Oct 2013 13:02:30 +0000 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> Message-ID: <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke __________________________________________ Hanneke van Dijk, PhD http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html Institute for Clinical Neuroscience, Heinrich Heine Universität Düsseldorf, Germany Hanneke.vanDijk at med.uni-duesseldorf.de Tel. +49 (0) 211 81 13074 __________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_vertical.jpg Type: image/jpeg Size: 95892 bytes Desc: source_vertical.jpg URL: From jan.schoffelen at donders.ru.nl Tue Oct 22 15:13:27 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 22 Oct 2013 15:13:27 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> Message-ID: <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Hi Hanneke, I don't know what you expect to see, but to me it is not clear what quantity you are visualizing here (given the units). Also, note that when you put precomputed spatial filters in the cfg, the lambda specified for the second round of ft_sourceanalysis is not going to change the spatial structure of the result, because the spatial filters are fixed. Also, note that specifying '0.05%' leads to a very tiny regularization. I think that you wanted to specify '5%', which translates to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol will not be used in the second round of ft_sourceanalysis (nor in the first one if you used precomputed leadfields) I don't see the point in fiddling around with the metric units (converting it to 'mm'), but then explicitly stating them to be in 'cm'. Did you not do this when actually computing the leadfields? I hope not. Best, Jan-Mathijs On Oct 22, 2013, at 3:02 PM, wrote: > Dear all, > > My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. > > The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... > > I am wondering if any of you has an idea where I should look to find a solution. > > Further information: > > I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). > > Then compute the fourier, and do sourceanalysis as follows: > > cfg = []; > cfg.method = 'dics'; > cfg.grid = mni_grid; > cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter > cfg.grid.leadfield = source.leadfield; > cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... > cfg.vol.unit = 'cm'; > cfg.frequency = 60; > cfg.latency = 3; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = '0.05%'; > cfg.dics.normalize = 'yes'; > cfg.keeptrials = 'yes'; > cfg.rawtrial = 'yes'; % project each single trial through the filter > s = ft_sourceanalysis(cfg, f); > > Thanks in advance for any suggestion! > > Groetjes Hanneke > > > __________________________________________ > > Hanneke van Dijk, PhD > http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html > Institute for Clinical Neuroscience, > Heinrich Heine Universität Düsseldorf, Germany > Hanneke.vanDijk at med.uni-duesseldorf.de > Tel. +49 (0) 211 81 13074 > __________________________________________ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From hanneke.p.van.dijk at gmail.com Tue Oct 22 16:53:56 2013 From: hanneke.p.van.dijk at gmail.com (Hanneke van Dijk) Date: Tue, 22 Oct 2013 16:53:56 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Thanks for your quick reply. I will go through your comments one by one: 1. The plot shows the nai, and in stead of these straight vertical lines going even into the center of the brain, I expected to see blobs. 2. In the precomputed filters I have used the same lambda, I should remove the cfg from this part. I have used cfg.dics.lambda from 0.05 to 50 and as I said this only changes the 'power' but not the structure of the data. 3. About the cfg.vol. I have been fidling around with the units for quite some time, but this is the only way the functional data will not end up the size of a pea in the anatomical data. I think this has to do with ctf/neuromag/spm coordinate system differences that are not yet fixed in FieldTrip? But it seems that there is no obvious thing that could be happening then? Groetjes Hanneke On Tue, Oct 22, 2013 at 3:13 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Hanneke, > > I don't know what you expect to see, but to me it is not clear what > quantity you are visualizing here (given the units). > Also, note that when you put precomputed spatial filters in the cfg, the > lambda specified for the second round of ft_sourceanalysis is not going to > change the spatial structure of the result, because the spatial filters are > fixed. Also, note that specifying '0.05%' leads to a very tiny > regularization. I think that you wanted to specify '5%', which translates > to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol > will not be used in the second round of ft_sourceanalysis (nor in the first > one if you used precomputed leadfields) I don't see the point in fiddling > around with the metric units (converting it to 'mm'), but then explicitly > stating them to be in 'cm'. Did you not do this when actually computing the > leadfields? I hope not. > > Best, > Jan-Mathijs > > > > On Oct 22, 2013, at 3:02 PM, < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > > Dear all,**** > ** ** > My data (that are recorded with a neuromag306 system) look vertically > smeared after sourceanalysis (see attached picture). The sources look like > columns. The location (when plotted with method 'surface') looks comparable > to the sensor analysis so I am not worried about that. **** > ** ** > The noise projection (cfg.dics.lambda) is something that I have been > playing around with, but other then 'nai amplitude' de- or increases, this > does not change the sources 'verticallness'. This indicates to me that this > might be the problem... **** > ** ** > I am wondering if any of you has an idea where I should look to find a > solution. **** > ** ** > Further information:**** > ** ** > I am using a mni-normalised headmodel such as described on the site: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but > adapted to the neuromag system (I will make changes to the specific site > :-) ).**** > ** ** > Then compute the fourier, and do sourceanalysis as follows:**** > ** ** > cfg = [];**** > cfg.method = 'dics';**** > cfg.grid = mni_grid;**** > cfg.grid.filter = source.avg.filter; % precomputed filter and > leadfield to project all trials through the same filter**** > cfg.grid.leadfield = source.leadfield;**** > cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is > needed somehow...**** > cfg.vol.unit = 'cm';**** > cfg.frequency = 60;**** > cfg.latency = 3;**** > cfg.dics.projectnoise = 'yes';**** > cfg.dics.lambda = '0.05%';**** > cfg.dics.normalize = 'yes';**** > cfg.keeptrials = 'yes';**** > cfg.rawtrial = 'yes'; % project each single trial through > the filter**** > s = ft_sourceanalysis(cfg, f);**** > ** ** > Thanks in advance for any suggestion!**** > ** ** > Groetjes Hanneke**** > ** ** > ** ** > __________________________________________**** > ** ** > Hanneke van Dijk, PhD**** > > http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html > **** > Institute for Clinical Neuroscience,**** > Heinrich Heine Universität Düsseldorf, Germany**** > Hanneke.vanDijk at med.uni-duesseldorf.de**** > Tel. +49 (0) 211 81 13074 **** > > __________________________________________ > **** > ** ** > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hanneke.p.van.dijk at gmail.com Tue Oct 22 17:08:28 2013 From: hanneke.p.van.dijk at gmail.com (Hanneke van Dijk) Date: Tue, 22 Oct 2013 17:08:28 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Message-ID: Hi Jan-Mathijs, schaam schaam, The unit thing must have been fixed! So problem fixed, thanks so much! Groetjes uit Duesseldorf! Hanneke Groetjes Hanneke On Tue, Oct 22, 2013 at 4:53 PM, Hanneke van Dijk < hanneke.p.van.dijk at gmail.com> wrote: > Hi Jan-Mathijs, > > Thanks for your quick reply. I will go through your comments one by one: > > 1. The plot shows the nai, and in stead of these straight vertical lines > going even into the center of the brain, I expected to see blobs. > 2. In the precomputed filters I have used the same lambda, I should remove > the cfg from this part. I have used cfg.dics.lambda from 0.05 to 50 and as > I said this only changes the 'power' but not the structure of the data. > 3. About the cfg.vol. I have been fidling around with the units for quite > some time, but this is the only way the functional data will not end up the > size of a pea in the anatomical data. I think this has to do with > ctf/neuromag/spm coordinate system differences that are not yet fixed in > FieldTrip? > > But it seems that there is no obvious thing that could be happening then? > > Groetjes Hanneke > > > > > > > On Tue, Oct 22, 2013 at 3:13 PM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Hanneke, >> >> I don't know what you expect to see, but to me it is not clear what >> quantity you are visualizing here (given the units). >> Also, note that when you put precomputed spatial filters in the cfg, the >> lambda specified for the second round of ft_sourceanalysis is not going to >> change the spatial structure of the result, because the spatial filters are >> fixed. Also, note that specifying '0.05%' leads to a very tiny >> regularization. I think that you wanted to specify '5%', which translates >> to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol >> will not be used in the second round of ft_sourceanalysis (nor in the first >> one if you used precomputed leadfields) I don't see the point in fiddling >> around with the metric units (converting it to 'mm'), but then explicitly >> stating them to be in 'cm'. Did you not do this when actually computing the >> leadfields? I hope not. >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 22, 2013, at 3:02 PM, < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >> Dear all,**** >> ** ** >> My data (that are recorded with a neuromag306 system) look vertically >> smeared after sourceanalysis (see attached picture). The sources look like >> columns. The location (when plotted with method 'surface') looks comparable >> to the sensor analysis so I am not worried about that. **** >> ** ** >> The noise projection (cfg.dics.lambda) is something that I have been >> playing around with, but other then 'nai amplitude' de- or increases, this >> does not change the sources 'verticallness'. This indicates to me that this >> might be the problem... **** >> ** ** >> I am wondering if any of you has an idea where I should look to find a >> solution. **** >> ** ** >> Further information:**** >> ** ** >> I am using a mni-normalised headmodel such as described on the site: >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but >> adapted to the neuromag system (I will make changes to the specific site >> :-) ).**** >> ** ** >> Then compute the fourier, and do sourceanalysis as follows:**** >> ** ** >> cfg = [];**** >> cfg.method = 'dics';**** >> cfg.grid = mni_grid;**** >> cfg.grid.filter = source.avg.filter; % precomputed filter and >> leadfield to project all trials through the same filter**** >> cfg.grid.leadfield = source.leadfield;**** >> cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is >> needed somehow...**** >> cfg.vol.unit = 'cm';**** >> cfg.frequency = 60;**** >> cfg.latency = 3;**** >> cfg.dics.projectnoise = 'yes';**** >> cfg.dics.lambda = '0.05%';**** >> cfg.dics.normalize = 'yes';**** >> cfg.keeptrials = 'yes';**** >> cfg.rawtrial = 'yes'; % project each single trial through >> the filter**** >> s = ft_sourceanalysis(cfg, f);**** >> ** ** >> Thanks in advance for any suggestion!**** >> ** ** >> Groetjes Hanneke**** >> ** ** >> ** ** >> __________________________________________**** >> ** ** >> Hanneke van Dijk, PhD**** >> >> http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html >> **** >> Institute for Clinical Neuroscience,**** >> Heinrich Heine Universität Düsseldorf, Germany**** >> Hanneke.vanDijk at med.uni-duesseldorf.de**** >> Tel. +49 (0) 211 81 13074 **** >> >> __________________________________________ >> **** >> ** ** >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haristz at gmail.com Wed Oct 23 02:00:01 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Tue, 22 Oct 2013 19:00:01 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS Message-ID: Hi There, I have a question regarding ft_sourceanalysis: I in fact seem to be getting conflicting results depending on the beamformer I use . In summary (and of course, provided I have not made an error somewhere!), for a given frequency band and a predefined filter LCMV seems to output results that look more as if they are based on the covariance matrix estimated on the evoked response (ie not the covariance matrix coming from averaging one way or the other the covariance matrices resulting from individual trials as is the case with the other beamformers). So in its "vanilla" form, when I test it against SAM and DICS, LCMV gives different results. When I comment out the part of the ft_sourceanalysis code that is executed for LCMV when a filter is input with cfg (this seems to be done to speed up the process), then the results are comparable for all 3 beamformers. More in detail (apologies for the rather lenthy post): We are using a motor task and studying beta descynchronisation. The images I link to are "gradnaveraged" relative changes in beta power between a period during baseline and a period during "task" over 10 subjects. I first deform the MNI grid to individual subjects' brains so everything takes place in MNI space.For all 3 beamformers the leadfield and headmodels are calculated in the same way (except for SAM where the singleshell model is unavailable and I used localspheres instead). All this was done with fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in the code for the beamformers or ft_sourceanalysis. We used DICS (centered on an appororiately chosen frequency), SAM and LCMV with the same data and intervals. For the latter 2 I first bandpass filter the data to the beta band during ft_preprocessing. For the DICS analysis I use exactly the same procedure as in the relevant tutorial. For SAM and LCMV I do the same with the minor change that the common filter is calculated over a much larger interval that includes the "baseline" and "task" intervals at its edges, instead of creating a dataset through concatenation of the "baseline" and "task" intervals compared. So code-wise (and per subject), for DICS this is: and then: cfg = []; cfg.frequency = freq_cmb.freq; cfg.grad = senscm; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freq_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; and for SAM and LCMV: cfg=[]; cfg.bpfilter='yes'; cfg.bpfreq =[freq-fsmth freq+fsmth]; cfg.channel=params.chan; datf=ft_preprocessing(cfg,dat); cfg = []; cfg.toilim = tb; dataPre = ft_redefinetrial(cfg, datf); cfg = []; cfg.toilim = ta; dataPost = ft_redefinetrial(cfg, datf); cfg=[]; cfg.toilim = [tb(1,1) ta(1,2)]; data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength = 2; further down but this would change the solution very little clear('dat'); cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); cfg = []; cfg.grad = senscm; cfg.method = 'lcmv';% (or 'sam') cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.lambda ='5%';%relevant code added to beamformer_sam to handle this cfg.keepfilter = 'yes'; cfg.fixedori = 'yes'; cfg.projectnoise='yes'; source = ft_sourceanalysis(cfg, d_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; The results for SAM (https://db.tt/fhvEAJN0) and DICS ( https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense physiologically). LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact similar to what you'd get if using the covariance matrix of the ERP average, ie: data_cmb = ft_timelockanalysis([], data_cmb); dataPre = ft_timelockanalysis([], dataPre); dataPost = ft_timelockanalysis([], dataPost); and then (as above) cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is similar to LCMV above. This is however not what we wanted. Going through the code in ft_sourceanalysis I see there is a part (only for LCMV and when a filter is provided) where the data and covariance matrix are treated differently. I can't say I fully understand the algorithm there but when I commented out that part my LCMV results are in very good agreement with DICS and SAM ( https://db.tt/aNz11ntb). I would as always be grateful for your feedback and opinions. Am I committing an error somewhere? - should the code behave differently there? With Thanks and Best Wishes, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center -------------- next part -------------- An HTML attachment was scrubbed... URL: From haristz at gmail.com Wed Oct 23 03:02:25 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Tue, 22 Oct 2013 20:02:25 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: ...sorry, forgot to add to my post that for SAM I use the option cfg.fixedori = 'robert'; Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 22 October 2013 19:00, Charidimos Tzagarakis wrote: > Hi There, > I have a question regarding ft_sourceanalysis: I in fact seem to be > getting conflicting results depending on the beamformer I use . > > In summary (and of course, provided I have not made an error somewhere!), > for a given frequency band and a predefined filter LCMV seems to output > results that look more as if they are based on the covariance matrix > estimated on the evoked response (ie not the covariance matrix coming from > averaging one way or the other the covariance matrices resulting from > individual trials as is the case with the other beamformers). So in its > "vanilla" form, when I test it against SAM and DICS, LCMV gives different > results. When I comment out the part of the ft_sourceanalysis code that is > executed for LCMV when a filter is input with cfg (this seems to be done to > speed up the process), then the results are comparable for all 3 > beamformers. > > More in detail (apologies for the rather lenthy post): > We are using a motor task and studying beta descynchronisation. The images > I link to are "gradnaveraged" relative changes in beta power between a > period during baseline and a period during "task" over 10 subjects. I first > deform the MNI grid to individual subjects' brains so everything takes > place in MNI space.For all 3 beamformers the leadfield and headmodels are > calculated in the same way (except for SAM where the singleshell model is > unavailable and I used localspheres instead). All this was done with > fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in > the code for the beamformers or ft_sourceanalysis. > > We used DICS (centered on an appororiately chosen frequency), SAM and LCMV > with the same data and intervals. For the latter 2 I first bandpass filter > the data to the beta band during ft_preprocessing. For the DICS analysis I > use exactly the same procedure as in the relevant tutorial. For SAM and > LCMV I do the same with the minor change that the common filter is > calculated over a much larger interval that includes the "baseline" and > "task" intervals at its edges, instead of creating a dataset through > concatenation of the "baseline" and "task" intervals compared. > So code-wise (and per subject), for DICS this is: > > > and then: > > cfg = []; > cfg.frequency = freq_cmb.freq; > cfg.grad = senscm; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf; > cfg.vol = volfcm; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > > source = ft_sourceanalysis(cfg, freq_cmb); > with source_Pre and source_Post calculated with the above cfg *plus* using > the filter estimated at "source". > cfg.grid.filter = source.avg.filter; > > and for SAM and LCMV: > cfg=[]; > > cfg.bpfilter='yes'; > cfg.bpfreq =[freq-fsmth freq+fsmth]; > cfg.channel=params.chan; > datf=ft_preprocessing(cfg,dat); > > > cfg = []; > cfg.toilim = tb; > dataPre = ft_redefinetrial(cfg, datf); > cfg = []; > cfg.toilim = ta; > dataPost = ft_redefinetrial(cfg, datf); > cfg=[]; > cfg.toilim = [tb(1,1) ta(1,2)]; > data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done > data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength > = 2; further down but this would change the solution very little > > clear('dat'); > > > cfg = []; > cfg.covariance = 'yes'; > cfg.channel = params.chan; > cfg.covariancewindow = 'all'; > cfg.removemean='no'; > cfg.keeptrials ='yes'; > %keyboard > d_cmb = ft_timelockanalysis(cfg, data_cmb); > d_Pre = ft_timelockanalysis(cfg, dataPre); > d_Post = ft_timelockanalysis(cfg, dataPost); > > > cfg = []; > cfg.grad = senscm; > cfg.method = 'lcmv';% (or 'sam') > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf; > cfg.vol = volfcm; > cfg.lambda ='5%';%relevant code added to beamformer_sam to handle > this > cfg.keepfilter = 'yes'; > cfg.fixedori = 'yes'; > cfg.projectnoise='yes'; > source = ft_sourceanalysis(cfg, d_cmb); > > with source_Pre and source_Post calculated with the above cfg *plus* using > the filter estimated at "source". > cfg.grid.filter = source.avg.filter; > > > The results for SAM (https://db.tt/fhvEAJN0) and DICS ( > https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense > physiologically). > LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact > similar to what you'd get if using the covariance matrix of the ERP > average, ie: > data_cmb = ft_timelockanalysis([], data_cmb); > dataPre = ft_timelockanalysis([], dataPre); > dataPost = ft_timelockanalysis([], dataPost); > and then (as above) > cfg = []; > cfg.covariance = 'yes'; > cfg.channel = params.chan; > cfg.covariancewindow = 'all'; > cfg.removemean='no'; > cfg.keeptrials ='yes'; > %keyboard > d_cmb = ft_timelockanalysis(cfg, data_cmb); > d_Pre = ft_timelockanalysis(cfg, dataPre); > d_Post = ft_timelockanalysis(cfg, dataPost); > > I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is > similar to LCMV above. > > This is however not what we wanted. Going through the code in > ft_sourceanalysis I see there is a part (only for LCMV and when a filter is > provided) where the data and covariance matrix are treated differently. I > can't say I fully understand the algorithm there but when I commented out > that part my LCMV results are in very good agreement with DICS and SAM ( > https://db.tt/aNz11ntb). > > I would as always be grateful for your feedback and opinions. Am I > committing an error somewhere? - should the code behave differently there? > With Thanks and Best Wishes, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Wed Oct 23 20:21:25 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 23 Oct 2013 12:21:25 -0600 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: <665BB2E0-A03D-4AE2-BF14-0F7F8A422E8E@ucdenver.edu> Haris, It is a lengthy post, so forgive me if I do not understand your question very well. I take it that you are somewhat confused by the LCMV result compared to the SAM and DICS beamformers. I think that you probably have a good grasp of what is happening though. The LCMV beamformer is a time-domain beamformer, not a frequency domain beamformer, and you would normally be using it to produce a source analysis of an averaged evoked field. The SAM and DICS beamformers are both operate in the frequency domain and are likely better able to pick up non-phase-locked, or induced changes, of the type you see associated with motor beta ERD/ERS. It seems to me that it would be possible to force most of these beamformers to produce similar results. The question I have is why? Is there something particular about the LCMV option that you want to use that isn't available with the other two that are producing better results with less tinkering? To me, it seems like the particular question you have lends itself quite well to the DICS or SAM approach, both of which have been used successfully to examine sources for beta ERD prior to movement onset. Since the ERD and ERS related to motor movement is induced (not phase-locked), beamforming the time locked average is not going to be a productive strategy whether or not you calculate the covariance matrix on individual trials or on the average response. In other words, if you average the response in the time-domain rather than the frequency domain, there will be very little power change evident in beta. Best, Don On Oct 22, 2013, at 7:02 PM, Charidimos Tzagarakis > wrote: ...sorry, forgot to add to my post that for SAM I use the option cfg.fixedori = 'robert'; Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 22 October 2013 19:00, Charidimos Tzagarakis > wrote: Hi There, I have a question regarding ft_sourceanalysis: I in fact seem to be getting conflicting results depending on the beamformer I use . In summary (and of course, provided I have not made an error somewhere!), for a given frequency band and a predefined filter LCMV seems to output results that look more as if they are based on the covariance matrix estimated on the evoked response (ie not the covariance matrix coming from averaging one way or the other the covariance matrices resulting from individual trials as is the case with the other beamformers). So in its "vanilla" form, when I test it against SAM and DICS, LCMV gives different results. When I comment out the part of the ft_sourceanalysis code that is executed for LCMV when a filter is input with cfg (this seems to be done to speed up the process), then the results are comparable for all 3 beamformers. More in detail (apologies for the rather lenthy post): We are using a motor task and studying beta descynchronisation. The images I link to are "gradnaveraged" relative changes in beta power between a period during baseline and a period during "task" over 10 subjects. I first deform the MNI grid to individual subjects' brains so everything takes place in MNI space.For all 3 beamformers the leadfield and headmodels are calculated in the same way (except for SAM where the singleshell model is unavailable and I used localspheres instead). All this was done with fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in the code for the beamformers or ft_sourceanalysis. We used DICS (centered on an appororiately chosen frequency), SAM and LCMV with the same data and intervals. For the latter 2 I first bandpass filter the data to the beta band during ft_preprocessing. For the DICS analysis I use exactly the same procedure as in the relevant tutorial. For SAM and LCMV I do the same with the minor change that the common filter is calculated over a much larger interval that includes the "baseline" and "task" intervals at its edges, instead of creating a dataset through concatenation of the "baseline" and "task" intervals compared. So code-wise (and per subject), for DICS this is: and then: cfg = []; cfg.frequency = freq_cmb.freq; cfg.grad = senscm; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freq_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; and for SAM and LCMV: cfg=[]; cfg.bpfilter='yes'; cfg.bpfreq =[freq-fsmth freq+fsmth]; cfg.channel=params.chan; datf=ft_preprocessing(cfg,dat); cfg = []; cfg.toilim = tb; dataPre = ft_redefinetrial(cfg, datf); cfg = []; cfg.toilim = ta; dataPost = ft_redefinetrial(cfg, datf); cfg=[]; cfg.toilim = [tb(1,1) ta(1,2)]; data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength = 2; further down but this would change the solution very little clear('dat'); cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); cfg = []; cfg.grad = senscm; cfg.method = 'lcmv';% (or 'sam') cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.lambda ='5%';%relevant code added to beamformer_sam to handle this cfg.keepfilter = 'yes'; cfg.fixedori = 'yes'; cfg.projectnoise='yes'; source = ft_sourceanalysis(cfg, d_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; The results for SAM (https://db.tt/fhvEAJN0) and DICS (https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense physiologically). LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact similar to what you'd get if using the covariance matrix of the ERP average, ie: data_cmb = ft_timelockanalysis([], data_cmb); dataPre = ft_timelockanalysis([], dataPre); dataPost = ft_timelockanalysis([], dataPost); and then (as above) cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is similar to LCMV above. This is however not what we wanted. Going through the code in ft_sourceanalysis I see there is a part (only for LCMV and when a filter is provided) where the data and covariance matrix are treated differently. I can't say I fully understand the algorithm there but when I commented out that part my LCMV results are in very good agreement with DICS and SAM (https://db.tt/aNz11ntb). I would as always be grateful for your feedback and opinions. Am I committing an error somewhere? - should the code behave differently there? With Thanks and Best Wishes, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center _______________________________________________ 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 Wed Oct 23 20:31:06 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 23 Oct 2013 12:31:06 -0600 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Haris, Sorry - In my last post, I mistakenly put DICS and the Fieldtrip implementation of SAM into the same frequency domain category. In Fieldtrip, SAM is a time-domain technique and is not the same as the implementation of SAM that has been used in the published literature for beta ERD. So, are you then wondering why the two time-domain approaches produce differing results? That probably does depend on how the covariance matrix is calculated. Although I still think it is a bad idea to use a time-domain beamformer on motor beta ERD/ERS. Best, Don From haristz at gmail.com Wed Oct 23 21:43:24 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Wed, 23 Oct 2013 14:43:24 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Don, Thanks for your reply. I do agree that some of these beamformers are probably better suited than others to study beta desynchronisation, or generally questions in the frequency domain. I in fact started from DICS. The reason I looked at LCMV and SAM is to be sure that I get consistent results (and also because my experiment can also address some additional time domain questions, so I wanted to see what happens when my data goes from one to the other). I therefore tried to set them up so I that the results from all 3 are similar. So you are correct in pointing out that my question is why SAM and LCMV produce different results. Based on their description within the fieldtrip website and mailing list (if I have interpreted these correctly) they should be treating the covariance matrix in the same way (to get a true evoked response covariance matrix you would normally need the extra call to ft_timelockanalysis that I show at the last piece of code in my post). Also , if the covariance matrix is indeed the issue, it seems that the change in how it is treated in the ft_sourceanalysis code (based on the "hack" I described) is unique to LCMV (none of the other beamformer options share that piece of code) and is active only when LCMV is given a precomputed filter which is (I think) unusual. Hence my question! Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 23 October 2013 13:31, Rojas, Don wrote: > Haris, > > Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > implementation of SAM into the same frequency domain category. In > Fieldtrip, SAM is a time-domain technique and is not the same as the > implementation of SAM that has been used in the published literature for > beta ERD. So, are you then wondering why the two time-domain approaches > produce differing results? That probably does depend on how the covariance > matrix is calculated. Although I still think it is a bad idea to use a > time-domain beamformer on motor beta ERD/ERS. > > Best, > > Don > > > > _______________________________________________ > 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 Thu Oct 24 10:08:44 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 24 Oct 2013 10:08:44 +0200 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Charidimos, Thanks for your elaborate e-mail. We discussed this issue in yesterday's FieldTrip meeting. It is very reasonable that you expect the three methods to produce the same results, and the code/interface indeed suggests that this would be the case. In other words, we need to clean up this part of the code to produce consistent results; however, this might take a while. We believe the discrepancy is caused by the fact that you compute the covariance while specifying cfg.keeptrials = 'yes', which is unnecessary while computing the filter. This results in a covariance matrix with dimensions trial X channel X channel, which then is subsequently averaged over trials during ft_sourceanalysis. Likely the filter is still in fact computed on the averaged covariance, as it should be. However, the subsequent projection of data through the filter will not first average the covariance, and will in essence only project the first trial through the filter. (This is because the dip{} fields will be struct arrays of dimension nTrial X 1, and in an assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so everything but the first element of a struct array is ignored in an assignment statement.) Could you try to compute the covariance with cfg.keeptrials = 'no' and then run LCMV again? This will still compute the covariance on the raw traces, not on the average. If our hunch is right, you should get the correct results then. As said, this is indeed messy and unclear, our apologies for that. Finally, could you tell us what part of the code you commented out to make the results consistent? We suspect it will be between lines 790 and 835, but it would be helpful to know for sure. Best, Eelke On 23 October 2013 21:43, Charidimos Tzagarakis wrote: > Hi Don, > Thanks for your reply. I do agree that some of these beamformers > are probably better suited than others to study beta desynchronisation, or > generally questions in the frequency domain. I in fact started from DICS. > The reason I looked at LCMV and SAM is to be sure that I get consistent > results (and also because my experiment can also address some additional > time domain questions, so I wanted to see what happens when my data goes > from one to the other). I therefore tried to set them up so I that the > results from all 3 are similar. So you are correct in pointing out that my > question is why SAM and LCMV produce different results. Based on their > description within the fieldtrip website and mailing list (if I have > interpreted these correctly) they should be treating the covariance matrix > in the same way (to get a true evoked response covariance matrix you would > normally need the extra call to ft_timelockanalysis that I show at the last > piece of code in my post). Also , if the covariance matrix is indeed the > issue, it seems that the change in how it is treated in the > ft_sourceanalysis code (based on the "hack" I described) is unique to LCMV > (none of the other beamformer options share that piece of code) and is > active only when LCMV is given a precomputed filter which is (I think) > unusual. > Hence my question! > Best, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > On 23 October 2013 13:31, Rojas, Don wrote: >> >> Haris, >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip >> implementation of SAM into the same frequency domain category. In Fieldtrip, >> SAM is a time-domain technique and is not the same as the implementation of >> SAM that has been used in the published literature for beta ERD. So, are you >> then wondering why the two time-domain approaches produce differing results? >> That probably does depend on how the covariance matrix is calculated. >> Although I still think it is a bad idea to use a time-domain beamformer on >> motor beta ERD/ERS. >> >> Best, >> >> Don >> >> >> >> _______________________________________________ >> 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 zizlsperger at gmail.com Thu Oct 24 13:32:49 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Thu, 24 Oct 2013 13:32:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Message-ID: <0DEFB7B6-FE48-43EF-88BC-3982D815F4F7@gmail.com> Hello thanks, Stephan and Don, that resolved the issue. Regularisation was good advice, too. Best Leo On Oct 21, 2013, at 5:18 PM, Rojas, Don wrote: > Based on past experience, I'd think that Stephan's suggestion is a good one to resolve the inner matrix dimension agreement error. You may have a pre-prepared leadfield with a different number of channels than the number you supply for the source solution. Check your cfg.elec.label field and see if it is the same length as the 1st dimension of EEG1_HC35_GA_JD_ICA_Coh5cov.avg. You might have left an ECG, EMG or EOG channel in the call to ft_prepare_leadfield. > > On Oct 21, 2013, at 4:31 AM, "smoratti at psi.ucm.es" wrote: > >> Dear Leopold, >> >> First, you have to regularise your MNE solution. Otherwise you get unstable results. >> Second, the error occurs in mom = w*dat; >> I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. >> >> >> ________________________________________________________ >> 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: >> >>> Dear all, >>> no suggestions so far? Am I missing something obvious? >>> In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) >>> Would love to hear your ideas... >>> Best >>> Leo >>> >>> >>> >>> >>> On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: >>> >>>> Hi all, >>>> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >>>> In my example the two datasets have the structure: >>>> >>>> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >>>> avg: [32x7000 double] >>>> var: [32x7000 double] >>>> time: [1x7000 double] >>>> dof: [32x7000 double] >>>> label: {32x1 cell} >>>> trial: [314x32x7000 double] >>>> dimord: 'rpt_chan_time' >>>> trialinfo: [314x32 double] >>>> cfg: [1x1 struct] >>>> >>>> >>>> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >>>> avg: [32x7000 double] >>>> var: [32x7000 double] >>>> time: [1x7000 double] >>>> dof: [32x7000 double] >>>> label: {32x1 cell} >>>> trial: [206x32x7000 double] >>>> dimord: 'rpt_chan_time' >>>> trialinfo: [206x32 double] >>>> cfg: [1x1 struct] >>>> >>>> When I try to do the sourceanalysis by: >>>> >>>> cfg = []; >>>> cfg.method = 'mne'; >>>> cfg.elec = elec_aligned; >>>> cfg.grid = leadfield; >>>> cfg.vol = vol; >>>> cfg.mne.prewhiten = 'yes'; >>>> cfg.mne.lambda = 3; >>>> cfg.mne.scalesourcecov = 'yes'; >>>> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >>>> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >>>> >>>> save source sourceCoh5 sourceCoh70; >>>> >>>> I get the error: >>>> >>>> the input is timelock data with 32 channels and 7000 timebins >>>> using headmodel specified in the configuration >>>> using electrodes specified in the configuration >>>> determining source compartment (3) >>>> projecting electrodes on skin surface >>>> combining electrode transfer and system matrix >>>> creating dipole grid based on user specified dipole positions >>>> using headmodel specified in the configuration >>>> using gradiometers specified in the configuration >>>> 8196 dipoles inside, 0 dipoles outside brain >>>> the call to "ft_prepare_sourcemodel" took 0 seconds >>>> estimating current density distribution for repetition 1 >>>> using pre-computed leadfields: some of the specified options will not have an effect >>>> Warning: computing a unregularised minimum norm solution. This typically does not work >>>> due to numerical accuracy problems >>>> > In minimumnormestimate at 150 >>>> In ft_sourceanalysis at 856 >>>> ??? Error using ==> mtimes >>>> Inner matrix dimensions must agree. >>>> >>>> Error in ==> minimumnormestimate at 226 >>>> mom = w * dat; >>>> >>>> Error in ==> ft_sourceanalysis at 856 >>>> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >>>> >>>> >>>> >>>> Is this due to the different trial numbers of the datasets or does it point to another problem? >>>> Thanks in advance >>>> Best >>>> >>>> Leo >>>> RWTH Aachen Neurology >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> _______________________________________________ >>> 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 vitoria.piai at gmail.com Thu Oct 24 13:40:51 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Thu, 24 Oct 2013 13:40:51 +0200 Subject: [FieldTrip] Rank deficiency in ft_regressconfound: worrisome? Message-ID: <52690743.6000806@gmail.com> Hi all, and maybe more specifically Arjen, I want to compare effects on 3 different tasks on the participant level. So I'm giving ft_regressconfound a try, following the tutorial, 'cause I thought that should improve the comparability of each participant's topographies across tasks. I'm just wondering how much I should worry about the warning of "Rank deficient" when running ft_regressconfound. Any thoughts on it and on what the consequences are of having a rank deficient model for the type of comparison I'm planning to make? Thanks a lot, groetjes, Vitória -- ** Please consider the environment - do you really need to print? ** From haristz at gmail.com Fri Oct 25 01:06:19 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Thu, 24 Oct 2013 18:06:19 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Eelke, Thank you for looking into this! The piece of code I commented out is indeed [790:836] (changing line 784 accordingly or alternatively adding a copy of 785-789 after 790). I did try running ft_timelockanalysis with keeptrials='no' for all 3 calls and that resulted in the same behaviour as before for LCMV (ie not the "correct" one). I also tried it setting keeptrials='no' in ft_sourceanalysis at the same time (ie keeptrials='no' for both ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I actually had run these tests before posting but wanted to 2ble check). I may however be confused here because there are some other possible combinations with keeptrials since for each subject there is a total of 6 calls to functions that accept it as an input and the filter is estimated with only 2 of them. Do let me know if there is another combination I should run and I will do that. Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 24 October 2013 03:08, Eelke Spaak wrote: > Hi Charidimos, > > Thanks for your elaborate e-mail. We discussed this issue in > yesterday's FieldTrip meeting. It is very reasonable that you expect > the three methods to produce the same results, and the code/interface > indeed suggests that this would be the case. In other words, we need > to clean up this part of the code to produce consistent results; > however, this might take a while. > > We believe the discrepancy is caused by the fact that you compute the > covariance while specifying cfg.keeptrials = 'yes', which is > unnecessary while computing the filter. This results in a covariance > matrix with dimensions trial X channel X channel, which then is > subsequently averaged over trials during ft_sourceanalysis. Likely the > filter is still in fact computed on the averaged covariance, as it > should be. However, the subsequent projection of data through the > filter will not first average the covariance, and will in essence only > project the first trial through the filter. (This is because the dip{} > fields will be struct arrays of dimension nTrial X 1, and in an > assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so > everything but the first element of a struct array is ignored in an > assignment statement.) > > Could you try to compute the covariance with cfg.keeptrials = 'no' and > then run LCMV again? This will still compute the covariance on the raw > traces, not on the average. If our hunch is right, you should get the > correct results then. > > As said, this is indeed messy and unclear, our apologies for that. > > Finally, could you tell us what part of the code you commented out to > make the results consistent? We suspect it will be between lines 790 > and 835, but it would be helpful to know for sure. > > Best, > Eelke > > > On 23 October 2013 21:43, Charidimos Tzagarakis wrote: > > Hi Don, > > Thanks for your reply. I do agree that some of these beamformers > > are probably better suited than others to study beta desynchronisation, > or > > generally questions in the frequency domain. I in fact started from DICS. > > The reason I looked at LCMV and SAM is to be sure that I get consistent > > results (and also because my experiment can also address some additional > > time domain questions, so I wanted to see what happens when my data goes > > from one to the other). I therefore tried to set them up so I that the > > results from all 3 are similar. So you are correct in pointing out that > my > > question is why SAM and LCMV produce different results. Based on their > > description within the fieldtrip website and mailing list (if I have > > interpreted these correctly) they should be treating the covariance > matrix > > in the same way (to get a true evoked response covariance matrix you > would > > normally need the extra call to ft_timelockanalysis that I show at the > last > > piece of code in my post). Also , if the covariance matrix is indeed the > > issue, it seems that the change in how it is treated in the > > ft_sourceanalysis code (based on the "hack" I described) is unique to > LCMV > > (none of the other beamformer options share that piece of code) and is > > active only when LCMV is given a precomputed filter which is (I think) > > unusual. > > Hence my question! > > Best, > > Haris > > > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > > > > > On 23 October 2013 13:31, Rojas, Don wrote: > >> > >> Haris, > >> > >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > >> implementation of SAM into the same frequency domain category. In > Fieldtrip, > >> SAM is a time-domain technique and is not the same as the > implementation of > >> SAM that has been used in the published literature for beta ERD. So, > are you > >> then wondering why the two time-domain approaches produce differing > results? > >> That probably does depend on how the covariance matrix is calculated. > >> Although I still think it is a bad idea to use a time-domain beamformer > on > >> motor beta ERD/ERS. > >> > >> Best, > >> > >> Don > >> > >> > >> > >> _______________________________________________ > >> 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 c.kung at donders.ru.nl Fri Oct 25 16:18:30 2013 From: c.kung at donders.ru.nl (Carmen Kung) Date: Fri, 25 Oct 2013 16:18:30 +0200 Subject: [FieldTrip] Reject components on unfiltered data Message-ID: <526A7DB6.2080405@donders.ru.nl> Dear all, I wonder if it is possible to first filter the data with a bandpass filter between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the ICA on filtered data to look for the components containing artefacts, then use the projection to reject the components in the original (unfiltered) data. Thank you very much in advance, Carmen -- Carmen Kung Donders Institute for Brain, Cognition, and Behaviour Radboud University Nijmegen P. O. Box 9104, 6500 HE Nijmegen, The Netherlands Tel: +31 24 36 12634 From eelke.spaak at donders.ru.nl Fri Oct 25 16:31:42 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 25 Oct 2013 16:31:42 +0200 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: <526A7DB6.2080405@donders.ru.nl> References: <526A7DB6.2080405@donders.ru.nl> Message-ID: Dear Carmen, Yes, that is possible; if you specify your original unfiltered data as the third input argument to ft_rejectcomponent this data will be projected through the unmixing matrix (and remixed after component rejection). Is that detailed enough to help you? Best, Eelke On 25 October 2013 16:18, Carmen Kung wrote: > Dear all, > > I wonder if it is possible to first filter the data with a bandpass filter > between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the > ICA on filtered data to look for the components containing artefacts, then > use the projection to reject the components in the original (unfiltered) > data. > > Thank you very much in advance, > Carmen > > > -- > Carmen Kung > Donders Institute for Brain, Cognition, and Behaviour > Radboud University Nijmegen > P. O. Box 9104, 6500 HE Nijmegen, The Netherlands > Tel: +31 24 36 12634 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Oct 28 11:26:14 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 28 Oct 2013 11:26:14 +0100 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Charidimos, If I understand you correctly, you specified cfg.keeptrials = 'no' in the calls to ft_timelockanalysis prior to the *first* call of ft_sourceanalysis, right? Could you try what happens when you specify it in ft_timelockanalysis prior to the second call to ft_sourceanalysis (so the step where the precomputed filter is applied)? Thanks, Eelke On 25 October 2013 01:06, Charidimos Tzagarakis wrote: > Hi Eelke, > Thank you for looking into this! > The piece of code I commented out is indeed [790:836] (changing line 784 > accordingly or alternatively adding a copy of 785-789 after 790). > I did try running ft_timelockanalysis with keeptrials='no' for all 3 calls > and that resulted in the same behaviour as before for LCMV (ie not the > "correct" one). I also tried it setting keeptrials='no' in > ft_sourceanalysis at the same time (ie keeptrials='no' for both > ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I > actually had run these tests before posting but wanted to 2ble check). > I may however be confused here because there are some other possible > combinations with keeptrials since for each subject there is a total of 6 > calls to functions that accept it as an input and the filter is estimated > with only 2 of them. > Do let me know if there is another combination I should run and I will do > that. > Best, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > On 24 October 2013 03:08, Eelke Spaak wrote: >> >> Hi Charidimos, >> >> Thanks for your elaborate e-mail. We discussed this issue in >> yesterday's FieldTrip meeting. It is very reasonable that you expect >> the three methods to produce the same results, and the code/interface >> indeed suggests that this would be the case. In other words, we need >> to clean up this part of the code to produce consistent results; >> however, this might take a while. >> >> We believe the discrepancy is caused by the fact that you compute the >> covariance while specifying cfg.keeptrials = 'yes', which is >> unnecessary while computing the filter. This results in a covariance >> matrix with dimensions trial X channel X channel, which then is >> subsequently averaged over trials during ft_sourceanalysis. Likely the >> filter is still in fact computed on the averaged covariance, as it >> should be. However, the subsequent projection of data through the >> filter will not first average the covariance, and will in essence only >> project the first trial through the filter. (This is because the dip{} >> fields will be struct arrays of dimension nTrial X 1, and in an >> assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so >> everything but the first element of a struct array is ignored in an >> assignment statement.) >> >> Could you try to compute the covariance with cfg.keeptrials = 'no' and >> then run LCMV again? This will still compute the covariance on the raw >> traces, not on the average. If our hunch is right, you should get the >> correct results then. >> >> As said, this is indeed messy and unclear, our apologies for that. >> >> Finally, could you tell us what part of the code you commented out to >> make the results consistent? We suspect it will be between lines 790 >> and 835, but it would be helpful to know for sure. >> >> Best, >> Eelke >> >> >> On 23 October 2013 21:43, Charidimos Tzagarakis wrote: >> > Hi Don, >> > Thanks for your reply. I do agree that some of these beamformers >> > are probably better suited than others to study beta desynchronisation, >> > or >> > generally questions in the frequency domain. I in fact started from >> > DICS. >> > The reason I looked at LCMV and SAM is to be sure that I get consistent >> > results (and also because my experiment can also address some additional >> > time domain questions, so I wanted to see what happens when my data goes >> > from one to the other). I therefore tried to set them up so I that the >> > results from all 3 are similar. So you are correct in pointing out that >> > my >> > question is why SAM and LCMV produce different results. Based on their >> > description within the fieldtrip website and mailing list (if I have >> > interpreted these correctly) they should be treating the covariance >> > matrix >> > in the same way (to get a true evoked response covariance matrix you >> > would >> > normally need the extra call to ft_timelockanalysis that I show at the >> > last >> > piece of code in my post). Also , if the covariance matrix is indeed the >> > issue, it seems that the change in how it is treated in the >> > ft_sourceanalysis code (based on the "hack" I described) is unique to >> > LCMV >> > (none of the other beamformer options share that piece of code) and is >> > active only when LCMV is given a precomputed filter which is (I think) >> > unusual. >> > Hence my question! >> > Best, >> > Haris >> > >> > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych >> > University of Minnesota Dept of Neuroscience and Brain Sciences Center >> > >> > >> > >> > On 23 October 2013 13:31, Rojas, Don wrote: >> >> >> >> Haris, >> >> >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip >> >> implementation of SAM into the same frequency domain category. In >> >> Fieldtrip, >> >> SAM is a time-domain technique and is not the same as the >> >> implementation of >> >> SAM that has been used in the published literature for beta ERD. So, >> >> are you >> >> then wondering why the two time-domain approaches produce differing >> >> results? >> >> That probably does depend on how the covariance matrix is calculated. >> >> Although I still think it is a bad idea to use a time-domain beamformer >> >> on >> >> motor beta ERD/ERS. >> >> >> >> Best, >> >> >> >> Don >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From c.kung at donders.ru.nl Mon Oct 28 12:39:52 2013 From: c.kung at donders.ru.nl (Carmen Kung) Date: Mon, 28 Oct 2013 12:39:52 +0100 Subject: [FieldTrip] Reject components on unfiltered data Message-ID: <526E4D08.4050600@donders.ru.nl> Hi Eelke, Thanks a lot for the info! That's specific enough. Cheers, Carmen -- Carmen Kung Donders Institute for Brain, Cognition, and Behaviour Radboud University Nijmegen P. O. Box 9104, 6500 HE Nijmegen, The Netherlands Tel: +31 24 36 12634 From tkietzma at uos.de Mon Oct 28 13:28:13 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Mon, 28 Oct 2013 13:28:13 +0100 Subject: [FieldTrip] repeated measures ANOVA (statfun_depsamplesF): dfdenom problems Message-ID: <1CE38208-EFC7-4AB0-A221-B5177D80CCFF@uos.de> Dear fieldtrip discussion list, We have recently run into problems using the implementation of a repeated measures ANOVA in statfun_depsamplesF.m. In our experiment, we have recorded data of 16 subjects, and the factor of the repeated-measures ANOVA has 37 levels (admittedly quite a few but that's just how it is). Now if I am not mistaken, then for a repeated measures ANOVA, the degrees of freedom in above case should be: df1 = 36 and df2 = 540 (this is in line with the results of SPSS, too). However, the statfun_depsamplesF.m function seems to compute dfdenom as nunits - ncontrasts (nunits is the number of subjects, and ncontrasts is nlevels-1). This of course leads to a different value as compared to SPSS and what I found in the literature, in which dfdenom is computed as (K-1)*(n-1), so in the current case as (nunits-1)*ncontrasts. For a one-factor repeated measures ANOVA, I could so far not find a principled reason why the number of levels should not exceed the number of subjects (which is the error message we get). In fact, SPSS works just fine in above scenario. Could someone please explain the logic behind the dfdenom computation in fieldtrip? Could it be that there is an error in how the degrees of freedom are computed, or am I missing something obvious here? For a MANOVA, the story would be different of course. I should add that we are currently interfacing fieldtrip from eeglab and get above error only if we choose the nonparametric fieldtrip statistics (with cluster correction), but the parametric tests implemented in eeglab work just fine. Thank you very much for your help, I am looking forward to your responses Tim From rajatthomas at gmail.com Mon Oct 28 14:39:23 2013 From: rajatthomas at gmail.com (Rajat Thomas) Date: Mon, 28 Oct 2013 14:39:23 +0100 Subject: [FieldTrip] Channel layout FT to EEGLAB Message-ID: Dear all, I made a layout file using the image of the ecog array I had, just like described in the tutorial. I would like to port this to EEGLAB, so that I can use the various ICA options to plot the components at the channel locations and so on. Could anyone either point me to a file that does this conversion? or Any way of using ICA within fieldtrip to plot the various components on the different channels using the layout file? I know it is used for channel rejection and so on but any help on plotting the components back on the ICA would be appreciated. Thanks a lot in advance. Rajat -- Rajat Mani Thomas Netherlands Institute for Neuroscience Amsterdam, The Netherlands http://www.cita.utoronto.ca/~thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 28 15:05:04 2013 From: mcantor at umich.edu (Max Cantor) Date: Mon, 28 Oct 2013 10:05:04 -0400 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: The fieldtrip tutorial has a section on ICA correction for both EOG and ECG. The ECG tutorial assumes you have an ECG channel, whereas the EOG channel uses ICA to find artifacts within your components, but obviously those can be reversed. http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Hopefully this helps, I can try to help if you have any specific questions since I was just working on this myself, but there may be somebody with greater expertise who can help you. On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like > described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on > the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting > the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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 bibi.raquel at gmail.com Mon Oct 28 15:36:18 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 28 Oct 2013 10:36:18 -0400 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: Hi Rajat, I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. Best, Raquel On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like > described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on > the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting > the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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 bibi.raquel at gmail.com Mon Oct 28 15:40:09 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 28 Oct 2013 10:40:09 -0400 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: <526E4D08.4050600@donders.ru.nl> References: <526E4D08.4050600@donders.ru.nl> Message-ID: Hi Eelke, I often wonder if it is better to filter or not filter prior to ICA. While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? Best, Raquel On Mon, Oct 28, 2013 at 7:39 AM, Carmen Kung wrote: > Hi Eelke, > > Thanks a lot for the info! That's specific enough. > > Cheers, > > Carmen > > -- > Carmen Kung > Donders Institute for Brain, Cognition, and Behaviour > Radboud University Nijmegen > P. O. Box 9104, 6500 HE Nijmegen, The Netherlands > Tel: +31 24 36 12634 > > ______________________________**_________________ > 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 mcantor at umich.edu Mon Oct 28 19:46:16 2013 From: mcantor at umich.edu (Max Cantor) Date: Mon, 28 Oct 2013 14:46:16 -0400 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526E4D08.4050600@donders.ru.nl> Message-ID: I can't speak for everyone, but we are filtering before ICA as of now. By having the data filtered, the components created should be a better representation of the actual effects rather than performing ICA on data not filtered, and thus more efficient. We also perform epoching and baselining, as well as a automatic artifact rejection of jump and muscle artifacts, and one visual artifact rejection check to get rid of any extremely noisy trials or channels. On Mon, Oct 28, 2013 at 10:40 AM, Raquel Bibi wrote: > Hi Eelke, > I often wonder if it is better to filter or not filter prior to ICA. > While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? > > Best, > > Raquel > > > On Mon, Oct 28, 2013 at 7:39 AM, Carmen Kung wrote: > >> Hi Eelke, >> >> Thanks a lot for the info! That's specific enough. >> >> Cheers, >> >> Carmen >> >> -- >> Carmen Kung >> Donders Institute for Brain, Cognition, and Behaviour >> Radboud University Nijmegen >> P. O. Box 9104, 6500 HE Nijmegen, The Netherlands >> Tel: +31 24 36 12634 >> >> ______________________________**_________________ >> 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 haristz at gmail.com Tue Oct 29 00:02:25 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Mon, 28 Oct 2013 18:02:25 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Eelke, I have now run a test which I think does what you describe. cfg.keeptrials='yes' for the calls to ft_timelockanalysis and ft_sourcenalysis that generate the filter. cfg.keeptrials='no' for all the other calls to these 2 functions (those that generate the 2 conditions to be compared). The result is still the same (ie not what I would call the 'correct' one, but rather what seems to be based on an evoked response covariance matrix). I should stress again that how I set keeptrials in ft_timelockanalysis is also how I set it for the "matched" call to ft_sourceanalysis (It didn't seem to me that this matters anyway as unless cfg.rawtrial='yes', ft_sourceanalysis handles both cases so that what is used further down is the same but I may be wrong in this) . Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 28 October 2013 05:26, Eelke Spaak wrote: > Hi Charidimos, > > If I understand you correctly, you specified cfg.keeptrials = 'no' in > the calls to ft_timelockanalysis prior to the *first* call of > ft_sourceanalysis, right? Could you try what happens when you specify > it in ft_timelockanalysis prior to the second call to > ft_sourceanalysis (so the step where the precomputed filter is > applied)? > > Thanks, > Eelke > > On 25 October 2013 01:06, Charidimos Tzagarakis wrote: > > Hi Eelke, > > Thank you for looking into this! > > The piece of code I commented out is indeed [790:836] (changing line 784 > > accordingly or alternatively adding a copy of 785-789 after 790). > > I did try running ft_timelockanalysis with keeptrials='no' for all 3 > calls > > and that resulted in the same behaviour as before for LCMV (ie not the > > "correct" one). I also tried it setting keeptrials='no' in > > ft_sourceanalysis at the same time (ie keeptrials='no' for both > > ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I > > actually had run these tests before posting but wanted to 2ble check). > > I may however be confused here because there are some other possible > > combinations with keeptrials since for each subject there is a total of 6 > > calls to functions that accept it as an input and the filter is estimated > > with only 2 of them. > > Do let me know if there is another combination I should run and I will do > > that. > > Best, > > Haris > > > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > > > On 24 October 2013 03:08, Eelke Spaak wrote: > >> > >> Hi Charidimos, > >> > >> Thanks for your elaborate e-mail. We discussed this issue in > >> yesterday's FieldTrip meeting. It is very reasonable that you expect > >> the three methods to produce the same results, and the code/interface > >> indeed suggests that this would be the case. In other words, we need > >> to clean up this part of the code to produce consistent results; > >> however, this might take a while. > >> > >> We believe the discrepancy is caused by the fact that you compute the > >> covariance while specifying cfg.keeptrials = 'yes', which is > >> unnecessary while computing the filter. This results in a covariance > >> matrix with dimensions trial X channel X channel, which then is > >> subsequently averaged over trials during ft_sourceanalysis. Likely the > >> filter is still in fact computed on the averaged covariance, as it > >> should be. However, the subsequent projection of data through the > >> filter will not first average the covariance, and will in essence only > >> project the first trial through the filter. (This is because the dip{} > >> fields will be struct arrays of dimension nTrial X 1, and in an > >> assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so > >> everything but the first element of a struct array is ignored in an > >> assignment statement.) > >> > >> Could you try to compute the covariance with cfg.keeptrials = 'no' and > >> then run LCMV again? This will still compute the covariance on the raw > >> traces, not on the average. If our hunch is right, you should get the > >> correct results then. > >> > >> As said, this is indeed messy and unclear, our apologies for that. > >> > >> Finally, could you tell us what part of the code you commented out to > >> make the results consistent? We suspect it will be between lines 790 > >> and 835, but it would be helpful to know for sure. > >> > >> Best, > >> Eelke > >> > >> > >> On 23 October 2013 21:43, Charidimos Tzagarakis > wrote: > >> > Hi Don, > >> > Thanks for your reply. I do agree that some of these beamformers > >> > are probably better suited than others to study beta > desynchronisation, > >> > or > >> > generally questions in the frequency domain. I in fact started from > >> > DICS. > >> > The reason I looked at LCMV and SAM is to be sure that I get > consistent > >> > results (and also because my experiment can also address some > additional > >> > time domain questions, so I wanted to see what happens when my data > goes > >> > from one to the other). I therefore tried to set them up so I that the > >> > results from all 3 are similar. So you are correct in pointing out > that > >> > my > >> > question is why SAM and LCMV produce different results. Based on their > >> > description within the fieldtrip website and mailing list (if I have > >> > interpreted these correctly) they should be treating the covariance > >> > matrix > >> > in the same way (to get a true evoked response covariance matrix you > >> > would > >> > normally need the extra call to ft_timelockanalysis that I show at the > >> > last > >> > piece of code in my post). Also , if the covariance matrix is indeed > the > >> > issue, it seems that the change in how it is treated in the > >> > ft_sourceanalysis code (based on the "hack" I described) is unique to > >> > LCMV > >> > (none of the other beamformer options share that piece of code) and is > >> > active only when LCMV is given a precomputed filter which is (I think) > >> > unusual. > >> > Hence my question! > >> > Best, > >> > Haris > >> > > >> > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > >> > University of Minnesota Dept of Neuroscience and Brain Sciences Center > >> > > >> > > >> > > >> > On 23 October 2013 13:31, Rojas, Don wrote: > >> >> > >> >> Haris, > >> >> > >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > >> >> implementation of SAM into the same frequency domain category. In > >> >> Fieldtrip, > >> >> SAM is a time-domain technique and is not the same as the > >> >> implementation of > >> >> SAM that has been used in the published literature for beta ERD. So, > >> >> are you > >> >> then wondering why the two time-domain approaches produce differing > >> >> results? > >> >> That probably does depend on how the covariance matrix is calculated. > >> >> Although I still think it is a bad idea to use a time-domain > beamformer > >> >> on > >> >> motor beta ERD/ERS. > >> >> > >> >> Best, > >> >> > >> >> Don > >> >> > >> >> > >> >> > >> >> _______________________________________________ > >> >> 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 -------------- An HTML attachment was scrubbed... URL: From arno at cerco.ups-tlse.fr Tue Oct 29 01:27:53 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Mon, 28 Oct 2013 17:27:53 -0700 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: Dear Rajat, this old function transforms EEG data contained in the Fieldtrip structure into an EEGLAB structure. After you have done that, to transform a channel location file, simply type in EEG.chanlocs = struct('labels', cfg.elec.label, 'X', mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', mattocell(cfg.elec.pnt(3,:))); EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); This code is untested. You might have to switch X, Y and Z to obtain the correct orientation for the electrode cap. Best, Arno On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > Hi Rajat, > I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. > > Best, > > Raquel > > > On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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: fieldtrip2eeglab.m Type: application/octet-stream Size: 1141 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From zizlsperger at gmail.com Tue Oct 29 10:30:42 2013 From: zizlsperger at gmail.com (Leopold Zizlsperger) Date: Tue, 29 Oct 2013 10:30:42 +0100 Subject: [FieldTrip] visualize source localization data Message-ID: Dear all, I have a question concerning source localization implementation. I need help in the very last step of visualizing a difference between 2 conditions over time: I get there by using the tutorial steps on single subject functional EEG data (*fieldtrip-20130914; *tried both WIN and MAC): *clear all;* *load('F:\fieldtrip-20130914\EEG1_HC35_GA_XY_ICA_rHFdemeanktkt.mat')* *load('F:\fieldtrip-20130914\EEG1_HC35_GA_XY_ICA_lHFdemeanktkt.mat')* *load leadfield;* *load vol;* *load elec_aligned;* * * * * *cfg = [];* * cfg.method = 'mne';* *cfg.elec = elec_aligned;* *cfg.grid = leadfield;* *cfg.vol = vol;* *cfg.mne.prewhiten = 'yes';* *cfg.mne.lambda = 3;* *cfg.mne.scalesourcecov = 'yes';* *cfg.mne.normalize = 'yes';* *sourcerHF = ft_sourceanalysis(cfg, EEG1_HC35_GA_XY_ICA_rHFdemeanktkt);* *sourcelHF = ft_sourceanalysis(cfg, EEG1_HC35_GA_XY_ICA_lHFdemeanktkt);* * * *save source sourcerHF sourcelHF;* * * *clear all;* *load source;* *load sourcespace;* * * *bnd.pnt = sourcespace.pnt;* *bnd.tri = sourcespace.tri;* *m=sourcerHF.avg.pow(:,1200);* *ft_plot_mesh(bnd, 'vertexcolor', m);* * * * * * * *> In ft_defaults at 74* * In ft_sourceanalysis at 146* *the input is timelock data with 32 channels and 7000 timebins* *using headmodel specified in the configuration* *using electrodes specified in the configuration* *determining source compartment (3)* *projecting electrodes on skin surface* *combining electrode transfer and system matrix* *creating dipole grid based on user specified dipole positions* *using headmodel specified in the configuration* *using gradiometers specified in the configuration* *8196 dipoles inside, 0 dipoles outside brain* *the call to "ft_prepare_sourcemodel" took 0 seconds* *estimating current density distribution for repetition 1* *using pre-computed leadfields: some of the specified options will not have an effect* *computing the solution where the noise covariance is used for regularisation* *prewhitening the leadfields using the noise covariance* *scaling the source covariance* *the call to "ft_sourceanalysis" took 10 seconds* *the input is timelock data with 32 channels and 7000 timebins* *using headmodel specified in the configuration* *using electrodes specified in the configuration* *determining source compartment (3)* *projecting electrodes on skin surface* *combining electrode transfer and system matrix* *creating dipole grid based on user specified dipole positions* *using headmodel specified in the configuration* *using gradiometers specified in the configuration* *8196 dipoles inside, 0 dipoles outside brain* *the call to "ft_prepare_sourcemodel" took 0 seconds* *estimating current density distribution for repetition 1* *using pre-computed leadfields: some of the specified options will not have an effect* *computing the solution where the noise covariance is used for regularisation* *prewhitening the leadfields using the noise covariance* *scaling the source covariance* *the call to "ft_sourceanalysis" took 87 seconds* *>> * * * *cfg = [];* *cfg.projectmom = 'yes';* *sdrHF = ft_sourcedescriptives(cfg,sourcerHF);* *sdlHF = ft_sourcedescriptives(cfg, sourcelHF);* * * *sdDIFF = sdrHF;* *sdDIFF.avg.pow = sdrHF.avg.pow - sdlHF.avg.pow;* *sdDIFF.tri = sourcespace.tri;* * * *save sd sdrHF sdlHF sdDIFF;* Then I tried different suggestions from the tutorial or the mailing list: *cfg = [];* *cfg.mask = 'avg.pow';* *ft_sourcemovie(cfg,sdDIFF);* * * *the input is source data with 8196 positions* *baseline correcting dipole moments [--------------------------------------\]* * projecting dipole moment [------------------------------------------------/]* *computing power [---------------------------------------------------------|]* *the call to "ft_sourcedescriptives" took 32 seconds* *the input is source data with 8196 positions* *baseline correcting dipole moments [---------------------------------------]* *projecting dipole moment [------------------------------------------------\]* *computing power [----------------------------------------------------------]* *the call to "ft_sourcedescriptives" took 33 seconds* *the input is source data with 8196 vertex positions and 16384 triangles* *Warning: use cfg.maskparameter instead of cfg.mask * *> In ft_checkconfig at 120* * In ft_sourcemovie at 48* *??? Error using ==> set* *Bad property value found.* *Object Name : axes* *Property Name : 'CLim'* *Values must be increasing and non-NaN.* * * *Error in ==> caxis at 80* * set(ax,'CLim',arg);* * * *Error in ==> ft_sourcemovie at 263* *caxis(cfg.zlim);* If I set a break before this point I can see that "arg" indeed contains two NaNs only. Do you have any suggestions why the script above fails to determine the axes properties? Alternatively I tried: *figure* *sdDIFF.tri = sourcespace.tri;* *cfg = [];* *cfg.alim = [0 0.5];* *cfg.zlim = [0 0.5];* *cfg.maskparameter = 'avg.pow';* *ft_sourcemovie(cfg,sdDIFF);* That results in a GUI that does seem to work but in the time course there is no activity displayed. Any advice how to visualize the difference properly? Thanks in advance. Best Leo RWTH Aachen Neurology P.S. structure of the difference *sdDIFF*: *time: [1x7000 double]* * pos: [8196x3 double]* * inside: [8196x1 double]* * outside: [1x0 double]* * method: 'average'* * avg: [1x1 struct]* * cfg: [1x1 struct]* * tri: [16384x3 int32]* -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Tue Oct 29 13:46:28 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Tue, 29 Oct 2013 13:46:28 +0100 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526E4D08.4050600@donders.ru.nl> Message-ID: <526FAE24.9040605@uni-leipzig.de> On 28/10/2013 15:40, Raquel Bibi wrote: > Hi Eelke, > I often wonder if it is better to filter or not filter prior to ICA. > While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? > > Best, > > Raquel > Hi Raquel, all, I can't speak for the Donders' view, but a high-pass filter (0.5 Hz, typically) before ICA often improves the quality of decompositions, since it improves the stationarity of the data by removing slow drifts. It's fine to then apply the weights from the resulting decomposition to the unfiltered dataset. I'd be cautious about applying too drastic a lowpass filter, as it tends to make the data from the various channels more similar and thus less independent from each other - it sometimes reduces the rank of the data, and ICA can behave a little weirdly with data which isn't full rank. Another handy thing to do is remove the mean of the whole epoch before running the ICA - see this paper from Groppe et al. (2009) http://dx.doi.org/10.1016/j.neuroimage.2008.12.038 Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Neumarkt 9-19, 04109 Leipzig, Germany Phone: +49 341 973 95 44 From anne.klepp at hhu.de Wed Oct 30 11:27:28 2013 From: anne.klepp at hhu.de (Anne Klepp) Date: Wed, 30 Oct 2013 11:27:28 +0100 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526A7DB6.2080405@donders.ru.nl> Message-ID: <5270DF10.1030506@hhu.de> Dear all, I will jump on the bandwagon here to ask what exactly the difference is between using the third input argument or not. With my data, using the data from the step right before ICA (so not actual raw/unfiltered data) as the third argument changes the output data.grad, but also changes the data itself. (This data is from after automatic artifact rejection, preprocessed including lp- and hp-filters, and has some repaired channels. Data is from a Neuromag306, with the gradiometers rejected during preprocessing, so there are 204 MEG channels plus 3 EOG/EMG.) I tried using fastica as well as specifying cfg.runica.pca=100 with runica. 2 components were rejected. To clarify what I mean by my data being changed I attached some files of what data look like in rejectvisual for all channels and in two example channels, for both ICA methods. I'm afraid I don't quite understand the consequences for my data by the information given in the FT help "In that case (3 arguments) componentanalysis will do a subspace projection of the input data onto the space which is spanned by the topographies in the unmixing matrix in comp, after removal of the artifact components. Please use this option of including data as input, if you wish to use the output data.grad in further computation, for example for leadfield computation." I suppose it makes sense data are different after (subspace) back projection, but what are the implications? If I don't want to do sourceanalysis, is there an advantage of sticking with 2 input arguments? I'd be thrilled if someone could offer some insight into this, best, Anne Am 25.10.2013 16:31, schrieb Eelke Spaak: > Dear Carmen, > > Yes, that is possible; if you specify your original unfiltered data as > the third input argument to ft_rejectcomponent this data will be > projected through the unmixing matrix (and remixed after component > rejection). > > Is that detailed enough to help you? > > Best, > Eelke > > On 25 October 2013 16:18, Carmen Kung wrote: >> Dear all, >> >> I wonder if it is possible to first filter the data with a bandpass filter >> between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the >> ICA on filtered data to look for the components containing artefacts, then >> use the projection to reject the components in the original (unfiltered) >> data. >> >> Thank you very much in advance, >> Carmen >> >> >> -- >> Carmen Kung >> Donders Institute for Brain, Cognition, and Behaviour >> Radboud University Nijmegen >> P. O. Box 9104, 6500 HE Nijmegen, The Netherlands >> Tel: +31 24 36 12634 >> >> _______________________________________________ >> 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 -- Anne Klepp (M.Sc. Psychologie) Institute of Clinical Neuroscience and Medical Psychology Heinrich-Heine-University Düsseldorf Universitätsstraße 1 40225 Düsseldorf, Germany Email: anne.klepp at hhu.de -------------- next part -------------- A non-text attachment was scrubbed... Name: ICA_data_2or3args.7z Type: application/octet-stream Size: 378658 bytes Desc: not available URL: From michielb at tcd.ie Wed Oct 30 13:22:56 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 30 Oct 2013 12:22:56 +0000 Subject: [FieldTrip] connectivity analysis Message-ID: Hi, I have 30 patients and 30 controls and I'm investigating their coherence (EEG, 128 electrodes). Every patient has ~30 trials resting state eyes open consisting of 7 frequency bins with 7 frequencies in each bin. My goal is to show connectivity differences between different brain regions in the control and patient group (doing electrode-level analysis now, source-level analysis is next step). - Is it more appropriate to keep the averaging step as the latest step (ie. calculate all coherence for all the different subjects, for all trials, for all different frequencies in frequency bins) or is it better to do the averaging asap (ie. average all frequencies in 1 frequency bin at the time-frequency analysis step, average all trials at the ft_freqdescriptives step, ...) - Is there any better way to do some statistics on the 128x128x7x7 (128 electrodes, 7 frequency bins, 7 frequencies in each bin) besides using the ttest2() matlab function? Any tips & tricks are more then welcome! Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.vanlier at bsse.ethz.ch Wed Oct 30 16:01:17 2013 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Wed, 30 Oct 2013 15:01:17 +0000 Subject: [FieldTrip] maximum statistic in cluster correction Message-ID: Hi all, I am trying to understand how the permutation test and cluster correction work. the Maris 2007 and 2012 papers along with the tutorials on the fieldtrip site helped a lot. However, i cant seem to grasp the idea behind the max stat very well. let me summarize how i think i understand things so far so you can see where i go wrong. Per channel per trial (a sample), we calculate the t statistic between conditions. This is the observed statistic. Next, we collect all the trials (or samples?) from both conditions and put them into 1 set. We randomly draw trials from this set and put them into subsets of the same size as the original condition sets, this is called a random partition. A t statistic is calculated on the difference between the two subsets. This process is repeated a large number of times and the results are put in a histogram. The histogram is called the permutation distribution. Find the proportion of random partitions that show a smaller t statistic than the observed t statistic. This is the monte carlo estimate. For example, if 97% of your draws from the permutation distribution show a smaller t statistic then the one you originally observed, you have a monte carlo p value of 0.03. Cluster based correction means that you take all the samples that show a t value that exceeds a certain threshold (ie the significant differences) and cluster them on the basis of temporal (and spatial) adjacency. The idea is that samples that are close together (in space or in time) show a similar effect. The next step is to sum the t values within each cluster and find the cluster with the largest sum (the maximum statistic). Here is where i don't understand the next step. You take the permutation distribution of the cluster with the maximum statistic? This means basically that you redo the permutation test but this time only with trials that fall within that cluster? Summing the t values from each partition would then give the permutation distribution of your max stat cluster. If you have other clusters, you plug their summed t value into that permutation distribution and compare the p value with your alpha value to see if they are significant as well. But if you do that for say 20 clusters you're still not controlling the FA rate? I'm at the point where the more i think about it the less things make sense, so i must be missing something upstream...? Best, Ben From ktyler at swin.edu.au Thu Oct 31 00:44:04 2013 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 30 Oct 2013 23:44:04 +0000 Subject: [FieldTrip] event related fields from source space Message-ID: FieldTripers, I am wanting to reconstruct event related fields from source space and have been beamforming with ft_sourceanalysis using cfg.method='lcmv'. I have not been able to find any clear instructors on this, but can any one tell me, does ft_sourceanalysis output 'data.avg.mom' contain the averaged ERPs reconstructed in source space? data.avg.mom appears to be a column of cells, one cell for each point in my 3d grid, with each cell containing 3 time series (ERFs), one for each 3d orientation??, x, y, z? Can any one tell me if this is indeed what I am looking at in data.avg.mom? Regards, Kaelasha Tyler PhD candidate Swinbunre University of Technology Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Oct 31 01:35:55 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 30 Oct 2013 18:35:55 -0600 Subject: [FieldTrip] event related fields from source space In-Reply-To: References: Message-ID: <72ECAF5C-D649-4C69-9AAA-A199E9F36452@ucdenver.edu> Kaelasha, That is exactly what you are looking at for data.avg.mom (x y and z dipole moments for your vector beamformer solution, for each grid point in your 3d source space). Best, Don ----------------------- Don Rojas, Ph.D. Associate Professor of Psychiatry U. of Colorado Denver Anschutz Medical Campus Director, UCD Magnetoencephalography Lab On Oct 30, 2013, at 5:44 PM, Kaelasha Tyler > wrote: FieldTripers, I am wanting to reconstruct event related fields from source space and have been beamforming with ft_sourceanalysis using cfg.method='lcmv'. I have not been able to find any clear instructors on this, but can any one tell me, does ft_sourceanalysis output 'data.avg.mom' contain the averaged ERPs reconstructed in source space? data.avg.mom appears to be a column of cells, one cell for each point in my 3d grid, with each cell containing 3 time series (ERFs), one for each 3d orientation??, x, y, z? Can any one tell me if this is indeed what I am looking at in data.avg.mom? Regards, Kaelasha Tyler PhD candidate Swinbunre University of Technology Australia _______________________________________________ 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 Oct 31 16:31:04 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Thu, 31 Oct 2013 16:31:04 +0100 (CET) Subject: [FieldTrip] maximum statistic in cluster correction In-Reply-To: References: Message-ID: <02b801ced64e$3615e200$a241a600$@maris@psych.ru.nl> Hi Ben, > I am trying to understand how the permutation test and cluster > correction work. the Maris 2007 and 2012 papers along with the > tutorials on the fieldtrip site helped a lot. However, i cant seem to > grasp the idea behind the max stat very well. let me summarize how i > think i understand things so far so you can see where i go wrong. > > Per channel per trial (a sample), we calculate the t statistic between > conditions. This is the observed statistic. Next, we collect all the > trials (or samples?) from both conditions and put them into 1 set. We > randomly draw trials from this set and put them into subsets of the > same size as the original condition sets, this is called a random > partition. A t statistic is calculated on the difference between the > two subsets. This process is repeated a large number of times and the > results are put in a histogram. The histogram is called the permutation > distribution. > > > Find the proportion of random partitions that show a smaller t > statistic than the observed t statistic. This is the monte carlo > estimate. For example, if 97% of your draws from the permutation > distribution show a smaller t statistic then the one you originally > observed, you have a monte carlo p value of 0.03. > > > Cluster based correction means that you take all the samples that show > a t value that exceeds a certain threshold (ie the significant > differences) and cluster them on the basis of temporal (and spatial) > adjacency. The idea is that samples that are close together (in space > or in time) show a similar effect. The next step is to sum the t values > within each cluster and find the cluster with the largest sum (the > maximum statistic). > > Here is where i don't understand the next step. You take the > permutation distribution of the cluster with the maximum statistic? > This means basically that you redo the permutation test but this time > only with trials that fall within that cluster? No. The relevant distribution is the permutation distribution of the "maximum cluster statistic". Over random permutations, the spatiotemporal extent of the cluster with largest cluster-level statistic varies. However, the only thing that we need is the value (one number) of the maximum cluster statistic. Best, Eric Maris Summing the t values > from each partition would then give the permutation distribution of > your max stat cluster. If you have other clusters, you plug their > summed t value into that permutation distribution and compare the p > value with your alpha value to see if they are significant as well. But > if you do that for say 20 clusters you're still not controlling the FA > rate? I'm at the point where the more i think about it the less things > make sense, so i must be missing something upstream...? > > > Best, > > Ben > From tkietzma at uos.de Thu Oct 31 16:34:10 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Thu, 31 Oct 2013 16:34:10 +0100 Subject: [FieldTrip] repeated measures ANOVA (statfun_depsamplesF): dfdenom problems Message-ID: <008D1219-3AC8-4011-985E-7396B0A9D64C@uos.de> Professor Maris asked me to repost this email to the list, so his response gets archived and accessible to everyone. Best regards and thanks Tim %% Dear fieldtrip discussion list, We have recently run into problems using the implementation of a repeated measures ANOVA in statfun_depsamplesF.m. In our experiment, we have recorded data of 16 subjects, and the factor of the repeated-measures ANOVA has 37 levels (admittedly quite a few but that's just how it is). Now if I am not mistaken, then for a repeated measures ANOVA, the degrees of freedom in above case should be: df1 = 36 and df2 = 540 (this is in line with the results of SPSS, too). However, the statfun_depsamplesF.m function seems to compute dfdenom as nunits - ncontrasts (nunits is the number of subjects, and ncontrasts is nlevels-1). This of course leads to a different value as compared to SPSS and what I found in the literature, in which dfdenom is computed as (K-1)*(n-1), so in the current case as (nunits-1)*ncontrasts. For a one-factor repeated measures ANOVA, I could so far not find a principled reason why the number of levels should not exceed the number of subjects (which is the error message we get). In fact, SPSS works just fine in above scenario. Could someone please explain the logic behind the dfdenom computation in fieldtrip? Could it be that there is an error in how the degrees of freedom are computed, or am I missing something obvious here? For a MANOVA, the story would be different of course. I should add that we are currently interfacing fieldtrip from eeglab and get above error only if we choose the nonparametric fieldtrip statistics (with cluster correction), but the parametric tests implemented in eeglab work just fine. Thank you very much for your help, I am looking forward to your responses Tim From aestnth at hum.au.dk Thu Oct 31 17:16:06 2013 From: aestnth at hum.au.dk (Niels Trusbak Haumann) Date: Thu, 31 Oct 2013 17:16:06 +0100 Subject: [FieldTrip] Reading data and trigger events from Neuromag fif dataset splitted into 2 files Message-ID: Dear FieldTrip community. Is it possible to read the data and trial events from a single continuous Neuromag fif dataset, which was automatically split into two separate fif files during recording, because it exceeeded the standard 2 GB file size limitation? The second of the two splitted fif files contains relevant information showing that the second file continues at the time in seconds at which the first file ended. However, if the two fif files are read separately into Field Trip format this information seems to be lost. FieldTrip seems to support reading in CTF datasets, which have been split into more files due to the 2 GB file size limitation, but I don't know whether there is a method for handling this problem with Neuromag fif data. ( [ http://fieldtrip.fcdonders.nl/getting_started/ctf?s[]=ctf ]http://fieldtrip.fcdonders.nl/getting_started/ctf?s[]=ctf ) I presume that it is a general problem that Neuromag fif datasets with 306 channel data sampled at 1 kHz 32 bit floats are splitted into more files, since only ca. 16-18 minutes raw data can be recorded before it is automatically splitted into two files. The large file size is not a problem after applying MaxFilter procedures to remove high frequency cHPI signals..., etc., and thereafter downsampling e.g. to 16 bit integers sampled at 250 Hz. I see from a previous discussion in another forum that it is not possible to merge (or append) the splitted files with the MaxFilter software. When reading triggers from splitted fif files there is usually one trial, which starts in the end of the first file and ends in the start of the second file, which cannot be correctly recognized, if the files are treated separately. This is however just a minor problem of loosing a single trial. I have a few wrong detections, probably because a few trials are both defined by up-going signals and down-going signals. Would ft_preprocessing (and the sub-routines that it calls) take this into consideration, if you e.g. specificy cfg.detectflank = 'up' ? I'm looking forward to hear any comments, suggestions or solutions. Greetings Niels. Niels Trusbak Haumann M.A. / PhD student Department of Aesthetic Studies / Center of Functionally Integrative Neuroscience Aarhus University / Aarhus University Hospital Denmark E-mail: aestnth at hum.au.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmuehl at gmail.com Thu Oct 31 16:31:30 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Thu, 31 Oct 2013 16:31:30 +0100 Subject: [FieldTrip] Call for Papers for BCI journal special issue on affective brain-computer interfaces Message-ID: -------------------------------------- Call for Papers - Special Issue on Affective Brain-Computer Interfaces (aBCI) Brain-Computer Interfaces Journal -------------------------------------- You are cordially invited to make a contribution to a special issue of Brain-Computer Interfaces (http://tinyurl.com/BCIjournal), entitled “ Affective Brain-Computer Interfaces”. The special issue is a follow-up to the successful 3rd aBCI workshop held at the ACII conference in Geneva, in September 2013 (http://hmi.ewi.utwente.nl/abci2013). But, this Call is open for every researcher working in the field of affective brain-computer interfacing and interested to contribute. Affective BCI aims at the detection of affective states, such as emotions or moods, from neuro-physiological signals. Such systems, allowing users to control computer games by their emotions, 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: encouraging affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. This special issue on aBCI explores the current possibilities and limitations of using neuro-physiological signals as a modality for the recognition of affective/cognitive states, and looks at visions for the use of this information about the user state in applications for domains like health, arts, and entertainment. We are seeking theoretical, methodological, and empirical papers dealing with different topics that include, but are not limited to: - novel methods and protocols for affective/cognitive state induction and data collection for aBCI, addressing challenges such as generalization/specificity of mental state classification; - the detection of affective/cognitive states via neurophysiological activity; - the incorporation of additional modalities, such as physiological sensors, video, or audio, to support the aBCI calibration and validation; - innovative concepts for communication or adaptive interfaces using aBCI. SCHEDULE FOR SUBMISSION - Deadline for Full Paper Submission: November 22, 2013 - Notification of 1st review outcome: December 15, 2013 - First Revision Due: January 15, 2014 - Notification of 2nd review outcome: February 01, 2014 - Camera-ready Papers due: February 15, 2014 - Expected publication: June 2014 Manuscripts should be submitted to abci at ewi.utwente.nl Manuscripts should follow the journal’s guidelines: http://www.tandfonline.com/action/authorSubmission?journalCode=tbci SPECIAL ISSUE GUEST EDITORS Authors are requested to inform the Special Issue Guest Editors about their intention to submit. Please direct any inquiries, including those about the suitability of your possible paper, to the Special-Issue Guest Editors via abci at ewi.utwente.nl : - Brendan Allison, University of California San Diego, USA - Guillaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland - Christian Mühl, INRIA Bordeaux - Sud-Ouest, France - Anton Nijholt, University of Twente, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Tue Oct 1 10:03:40 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 1 Oct 2013 10:03:40 +0200 Subject: [FieldTrip] ICA on elekta data In-Reply-To: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> References: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> Message-ID: <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> Hi Craig, I am CCing the FT mailing list, as there is a lot of expertise there as well (as well as interest in the answer probably). You would for sure combine the gradiometers. They have their signals expressed in the same units (fieldtrength/distance). But you would probably also benefit from including the magnetometers, as they reflect the same sources that linearly mix on the channel level. However, the magnetometers are expressed in another unit (fieldstrength) which results in them being potentially weighted differently. E.g. imagine that you express distance in mm, then the planar signals are 1000 times smaller than if you express distance in meter, whereas the magnetometer signals (the 102 rows of the same data matrix) don't change. If you were to do PCA, it would make a large difference since the channel-level variances are hugely different. But I think that if you do ICA, the "sphering" step that is done prior to the unmixing matrix estimation takes care of the different scaling and it would not matter if you were to to it in meter or milimeter. As I don't have the hands-on experience, it is something I would explicitly check by doing the ICA decomposition twice on differently scaled gradiometer data (keeping the magnetometer rows in the data the same). best regards, Robert On 30 Sep 2013, at 15:33, Richter, Craig wrote: > Hi Robert, > > How would you approach ICA on data from the Elekta system? I have the 102 chips with 1 magnetometer, and two orthogonal planar gradiometers, as you know. It seems to me that the magnetometers should be done separately, but how would you handle the gradiometers? Do these need to be combined? > > I wanted to see how you would proceed. > > Best, > > C. > From mluessi at nmr.mgh.harvard.edu Tue Oct 1 13:43:31 2013 From: mluessi at nmr.mgh.harvard.edu (Martin Luessi) Date: Tue, 01 Oct 2013 07:43:31 -0400 Subject: [FieldTrip] ICA on elekta data In-Reply-To: <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> References: <5CA78E39-5081-4C27-B75D-26BCD845E8DB@esi-frankfurt.de> <53EA0E30-493C-4632-88DA-E34018ADCB82@donders.ru.nl> Message-ID: <524AB563.1020403@nmr.mgh.harvard.edu> Hi Craig, What you could do to handle the different units is whiten the data using a noise covariance. I.e., you collect empty-room noise, compute a noise covariance "C" and then pre-multiply the data with "C^{-1/2}". This method is used in the MNE software to combine different sensor types (gradiometers, magnetometers, eeg) for ICA, minimum norm solutions etc. The ICA code is here: https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/ica.py The code is in Python, but it should be straight-forward to translate parts to Matlab. If you don't want to implement it yourself, you could also use MNE to clean the raw data, save it back as a raw .fif file and then continue your analysis in FT. There is an example here: http://martinos.org/mne/auto_examples/preprocessing/plot_ica_from_raw.html#example-preprocessing-plot-ica-from-raw-py I hope this helps, Martin PS: Robert, I hope you don't mind that I advertise MNE on this list ;). I felt that it was appropriate since whitening is very useful when working with an Elekta system. On 10/01/13 04:03, Robert Oostenveld wrote: > Hi Craig, > > I am CCing the FT mailing list, as there is a lot of expertise there as well (as well as interest in the answer probably). > > You would for sure combine the gradiometers. They have their signals expressed in the same units (fieldtrength/distance). But you would probably also benefit from including the magnetometers, as they reflect the same sources that linearly mix on the channel level. However, the magnetometers are expressed in another unit (fieldstrength) which results in them being potentially weighted differently. E.g. imagine that you express distance in mm, then the planar signals are 1000 times smaller than if you express distance in meter, whereas the magnetometer signals (the 102 rows of the same data matrix) don't change. > > If you were to do PCA, it would make a large difference since the channel-level variances are hugely different. But I think that if you do ICA, the "sphering" step that is done prior to the unmixing matrix estimation takes care of the different scaling and it would not matter if you were to to it in meter or milimeter. As I don't have the hands-on experience, it is something I would explicitly check by doing the ICA decomposition twice on differently scaled gradiometer data (keeping the magnetometer rows in the data the same). > > best regards, > Robert > > > > > > On 30 Sep 2013, at 15:33, Richter, Craig wrote: > >> Hi Robert, >> >> How would you approach ICA on data from the Elekta system? I have the 102 chips with 1 magnetometer, and two orthogonal planar gradiometers, as you know. It seems to me that the magnetometers should be done separately, but how would you handle the gradiometers? Do these need to be combined? >> >> I wanted to see how you would proceed. >> >> Best, >> >> C. >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Martin Luessi, Ph.D. Research Fellow Department of Radiology Athinoula A. Martinos Center for Biomedical Imaging Massachusetts General Hospital Harvard Medical School 149 13th Street Charlestown, MA 02129 Fax: +1 617 726-7422 The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. From styliadis at hotmail.com Wed Oct 2 12:39:32 2013 From: styliadis at hotmail.com (Haris Styliadis) Date: Wed, 2 Oct 2013 11:39:32 +0100 Subject: [FieldTrip] sloreta gamma band Message-ID: Dear Fieldtripers,Since there is no forum for the software sLORETA (http://www.uzh.ch/keyinst/loreta.htm), I have decided to post here to see if I can get any help.I am currently processing my data on sLORETA and I have noticed that the gamma band is excluded from the 'EEG to CROSS SPECTRA' module. However, there is a prompt for a user defined bands selection. I was not able to figure out if this file should be a text file (most probable) and hoe it should be written. Please help!With kind regards,Haris Styliadis -- Haris StyliadisM.Sc. Telecommunications & Computer Network EngineeringB.Eng. Electronic Engineering with Medical ElectronicsPhD Candidate - Research AssistantDepartment of MedicineSchool of Health SciencesAristotle University of Thessaloniki PO Box 376, 54124, Thessaloniki, Greece -------------- next part -------------- An HTML attachment was scrubbed... URL: From b.osuagwu.1 at research.gla.ac.uk Wed Oct 2 13:44:44 2013 From: b.osuagwu.1 at research.gla.ac.uk (Bethel Osuagwu) Date: Wed, 2 Oct 2013 12:44:44 +0100 Subject: [FieldTrip] sloreta gamma band In-Reply-To: References: Message-ID: <7AB2A399CAFFA442A6262BF9939AC33B5BF3C8A53A@CMS07.campus.gla.ac.uk> Hi Haris see this link below has the answere you are after:Please not that this is a new sloreta forum under construction http://biomedsig.com/forum/viewtopic.php?f=2&t=3#p3 Hope that helps Bethel ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] On Behalf Of Haris Styliadis [styliadis at hotmail.com] Sent: 02 October 2013 11:39 To: fieldtrip at science.ru.nl Cc: Panagiotis Kartsidis Subject: [FieldTrip] sloreta gamma band Dear Fieldtripers, Since there is no forum for the software sLORETA (http://www.uzh.ch/keyinst/loreta.htm), I have decided to post here to see if I can get any help. I am currently processing my data on sLORETA and I have noticed that the gamma band is excluded from the 'EEG to CROSS SPECTRA' module. However, there is a prompt for a user defined bands selection. I was not able to figure out if this file should be a text file (most probable) and hoe it should be written. Please help! With kind regards, Haris Styliadis -- Haris Styliadis M.Sc. Telecommunications & Computer Network Engineering B.Eng. Electronic Engineering with Medical Electronics PhD Candidate - Research Assistant Department of Medicine School of Health Sciences Aristotle University of Thessaloniki PO Box 376, 54124, Thessaloniki, Greece From Lilla.Magyari at mpi.nl Wed Oct 2 15:12:45 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Wed, 2 Oct 2013 15:12:45 +0200 (CEST) Subject: [FieldTrip] EEG Source reconstruction: sourcespace and the volume conductor misaligned In-Reply-To: References: Message-ID: <1365.195.169.109.44.1380719565.squirrel@195.169.109.44> Dear all, I just would like to mention that I also went through again on the MNE tutorial and I managed to reproduce the results. I also had to convert the units of the volume conductor. However, it was not possible to convert the units of the volume conductor directly. I converted the units of the segmentation, and then I created the vol which got the same units as the segmentation. I do not if this is due to a difference between the FieldTrip versions. I was using the latest one. Best, Lilla > Hey Steve, > thanks, you are great, I tried that again and it basically fixed my > problem > (see picture). > For documentation and maybe others to profit from: > Going through the > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate > tutorial I had problems building the volume conduction model which I > solved > by going through the additional tutorial > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > > But after the combination of the matrices and aligning them I got a > considerable sizing problem, see 2nd picture > [[[ mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > > > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > % go to the Subject01/bem directory > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', > 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > > ... > > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight]]] > > So I included Steve's suggestion > > vol = ft_convert_units(vol, 'cm') > > and specified the location of the fiducials again > > [[[ cfg = []; > > > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > > with the preauricular points this time in front of the auditory canals > and it worked out well. > > > Thanks all > > > Leo > > > > > > > On Mon, Sep 30, 2013 at 1:12 PM, Stephen Politzer-Ahles < > politzerahless at gmail.com> wrote: > >> Hi Leo, >> >> If I am remembering correctly, I think the problem could still be >> related >> to ft_convert_units even if the volume conductor and head model look >> like >> they're similar in size. For example, in the images I sent out when I >> was >> having this problem earlier, the volume conductor and hte sourcespace >> are >> the same size but one is tilted more, and the solution was nevertheless >> related to ft_convert_units (I think). In my case, this was because the >> conversion had to happen at a different time than it does in the >> tutorial. >> (I had to insert ft_convert_units somewhere earlier in the pipeline than >> where it was happening in the tutorial.) I'm sorry I can't be more >> specific, but if it will help I could try to look through my old code >> and >> re-figure out what I changed at the time. >> >> Best, >> Steve >> >> >> >> Stephen Politzer-Ahles >> New York University, Abu Dhabi >> Neuroscience of Language Lab >> http://www.nyu.edu/projects/politzer-ahles/ >> >> >> >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Mon, 30 Sep 2013 12:53:06 +0200 >>> From: Leopold Zizlsperger >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] EEG Source reconstruction: sourcespace and >>> >>> the volume conductor misaligned >>> Message-ID: >>> >> WTe+T1PZO0jMb6KUvpHFyi-c0tFuG8Mc0m9um6vVdacA at mail.gmail.com> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> >>> Hello >>> thanks for your answers, in combination with the tutorial they were a >>> big >>> help. >>> I think I got closer but have a last issue: >>> @ Jan-Mathijs: I redid the headmodel and it looks better now as shown >>> on >>> the screenshots attached, thanks >>> @ Lilla and Stephen: the scaling in general should not be the problem I >>> think, the sizes seem to match, thank you >>> While both the volume conduction and the headmodel are expressed in CTF >>> coordinates, see second screenshot vol vs sourcespace, they don't align >>> very well > first screenshot >>> Is there a way to align them manually? Or would it be legitimate to >>> "cheat" >>> with the fiducials of the sourcemodel ? By changing the preauricular >>> points >>> I think I could align them, but I am not sure if that would cuase >>> problems >>> later on... >>> Thanks in advance >>> Leo >>> >>> >>> On Mon, Sep 30, 2013 at 12:43 PM, Leopold Zizlsperger < >>> zizlsperger at gmail.com >>> > wrote: >>> >>> > Hello >>> > thanks for your answers, in combination with the tutorial they were a >>> big >>> > help. >>> > I think I got closer but have a last issue: >>> > @ Jan-Mathijs: I redid the headmodel and it looks better now as shown >>> on >>> > the screenshots attached, thanks >>> > @ Lilla and Stephen: the scaling in general should not be the problem >>> I >>> > think, the sizes seem to match, thank you >>> > While both the volume conduction and the headmodel are expressed in >>> CTF >>> > coordinates, see third screenshot vol vs sourcespace, they don't >>> align >>> very >>> > well > first two screenshots >>> > Is there a way to align them manually? Or would it be legitimate to >>> > "cheat" with the fiducials of the sourcemodel ? By changing the >>> > preauricular points I think I could align them, but I am not sure if >>> that >>> > would cuase problems later on... >>> > Thanks in advance >>> > Leo >>> > >>> > >>> > >>> > On Mon, Sep 30, 2013 at 10:29 AM, jan-mathijs schoffelen < >>> > jan.schoffelen at donders.ru.nl> wrote: >>> > >>> >> Hi Leo, >>> >> >>> >> May I add to Lilla's comments that the reconstructed headmodel looks >>> >> quite bad to me. This suggests that the automatic anatomical >>> segmentation >>> >> did not work well. The most likely cause is that the coordinate >>> system >>> >> which you specified for the anatomical image in the input was >>> incorrect >>> >> (e.g. specifying 'spm', while it should have been 'ctf' or so), or >>> that the >>> >> transformation matrix mapping from voxels to head coordinates was >>> not >>> >> correct. >>> >> >>> >> Best, >>> >> Jan-Mathijs >>> >> >>> >> >>> >> On Sep 30, 2013, at 9:53 AM, lilla.magyari at mpi.nl wrote: >>> >> >>> >> Hello Leo and Stephen, >>> >> >>> >> yes, it is unfortunate, that there is still a problem with the MNE >>> >> tutorial. I think the main problem is the integration of the >>> pipeline >>> with >>> >> Freesurfer which requires a more careful look on the script. >>> >> I could not find the attached image from Leo. If the sourcespace and >>> the >>> >> volume conduction models are not well-aligned because one of them is >>> too >>> >> small compared to the other, then it will probably help if you >>> convert >>> the >>> >> units. >>> >> In Fieldtrip, the handling of the units of the volume conduction >>> model >>> has >>> >> changed, which means that they are not automatically converted to >>> 'cm' >>> >> anymore. >>> >> Lilla >>> >> >>> >> >>> >> Hello Leo, >>> >> >>> >> >>> >> This looks like the same problem I was having a few months ago, and >>> there >>> >> >>> >> should be some messages on the list about it. I am not able to look >>> at >>> my >>> >> >>> >> data and scripts right now, but if I remember correctly (you can >>> check >>> the >>> >> >>> >> lists for more) the problem had to do with the transformation >>> matrix, >>> and >>> >> >>> >> ft_convert_units. In my case, during the "volume conduction model" >>> step of >>> >> >>> >> the tutorial (the last step before you can plot the vol and >>> sourcespace >>> >> >>> >> together), I had to add an extra >>> >> >>> >> >>> >> vol = ft_convert_units(vol, 'cm') >>> >> >>> >> >>> >> before ft_transform_geometry. I don't remember if this alone will >>> solve >>> >> >>> >> the >>> >> >>> >> problem (unfortunately the the situation is kind of complicated >>> right >>> now, >>> >> >>> >> there is also a different version of the minimum norms tutorial that >>> is >>> >> >>> >> still in development--see the previous messages for links--and I >>> think >>> my >>> >> >>> >> processing pipeline ended up being a mixture of the two to get >>> things >>> >> >>> >> working. Which means that it's hard to track where exactly I solved >>> the >>> >> >>> >> problem.) >>> >> >>> >> >>> >> Best, >>> >> >>> >> Steve >>> >> >>> >> >>> >> >>> >> >>> >> Message: 1 >>> >> >>> >> Date: Sat, 28 Sep 2013 15:25:32 +0200 >>> >> >>> >> From: Zizlsperger Leopold >>> >> >>> >> To: >>> >> >>> >> Subject: [FieldTrip] EEG Source reconstruction: sourcespace and the >>> >> >>> >> volume conductor misaligned >>> >> >>> >> Message-ID: <06D14B0C-655A-4EF2-A69A-B735DBDBC504 at gmail.com> >>> >> >>> >> Content-Type: text/plain; charset="iso-8859-1" >>> >> >>> >> >>> >> Hi all, >>> >> >>> >> I am following the instructions in the "Source reconstruction of >>> >> >>> >> event-related fields using minimum-norm estimate" tutorial closely >>> to >>> do >>> >> >>> >> a >>> >> >>> >> source-analysis of EEG data using the example MRI. As I am following >>> the >>> >> >>> >> tutorial almost unchanged I am not including the script here. >>> >> >>> >> >>> >> When I re-align the volume conduction model to the sourcespace they >>> are >>> >> >>> >> not aligned very well, see screenshot attached. I remember a similar >>> >> >>> >> question in the mailing list a while ago but cannot find it... >>> >> >>> >> >>> >> Is there a way to interactively realign volume conduction model and >>> >> >>> >> sourcespace? Re-doing the fiducials did not change the aligment >>> >> >>> >> considerably. Also, my volume conduction model looks weird... >>> >> >>> >> I used ft_determine_coordsys on both the vol and the sourcespace, >>> see >>> >> >>> >> screenshots attached, too. >>> >> >>> >> Would be nice if you could point me in the right direction. >>> >> >>> >> Thanks in advance. >>> >> >>> >> Leo >>> >> >>> >> >>> >> ---- >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> Dr. med. Leopold Zizlsperger >>> >> >>> >> Klinik f?r Neurologie >>> >> >>> >> Uniklinik RWTH Aachen >>> >> >>> >> Pauwelsstrasse 30 >>> >> >>> >> 52074 Aachen >>> >> >>> >> Tel: +49 241 80 35465 >>> >> >>> >> lzizlsperger at ukaachen.de >>> >> >>> >> >>> >> Leopold Zizlsperger, MD >>> >> >>> >> Department of Neurology >>> >> >>> >> RWTH Aachen University >>> >> >>> >> Pauwelsstrasse 30 >>> >> >>> >> 52074 Aachen, Germany >>> >> >>> >> Tel: +49 241 80 35465 >>> >> >>> >> lzizlsperger at ukaachen.de >>> >> >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> An HTML attachment was scrubbed... >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment.html >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: align 2.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 200601 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: align.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 208103 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0001.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: vol.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 148045 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0002.png >>> >> >>> >> >>> >> -------------- next part -------------- >>> >> >>> >> A non-text attachment was scrubbed... >>> >> >>> >> Name: sourcespace.png >>> >> >>> >> Type: image/png >>> >> >>> >> Size: 122200 bytes >>> >> >>> >> Desc: not available >>> >> >>> >> URL: < >>> >> >>> >> >>> >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130928/aff715c6/attachment-0003.png >>> >> >>> >> >>> >> >>> >> ------------------------------ >>> >> >>> >> >>> >> _______________________________________________ >>> >> >>> >> fieldtrip mailing list >>> >> >>> >> fieldtrip at donders.ru.nl >>> >> >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> End of fieldtrip Digest, Vol 34, Issue 28 >>> >> >>> >> ***************************************** >>> >> >>> >> >>> >> _______________________________________________ >>> >> >>> >> 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 >>> >> >>> >> >>> >> Jan-Mathijs Schoffelen, MD PhD >>> >> >>> >> Donders Institute for Brain, Cognition and Behaviour, >>> >> Centre for Cognitive Neuroimaging, >>> >> Radboud University Nijmegen, The Netherlands >>> >> >>> >> Max Planck Institute for Psycholinguistics, >>> >> Nijmegen, The Netherlands >>> >> >>> >> J.Schoffelen at donders.ru.nl >>> >> Telephone: +31-24-3614793 >>> >> >>> >> http://www.hettaligebrein.nl >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> > >>> > >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment.html >>> > >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: source sourcespace mit vol.png >>> Type: image/png >>> Size: 307944 bytes >>> Desc: not available >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment.png >>> > >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: source sourcespace vs vol.png >>> Type: image/png >>> Size: 337423 bytes >>> Desc: not available >>> URL: < >>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130930/a4a68f34/attachment-0001.png >>> > >>> >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> End of fieldtrip Digest, Vol 34, Issue 31 >>> ***************************************** >>> >> >> >> _______________________________________________ >> 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 Keith.McConnell at cchmc.org Wed Oct 2 18:46:17 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Wed, 2 Oct 2013 16:46:17 +0000 Subject: [FieldTrip] ft_rejectartifact Message-ID: Hello, I have an experiment for which I have an extended stimulus for a very few number of trials (20). I would like to build a for loop to create TF plots for each trial individually. There are jump artifacts in the data. When a trial is rejected due to jump artifact my loop crashes: Error using ft_rejectartifact (line 491) No trials left after artifact rejection. I would like to create an if/then statement that will identify that the individual trial was rejected and return to running the for loop. I cannot find the flag that is generated that tells me that there are no trials left. Can someone help? Thanks, Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Thu Oct 3 11:24:08 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 3 Oct 2013 11:24:08 +0200 (CEST) Subject: [FieldTrip] ft_rejectartifact In-Reply-To: Message-ID: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> Dear Keith, What ft_rejectartifact does when rejecting trials completely is check the cfg.trl matrix (which contains the first, last, and offset sample with respect to the original data) for occurences of the artifact that you want to reject. If an artifact is present, it removes the line from this matrix. Then the artifact free data is read-in from disk or from memory. Basically line 491 checks whether cfg.trl is empty as that would indicate that no trials are left after rejection. Am I correct in assuming you are running ft_rejectartifact on each trial separately? If so, you could also run it on the entire dataset before going through your loop with the option cfg.artfctdef.feedback = 'yes'; .Doing this will remove the trials containing jump artifacts while preserving the other trials and it will give you feedback on which trials were removed. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "Keith McConnell" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 2 oktober 2013 18:46:17 > Onderwerp: [FieldTrip] ft_rejectartifact > Hello, > I have an experiment for which I have an extended stimulus for a very > few number of trials (20). I would like to build a for loop to create > TF plots for each trial individually. > There are jump artifacts in the data. > When a trial is rejected due to jump artifact my loop crashes: > Error using ft_rejectartifact (line 491) > No trials left after artifact rejection. > I would like to create an if/then statement that will identify that > the individual trial was rejected and return to running the for loop. > I cannot find the flag that is generated that tells me that there are > no trials left. > Can someone help? > Thanks, > Keith > Keith McConnell, M.S. > 513.636.0739 (desk) > 513.504.9907 (cell) > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Thu Oct 3 13:24:05 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Thu, 3 Oct 2013 11:24:05 +0000 Subject: [FieldTrip] ft_rejectartifact In-Reply-To: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> References: <1172451321.2872519.1380792248104.JavaMail.root@draco.zimbra.ru.nl> Message-ID: Thanks Jim. You're correct, I was trying to run ft_rejectartifact on each trial individually. Your strategy seems like a much more workable solution. Thanks. Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Thursday, October 03, 2013 5:24 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_rejectartifact Dear Keith, What ft_rejectartifact does when rejecting trials completely is check the cfg.trl matrix (which contains the first, last, and offset sample with respect to the original data) for occurences of the artifact that you want to reject. If an artifact is present, it removes the line from this matrix. Then the artifact free data is read-in from disk or from memory. Basically line 491 checks whether cfg.trl is empty as that would indicate that no trials are left after rejection. Am I correct in assuming you are running ft_rejectartifact on each trial separately? If so, you could also run it on the entire dataset before going through your loop with the option cfg.artfctdef.feedback = 'yes'; .Doing this will remove the trials containing jump artifacts while preserving the other trials and it will give you feedback on which trials were removed. Best, Jim ________________________________ Van: "Keith McConnell" > Aan: fieldtrip at science.ru.nl Verzonden: Woensdag 2 oktober 2013 18:46:17 Onderwerp: [FieldTrip] ft_rejectartifact Hello, I have an experiment for which I have an extended stimulus for a very few number of trials (20). I would like to build a for loop to create TF plots for each trial individually. There are jump artifacts in the data. When a trial is rejected due to jump artifact my loop crashes: Error using ft_rejectartifact (line 491) No trials left after artifact rejection. I would like to create an if/then statement that will identify that the individual trial was rejected and return to running the for loop. I cannot find the flag that is generated that tells me that there are no trials left. Can someone help? Thanks, Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen -------------- next part -------------- An HTML attachment was scrubbed... URL: From vnune at hunter.cuny.edu Thu Oct 3 16:22:53 2013 From: vnune at hunter.cuny.edu (Valerie Nunez) Date: Thu, 3 Oct 2013 10:22:53 -0400 (EDT) Subject: [FieldTrip] Cluster-level permutation test statistics Message-ID: <201310031422.041560@msa1.hunter.cuny.edu> Hello, I'm a little confused about the notion of unit of observation (UO) as subject or trial in the cluster_permutation_timelock tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock Specifically, I don't quite understand how the example of congruent and incongruent trials for a single subject is considered a between-trials design and therefore uses an independent t-test. If two trials have taken place for one subject, why isn't this considered a within-subject design, thereby requiring a dependent-samples t-test? What am I missing? Thanks, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Oct 3 16:39:14 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 3 Oct 2013 16:39:14 +0200 Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: <201310031422.041560@msa1.hunter.cuny.edu> References: <201310031422.041560@msa1.hunter.cuny.edu> Message-ID: Hi Valerie, The crucial thing to note here is that it does not make sense to pair any individual trial in condition A with another individual trial in condition B. There are no pairs, the design is between-units-of-observation, thus a two-sample (= independent) t-test is used. Note furthermore that when doing this test you are testing a hypothesis about a population of trials, and not about a population of people. If you want to test a hypothesis about a population of people, you would typically compute some average value for condition A and condition B for each subject, and then do a test over subjects. Note that here you would do a paired-sample (= dependent) t-test, since now it does make sense to pair each value in condition A with another value in condition B (namely, those belonging to the same subject). Now you have one value per condition per subject, and each subject was tested in two conditions. Does this help? Best, Eelke On 3 October 2013 16:22, Valerie Nunez wrote: > Hello, > > I'm a little confused about the notion of unit of observation (UO) as > subject or trial in the cluster_permutation_timelock tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock > > Specifically, I don't quite understand how the example of congruent and > incongruent trials for a single subject is considered a between-trials > design and therefore uses an independent t-test. If two trials have taken > place for one subject, why isn't this considered a within-subject design, > thereby requiring a dependent-samples t-test? > > What am I missing? > > Thanks, > > Valerie > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From vnune at hunter.cuny.edu Thu Oct 3 16:59:04 2013 From: vnune at hunter.cuny.edu (Valerie Nunez) Date: Thu, 3 Oct 2013 10:59:04 -0400 (EDT) Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: References: Message-ID: <201310031459.041567@msa1.hunter.cuny.edu> Hi Eelke, That makes much more sense. Thanks for your help, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Oct 4 06:53:30 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 4 Oct 2013 06:53:30 +0200 (CEST) Subject: [FieldTrip] Cluster-level permutation test statistics In-Reply-To: <201310031422.041560@msa1.hunter.cuny.edu> References: <201310031422.041560@msa1.hunter.cuny.edu> Message-ID: <03d301cec0bd$ae207e00$0a617a00$@maris@psych.ru.nl> Hi Valerie, A dependent samples t-test (also called paired-samples t-tests) involves pairs of observations. If you have 20 trials in one subject, 10 in condition A and 10 in condition B, what would be your pairs (i.e., in which natural way would you construct pairs)? It may good to also read one of our papers before starting with the tutorial. The concept of a UO is not specific to permutation-based statistics, and given that your problem seems to be with this concept, you could try Maris_Psychophysiology_2012, which starts out with classical statistical tests. For cluster-based permutation statistics itself, Maris&Oostenveld_JNM_2007 is the better choice. Best, Eric Maris From: Valerie Nunez [mailto:vnune at hunter.cuny.edu] Sent: donderdag 3 oktober 2013 16:23 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Cluster-level permutation test statistics Hello, I'm a little confused about the notion of unit of observation (UO) as subject or trial in the cluster_permutation_timelock tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock Specifically, I don't quite understand how the example of congruent and incongruent trials for a single subject is considered a between-trials design and therefore uses an independent t-test. If two trials have taken place for one subject, why isn't this considered a within-subject design, thereby requiring a dependent-samples t-test? What am I missing? Thanks, Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From chan at med.uni-frankfurt.de Fri Oct 4 15:38:53 2013 From: chan at med.uni-frankfurt.de (Jason Chan) Date: Fri, 4 Oct 2013 15:38:53 +0200 Subject: [FieldTrip] 2IFC baseline-corrected TFR Message-ID: <002001cec107$11240c30$336c2490$@med.uni-frankfurt.de> Dear Fieldtripers, I ran a 2 interval force choice experiment (2-IFC) experiment in the MEG whereby participants indicated in which interval an event occurred. I am trying to do a baseline-corrected TFR analyses on Interval 2. I would like to keep the same baseline window for Interval 2 as Interval 1 (i.e., before Interval 1). I have tried to do this two different ways. 1. When preprocessing, specifying the cfg.baseline to the desired time. However, it appears that this will not append the specified baseline to the 'trial' time. 2. I preprocessed the entire length of the trial (baseline + Interval 1+Interval 2) and ran a TFR . However, trial lengths are obviously different between the two interval. This is a problem when I want to append Interval 1 and 2, based on participants' responses. Is there a way that I can specify a baseline window that is separate from the 'trial' duration? Kind regards, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Sat Oct 5 04:26:17 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Oct 2013 04:26:17 +0200 Subject: [FieldTrip] follow-up on grad fields with NaNs after ICA Message-ID: <524F78C9.4090002@gmail.com> Hi FT-ers, It took me a while to find some older posts that would answer my question, and this thread almost did the whole job: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006779.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006788.html Like Alex, I figured out that it was the ICA that left my grad.chanpos with NaNs only, and like Haiteng, I thought just replacing the grad field with a pre-ICA grad field would be one way to go. But just like Alex I was wondering whether this is the right way to go: "however, it feels somewhat dangerous to perform such "dirty" fixes, since that grad info is probably removed for a certain reason. We are oblivious to its impact subsequent steps like planar transform and source reconstruction." Talking to a knowledgeable colleague yesterday about this issue, he also had his question marks. But I don't see any follow-up on Alex's remark (I guess he further discussed this with colleagues while drinking coffee at the DCCN kitchen...! :-) SS So I still don't know the answer and maybe some other people may want to know it as well in the future. Any opinion on whether it's safe to use pre-ICA grad information for subsequent planar transformation and source analyses? Thanks a lot, Vitória -- ** Please consider the environment - do you really need to print? ** From vitoria.piai at gmail.com Sat Oct 5 15:39:13 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Oct 2013 15:39:13 +0200 Subject: [FieldTrip] follow-up on grad fields with NaNs after ICA In-Reply-To: <6CDC0300-2062-49CB-AAAD-BF28339F1EA1@gmail.com> References: <6CDC0300-2062-49CB-AAAD-BF28339F1EA1@gmail.com> Message-ID: <52501681.9090904@gmail.com> Dear Vitória, The short answer to your question would be: If in subsequent steps you do planar gradient transformation or data visualization it's safe to replace the grad. If in subsequent steps you want to do sourceanalysis, it's not safe to replace the grad. Reason: essential information that is needed for a correct forward computation (i.e. construction of the leadfields) is removed by replacing the grad. This information is represented in grad.tra. The explanation would be a bit technical, and it has been our intention for a while to document this on the FT-wiki as a FAQ, but we didn't get to it yet. For visualization and planar gradient transformation, only the grad.chanpos is needed, and this is correctly represented in an 'earlier-stage' grad-structure. Note that we have made some changes just this past week that actually addresses this NaN-issue. It will not work on backprojected data (i.e. data that has gone through ft_componentanalysis, followed by ft_rejectcomponent), but if you grab the most recent FT version and do ft_rejectcomponent, I believe the grad.chanpos will be reconstructed without NaNs. I haven't tried it myself, but rumour has it that this is the case. Would you be interested in contributing to the documentation, let me know... Best wishes, Jan-Mathijs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% On Oct 5, 2013, at 4:26 AM, Vitória Magalhães Piai wrote: > Hi FT-ers, > > It took me a while to find some older posts that would answer my > question, and this thread almost did the whole job: > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006779.html > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-July/006788.html > > Like Alex, I figured out that it was the ICA that left my grad.chanpos > with NaNs only, and like Haiteng, I thought just replacing the grad > field with a pre-ICA grad field would be one way to go. > But just like Alex I was wondering whether this is the right way to > go: "however, it feels somewhat dangerous to perform such "dirty" > fixes, since that grad info is probably removed for a certain reason. > We are oblivious to its impact subsequent steps like planar transform > and source reconstruction." > Talking to a knowledgeable colleague yesterday about this issue, he > also had his question marks. But I don't see any follow-up on Alex's > remark (I guess he further discussed this with colleagues while > drinking coffee at the DCCN kitchen...! :-) > SS > So I still don't know the answer and maybe some other people may want > to know it as well in the future. > > Any opinion on whether it's safe to use pre-ICA grad information for > subsequent planar transformation and source analyses? > Thanks a lot, Vitória > > -- > ** Please consider the environment - do you really need to print? ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Mon Oct 7 23:54:40 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 00:54:40 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) Message-ID: Hello all, We are having some problems defining atlas-based ROIs using ft_sourcestatistics on two source structures obtained via ft_sourceanalysis (whose grid is later changed according to a precalculated MNI-warped grid). It seems like the function "statistics_wrapper" has changed between "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls "volumelookup" and not "ft_volumelookup", so we get the following error: ??? Undefined function or method 'volumelookup' for input arguments of type 'struct'. Error in ==> statistics_wrapper at 136 tmp = volumelookup(tmpcfg, varargin{1}); Using the older fieldtrip vesion we get this error: ??? Subscript indices must either be real positive integers or logicals. Error in ==> statistics_wrapper at 213 tmp(i,:) = mean(dat(roi,:), 1); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So it seems like we didn't define the ROIs correctly, however we are not sure why. Any suggestions would be greatly appreciated! The relevant pieceof code is attached. Thank you all, Aia and Roey Relevant code ============ % Convert sources units to mm, to fit the atlas's units sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); sourceCondition2 = ft_convert_units(sourceCondition2, ' design = [ ones(1,length(sourceCondition1.trial)), 2*ones(1,length(sourceCondition2.trial)) ]; cfg = []; cfg.dim = sourceCondition1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.01; cfg.tail = 0; cfg.design(1,:) = design; cfg.ivar = 1; % Load the Atlas templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory backslashIndices = find(templateDir=='\'); templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: "Precentral_L", "Precentral_R", etc/ cfg.avgoverroi = 'yes'; cfg.hemisphere = 'both'; cfg.inputcoord = 'mni'; stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 08:25:46 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 09:25:46 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: Message-ID: Hello again, Sorry, it seems like the older version (with ft_volumelookup) is just our mistake. However the problem is still relevant, for the function volumelookup is still undefinded in our case. Hopefully someone might know what we did wrong. Thank you once again! Aia and Roey On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > Hello all, > > We are having some problems defining atlas-based ROIs using > ft_sourcestatistics on two source structures obtained via ft_sourceanalysis > (whose grid is later changed according to a precalculated MNI-warped grid). > > It seems like the function "statistics_wrapper" has changed between > "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls > "volumelookup" and not "ft_volumelookup", so we get the following error: > > ??? Undefined function or method 'volumelookup' for input > arguments of type 'struct'. > > Error in ==> statistics_wrapper at 136 > tmp = volumelookup(tmpcfg, varargin{1}); > > Using the older fieldtrip vesion we get this error: > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > So it seems like we didn't define the ROIs correctly, however we are not > sure why. > > Any suggestions would be greatly appreciated! > The relevant pieceof code is attached. > > Thank you all, > Aia and Roey > > > > Relevant code > ============ > % Convert sources units to mm, to fit the atlas's units > sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); > sourceCondition2 = ft_convert_units(sourceCondition2, ' > design = [ ones(1,length(sourceCondition1.trial)), > 2*ones(1,length(sourceCondition2.trial)) ]; > > cfg = []; > cfg.dim = sourceCondition1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.01; > cfg.tail = 0; > cfg.design(1,:) = design; > cfg.ivar = 1; > > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) > to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; > > > cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: > "Precentral_L", "Precentral_R", etc/ > > cfg.avgoverroi = 'yes'; > cfg.hemisphere = 'both'; > cfg.inputcoord = 'mni'; > > stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Oct 8 08:38:33 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 8 Oct 2013 08:38:33 +0200 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: Message-ID: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Dear Roey and Aia, This indeed was our bad. We have fixed it in the current version of FieldTrip. The version will be available for download tonight (CET), but you can get an instantaneous update of the code repository by doing 'ft_version update' on the Matlab command line. This will update the fieldtrip copy you are using to the latest version. Note that if you want to keep a 'static' version, you need to back up the version with a fixed date, because all changes will be incorporated. A little note to the following piece of code: > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; The same can be achieved with the fullfile function (which deals with platform specific file-separators automatically): templateDir=which('ft_defaults'); cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); Best, Jan-Mathijs On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > Hello again, > > Sorry, it seems like the older version (with ft_volumelookup) is just our mistake. > However the problem is still relevant, for the function volumelookup is still undefinded in our case. > > Hopefully someone might know what we did wrong. > > Thank you once again! > Aia and Roey > > > On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > Hello all, > > We are having some problems defining atlas-based ROIs using ft_sourcestatistics on two source structures obtained via ft_sourceanalysis (whose grid is later changed according to a precalculated MNI-warped grid). > > It seems like the function "statistics_wrapper" has changed between "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls "volumelookup" and not "ft_volumelookup", so we get the following error: > > ??? Undefined function or method 'volumelookup' for input > arguments of type 'struct'. > > Error in ==> statistics_wrapper at 136 > tmp = volumelookup(tmpcfg, varargin{1}); > > Using the older fieldtrip vesion we get this error: > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > So it seems like we didn't define the ROIs correctly, however we are not sure why. > > Any suggestions would be greatly appreciated! > The relevant pieceof code is attached. > > Thank you all, > Aia and Roey > > > > Relevant code > ============ > % Convert sources units to mm, to fit the atlas's units > sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); > sourceCondition2 = ft_convert_units(sourceCondition2, ' > design = [ ones(1,length(sourceCondition1.trial)), 2*ones(1,length(sourceCondition2.trial)) ]; > > cfg = []; > cfg.dim = sourceCondition1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'indepsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.01; > cfg.tail = 0; > cfg.design(1,:) = design; > cfg.ivar = 1; > > % Load the Atlas > templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory > backslashIndices = find(templateDir=='\'); > templateDir(backslashIndices(end)+1:end) = []; clear backslashIndices; > cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; > > > cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: "Precentral_L", "Precentral_R", etc/ > > cfg.avgoverroi = 'yes'; > cfg.hemisphere = 'both'; > cfg.inputcoord = 'mni'; > > stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 08:43:14 2013 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 8 Oct 2013 09:43:14 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Thank you so much for your kind and quick answer! We do hope this will fix things up. We will check it asap. Best regards, Aia and Roey On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Roey and Aia, > > This indeed was our bad. We have fixed it in the current version of > FieldTrip. > The version will be available for download tonight (CET), but you can get > an instantaneous update of the code repository by doing 'ft_version update' > on the Matlab command line. > This will update the fieldtrip copy you are using to the latest version. > Note that if you want to keep a 'static' version, you need to back up the > version with a fixed date, because all changes will be incorporated. > > A little note to the following piece of code: > > % Load the Atlas >> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >> to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >> > > The same can be achieved with the fullfile function (which deals with > platform specific file-separators automatically): > > templateDir=which('ft_defaults'); > cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); > > > Best, > Jan-Mathijs > > > > On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > > Hello again, > > Sorry, it seems like the older version (with ft_volumelookup) is just our > mistake. > However the problem is still relevant, for the function volumelookup is > still undefinded in our case. > > Hopefully someone might know what we did wrong. > > Thank you once again! > Aia and Roey > > > On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: > >> Hello all, >> >> We are having some problems defining atlas-based ROIs using >> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >> (whose grid is later changed according to a precalculated MNI-warped grid). >> >> It seems like the function "statistics_wrapper" has changed between >> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >> "volumelookup" and not "ft_volumelookup", so we get the following error: >> >> ??? Undefined function or method 'volumelookup' for input >> arguments of type 'struct'. >> >> Error in ==> statistics_wrapper at 136 >> tmp = volumelookup(tmpcfg, varargin{1}); >> >> Using the older fieldtrip vesion we get this error: >> ??? Subscript indices must either be real positive integers or >> logicals. >> >> Error in ==> statistics_wrapper at 213 >> tmp(i,:) = mean(dat(roi,:), 1); >> >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> So it seems like we didn't define the ROIs correctly, however we are not >> sure why. >> >> Any suggestions would be greatly appreciated! >> The relevant pieceof code is attached. >> >> Thank you all, >> Aia and Roey >> >> >> >> Relevant code >> ============ >> % Convert sources units to mm, to fit the atlas's units >> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >> sourceCondition2 = ft_convert_units(sourceCondition2, ' >> design = [ ones(1,length(sourceCondition1.trial)), >> 2*ones(1,length(sourceCondition2.trial)) ]; >> >> cfg = []; >> cfg.dim = sourceCondition1.dim; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'indepsamplesT'; >> cfg.parameter = 'pow'; >> cfg.correctm = 'cluster'; >> cfg.numrandomization = 1000; >> cfg.alpha = 0.01; >> cfg.tail = 0; >> cfg.design(1,:) = design; >> cfg.ivar = 1; >> >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >> to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >> >> >> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >> "Precentral_L", "Precentral_R", etc/ >> >> cfg.avgoverroi = 'yes'; >> cfg.hemisphere = 'both'; >> cfg.inputcoord = 'mni'; >> >> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >> >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tahere.toosi at gmail.com Tue Oct 8 08:54:26 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Tue, 8 Oct 2013 10:24:26 +0330 Subject: [FieldTrip] Layout for QuickCap 32 channel (Neuroscan) Message-ID: Hi Filedtripers, I have a problem making the layout file for Neuroscan 32 channel Quick Cap . I read the description on constructing layout for 128 channel Quick cap, but I encountered the same problem that Andre reported before : the electrodes seems to be shifted toward the back of the head. Could you please help me constructing the layout? Attached, please find the .sfp file. Thanks, Tahereh -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: QuickCap_32Custom.sfp Type: application/octet-stream Size: 1152 bytes Desc: not available URL: From MEpstein at NKI.RFMH.ORG Tue Oct 8 17:50:07 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Tue, 8 Oct 2013 15:50:07 +0000 Subject: [FieldTrip] definetrial with ANT .cnt files Message-ID: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> Hi all, I'm having a problem defining triggers using ft_definetrial with ANT .cnt files. Say I want to do a simple epoching around events with a trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get an error saying no trials are defined. However I figured out that if I put in cfg.trialdef.eventvalue =[1 char(0) char(0)]; then it works fine. The trigger files look totally normal, and other programs don't seem to have this issue. Anyone else ever have a problem like this? Thanks, -Michael IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From notthemindprobe at yahoo.com Tue Oct 8 15:01:11 2013 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Tue, 8 Oct 2013 06:01:11 -0700 (PDT) Subject: [FieldTrip] Automatically saving GDF using the realtime buffer Message-ID: <1381237271.38083.YahooMailNeo@web165005.mail.bf1.yahoo.com> Fieldtrip:   Hi, I am a new user of Fieldtrip, but our lab has a (pretty well working) real-time analysis of BioSemi EEG using two computers, matlab, and the FieldTrip buffer.  The buffer is used for communicating data between two machines: machine A collects and saves the data while also writingto the buffer, and machine B uses matlab to read the data off of the buffer (TCP/IP connection) and then run a soft real-time analysis of the EEG data.   Currently we manually start and stop the saving of a GDF file on machine A by hitting the S and D keys.   I would like to automatically start and stop the file saving, and was wondering if anyone had any suggestions?  I read that the OnlineDataManager (which interacts with our biosemi2ft code) handles the saving, and also does listen for ASCII messages on a TCP port for various commands, including "SAVE START/STOP".  Unfortunately, I'm not a programmer, and haven't been able to figure out how to write those commands to the port.  Is there a way to use the ft_write_data (or similar) to do that?  How do you make address the command to the specific port?   Any suggestions would be greatfully received.   Thanks!   Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Oct 8 23:41:19 2013 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 9 Oct 2013 00:41:19 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: Dear fieldtrippers (Jan-Mathijs included), (This message seems long, but is actually quite simple) Having downloaded the latest fieldtrip version (20131008), we tried rerunning the code and got the following error: ??? Reference to non-existent field 'coordsys'. Error in ==> ft_volumelookup at 206 if strcmp(cfg.inputcoord, 'mni') && strcmp(atlas.coordsys, 'tal') Error in ==> statistics_wrapper at 136 tmp = ft_volumelookup(tmpcfg, varargin{1}); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); Since the spm8 MNI atlas indeed has no "coordsys" field. Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by hand, or by simply deleting that "if" line), we still get one of two errors: * * * * * (1) * * * * * If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the MNI atlas has to offer, we get an indices error: ??? Subscript indices must either be real positive integers or logicals. Error in ==> statistics_wrapper at 213 tmp(i,:) = mean(dat(roi,:), 1); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); * * * * * (2) * * * * * If we define "cfg.roi = AAL_names{1};" for example, we get a different error: ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 187 tmp(cfg.inside) = postailobs; Error in ==> ft_statistics_montecarlo at 326 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 298 [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); And in "cluserstat" appears this comment: "%this snippet is to support correct clustering of N-dimensional data, not fully tested yet". Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the variables vectors "postailobs" and "negtailobs" Any ideas on how to solve this atlas source statistics problem (defining the coordsys field, performing statistics across all ROIs, and using the postailobs/negtailobs vectors) would be greatly appreciated! Good night, Aia and Roey On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Dear Roey and Aia, >> >> This indeed was our bad. We have fixed it in the current version of >> FieldTrip. >> The version will be available for download tonight (CET), but you can get >> an instantaneous update of the code repository by doing 'ft_version update' >> on the Matlab command line. >> This will update the fieldtrip copy you are using to the latest version. >> Note that if you want to keep a 'static' version, you need to back up the >> version with a fixed date, because all changes will be incorporated. >> >> A little note to the following piece of code: >> >> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = []; clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >> >> The same can be achieved with the fullfile function (which deals with >> platform specific file-separators automatically): >> >> templateDir=which('ft_defaults'); >> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >> >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >> >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) is just >> our mistake. >> However the problem is still relevant, for the function volumelookup is >> still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >> >>> Hello all, >>> >>> We are having some problems defining atlas-based ROIs using >>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>> (whose grid is later changed according to a precalculated MNI-warped grid). >>> >>> It seems like the function "statistics_wrapper" has changed between >>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>> >>> ??? Undefined function or method 'volumelookup' for input >>> arguments of type 'struct'. >>> >>> Error in ==> statistics_wrapper at 136 >>> tmp = volumelookup(tmpcfg, varargin{1}); >>> >>> Using the older fieldtrip vesion we get this error: >>> ??? Subscript indices must either be real positive integers or >>> logicals. >>> >>> Error in ==> statistics_wrapper at 213 >>> tmp(i,:) = mean(dat(roi,:), 1); >>> >>> Error in ==> ft_sourcestatistics at 107 >>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> So it seems like we didn't define the ROIs correctly, however we are not >>> sure why. >>> >>> Any suggestions would be greatly appreciated! >>> The relevant pieceof code is attached. >>> >>> Thank you all, >>> Aia and Roey >>> >>> >>> >>> Relevant code >>> ============ >>> % Convert sources units to mm, to fit the atlas's units >>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>> design = [ ones(1,length(sourceCondition1.trial)), >>> 2*ones(1,length(sourceCondition2.trial)) ]; >>> >>> cfg = []; >>> cfg.dim = sourceCondition1.dim; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'indepsamplesT'; >>> cfg.parameter = 'pow'; >>> cfg.correctm = 'cluster'; >>> cfg.numrandomization = 1000; >>> cfg.alpha = 0.01; >>> cfg.tail = 0; >>> cfg.design(1,:) = design; >>> cfg.ivar = 1; >>> >>> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = []; clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >>> >>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>> "Precentral_L", "Precentral_R", etc/ >>> >>> cfg.avgoverroi = 'yes'; >>> cfg.hemisphere = 'both'; >>> cfg.inputcoord = 'mni'; >>> >>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>> >>> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Wed Oct 9 00:13:19 2013 From: octavian.lie at gmail.com (octavian lie) Date: Tue, 8 Oct 2013 17:13:19 -0500 Subject: [FieldTrip] error ft_version Message-ID: Dear All, I was trying to update fieldtrip code, I get the following: ft_version update comparing local and remote (latest) hashes, this might take a minute... the following new files will be added: ! 1. r7274 fileio/ft_read_mri.m 2. r7273 test/test_ft_datatype_sens.m ! 3. r7272 utilities/private/scalingfactor.m ! 4. r7272 forward/private/scalingfactor.m ! 5. r7272 fileio/private/scalingfactor.m ! 6. r7271 private/scalingfactor.m 7. r7271 test/test_bug1916.m ! 8. r7270 utilities/printstruct.m ! 9. r7267 plotting/ft_plot_text.m ! 10. r7264 plotting/private/ft_voltype.m ! 11. r7264 inverse/private/ft_voltype.m ! 12. r7264 fileio/private/ft_voltype.m ! 13. r7263 forward/ft_voltype.m the following files will be updated: 14. r7233-->r7276 ft_freqanalysis.m 15. r7220-->r7275 ft_volumesegment.m 16. r7133-->r7272 plotting/private/scalingfactor.m 17. r7209-->r7268 fileio/ft_read_data.m 18. r7208-->r7268 fileio/ft_chanunit.m 19. r7188-->r7266 ft_prepare_sourcemodel.m 20. r7261-->r7265 utilities/private/ft_postamble_debug.m 21. r7258-->r7263 forward/ft_headmodel_concentricspheres.m 22. r7258-->r7263 forward/ft_headmodel_localspheres.m 23. r7258-->r7263 forward/ft_headmodel_singlesphere.m !!NOTE: if you choose to include changes marked with a leading !, they will overwrite local changes or additions! which changes do you want to include? ([vector] for specific changes, 'all', or [] for none) ? all Undefined function or variable "status". Error in ft_version (line 344) if status && isnumeric(changesToInclude) && all(changesToInclude > 0)... Please advise, Octavian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Oct 9 08:56:36 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 09 Oct 2013 08:56:36 +0200 Subject: [FieldTrip] definetrial with ANT .cnt files In-Reply-To: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> References: <3E54C3C165B1F2428D0A866C8A04ADBD011246@nki-exchdb2> Message-ID: <5254FE24.8080209@donders.ru.nl> Hi Michael, it might help if you set cfg.trialdef.eventtype = '?' and check what triggervalues and -types FieldTrip actually detects. Maybe the triggers are not saved as numeric values but as characters, thus maybe you need to set eventvalue = '1' instead of =1? FieldTrip can be sensitive to those kind of things. For example, our BVA-files record triggers are stored as 'S 1', and you need to add the two white spaces between the 'S' and the '1' when defining cfg.trialdef.eventvalue, otherwise desired and actual triggervalues do not match. Best, Jörn On 10/8/2013 5:50 PM, Epstein, Michael wrote: > > Hi all, > > I'm having a problem defining triggers using ft_definetrial with ANT > .cnt files. Say I want to do a simple epoching around events with a > trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get > an error saying no trials are defined. However I figured out that if I > put in cfg.trialdef.eventvalue =[1char(0) char(0)]; then it works > fine. The trigger files look totally normal, and other programs don't > seem to have this issue. Anyone else ever have a problem like this? > > Thanks, > > -Michael > > IMPORTANT NOTICE: This e-mail is meant only for the use of the > intended recipient. It may contain confidential information which is > legally privileged or otherwise protected by law. If you received this > e-mail in error or from someone who is not authorized to send it to > you, you are strictly prohibited from reviewing, using, disseminating, > distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF > THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. > Thank you for your cooperation. > > > _______________________________________________ > 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 Wed Oct 9 09:15:54 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 09 Oct 2013 09:15:54 +0200 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> Message-ID: <525502AA.8000501@donders.ru.nl> Hi Roey, habe you tried the atlas that is shipped with FieldTrip? It can be found in fieldtrip/templates/atlas/AAL/ Best, Jörn On 10/8/2013 11:41 PM, Roey Schurr wrote: > Dear fieldtrippers (Jan-Mathijs included), > > (This message seems long, but is actually quite simple) > > Having downloaded the latest fieldtrip version (20131008), we tried > rerunning the code and got the following error: > > ??? Reference to non-existent field 'coordsys'. > > Error in ==> ft_volumelookup at 206 > if strcmp(cfg.inputcoord, 'mni') && > strcmp(atlas.coordsys, 'tal') > > Error in ==> statistics_wrapper at 136 > tmp = ft_volumelookup(tmpcfg, varargin{1}); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > Since the spm8 MNI atlas indeed has no "coordsys" field. > Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " > by hand, or by simply deleting that "if" line), we still get one of > two errors: > > * * * * * (1) * * * * * > If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs > the MNI atlas has to offer, we get an indices error: > > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > * * * * * (2) * * * * * > If we define "cfg.roi = AAL_names{1};" for example, we get a different > error: > > ??? In an assignment A(:) = B, the number of elements in A and > B must be the same. > > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, > statobs,'issource',issource); > > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, > 'issource',issource); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > And in "cluserstat" appears this comment: "%this snippet is to support > correct clustering of N-dimensional data, not fully tested yet". > Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 > to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but > misuses the variables vectors "postailobs" and "negtailobs" > > > Any ideas on how to solve this atlas source statistics problem > (defining the coordsys field, performing statistics across all ROIs, > and using the postailobs/negtailobs vectors) would be greatly appreciated! > > Good night, > Aia and Roey > > > On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr > wrote: > > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen > > wrote: > > Dear Roey and Aia, > > This indeed was our bad. We have fixed it in the current > version of FieldTrip. > The version will be available for download tonight (CET), but > you can get an instantaneous update of the code repository by > doing 'ft_version update' on the Matlab command line. > This will update the fieldtrip copy you are using to the > latest version. Note that if you want to keep a 'static' > version, you need to back up the version with a fixed date, > because all changes will be incorporated. > > A little note to the following piece of code: > >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known >> function (ft_defaults) to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, >> 'template\atlas\aal\ROI_MNI_V4.nii']; >> > > The same can be achieved with the fullfile function (which > deals with platform specific file-separators automatically): > > templateDir=which('ft_defaults'); > cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); > > > Best, > Jan-Mathijs > > > > On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: > >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) >> is just our mistake. >> However the problem is still relevant, for the function >> volumelookup is still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr >> > wrote: >> >> Hello all, >> >> We are having some problems defining atlas-based ROIs >> using ft_sourcestatistics on two source structures >> obtained via ft_sourceanalysis (whose grid is later >> changed according to a precalculated MNI-warped grid). >> >> It seems like the function "statistics_wrapper" has >> changed between "fieldtrip-20130822" and >> "fieldtrip-20131007": line 136 now calls "volumelookup" >> and not "ft_volumelookup", so we get the following error: >> >> ??? Undefined function or method 'volumelookup' for >> input >> arguments of type 'struct'. >> >> Error in ==> statistics_wrapper at 136 >> tmp = volumelookup(tmpcfg, varargin{1}); >> >> Using the older fieldtrip vesion we get this error: >> ??? Subscript indices must either be real positive >> integers or >> logicals. >> >> Error in ==> statistics_wrapper at 213 >> tmp(i,:) = mean(dat(roi,:), 1); >> >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> So it seems like we didn't define the ROIs correctly, >> however we are not sure why. >> >> Any suggestions would be greatly appreciated! >> The relevant pieceof code is attached. >> >> Thank you all, >> Aia and Roey >> >> >> >> Relevant code >> ============ >> % Convert sources units to mm, to fit the atlas's units >> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >> sourceCondition2 = ft_convert_units(sourceCondition2, ' >> design = [ ones(1,length(sourceCondition1.trial)), >> 2*ones(1,length(sourceCondition2.trial)) ]; >> >> cfg = []; >> cfg.dim = sourceCondition1.dim; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'indepsamplesT'; >> cfg.parameter = 'pow'; >> cfg.correctm = 'cluster'; >> cfg.numrandomization = 1000; >> cfg.alpha = 0.01; >> cfg.tail = 0; >> cfg.design(1,:) = design; >> cfg.ivar = 1; >> >> % Load the Atlas >> templateDir = which('ft_defaults'); % use a known >> function (ft_defaults) to find FieldTrip's directory >> backslashIndices = find(templateDir=='\'); >> templateDir(backslashIndices(end)+1:end) = []; clear >> backslashIndices; >> cfg.atlas = [templateDir, >> 'template\atlas\aal\ROI_MNI_V4.nii']; >> >> >> cfg.roi = AAL_names; % This is a cell array of the >> atlas's ROIs: "Precentral_L", "Precentral_R", etc/ >> >> cfg.avgoverroi = 'yes'; >> cfg.hemisphere = 'both'; >> cfg.inputcoord = 'mni'; >> >> stat = ft_sourcestatistics(cfg, sourceCondition1, >> sourceCondition2); >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > 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 m.stoica at uke.de Wed Oct 9 15:59:50 2013 From: m.stoica at uke.de (Stoica, Mircea) Date: Wed, 9 Oct 2013 13:59:50 +0000 Subject: [FieldTrip] Problem reading data at the beginning of the buffer Message-ID: Dear fieldtrip users, my setup consists of a Biosemi amplifier with 32 channels, from which I stream data using the buffer (biosemi2ft.exe). At the full sampling rate of 2048 Hz, the buffer returns error 517 whenever I try reading data older than about 5 minutes. As expected, with lower sampling rates this time grows larger. While I could work around this, by reading smaller chunks of data, it is still quite frustrating and I couldn't find any info on how to fix this. Any suggestions would be highly appreciated. Best, Mircea -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Oct 9 16:41:33 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 9 Oct 2013 16:41:33 +0200 Subject: [FieldTrip] file imports Message-ID: Dear all, I've got a very simple question. How does one import files acquired in SIG/STS file formats and convert them into EDF or EEG files that most software supports? I've downloaded the browser from Stellate, and I can see the data, but I was not able to export the files to any other format. Please help! Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 10 10:43:38 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 10 Oct 2013 10:43:38 +0200 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> Message-ID: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Hi Craig, Let me forward this to the email discussion list. On 9 Oct 2013, at 23:27, CR wrote: > Hi Robert, > I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. > > Method 1: ICA > > I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. so a bit like http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts with the correlation method of http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > Method 2: PCA > > I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. > > Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. Option 1 is better, as it is less aggressive in removing brain components. If speed is a concern, you could do - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data - a combination of the two - try out anothe rica algorithm (fastica versus runica) - try out with the options of the ica algorithm, esp the stopping options - get a faster computer best regards Robert From alik.widge at gmail.com Thu Oct 10 11:50:13 2013 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 10 Oct 2013 05:50:13 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: Thank you for posting this, as I'm in the middle of this same processing step, and I've been pondering methods as well while following the tutorials. (In my case, 60-channel EEG plus one bipolar EOG in a diagonal configuration.) Your response to Craig contains something that's been bugging me a little bit: When doing the ICA on a test recording, I find (and it sounds like he finds as well) that there is not a single component that captures eyeblinks well (and I have tried various adjustments, such as altering number of components via pre-PCA, clipping or not clipping out epochs that look to me to have substantial slow eye-roll, turning runica.extended on/off). I do get components that have the classic "pair of eyeglasses" or "single eyeball" look... but I get four or five of them on a 58-component decomposition, and that's before we talk about the components that are almost pure 60-cycle noise or temporal EMG. You seem to be telling us, in your comment about orthogonality and percentage of variance captured, that this is actually a *good* thing, because it reduces the chance of removing activity from the frontal pole. Can you help me understand that a bit better? I've felt very nervous about the sheer number of components I'm removing; it feels as though I'm killing a big chunk of the dataset, and doing so somewhat blindly. Thanks, Alik Widge, MD, PhD Massachusetts General Hospital Charlestown, MA, USA alik.widge at gmail.com (206) 866-5435 On Thu, Oct 10, 2013 at 4:43 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Craig, > > Let me forward this to the email discussion list. > > > On 9 Oct 2013, at 23:27, CR wrote: > > > Hi Robert, > > I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > > > > Method 1: ICA > > > > I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there > something else that makes the data not compatible with the stationary > mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you use > the default cfg.demean=yes). Doing a low-pass filter on the continuous data > would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant components, > and reject these based on a threshold. > > so a bit like > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > with the correlation method of > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > > > Method 2: PCA > > > > I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > > > > Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of > the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > 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 hamid.mohseni at eng.ox.ac.uk Thu Oct 10 12:51:07 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Thu, 10 Oct 2013 11:51:07 +0100 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: This is an interesting question! I think PCA is better than ICA in eye-blink removal. Because what ICA does is first ESTIMATING the eye blink component and then linearly removing that component from the data set. However, in PCA approach, a better estimation of eyeblink component is employed (using for example eye-blink system) to linearly remove that component from the data set---note that this component also does not contain brain activity. In the cases when we do not have the direct eye-blink measurement ICA is better. Other ideas? Thanks On 10 October 2013 10:50, Alik Widge wrote: > Thank you for posting this, as I'm in the middle of this same processing > step, and I've been pondering methods as well while following the > tutorials. (In my case, 60-channel EEG plus one bipolar EOG in a diagonal > configuration.) Your response to Craig contains something that's been > bugging me a little bit: > > When doing the ICA on a test recording, I find (and it sounds like he > finds as well) that there is not a single component that captures eyeblinks > well (and I have tried various adjustments, such as altering number of > components via pre-PCA, clipping or not clipping out epochs that look to me > to have substantial slow eye-roll, turning runica.extended on/off). I do > get components that have the classic "pair of eyeglasses" or "single > eyeball" look... but I get four or five of them on a 58-component > decomposition, and that's before we talk about the components that are > almost pure 60-cycle noise or temporal EMG. > > You seem to be telling us, in your comment about orthogonality and > percentage of variance captured, that this is actually a *good* thing, > because it reduces the chance of removing activity from the frontal pole. > Can you help me understand that a bit better? I've felt very nervous about > the sheer number of components I'm removing; it feels as though I'm killing > a big chunk of the dataset, and doing so somewhat blindly. > > > Thanks, > > Alik Widge, MD, PhD > Massachusetts General Hospital > Charlestown, MA, USA > alik.widge at gmail.com > (206) 866-5435 > > > > On Thu, Oct 10, 2013 at 4:43 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Craig, >> >> Let me forward this to the email discussion list. >> >> >> On 9 Oct 2013, at 23:27, CR wrote: >> >> > Hi Robert, >> > I wanted to see what your thoughts were on the merits of 2 different >> methods of removing blinks. I have a 12 minute resting state segment of >> data, so it has required me to do some things a little differently. >> > >> > Method 1: ICA >> > >> > I break the 12 minute segment into 2 second intervals, since doing ICA >> on the whole segment gave a poor result. >> >> why does it give you a poor result? Has the subject been moving? Is there >> something else that makes the data not compatible with the stationary >> mixing assumption? >> >> Or is it the difference in the preprocessing? 12 minutes of data >> represented in one segment can have drift, whereas 12 minutes of data >> represented in 2 second snippets will not have the drift (assuming you use >> the default cfg.demean=yes). Doing a low-pass filter on the continuous data >> would have a similar effect as segmenting it and demeaning the 2 sec >> snippets. >> >> > I apply the resulting unmixing matrix to the 12 minute segment and >> correlate each component with the EOG to find the most relevant components, >> and reject these based on a threshold. >> >> so a bit like >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts >> with the correlation method of >> >> http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts >> >> >> > Method 2: PCA >> > >> > I do a timelock analysis based on the blink onset point returned by the >> eyelink system. I then PCA the resulting blink ERF. I then reject the >> component(s) that account for say 98% of the total variance. >> > >> > Obviously option 2 is much faster. What do you see as the relative >> merits/problems with the techniques? Technique 1 is largely what the FT >> tutorials suggest, so what about method 2? >> >> Option 2 makes the large variance component orthogonal to the remainder >> of the components, whereas in option 1 the eye component and frontal brain >> components are both estimated, not orthogonal, and removing of the eye >> component does not remove the frontal brain component. >> >> Option 1 is better, as it is less aggressive in removing brain components. >> >> If speed is a concern, you could do >> - ft_resampledata to e.g. 250 Hz or even less, estimate the components >> based on that and project them out of the original high Fsample data. >> - do ft_componentanalysis on a subset of the data (say every 4th data >> segment after cutting it in pieces), and project them out of the original >> segmented data >> - a combination of the two >> - try out anothe rica algorithm (fastica versus runica) >> - try out with the options of the ica algorithm, esp the stopping options >> - get a faster computer >> >> best regards >> Robert >> >> >> >> >> >> >> _______________________________________________ >> 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 > -- Hamid R. Mohseni, PhD Post-Doctoral Research Fellow Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Thu Oct 10 15:35:32 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 10 Oct 2013 09:35:32 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: Dear Robert, Over a year ago I tried to use the suggested method of the lower sample rate and project onto my original data. I had problems. Can you provide a little snippet of the projection? Best, Raquel Sent from my iPhone > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld wrote: > > Hi Craig, > > Let me forward this to the email discussion list. > > >> On 9 Oct 2013, at 23:27, CR wrote: >> >> Hi Robert, >> I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. >> >> Method 1: ICA >> >> I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > >> I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. > > so a bit like > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > with the correlation method of > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > >> Method 2: PCA >> >> I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. >> >> Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From j.herring at fcdonders.ru.nl Thu Oct 10 17:35:25 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 10 Oct 2013 17:35:25 +0200 (CEST) Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: <000f01cec5ce$5743f790$05cbe6b0$@herring@fcdonders.ru.nl> Dear Raquel, What you could do, for example, is: % Save your data to disk Save('data','data','-v7.3'); % Saves the variable data to the file data.mat. The '-v7.3' switch allows the file to be larger than 4gb, if necessary. % Resample your data cfg = []; cfg.resamplefs = 250; % Or less data_resampled = ft_resampledata(cfg, data); % Clear original data from memory Clear data % Perform ICA on resampled data cfg = []; cfg.method = 'runica'; % or 'fastica', for example. comp = ft_componentanalysis(cfg, data_resampled); % clear resampled data Clear data_resampled % load original data Load('data.mat'); % Use previously calculated unmixing matrix on original data cfg = []; cfg.unmixing = comp.unmixing; % copy unmixing matrix to new configuration structure cfg.topolabel = comp.topolabel; % copy channel labels to new config structure. comp = ft_componentanalysis(cfg, data); All the saving and clearing in between might not be necessary depending on how much RAM you have and on the size of your data. Best, Jim -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi Sent: donderdag 10 oktober 2013 15:36 To: FieldTrip discussion list Cc: FieldTrip discussion list; CR Subject: Re: [FieldTrip] ICA/PCA EOG artifact removal Dear Robert, Over a year ago I tried to use the suggested method of the lower sample rate and project onto my original data. I had problems. Can you provide a little snippet of the projection? Best, Raquel Sent from my iPhone > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld wrote: > > Hi Craig, > > Let me forward this to the email discussion list. > > >> On 9 Oct 2013, at 23:27, CR wrote: >> >> Hi Robert, >> I wanted to see what your thoughts were on the merits of 2 different methods of removing blinks. I have a 12 minute resting state segment of data, so it has required me to do some things a little differently. >> >> Method 1: ICA >> >> I break the 12 minute segment into 2 second intervals, since doing ICA on the whole segment gave a poor result. > > why does it give you a poor result? Has the subject been moving? Is there something else that makes the data not compatible with the stationary mixing assumption? > > Or is it the difference in the preprocessing? 12 minutes of data represented in one segment can have drift, whereas 12 minutes of data represented in 2 second snippets will not have the drift (assuming you use the default cfg.demean=yes). Doing a low-pass filter on the continuous data would have a similar effect as segmenting it and demeaning the 2 sec snippets. > >> I apply the resulting unmixing matrix to the 12 minute segment and correlate each component with the EOG to find the most relevant components, and reject these based on a threshold. > > so a bit like > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i ca_to_remove_eog_artifacts > with the correlation method of > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i ca_to_remove_ecg_artifacts > > >> Method 2: PCA >> >> I do a timelock analysis based on the blink onset point returned by the eyelink system. I then PCA the resulting blink ERF. I then reject the component(s) that account for say 98% of the total variance. >> >> Obviously option 2 is much faster. What do you see as the relative merits/problems with the techniques? Technique 1 is largely what the FT tutorials suggest, so what about method 2? > > Option 2 makes the large variance component orthogonal to the remainder of the components, whereas in option 1 the eye component and frontal brain components are both estimated, not orthogonal, and removing of the eye component does not remove the frontal brain component. > > Option 1 is better, as it is less aggressive in removing brain components. > > If speed is a concern, you could do > - ft_resampledata to e.g. 250 Hz or even less, estimate the components based on that and project them out of the original high Fsample data. > - do ft_componentanalysis on a subset of the data (say every 4th data segment after cutting it in pieces), and project them out of the original segmented data > - a combination of the two > - try out anothe rica algorithm (fastica versus runica) > - try out with the options of the ica algorithm, esp the stopping options > - get a faster computer > > best regards > Robert > > > > > > > _______________________________________________ > 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 mcantor at umich.edu Thu Oct 10 17:29:52 2013 From: mcantor at umich.edu (Max Cantor) Date: Thu, 10 Oct 2013 11:29:52 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> Message-ID: My lab is trying to sort out a very similar issue, this was a very convenient coincidence. Anyway, my PI probably understands this issue better, but for my sake, there seems to be some disagreement here about whether ICA or PCA is better? We have a dedicated VEOG channel, but no dedicated ECG channel, so according to Hamid, we would be better off using ICA for removing ECG artifacts and PCA for EOG artifacts? Also, I'm looking at ft_componentanalysis and ft_denoise_pca, and I'm wondering if there is a simple explanation for what the difference between using ft_componentanalysis with, for instance, cfg.runica.pca, and just using ft_denoise_pca is for PCA? Finally, I noticed ft_componentanalysis has an option for a displaymode and interactivepca, and I'm wondering if this essentially turns the inputting of components to be rejected into a gui? I'm trying to create functions for our muscle, EOG, and ECG artifact rejections, but because the components to be removed seem to need to be added into the script itself, trying to run it as a function within our analysis script obviously leads to it not rejecting any components. On Thu, Oct 10, 2013 at 9:35 AM, Raquel Bibi wrote: > Dear Robert, > Over a year ago I tried to use the suggested method of the lower sample > rate and project onto my original data. I had problems. Can you provide a > little snippet of the projection? > > Best, > > Raquel > Sent from my iPhone > > > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > > > > Hi Craig, > > > > Let me forward this to the email discussion list. > > > > > >> On 9 Oct 2013, at 23:27, CR wrote: > >> > >> Hi Robert, > >> I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > >> > >> Method 1: ICA > >> > >> I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > > > why does it give you a poor result? Has the subject been moving? Is > there something else that makes the data not compatible with the stationary > mixing assumption? > > > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you use > the default cfg.demean=yes). Doing a low-pass filter on the continuous data > would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > >> I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant components, > and reject these based on a threshold. > > > > so a bit like > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts > > with the correlation method of > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts > > > > > >> Method 2: PCA > >> > >> I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > >> > >> Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > > > Option 2 makes the large variance component orthogonal to the remainder > of the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > > > Option 1 is better, as it is less aggressive in removing brain > components. > > > > If speed is a concern, you could do > > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > > - a combination of the two > > - try out anothe rica algorithm (fastica versus runica) > > - try out with the options of the ica algorithm, esp the stopping options > > - get a faster computer > > > > best regards > > Robert > > > > > > > > > > > > > > _______________________________________________ > > 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 bibi.raquel at gmail.com Thu Oct 10 19:58:45 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 10 Oct 2013 13:58:45 -0400 Subject: [FieldTrip] ICA/PCA EOG artifact removal In-Reply-To: <5256c967.070a0e0a.7aea.6d36SMTPIN_ADDED_BROKEN@mx.google.com> References: <4C34FCE6-2B82-4A35-8B92-19302050E7BB@gmail.com> <1D861DF8-4A6F-499C-962D-BDB4D2CAC954@donders.ru.nl> <5256c967.070a0e0a.7aea.6d36SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Thanks Jim and Craig! On Thu, Oct 10, 2013 at 11:35 AM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Dear Raquel, > > What you could do, for example, is: > > > > % Save your data to disk > Save('data','data','-v7.3'); % Saves the variable data to the file > data.mat. The '-v7.3' switch allows the file to be larger than 4gb, if > necessary. > > % Resample your data > cfg = []; > cfg.resamplefs = 250; % Or less > > data_resampled = ft_resampledata(cfg, data); > > % Clear original data from memory > Clear data > > > % Perform ICA on resampled data > cfg = []; > cfg.method = 'runica'; % or 'fastica', for example. > > comp = ft_componentanalysis(cfg, data_resampled); > > % clear resampled data > Clear data_resampled > > % load original data > Load('data.mat'); > > % Use previously calculated unmixing matrix on original data > cfg = []; > cfg.unmixing = comp.unmixing; % copy unmixing matrix to new configuration > structure > cfg.topolabel = comp.topolabel; % copy channel labels to new config > structure. > > comp = ft_componentanalysis(cfg, data); > > > > All the saving and clearing in between might not be necessary depending on > how much RAM you have and on the size of your data. > > Best, > > Jim > > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi > Sent: donderdag 10 oktober 2013 15:36 > To: FieldTrip discussion list > Cc: FieldTrip discussion list; CR > Subject: Re: [FieldTrip] ICA/PCA EOG artifact removal > > Dear Robert, > Over a year ago I tried to use the suggested method of the lower sample > rate and project onto my original data. I had problems. Can you provide a > little snippet of the projection? > > Best, > > Raquel > Sent from my iPhone > > > On Oct 10, 2013, at 4:43 AM, Robert Oostenveld > wrote: > > > > Hi Craig, > > > > Let me forward this to the email discussion list. > > > > > >> On 9 Oct 2013, at 23:27, CR wrote: > >> > >> Hi Robert, > >> I wanted to see what your thoughts were on the merits of 2 different > methods of removing blinks. I have a 12 minute resting state segment of > data, so it has required me to do some things a little differently. > >> > >> Method 1: ICA > >> > >> I break the 12 minute segment into 2 second intervals, since doing ICA > on the whole segment gave a poor result. > > > > why does it give you a poor result? Has the subject been moving? Is > there something else that makes the data not compatible with the > stationary mixing assumption? > > > > Or is it the difference in the preprocessing? 12 minutes of data > represented in one segment can have drift, whereas 12 minutes of data > represented in 2 second snippets will not have the drift (assuming you > use the default cfg.demean=yes). Doing a low-pass filter on the continuous > data would have a similar effect as segmenting it and demeaning the 2 sec > snippets. > > > >> I apply the resulting unmixing matrix to the 12 minute segment and > correlate each component with the EOG to find the most relevant > components, and reject these based on a threshold. > > > > so a bit like > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_eog_artifacts > > with the correlation method of > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_ecg_artifacts > > > > > >> Method 2: PCA > >> > >> I do a timelock analysis based on the blink onset point returned by the > eyelink system. I then PCA the resulting blink ERF. I then reject the > component(s) that account for say 98% of the total variance. > >> > >> Obviously option 2 is much faster. What do you see as the relative > merits/problems with the techniques? Technique 1 is largely what the FT > tutorials suggest, so what about method 2? > > > > Option 2 makes the large variance component orthogonal to the remainder > of the components, whereas in option 1 the eye component and frontal brain > components are both estimated, not orthogonal, and removing of the eye > component does not remove the frontal brain component. > > > > Option 1 is better, as it is less aggressive in removing brain > components. > > > > If speed is a concern, you could do > > - ft_resampledata to e.g. 250 Hz or even less, estimate the components > based on that and project them out of the original high Fsample data. > > - do ft_componentanalysis on a subset of the data (say every 4th data > segment after cutting it in pieces), and project them out of the original > segmented data > > - a combination of the two > > - try out anothe rica algorithm (fastica versus runica) > > - try out with the options of the ica algorithm, esp the stopping > options > > - get a faster computer > > > > best regards > > Robert > > > > > > > > > > > > > > _______________________________________________ > > 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 roeysc at gmail.com Thu Oct 10 20:48:05 2013 From: roeysc at gmail.com (Roey Schurr) Date: Thu, 10 Oct 2013 21:48:05 +0300 Subject: [FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics) In-Reply-To: <525502AA.8000501@donders.ru.nl> References: <5C6ABC8B-ACD4-40F0-B27D-333301640320@donders.ru.nl> <525502AA.8000501@donders.ru.nl> Message-ID: Hello again, Thanks Jörn, indeed we are using the atlas you mentioned. We also found out one of the problems was that ft_read_atlas was taken from an EEGLAB directory and not a FT one. Yet the problems persist in the function clusterstat, when using cfg.avgoverroi = 'yes': ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 210 tmp(cfg.inside) = postailobs; Some dimensions in our code: The template sourcemodel gris for the singlesphere is 17 X 17 X 17 Hence the subject's sourcemodel grid for the singlesphere is 17 X 17 X 17 Hence the source reconstruction is also 17 X 17 X 17 The MNI MRI is 91 X 109 X 91 The AAL atlas is also 91 X 109 X 91 We don't understane how come "poastailobs" is 232 (twice the number of ROIs defined in the atlas). But still, " cfg.inside " defined all voxel that are inside the brain in the source space, so it is clear that an assignment as that demanded by line 210 in clusterstat would not work, We thought we could use ft_volumelookup in order to find those voxels that correspond to the areas that got 1 in "postailobs", but that won't work, since we do not have the source struct available at that point in the code. Are we using structures of insuitable dimensions? Are we doing anything wrong? Or is there a problem with the firldtrip code itself? Any help would be greatly appreciated! Aia and Roey On Wed, Oct 9, 2013 at 10:15 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Roey, > > habe you tried the atlas that is shipped with FieldTrip? It can be found > in fieldtrip/templates/atlas/AAL/ > > Best, > Jörn > > > On 10/8/2013 11:41 PM, Roey Schurr wrote: > > Dear fieldtrippers (Jan-Mathijs included), > > (This message seems long, but is actually quite simple) > > Having downloaded the latest fieldtrip version (20131008), we tried > rerunning the code and got the following error: > > ??? Reference to non-existent field 'coordsys'. > > Error in ==> ft_volumelookup at 206 > if strcmp(cfg.inputcoord, 'mni') && > strcmp(atlas.coordsys, 'tal') > > Error in ==> statistics_wrapper at 136 > tmp = ft_volumelookup(tmpcfg, varargin{1}); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > Since the spm8 MNI atlas indeed has no "coordsys" field. > Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by > hand, or by simply deleting that "if" line), we still get one of two errors: > > * * * * * (1) * * * * * > If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the > MNI atlas has to offer, we get an indices error: > > ??? Subscript indices must either be real positive integers or > logicals. > > Error in ==> statistics_wrapper at 213 > tmp(i,:) = mean(dat(roi,:), 1); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > * * * * * (2) * * * * * > If we define "cfg.roi = AAL_names{1};" for example, we get a different > error: > > ??? In an assignment A(:) = B, the number of elements in A and > B must be the same. > > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, > statobs,'issource',issource); > > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, > 'issource',issource); > > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > And in "cluserstat" appears this comment: "%this snippet is to support > correct clustering of N-dimensional data, not fully tested yet". > Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to > "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the > variables vectors "postailobs" and "negtailobs" > > > Any ideas on how to solve this atlas source statistics problem (defining > the coordsys field, performing statistics across all ROIs, and using the > postailobs/negtailobs vectors) would be greatly appreciated! > > Good night, > Aia and Roey > > > On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > >> Dear Jan-Mathijs, >> >> Thank you so much for your kind and quick answer! >> We do hope this will fix things up. We will check it asap. >> >> Best regards, >> Aia and Roey >> >> >> >> >> On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Dear Roey and Aia, >>> >>> This indeed was our bad. We have fixed it in the current version of >>> FieldTrip. >>> The version will be available for download tonight (CET), but you can >>> get an instantaneous update of the code repository by doing 'ft_version >>> update' on the Matlab command line. >>> This will update the fieldtrip copy you are using to the latest version. >>> Note that if you want to keep a 'static' version, you need to back up the >>> version with a fixed date, because all changes will be incorporated. >>> >>> A little note to the following piece of code: >>> >>> % Load the Atlas >>>> templateDir = which('ft_defaults'); % use a known function >>>> (ft_defaults) to find FieldTrip's directory >>>> backslashIndices = find(templateDir=='\'); >>>> templateDir(backslashIndices(end)+1:end) = []; clear >>>> backslashIndices; >>>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>>> >>> >>> The same can be achieved with the fullfile function (which deals with >>> platform specific file-separators automatically): >>> >>> templateDir=which('ft_defaults'); >>> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >>> >>> >>> Best, >>> Jan-Mathijs >>> >>> >>> >>> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >>> >>> Hello again, >>> >>> Sorry, it seems like the older version (with ft_volumelookup) is just >>> our mistake. >>> However the problem is still relevant, for the function volumelookup is >>> still undefinded in our case. >>> >>> Hopefully someone might know what we did wrong. >>> >>> Thank you once again! >>> Aia and Roey >>> >>> >>> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >>> >>>> Hello all, >>>> >>>> We are having some problems defining atlas-based ROIs using >>>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>>> (whose grid is later changed according to a precalculated MNI-warped grid). >>>> >>>> It seems like the function "statistics_wrapper" has changed between >>>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>>> >>>> ??? Undefined function or method 'volumelookup' for input >>>> arguments of type 'struct'. >>>> >>>> Error in ==> statistics_wrapper at 136 >>>> tmp = volumelookup(tmpcfg, varargin{1}); >>>> >>>> Using the older fieldtrip vesion we get this error: >>>> ??? Subscript indices must either be real positive integers or >>>> logicals. >>>> >>>> Error in ==> statistics_wrapper at 213 >>>> tmp(i,:) = mean(dat(roi,:), 1); >>>> >>>> Error in ==> ft_sourcestatistics at 107 >>>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>>> >>>> So it seems like we didn't define the ROIs correctly, however we are >>>> not sure why. >>>> >>>> Any suggestions would be greatly appreciated! >>>> The relevant pieceof code is attached. >>>> >>>> Thank you all, >>>> Aia and Roey >>>> >>>> >>>> >>>> Relevant code >>>> ============ >>>> % Convert sources units to mm, to fit the atlas's units >>>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>>> design = [ ones(1,length(sourceCondition1.trial)), >>>> 2*ones(1,length(sourceCondition2.trial)) ]; >>>> >>>> cfg = []; >>>> cfg.dim = sourceCondition1.dim; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'indepsamplesT'; >>>> cfg.parameter = 'pow'; >>>> cfg.correctm = 'cluster'; >>>> cfg.numrandomization = 1000; >>>> cfg.alpha = 0.01; >>>> cfg.tail = 0; >>>> cfg.design(1,:) = design; >>>> cfg.ivar = 1; >>>> >>>> % Load the Atlas >>>> templateDir = which('ft_defaults'); % use a known function >>>> (ft_defaults) to find FieldTrip's directory >>>> backslashIndices = find(templateDir=='\'); >>>> templateDir(backslashIndices(end)+1:end) = []; clear >>>> backslashIndices; >>>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>>> >>>> >>>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>>> "Precentral_L", "Precentral_R", etc/ >>>> >>>> cfg.avgoverroi = 'yes'; >>>> cfg.hemisphere = 'both'; >>>> cfg.inputcoord = 'mni'; >>>> >>>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>>> >>>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> Jan-Mathijs Schoffelen, MD PhD >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Cognitive Neuroimaging, >>> Radboud University Nijmegen, The Netherlands >>> >>> Max Planck Institute for Psycholinguistics, >>> Nijmegen, The Netherlands >>> >>> J.Schoffelen at donders.ru.nl >>> Telephone: +31-24-3614793 >>> >>> http://www.hettaligebrein.nl >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > _______________________________________________ > 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 notthemindprobe at yahoo.com Thu Oct 10 21:39:00 2013 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Thu, 10 Oct 2013 12:39:00 -0700 (PDT) Subject: [FieldTrip] Automatically saving GDF using the realtime buffer In-Reply-To: References: Message-ID: <1381433940.31104.YahooMailNeo@web165003.mail.bf1.yahoo.com> Fieldtrip users:   Well, I managed to get the remote start/stop of GDF files working via the TCP/IP port.  It is not that complicated, but there are some ambiguities in the documentation, so I thought I would post the solution in case it helped anyone else.    Apparently there is a fifth argument that can be given to the biosemi2ft code.  I had seen the listing of the command as:   biosemi2ft   However, if you give it a 5th argument, that works as the port to which to control the ODM, if not specified the control port is 8000, since I had been trying to use the local default port (1972) that is why I was having issues.  At some spoint someone may want to update the documentation to specify that the control port default is 8000, and not the port used for the buffer.  I was able to control the saving of the GDF files by just using the matlab tcp_udp_ip toolbox:   host = 'localhost'; port = 8000;   con=pnet('tcpconnect',host,port) pnet(con,'setwritetimeout',2) [ip,port]=pnet(con,'gethost') stat=pnet(con,'status')   msg = 'SAVE START'; pnet(con,'printf','\n%s\n',msg); pause(5) msg = 'SAVE STOP'; pnet(con,'printf','\n%s\n',msg); pause(5) % pnet(con,'close')     Best, Eric ________________________________ From: "fieldtrip-request at science.ru.nl" To: fieldtrip at science.ru.nl Sent: Tuesday, October 8, 2013 5:41 PM Subject: fieldtrip Digest, Vol 35, Issue 11 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. definetrial with ANT .cnt files (Epstein, Michael)   2. Automatically saving GDF using the realtime buffer       (Eric Pohlmeyer)   3. Re: Using Atlas ROIs in EEG Source Statistics       (ft_sourcestatistics) (Roey Schurr) ---------------------------------------------------------------------- Message: 1 Date: Tue, 8 Oct 2013 15:50:07 +0000 From: "Epstein, Michael" To: FieldTrip discussion list Subject: [FieldTrip] definetrial with ANT .cnt files Message-ID: <3E54C3C165B1F2428D0A866C8A04ADBD011246 at nki-exchdb2> Content-Type: text/plain; charset="us-ascii" Hi all, I'm having a problem defining triggers using ft_definetrial  with ANT .cnt files. Say I want to do a simple epoching around events with a trigger code of 1 - when I put in cfg.trialdef.eventvalue = 1; I get an error saying no trials are defined. However I figured out that if I put in cfg.trialdef.eventvalue =[1 char(0) char(0)]; then it works fine. The trigger files look totally normal, and other programs don't seem to have this issue. Anyone else ever have a problem like this? Thanks, -Michael IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 8 Oct 2013 06:01:11 -0700 (PDT) From: Eric Pohlmeyer To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] Automatically saving GDF using the realtime     buffer Message-ID:     <1381237271.38083.YahooMailNeo at web165005.mail.bf1.yahoo.com> Content-Type: text/plain; charset="iso-8859-1" Fieldtrip: ? Hi, I am a new user of Fieldtrip, but our lab has a (pretty well working) real-time analysis of BioSemi EEG using?two computers, matlab, and the FieldTrip buffer.? The buffer is used for communicating?data between two machines: machine A?collects and saves?the data while also writingto the buffer, and machine B uses matlab to read the data off of the buffer (TCP/IP connection) and then run a soft real-time analysis of the EEG data. ? Currently we manually start and stop?the saving of a GDF file on?machine A by hitting the S and D keys. ? I would like to automatically start and stop the file saving, and was wondering if anyone had any suggestions?? I read that the OnlineDataManager (which interacts with our biosemi2ft code) handles the saving, and also does listen for ASCII messages on a TCP port for various commands, including "SAVE START/STOP".? Unfortunately, I'm not a programmer, and haven't been able to figure out how to write those commands to the port.? Is there a way to use the ft_write_data (or similar) to do that?? How do you make address the command to the specific port? ? Any suggestions would be greatfully received. ? Thanks! ? Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Wed, 9 Oct 2013 00:41:19 +0300 From: Roey Schurr To: FieldTrip discussion list Subject: Re: [FieldTrip] Using Atlas ROIs in EEG Source Statistics     (ft_sourcestatistics) Message-ID:     Content-Type: text/plain; charset="iso-8859-1" Dear fieldtrippers (Jan-Mathijs included), (This message seems long, but is actually quite simple) Having downloaded the latest fieldtrip version (20131008), we tried rerunning the code and got the following error:     ??? Reference to non-existent field 'coordsys'.     Error in ==> ft_volumelookup at 206           if    strcmp(cfg.inputcoord, 'mni') &&           strcmp(atlas.coordsys, 'tal')     Error in ==> statistics_wrapper at 136             tmp = ft_volumelookup(tmpcfg, varargin{1});     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); Since the spm8 MNI atlas indeed has no "coordsys" field. Even if we bypass this problem (by setting "atlas.coordsys = 'mni' " by hand, or by simply deleting that "if" line), we still get one of two errors: * * * * * (1) * * * * * If we define "cfg.roi = AAL_names;" where AAL_names stores all 90 ROIs the MNI atlas has to offer, we get an indices error:     ??? Subscript indices must either be real positive integers or     logicals.     Error in ==> statistics_wrapper at 213           tmp(i,:) = mean(dat(roi,:), 1);     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); * * * * * (2) * * * * * If we define "cfg.roi = AAL_names{1};" for example, we get a different error:     ??? In an assignment  A(:) = B, the number of elements in A and     B must be the same.     Error in ==> clusterstat at 187         tmp(cfg.inside) = postailobs;     Error in ==> ft_statistics_montecarlo at 326       [stat, cfg] = clusterstat(cfg, statrand,       statobs,'issource',issource);     Error in ==> statistics_wrapper at 298         [stat, cfg] = statmethod(cfg, dat, design,         'issource',issource);     Error in ==> ft_sourcestatistics at 107         [stat, cfg] = statistics_wrapper(cfg, varargin{:}); And in "cluserstat" appears this comment: "%this snippet is to support correct clustering of N-dimensional data, not fully tested yet". Changing line 187 to: "tmp(cfg.inside) = postailobs(1);" (and line 211 to "tmp(cfg.inside) = negtailobs(1);") prevents this problem, but misuses the variables vectors "postailobs" and "negtailobs" Any ideas on how to solve this atlas source statistics problem (defining the coordsys field, performing statistics across all ROIs, and using the postailobs/negtailobs vectors) would be greatly appreciated! Good night, Aia and Roey On Tue, Oct 8, 2013 at 9:43 AM, Roey Schurr wrote: > Dear Jan-Mathijs, > > Thank you so much for your kind and quick answer! > We do hope this will fix things up. We will check it asap. > > Best regards, > Aia and Roey > > > > > On Tue, Oct 8, 2013 at 9:38 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Dear Roey and Aia, >> >> This indeed was our bad. We have fixed it in the current version of >> FieldTrip. >> The version will be available for download tonight (CET), but you can get >> an instantaneous update of the code repository by doing 'ft_version update' >> on the Matlab command line. >> This will update the fieldtrip copy you are using to the latest version. >> Note that if you want to keep a 'static' version, you need to back up the >> version with a fixed date, because all changes will be incorporated. >> >> A little note to the following piece of code: >> >> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = [];      clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >> >> The same can be achieved with the fullfile function (which deals with >> platform specific file-separators automatically): >> >> templateDir=which('ft_defaults'); >> cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii'); >> >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote: >> >> Hello again, >> >> Sorry, it seems like the older version (with ft_volumelookup) is just >> our mistake. >> However the problem is still relevant, for the function volumelookup is >> still undefinded in our case. >> >> Hopefully someone might know what we did wrong. >> >> Thank you once again! >> Aia and Roey >> >> >> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr wrote: >> >>> Hello all, >>> >>> We are having some problems defining atlas-based ROIs using >>> ft_sourcestatistics on two source structures obtained via ft_sourceanalysis >>> (whose grid is later changed according to a precalculated MNI-warped grid). >>> >>> It seems like the function "statistics_wrapper" has changed between >>> "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls >>> "volumelookup" and not "ft_volumelookup", so we get the following error: >>> >>>      ??? Undefined function or method 'volumelookup' for input >>>      arguments of type 'struct'. >>> >>>      Error in ==> statistics_wrapper at 136 >>>              tmp = volumelookup(tmpcfg, varargin{1}); >>> >>> Using the older fieldtrip vesion we get this error: >>>    ??? Subscript indices must either be real positive integers or >>>    logicals. >>> >>>      Error in ==> statistics_wrapper at 213 >>>            tmp(i,:) = mean(dat(roi,:), 1); >>> >>>      Error in ==> ft_sourcestatistics at 107 >>>          [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> So it seems like we didn't define the ROIs correctly, however we are not >>> sure why. >>> >>> Any suggestions would be greatly appreciated! >>> The relevant pieceof code is attached. >>> >>> Thank you all, >>> Aia and Roey >>> >>> >>> >>> Relevant code >>> ============ >>> % Convert sources units to mm, to fit the atlas's units >>> sourceCondition1 = ft_convert_units(sourceCondition1, 'mm'); >>> sourceCondition2 = ft_convert_units(sourceCondition2, ' >>> design = [ ones(1,length(sourceCondition1.trial)), >>> 2*ones(1,length(sourceCondition2.trial)) ]; >>> >>> cfg = []; >>> cfg.dim = sourceCondition1.dim; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'indepsamplesT'; >>> cfg.parameter = 'pow'; >>> cfg.correctm = 'cluster'; >>> cfg.numrandomization = 1000; >>> cfg.alpha = 0.01; >>> cfg.tail = 0; >>> cfg.design(1,:) = design; >>> cfg.ivar = 1; >>> >>> % Load the Atlas >>> templateDir = which('ft_defaults'); % use a known function (ft_defaults) >>> to find FieldTrip's directory >>> backslashIndices = find(templateDir=='\'); >>> templateDir(backslashIndices(end)+1:end) = [];      clear >>> backslashIndices; >>> cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii']; >>> >>> >>> cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: >>> "Precentral_L", "Precentral_R", etc/ >>> >>> cfg.avgoverroi  = 'yes'; >>> cfg.hemisphere  = 'both'; >>> cfg.inputcoord  = 'mni'; >>> >>> stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2); >>> >>> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >>    Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 35, Issue 11 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Fri Oct 11 19:20:39 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Fri, 11 Oct 2013 17:20:39 +0000 Subject: [FieldTrip] ft_freqanalysis Message-ID: can someone please tell me if ft_freqanalysis averages trials before computing the frequency analysis? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Oct 11 19:31:29 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 11 Oct 2013 19:31:29 +0200 Subject: [FieldTrip] ft_freqanalysis In-Reply-To: References: Message-ID: Hi Keith, No, it doesn't. Best, Jan-Mathijs On Oct 11, 2013, at 7:20 PM, McConnell, Keith wrote: > can someone please tell me if ft_freqanalysis averages trials before computing the frequency analysis? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From instanton at gmail.com Fri Oct 11 23:03:55 2013 From: instanton at gmail.com (woun zoo) Date: Fri, 11 Oct 2013 14:03:55 -0700 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? Message-ID: Hi I'd like to know the way to keep each trial's time-frequency data (complex amplitude from fourier method). For example, if I have 20 trials and run ft_freqanalysis for time-frequency spectra, I end up having only final averaged result. Where can I see each individual trial's time-frequency complex amplitudes? Or what should I do to have TF data from all single trials? Thank you very much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Oct 11 23:43:27 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Fri, 11 Oct 2013 23:43:27 +0200 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Dear Woun, It is possible you may have already solved the problem. In case you didn't, let me tell you that: When doing timelocks or freqanalysis at the individual level you can set: - cfg.keeptrials = 'yes' and the output structure will have a field with each single trial in addition to the "avg" field that you already have. At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) the analogous option is - cfg.keepindividuals = 'yes' And the resulting structure will have an additional field called "individual". Keeptrials and keepindividuals are set to "no" by default. When "keeping" trials/individuals the output will be much bigger, depending on the number of channels, trials, time,... specially for TFanalysis you usually need to put an eye on that (load times are faster, space consuming, etc). It may be a good habit in order to keep good track of your processing but it can be a nuisance too Tip: look at the field "dimord". Now you have: chan_freq_time, what you want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. I hope I did not mislead your question. If this small talk actually solved your problem, let me suggest you to highlight your fieldtrip functions and press F1, and do it often, magic will happen., it will help learning much faster. Cheers, Tino 2013/10/11 woun zoo > Hi > > I'd like to know the way to keep each trial's time-frequency data (complex > amplitude from fourier method). For example, if I have 20 trials and run > ft_freqanalysis for time-frequency spectra, I end up having only final > averaged result. Where can I see each individual trial's time-frequency > complex amplitudes? Or what should I do to have TF data from all single > trials? > > Thank you very much. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Oct 11 23:46:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Fri, 11 Oct 2013 23:46:49 +0200 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Please notice that for the grandaverages is not spelled "individual*s*" but cfg.keepindividual = 'yes' without the 's' My bad, T 2013/10/11 Constantino Méndez Bértolo > Dear Woun, > > It is possible you may have already solved the problem. In case you > didn't, let me tell you that: > When doing timelocks or freqanalysis at the individual level you can set: > > - cfg.keeptrials = 'yes' > > > and the output structure will have a field with each single trial in > addition to the "avg" field that you already have. > At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) the > analogous option is > > - cfg.keepindividuals = 'yes' > > And the resulting structure will have an additional field called > "individual". > Keeptrials and keepindividuals are set to "no" by default. When "keeping" > trials/individuals the output will be much bigger, depending on the number > of channels, trials, time,... specially for TFanalysis you usually need to > put an eye on that (load times are faster, space consuming, etc). It may be > a good habit in order to keep good track of your processing but it can be a > nuisance too > Tip: look at the field "dimord". Now you have: chan_freq_time, what you > want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. > I hope I did not mislead your question. If this small talk actually solved > your problem, let me suggest you to highlight your fieldtrip functions and > press F1, and do it often, magic will happen., it will help learning much > faster. > Cheers, > Tino > > > 2013/10/11 woun zoo > >> Hi >> >> I'd like to know the way to keep each trial's time-frequency data >> (complex amplitude from fourier method). For example, if I have 20 trials >> and run ft_freqanalysis for time-frequency spectra, I end up having only >> final averaged result. Where can I see each individual trial's >> time-frequency complex amplitudes? Or what should I do to have TF data from >> all single trials? >> >> Thank you very much. >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From instanton at gmail.com Fri Oct 11 23:58:03 2013 From: instanton at gmail.com (woun zoo) Date: Fri, 11 Oct 2013 14:58:03 -0700 Subject: [FieldTrip] where can I get complex amplitudes for each trial in ft_freqanalysis? In-Reply-To: References: Message-ID: Thank you so much. ^_^;; On Fri, Oct 11, 2013 at 2:46 PM, Constantino Méndez Bértolo < constantino.mendezbertolo at ctb.upm.es> wrote: > Please notice that for the grandaverages is not spelled "individual*s*" > but > > cfg.keepindividual = 'yes' > > without the 's' > > My bad, > T > > > 2013/10/11 Constantino Méndez Bértolo < > constantino.mendezbertolo at ctb.upm.es> > >> Dear Woun, >> >> It is possible you may have already solved the problem. In case you >> didn't, let me tell you that: >> When doing timelocks or freqanalysis at the individual level you can set: >> >> - cfg.keeptrials = 'yes' >> >> >> and the output structure will have a field with each single trial in >> addition to the "avg" field that you already have. >> At the population level (ft_timelockgrandaverage, ft_freqgrandaverage) >> the analogous option is >> >> - cfg.keepindividuals = 'yes' >> >> And the resulting structure will have an additional field called >> "individual". >> Keeptrials and keepindividuals are set to "no" by default. When "keeping" >> trials/individuals the output will be much bigger, depending on the number >> of channels, trials, time,... specially for TFanalysis you usually need to >> put an eye on that (load times are faster, space consuming, etc). It may be >> a good habit in order to keep good track of your processing but it can be a >> nuisance too >> Tip: look at the field "dimord". Now you have: chan_freq_time, what you >> want is having 'rpt_chan_freq_time'. 'rpt' refers to each trial/individual. >> I hope I did not mislead your question. If this small talk actually >> solved your problem, let me suggest you to highlight your fieldtrip >> functions and press F1, and do it often, magic will happen., it will help >> learning much faster. >> Cheers, >> Tino >> >> >> 2013/10/11 woun zoo >> >>> Hi >>> >>> I'd like to know the way to keep each trial's time-frequency data >>> (complex amplitude from fourier method). For example, if I have 20 trials >>> and run ft_freqanalysis for time-frequency spectra, I end up having only >>> final averaged result. Where can I see each individual trial's >>> time-frequency complex amplitudes? Or what should I do to have TF data from >>> all single trials? >>> >>> Thank you very much. >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> Constantino Méndez-Bértolo >> Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) >> >> Parque Científico y Tecnológico de la UPM, Campus de Montegancedo >> >> 28223 Pozuelo de Alarcón, Madrid, SPAIN >> >> >> > > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > > _______________________________________________ > 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 Heng-RuMay.Tan at glasgow.ac.uk Sat Oct 12 00:38:15 2013 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 11 Oct 2013 23:38:15 +0100 Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers Message-ID: <52587DD7.2080801@glasgow.ac.uk> Hi there, I am resending my question below to the Fieldtrip discussion. Many thanks in advance! > On 11/10/2013 20:10, Eric Maris wrote: >> Hi May, >> >> Could you post your question on thr Fieldtrip discussion list? In that way, many more people can participate in the discussion. Moreover, the discussion will be archived, allowing people with the same question to inform themselves. >> >> Best, >> >> Eric I wish to seek some insights into non-parametric statistical testing in the MEG data analysis I am planning to do at the source level. For the most part, I have an appreciation of the permutation strategy (concept of random partitioning) described in Maris & Oostenveld 2007, which is implemented in fieldtrip. I have however a concern regarding trial number differences between subject group for permutation statistics. The data I am looking at after preprocessing/artefact removal etc. looks roughly as follows: 2 subject groups: Controls (C) and Patients (P). For a particular experimental condition (A), on average, subjects within each group have the following number of trials: condA_Ntrials_C ~= 100 condA_Ntrials_P ~= 80 I plan to perform a 2-step statistics-test to test for differences between C and P groups on a particular experimental condition. Using a 1st level within subject t-test (or active-vs-baseline test) on baseline vs active period for each group, deriving subject-specific t-stats which are to be subsequently used in a 2nd level test between subject group contrast, using nonparametric test. Question 1) Does it matter if the average trials per subject in each group is different? Should I try to equalize the trial numbers by e.g. random removal of some trials before computing any statistics? Is this advisable? Question 2) Minimum trials required for source-level significance? The supplementary info. accompanying the 2007 paper illustrated some minimum trial numbers required for obtaining a significant effect at the sensor-level analysis, given some threshold (e.g. cluster>250 sensor-time pairs). Has anyone systematically shown what is the minimum number of trials required to obtain significant clusters/fdr stats at the source-level analysis? If not, is there a sensible way to find out? (presumably involving some form of bootstrapping and simulation?) This relates to another issue I have with regards to 'within-subjects' comparison for 2 experimental conditions A and B where there are average trial number differences both within and between subject groups: condA_Ntrials_C ~= 100 condB_Ntrials_C ~= 60 (min. =35) condA_Ntrials_P ~= 80 condB_Ntrials_P ~= 50 (min. =35) A similar concern of uneven trials arises if say I wish to perform a within subjects comparison between the experimental conditions. In general, Q: Would the intended 2-step statistical test (as described above) be appropriate, OR would it best to control for 'equal' number of trials for all subjects and conditions of interest? I would really appreciate it if someone could kindly comment or offer advise where appropriate. Thank you very much in advance for your time. Yours sincerely, May -- Heng-Ru/May/ Tan Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive Neuroimaging (CCNi)▫ University of Glasgow 58 Hillhead Street, Glasgow G12 8QB▫ +44 (0)141-330-5090▫ Heng-RuMay.Tan at glasgow.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Sat Oct 12 18:15:52 2013 From: michielb at tcd.ie (Bart Michiels) Date: Sat, 12 Oct 2013 17:15:52 +0100 Subject: [FieldTrip] problem ft_freqanalysis Message-ID: After using ft_freqanalysis for EEG resting-state data I am unable to see the whole spectrum of my data, which should show some content between 0 and 60 Hz. I only see some low-frequency content (between 0 and 8 Hz) when using plot(...). Pre-processing steps: Avg re-reference, BP filter 0.25-100, cut continuous data into 4s segments, resample data to 512 Hz, detrend, re-reference (after avg rereferencing) to the A1&A2 electrode, Artefact rejection (max=80,min=-80,range=160, default jump artefact algorithm), visual inspection of the data. There are three datasets of 1 patients (every dataset cut into 4s segments). After preprocessing, those data sets are merged with ft.appenddata. I tried everything (wavelet, multi-taper), I always have the same result, can someone tell me what I am doing wrong? Bart Michiels, Research Assistant. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehsan.sabri at gmail.com Sun Oct 13 16:29:03 2013 From: ehsan.sabri at gmail.com (Ehsan Sabri) Date: Sun, 13 Oct 2013 17:59:03 +0330 Subject: [FieldTrip] Neuroshare - nev file from Blackrock microsystems Message-ID: Dear all, I'm trying to import an event file from a blackrock microsystem setup using 'neuroshare' m files. I use 'Matlab Import Filter' (Neuroshare m file package) version 2.5 and Matlab 2012a. It seems that this mexprog.mexw is not compatible with nsNEVLibrary.dll. ------------------------------------------------------------------------------------------------------------------ K>> which(lib) C:\Users\WIN 7\Documents\Utah Data\Toolboxes\Matlab-Import-Filter_2_5\RequiredResources\nsNEVLibrary.dll K>> [a]=mexprog(18, which(lib)) Warning: Unable to load this DLL a = -1 ------------------------------------------------------------------------------------------------------------------ (see read_neuroshare.m line 82) Did anyone encounter such non compatibility? Is there any other version for nsNEVLibrary.dll? (I also tried the one with PowerNAP 0.7) Best, Ehsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Mon Oct 14 16:53:38 2013 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Mon, 14 Oct 2013 16:53:38 +0200 Subject: [FieldTrip] Warning 'nifti' class Message-ID: Dear all, when loading my source files I get two warnings in Matlab which say: 1. "Warning: Class 'nifti' is an unknown object class..." and 2. "Warning: Class 'file_array' is an unknown object class...". Can anyone tell me why Matlab gives me this warning and/or what I did wrong (if so)? Thanks a lot and best regards, Andreas Sauer -- Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Oct 14 17:00:43 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 14 Oct 2013 17:00:43 +0200 Subject: [FieldTrip] problem ft_freqanalysis In-Reply-To: References: Message-ID: <525C071B.1040505@donders.ru.nl> Hi Bart, it might help if you paste the code that you are using for computing the FFT and for plotting. Also, showing the structure (e.g. fieldnames and size of the content) might help. Generally, the problem could just be related to huge 1/f noise and that you need to zoom in to see modulations of higher frequencies. Hard to tell though without any further information on what you are exactly doing ;) Best, Jörn On 10/12/2013 6:15 PM, Bart Michiels wrote: > After using ft_freqanalysis for EEG resting-state data I am unable to > see the whole spectrum of my data, which should show some content > between 0 and 60 Hz. I only see some low-frequency content (between 0 > and 8 Hz) when using plot(...). > > Pre-processing steps: > Avg re-reference, BP filter 0.25-100, cut continuous data into 4s > segments, resample data to 512 Hz, detrend, re-reference (after avg > rereferencing) to the A1&A2 electrode, Artefact rejection > (max=80,min=-80,range=160, default jump artefact algorithm), visual > inspection of the data. There are three datasets of 1 patients (every > dataset cut into 4s segments). After preprocessing, those data sets > are merged with ft.appenddata. > > I tried everything (wavelet, multi-taper), I always have the same > result, can someone tell me what I am doing wrong? > > Bart Michiels, Research Assistant. > > > _______________________________________________ > 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 Keith.McConnell at cchmc.org Mon Oct 14 20:14:14 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Mon, 14 Oct 2013 18:14:14 +0000 Subject: [FieldTrip] source localization help Message-ID: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Oct 14 21:25:10 2013 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 14 Oct 2013 21:25:10 +0200 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: <033FAAB9-3BC8-4473-902D-2B5C5DB6DAD0@gmail.com> Hi Keith, you have a typo in your script. It should be 'avg.pow' instead of 'ave.pow'. good luck Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 14.10.2013 um 20:14 schrieb McConnell, Keith: > Hello, > > I am trying to run the beamformer source analysis. > > In the code: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > I am generating the error: > > Reference to non-existent field 'ave'. > > Any help? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > 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 Mon Oct 14 21:28:52 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 14 Oct 2013 13:28:52 -0600 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 Keith.McConnell at cchmc.org Mon Oct 14 21:56:00 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Mon, 14 Oct 2013 19:56:00 +0000 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 Mon Oct 14 22:12:25 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 14 Oct 2013 14:12:25 -0600 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 haristz at gmail.com Mon Oct 14 22:16:34 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Mon, 14 Oct 2013 15:16:34 -0500 Subject: [FieldTrip] Artifacts in sourceplot ortho? Message-ID: Hi There, I have been having some problems with the use of sourceplot: I am trying to display the results of ft_sourcestatistics where input is sources for 2 conditions coming from multiple subjects (individual subjects warped to MNI space). To begin with, I interpolate my results to the MNI mri in fieldtrip - eg for p values : templatefile = '~/fieldtrip/external/spm8/templates/T1.nii'; template_mri = ft_read_mri(templatefile); cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'prob'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; imgdat = ft_sourceinterpolate(cfg, dat, template_mri); This seems to work fine except (and this is my question) for some *stange artifactual voxels* appearing when I use the 'ortho' method (see screenshot here https://db.tt/W7fiVIWq ) Here is the actual call: cfg = []; cfg.coordsys = 'mni'; cfg.funparameter = 'prob'; cfg.maskparameter = cfg.funparameter; cfg.funcolorlim=[0 0.05]; cfg.opacitymap ='rampdown' cfg.opacitylim=[0 0.05] cfg.method='ortho'; cfg.interactive='yes'; cfg.atlas='~/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; ft_sourceplot(cfg,imgdat) I am referring to the "white voxels" that seem to have value of 1 (which I thought, based on the above call should not be displayed(?)). The same kind of problem appears when I use other parameters from "prob", eg "stat" . Those "strange" voxels are always the same. This problem is not present with eg method "slice" Any advice or insight you might have would be much appreciated. Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center -------------- next part -------------- An HTML attachment was scrubbed... URL: From Keith.McConnell at cchmc.org Tue Oct 15 14:21:01 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Tue, 15 Oct 2013 12:21:01 +0000 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: Here you go. Thanks for the help. cfg = []; cfg.method = 'dics'; cfg.frequency = 8; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); save sourcePost_nocon sourcePost_nocon load sourcePost_nocon Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 4:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 julian.keil at gmail.com Tue Oct 15 14:32:27 2013 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 15 Oct 2013 14:32:27 +0200 Subject: [FieldTrip] source localization help In-Reply-To: References: Message-ID: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> Hi Keith, did you check if your output "sourcePost_nocon" contains the .avg-field (including the subfields avg.pow, avg.filter and so on)? If not, then something goes wrong in your source analysis. Have you checked your grid and vol? Especially, does your grid contain meaningful values, and not just NaNs? If your lead field is only NaNs, no data will be projected. Good Luck! ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 15.10.2013 um 14:21 schrieb McConnell, Keith: > Here you go. Thanks for the help. > > cfg = []; > cfg.method = 'dics'; > cfg.frequency = 8; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > > sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); > > save sourcePost_nocon sourcePost_nocon > > load sourcePost_nocon > > > > > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don > Sent: Monday, October 14, 2013 4:12 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source localization help > > Keith, > > I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? > > Don > > On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" wrote: > > > Ach. The solution may still prove to be simple, but I have made this change: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > and now receive this error: > > Reference to non-existent field 'avg'. > > Thanks for the help. > > Keith > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don > Sent: Monday, October 14, 2013 3:29 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source localization help > > I believe you should change cfg.parameter to read > > cfg.parameter = 'avg.pow' > > not > > cfg.parameter = 'ave.pow' > > > On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" wrote: > > > > Hello, > > I am trying to run the beamformer source analysis. > > In the code: > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); > > I am generating the error: > > Reference to non-existent field 'ave'. > > Any help? > > Keith McConnell, M.S. > > 513.636.0739 (desk) > 513.504.9907 (cell) > > Division of Pulmonary Medicine > Cincinnati Children's Hospital Medical Center > Cincinnati, OH 45229 > > _______________________________________________ > 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 Keith.McConnell at cchmc.org Tue Oct 15 14:38:17 2013 From: Keith.McConnell at cchmc.org (McConnell, Keith) Date: Tue, 15 Oct 2013 12:38:17 +0000 Subject: [FieldTrip] source localization help In-Reply-To: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> References: <1EEFC494-19BB-40F7-8746-049816348B07@gmail.com> Message-ID: What within grid and vol do I check? In grid.leadfield, for example, I do have some NaNs, but mostly *good* data. Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Julian Keil Sent: Tuesday, October 15, 2013 8:32 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Hi Keith, did you check if your output "sourcePost_nocon" contains the .avg-field (including the subfields avg.pow, avg.filter and so on)? If not, then something goes wrong in your source analysis. Have you checked your grid and vol? Especially, does your grid contain meaningful values, and not just NaNs? If your lead field is only NaNs, no data will be projected. Good Luck! ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 15.10.2013 um 14:21 schrieb McConnell, Keith: Here you go. Thanks for the help. cfg = []; cfg.method = 'dics'; cfg.frequency = 8; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost_nocon = ft_sourceanalysis(cfg, BAROpost); save sourcePost_nocon sourcePost_nocon load sourcePost_nocon Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 4:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help Keith, I'm assuming that sourcePost_nocon is the output from ft_sourceanalysis. Can you provide us with the cfg for your call to ft_sourceanalysis? Don On Oct 14, 2013, at 1:56 PM, "McConnell, Keith" > wrote: Ach. The solution may still prove to be simple, but I have made this change: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); and now receive this error: Reference to non-existent field 'avg'. Thanks for the help. Keith Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Rojas, Don Sent: Monday, October 14, 2013 3:29 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] source localization help I believe you should change cfg.parameter to read cfg.parameter = 'avg.pow' not cfg.parameter = 'ave.pow' On Oct 14, 2013, at 12:14 PM, "McConnell, Keith" > wrote: Hello, I am trying to run the beamformer source analysis. In the code: cfg = []; cfg.downsample = 2; cfg.parameter = 'ave.pow'; %error here for parameter = avg.pow referencing a nonexistent field sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon, mri); I am generating the error: Reference to non-existent field 'ave'. Any help? Keith McConnell, M.S. 513.636.0739 (desk) 513.504.9907 (cell) Division of Pulmonary Medicine Cincinnati Children's Hospital Medical Center Cincinnati, OH 45229 _______________________________________________ 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 e.maris at psych.ru.nl Wed Oct 16 06:58:00 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Wed, 16 Oct 2013 06:58:00 +0200 (CEST) Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers In-Reply-To: <52587DD7.2080801@glasgow.ac.uk> References: <52587DD7.2080801@glasgow.ac.uk> Message-ID: <005d01ceca2c$4add4530$e097cf90$@maris@psych.ru.nl> Dear May, 2 subject groups: Controls (C) and Patients (P). For a particular experimental condition (A), on average, subjects within each group have the following number of trials: condA_Ntrials_C ~= 100 condA_Ntrials_P ~= 80 I plan to perform a 2-step statistics-test to test for differences between C and P groups on a particular experimental condition. Using a 1st level within subject t-test (or active-vs-baseline test) on baseline vs active period for each group, deriving subject-specific t-stats which are to be subsequently used in a 2nd level test between subject group contrast, using nonparametric test. Question 1) Does it matter if the average trials per subject in each group is different? Should I try to equalize the trial numbers by e.g. random removal of some trials before computing any statistics? Is this advisable? Performing a second level t-test (in your case, between different groups of subjects) on first level t-tests is very unusual. In fact, this would imply that you second level t-test is about an hypothesis that pertains to first level t-tests. Instead, one always performs a second level t-test on first-level averages (typically baseline-normalized to deal with individual differences in distance to the helmet or baseline power). Differences in number of trials per conditions is never a problem as long as your first-level measure (the baseline-normalized mean) is unbiased. Question 2) Minimum trials required for source-level significance? The supplementary info. accompanying the 2007 paper illustrated some minimum trial numbers required for obtaining a significant effect at the sensor-level analysis, given some threshold (e.g. cluster>250 sensor-time pairs). Has anyone systematically shown what is the minimum number of trials required to obtain significant clusters/fdr stats at the source-level analysis? If not, is there a sensible way to find out? (presumably involving some form of bootstrapping and simulation?) There is no sensible way to find out this minimum number of trials, because the true effect size is unknown. This relates to another issue I have with regards to 'within-subjects' comparison for 2 experimental conditions A and B where there are average trial number differences both within and between subject groups: condA_Ntrials_C ~= 100 condB_Ntrials_C ~= 60 (min. =35) condA_Ntrials_P ~= 80 condB_Ntrials_P ~= 50 (min. =35) A similar concern of uneven trials arises if say I wish to perform a within subjects comparison between the experimental conditions. I think I’ve dealt with this question. In general, Q: Would the intended 2-step statistical test (as described above) be appropriate, OR would it best to control for 'equal' number of trials for all subjects and conditions of interest? I think I’ve answered this. Best, Eric Maris I would really appreciate it if someone could kindly comment or offer advise where appropriate. Thank you very much in advance for your time. Yours sincerely, May -- Heng-Ru May Tan Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive Neuroimaging (CCNi) ▫ University of Glasgow 58 Hillhead Street, Glasgow G12 8QB ▫ +44 (0)141-330-5090 ▫ Heng-RuMay.Tan at glasgow.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Wed Oct 16 11:19:17 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Wed, 16 Oct 2013 11:19:17 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters Message-ID: <525E5A15.9080900@gmail.com> Dear all, I'm trying to run ft_sourcestatistics with a specified ROI. It's data (MNEs) averaged over time. If I run ft_sourcestatistics without an ROI, I get a cluster with prob = .178. It looks like this (figure attached), where I masked using the t-values. Since I'm dealing with an N400-like component, I've got good reasons to expect the effect to be localised (mainly) to left temporal areas. So I tried adding this to my cfg: cfgst.atlas = 'aal\ROI_MNI_V4.nii'; cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; cfgst.avgoverroi = 'yes'; cfgst.hemisphere = 'left'; cfgst.inputcoord = 'mni' ; stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); If cfgst.avgoverroi == 'yes'; I get the following error: ??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> clusterstat at 187 tmp(cfg.inside) = postailobs; Error in ==> ft_statistics_montecarlo at 326 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 298 [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); Error in ==> ft_sourcestatistics at 107 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); If cfgst.avgoverroi == 'no'; ft outputs "found positive clusters in observed data" and stat.posclusters/negclusters is only NaN. This is regardless of whether cfgst.roi is one label or a cell array. Does anyone know what I'm doing wrong? I've been completely stuck on source statistics for these MNEs for days, so /any/ help would be highly appreciated, even if it is to suggest another way to do the stats! Thanks a lot, Vitória -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figure.png Type: image/png Size: 111863 bytes Desc: not available URL: From Heng-RuMay.Tan at glasgow.ac.uk Wed Oct 16 12:06:28 2013 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Wed, 16 Oct 2013 11:06:28 +0100 Subject: [FieldTrip] Questions relating to MEG nonparametric testing and uneven trial numbers In-Reply-To: References: Message-ID: <525E6524.4070402@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From kgm at tf.uni-kiel.de Wed Oct 16 15:30:49 2013 From: kgm at tf.uni-kiel.de (kgm at tf.uni-kiel.de) Date: Wed, 16 Oct 2013 15:30:49 +0200 Subject: [FieldTrip] Question on forward modeling Message-ID: Hello, I am trying to do forward modeling using individual MRI and MEG from Neuromag306 system. I have three questions. I have performed the following steps: 1. ft_read_mri 2. ft_volumerealign 3. ft_volumesegment Q1. At this point I want to check if the segmentation fits the MRI correctly. So I used ft_sourceplot but I am getting the following message with an empty plot: the input is segmented volume data with dimensions [256 256 176] scaling anatomy to [0 1] no functional parameter no masking parameter the call to "ft_sourceplot" took 4 seconds 4. ft_prepare_headmodel, method: singleshell 5. ft_plot_sens and ft_plot_vol, after converting the units Q2. The plot shows that the sensors/electrodes are quiet far away from the brain. Is there a means to do some projection to lower them a bit? Or is the problem arising from the co-registration? I have attached the figure. Q3. I have also used 'localspheres' method to prepare the head model. The output of the plot (attached) gives me some rounded image which does not look like a brain. Is there another function used to plot the local spheres? Looking forward for the response. Best regards, Ms.c. Kidist G.Mideksa Department of Neurology, Uni-Klinikum, Kiel, Germany -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodel_singleshell.fig Type: application/octet-stream Size: 57187 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodel_localspheres.fig Type: application/octet-stream Size: 693817 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Wed Oct 16 15:53:24 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 16 Oct 2013 15:53:24 +0200 Subject: [FieldTrip] Question on forward modeling In-Reply-To: References: Message-ID: <525E9A53.70308@donders.ru.nl> Hi Kidist, On 10/16/2013 3:30 PM, kgm at tf.uni-kiel.de wrote: > Hello, > > I am trying to do forward modeling using individual MRI and MEG from > Neuromag306 system. I have three questions. > > I have performed the following steps: > > 1. ft_read_mri > 2. ft_volumerealign > 3. ft_volumesegment > Q1. At this point I want to check if the segmentation fits the MRI > correctly. So I used ft_sourceplot but I am getting the following > message with an empty plot: > the input is segmented volume data with dimensions [256 256 176] > scaling anatomy to [0 1] > no functional parameter > no masking parameter > the call to "ft_sourceplot" took 4 seconds Hard to tell, maybe post a snippet of your cfg? First, however, you might want to have a look at this tutorial and especially check how the segmented mri is plotted and what else is done: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#preparing_the_data_and_the_forward_and_inverse_model > 4. ft_prepare_headmodel, method: singleshell > 5. ft_plot_sens and ft_plot_vol, after converting the units > Q2. The plot shows that the sensors/electrodes are quiet far away from > the brain. Is there a means to do some projection to lower them a bit? > Or is the problem arising from the co-registration? I have attached the > figure. Most likely, this is indeed a problem with the co-registration, or the subject was just seated that way. You mustn't just project sensors to make the plot appeal better to you ;) > Q3. I have also used 'localspheres' method to prepare the head model. > The output of the plot (attached) gives me some rounded image which > does not look like a brain. Is there another function used to plot the > local spheres? My guess is that you need to reduce the radii of the localspheres. Looks like they are defined in cm while the rest of your anatomy is defined in mm. Best, Jörn > > Looking forward for the response. > > Best regards, > > Ms.c. Kidist G.Mideksa > Department of Neurology, > Uni-Klinikum, Kiel, Germany > > > _______________________________________________ > 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 Wed Oct 16 16:07:41 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 16 Oct 2013 16:07:41 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: <525E5A15.9080900@gmail.com> References: <525E5A15.9080900@gmail.com> Message-ID: <525E9DAD.7000107@donders.ru.nl> Hi Vitoria, I guess that is the same error that Roey Schurr described a few days back. There were some changes recently in the atlas lookup function (we replaced one function and made another more general). Apparently that broke some things, or you two just happen to do this as the first ever ;) The only thing I can think of is that you might need to interpolate to the MNI template so that the dimensions are matched between the atlas and your source structures. Could you give that a try and let us know whether that helps? Best, Jörn On 10/16/2013 11:19 AM, Vitória Magalhães Piai wrote: > Dear all, > > I'm trying to run ft_sourcestatistics with a specified ROI. It's data > (MNEs) averaged over time. > > If I run ft_sourcestatistics without an ROI, I get a cluster with prob > = .178. It looks like this (figure attached), where I masked using the > t-values. > Since I'm dealing with an N400-like component, I've got good reasons > to expect the effect to be localised (mainly) to left temporal areas. > > So I tried adding this to my cfg: > > cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' > 'Temporal_Inf_L' }; > cfgst.avgoverroi = 'yes'; > cfgst.hemisphere = 'left'; > cfgst.inputcoord = 'mni' ; > stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > > If cfgst.avgoverroi == 'yes'; I get the following error: > > ??? In an assignment A(:) = B, the number of elements in A and B > must be the same. > Error in ==> clusterstat at 187 > tmp(cfg.inside) = postailobs; > Error in ==> ft_statistics_montecarlo at 326 > [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); > Error in ==> statistics_wrapper at 298 > [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); > Error in ==> ft_sourcestatistics at 107 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > If cfgst.avgoverroi == 'no'; > ft outputs "found positive clusters in observed data" and > stat.posclusters/negclusters is only NaN. This is regardless of > whether cfgst.roi is one label or a cell array. > > Does anyone know what I'm doing wrong? > I've been completely stuck on source statistics for these MNEs for > days, so /any/ help would be highly appreciated, even if it is to > suggest another way to do the stats! > > Thanks a lot, Vitória > > > _______________________________________________ > 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 kgm at tf.uni-kiel.de Wed Oct 16 16:57:11 2013 From: kgm at tf.uni-kiel.de (kgm at tf.uni-kiel.de) Date: Wed, 16 Oct 2013 16:57:11 +0200 Subject: [FieldTrip] Question on forward modeling In-Reply-To: <525E9A53.70308@donders.ru.nl> References: <525E9A53.70308@donders.ru.nl> Message-ID: Hi Jörn, > Hard to tell, maybe post a snippet of your cfg? First, however, you > might want to have a look at this tutorial and especially check how the > segmented mri is plotted and what else is done: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#preparing_the_data_and_the_forward_and_inverse_model > I have exactly followed what is stated on the tutorial. The cfg for the ft_sourceplot function is: cfg.funparameter = 'gray'; The cfg for the ft_volumesegment function is: cfg.method = 'interactive'; cfg.coordsys = 'neuromag'; cfg.output = 'brain'; > My guess is that you need to reduce the radii of the localspheres. Looks > like they are defined in cm while the rest of your anatomy is defined in > mm. > I have also reduced from cm to mm but still it is the same. Best regards, Kidist From phyllis.mania at uni-hamburg.de Wed Oct 16 18:09:03 2013 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Wed, 16 Oct 2013 18:09:03 +0200 Subject: [FieldTrip] error with runica Message-ID: <004501ceca8a$08552b20$18ff8160$@uni-hamburg.de> Dear all, I have a problem with running an ICA in one of my subjects (EEG, 70 channels, 878 trials), even though it was preprocessed exactly like all others (same number of channels, similar number of trials). When calling ft_componentanalysis with 'runica' the learning rate gets as low as 3.09032e-05 before it actually starts with step 1. It takes up to 512 steps (very slowly) but the lrate never changes from 0 after the first few steps while the angledelta is constant at 22.3. In the the end I get the following warning: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.190323e-16. > In runica at 1430 In ft_componentanalysis at 463 When trying to plot the components with ft_topoplotTFR only one black & white head shows up and the following error: Error using surf (line 75) X, Y, Z, and C cannot be complex. Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 185) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_topoplotIC (line 148) ft_topoplotTFR(cfg, varargin{:}); Running 'fastica' seems to work fine. I read about the issue with some 64 bit computers but the workaround with pop_runica didn't work for me. Thank you in advance! Best, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Oct 16 18:20:33 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Wed, 16 Oct 2013 18:20:33 +0200 (CEST) Subject: [FieldTrip] error with runica In-Reply-To: <004501ceca8a$08552b20$18ff8160$@uni-hamburg.de> Message-ID: <1163701128.3323422.1381940433385.JavaMail.root@sculptor.zimbra.ru.nl> Hi Phyllis, This error occurs when the input data is rank deficient, see: http://fieldtrip.fcdonders.nl/faq/why_does_my_ica_output_contain_complex_numbers Try to exclude the reference channel of your EEG (which is a linear combination of other EEG channels and can produce the rank deficiency) or ask runinca N independent components being N the rank of your data best, Diego ----- Original Message ----- > From: "Phyllis Mania" > To: fieldtrip at science.ru.nl > Sent: Wednesday, 16 October, 2013 6:09:03 PM > Subject: [FieldTrip] error with runica > Dear all, > I have a problem with running an ICA in one of my subjects (EEG, 70 > channels, 878 trials), even though it was preprocessed exactly like > all others (same number of channels, similar number of trials). When > calling ft_componentanalysis with ‘runica’ the learning rate gets as > low as 3.09032e-05 before it actually starts with step 1. It takes up > to 512 steps (very slowly) but the lrate never changes from 0 after > the first few steps while the angledelta is constant at 22.3. > In the the end I get the following warning: > Warning: Matrix is close to singular or badly scaled. Results may be > inaccurate. RCOND = 1.190323e-16. > > In runica at 1430 > In ft_componentanalysis at 463 > When trying to plot the components with ft_topoplotTFR only one black > & white head shows up and the following error: > Error using surf (line 75) > X, Y, Z, and C cannot be complex. > Error in ft_plot_topo (line 251) > h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', > 'none', 'FaceColor', shading); > Error in topoplot_common (line 704) > ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... > Error in ft_topoplotTFR (line 185) > [cfg] = topoplot_common(cfg, varargin{:}); > Error in ft_topoplotIC (line 148) > ft_topoplotTFR(cfg, varargin{:}); > Running ‘fastica’ seems to work fine. I read about the issue with some > 64 bit computers but the workaround with pop_runica didn’t work for > me. > Thank you in advance! > Best, > Phyllis > _______________________________________________ > 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 Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Wed Oct 16 19:06:13 2013 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Wed, 16 Oct 2013 19:06:13 +0200 Subject: [FieldTrip] error with runica Message-ID: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> Dear Diego, thank you for getting back to me so quickly! While the ref channel was actually excluded it still worked when I did N-1. Would you suggest this as a general rule for all subjects, to keep it constant? I do have different numbers of channels across subjects, because I sometimes need to exclude one that didn't record (usually Iz). Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Oct 16 19:10:20 2013 From: roeysc at gmail.com (Roey) Date: Wed, 16 Oct 2013 20:10:20 +0300 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: <525E9DAD.7000107@donders.ru.nl> References: <525E5A15.9080900@gmail.com> <525E9DAD.7000107@donders.ru.nl> Message-ID: Hi Vitoria and everyone else, I agree with Jörn (thank you!) , indeed it seems this is the same problem. Hopefully I'll get back to it next week and maybe figure it out. Right now it seems like the A side consists of all the inside-voxels, whereas the B side consists of the different ROIs, and hence the mismatch. A possible solution could be having the atlas we are using available to that function, and translating the B side to the voxel space. By the way, are you using an MNI grid per subject? Best, roey ב-16 באוק 2013, בשעה 17:07, "Jörn M. Horschig" כתב/ה: > Hi Vitoria, > > I guess that is the same error that Roey Schurr described a few days back. There were some changes recently in the atlas lookup function (we replaced one function and made another more general). Apparently that broke some things, or you two just happen to do this as the first ever ;) > The only thing I can think of is that you might need to interpolate to the MNI template so that the dimensions are matched between the atlas and your source structures. Could you give that a try and let us know whether that helps? > > Best, > Jörn > > > On 10/16/2013 11:19 AM, Vitória Magalhães Piai wrote: >> Dear all, >> >> I'm trying to run ft_sourcestatistics with a specified ROI. It's data (MNEs) averaged over time. >> >> If I run ft_sourcestatistics without an ROI, I get a cluster with prob = .178. It looks like this (figure attached), where I masked using the t-values. >> Since I'm dealing with an N400-like component, I've got good reasons to expect the effect to be localised (mainly) to left temporal areas. >> >> So I tried adding this to my cfg: >> >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; >> cfgst.avgoverroi = 'yes'; >> cfgst.hemisphere = 'left'; >> cfgst.inputcoord = 'mni' ; >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); >> >> If cfgst.avgoverroi == 'yes'; I get the following error: >> >> ??? In an assignment A(:) = B, the number of elements in A and B >> must be the same. >> Error in ==> clusterstat at 187 >> tmp(cfg.inside) = postailobs; >> Error in ==> ft_statistics_montecarlo at 326 >> [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); >> Error in ==> statistics_wrapper at 298 >> [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); >> Error in ==> ft_sourcestatistics at 107 >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> If cfgst.avgoverroi == 'no'; >> ft outputs "found positive clusters in observed data" and stat.posclusters/negclusters is only NaN. This is regardless of whether cfgst.roi is one label or a cell array. >> >> Does anyone know what I'm doing wrong? >> I've been completely stuck on source statistics for these MNEs for days, so any help would be highly appreciated, even if it is to suggest another way to do the stats! >> >> Thanks a lot, Vitória >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From merhart at ucsd.edu Wed Oct 16 20:11:43 2013 From: merhart at ucsd.edu (Matt Erhart) Date: Wed, 16 Oct 2013 11:11:43 -0700 Subject: [FieldTrip] Elekta Neuromag306 Trigger Extraction Message-ID: Hello, For about 5 of my 20 subjects, the trigger channel STI101 is returning incorrect values probably because of noise in that channel. How can I use the digital triggers, i.e. [STI001:STI006] for one task and [STI001:STI008 STI011:STI012] for another, properly? How can I adjust the extraction from STI101 such that it might be more tolerant to noise in a given subject? What's the best practice for checking/changing triggers by hand if the above don't fully work? I've got some real trigger values < 5, will I break something if I turn off fixneuromag and allow them to be included by default? thanks! Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Oct 16 20:15:04 2013 From: d.lozanosoldevilla at fcdonders.ru.nl (Diego Lozano Soldevilla) Date: Wed, 16 Oct 2013 20:15:04 +0200 Subject: [FieldTrip] error with runica In-Reply-To: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> References: <005f01ceca92$04e53810$0eafa830$@uni-hamburg.de> Message-ID: Hi Phyllis, If your participants differ in number of channels, I'd adjust individually the number of independent components computing the rank of the data before running ICA. best, Diego On 16 October 2013 19:06, Phyllis Mania wrote: > Dear Diego,**** > > ** ** > > thank you for getting back to me so quickly! While the ref channel was > actually excluded it still worked when I did N-1. Would you suggest this as > a general rule for all subjects, to keep it constant? I do have different > numbers of channels across subjects, because I sometimes need to exclude > one that didn’t record (usually Iz).**** > > ** ** > > Cheers, Phyllis**** > > _______________________________________________ > 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 hamid.mohseni at eng.ox.ac.uk Thu Oct 17 00:12:42 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Wed, 16 Oct 2013 23:12:42 +0100 Subject: [FieldTrip] Elekta Neuromag306 Trigger Extraction In-Reply-To: <7ccd2d77-b86d-4145-be98-568325be03c8@HUB06.ad.oak.ox.ac.uk> References: <7ccd2d77-b86d-4145-be98-568325be03c8@HUB06.ad.oak.ox.ac.uk> Message-ID: Hello Matt, Sometimes there is a binary coding problem in storing triggers value in Elekta system. For example instead of storing 1, 2, 3 it stores 257, 258, 259, respectively. In this case you need to use reminder operator rem(triggervalue, 256) to get the correct value. Is that what you are referring to? Hamid On 16 October 2013 19:11, Matt Erhart wrote: > Hello, > > For about 5 of my 20 subjects, the trigger channel STI101 is returning > incorrect values probably because of noise in that channel. > > How can I use the digital triggers, i.e. [STI001:STI006] for one task and > [STI001:STI008 STI011:STI012] for another, properly? > > How can I adjust the extraction from STI101 such that it might be more > tolerant to noise in a given subject? > > What's the best practice for checking/changing triggers by hand if the > above don't fully work? > > I've got some real trigger values < 5, will I break something if I turn > off fixneuromag and allow them to be included by default? > > thanks! > Matt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Fellow Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Thu Oct 17 10:30:46 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Thu, 17 Oct 2013 10:30:46 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters Message-ID: Hi Roey and Joern, Joern, my subjects' data are interpolated to the MNI template, as far as I understand. I'm using a code that Jan-Mathijs and I worked on some time ago, so what I'm doing should be really close to what's in the tutorial. The only thing I can tell that is in the tutorial but not in my code is the following: "After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the template_grid onto the subjects's source, which is thereby in MNI coordinates." In my code, we only copied .pos and .dim from the template to the subjects, but not .xgrid, .ygrid, .zgrid. Would that explain the error? I think I was using an FT version from the beginning of October when I got the error (running in my PC, so not the DCCN's... sorry, I cannot look that up now). When were the changes made you are referring to? I could look up which version I was using (sorry for missing this very crucial information in my last email), but it might as well be the case, as you mentioned, that Roey and I are the first ones to try it out in this particular way ;) Let me know if you need more info. Btw, I have these data in a hard disk at the DCCN if you need to have a look. Roey, yes, I'm using an MNI grid per subject (similar to the tutorial: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space> Make the individual subjects' grid). Cheers, Vitoria > ------------------------------ > > Message: 3 > Date: Wed, 16 Oct 2013 20:10:20 +0300 > From: Roey > To: FieldTrip discussion list > Subject: Re: [FieldTrip] source statistics with ROI yields NaN > clusters > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Vitoria and everyone else, > > I agree with J?rn (thank you!) , indeed it seems this is the same > problem. Hopefully I'll get back to it next week and maybe figure it > out. Right now it seems like the A side consists of all the > inside-voxels, whereas the B side consists of the different ROIs, and > hence the mismatch. > > A possible solution could be having the atlas we are using available > to that function, and translating the B side to the voxel space. > > By the way, are you using an MNI grid per subject? > > Best, > roey > > > > ?-16 ???? 2013, ???? 17:07, "J?rn M. Horschig" > ???/?: > > > Hi Vitoria, > > > > I guess that is the same error that Roey Schurr described a few days > > back. There were some changes recently in the atlas lookup function > > (we replaced one function and made another more general). Apparently > > that broke some things, or you two just happen to do this as the > > first ever ;) > > The only thing I can think of is that you might need to interpolate > > to the MNI template so that the dimensions are matched between the > > atlas and your source structures. Could you give that a try and let > > us know whether that helps? > > > > Best, > > J?rn > > > > > > On 10/16/2013 11:19 AM, Vit?ria Magalh?es Piai wrote: > >> Dear all, > >> > >> I'm trying to run ft_sourcestatistics with a specified ROI. It's > >> data (MNEs) averaged over time. > >> > >> If I run ft_sourcestatistics without an ROI, I get a cluster with > >> prob = .178. It looks like this (figure attached), where I masked > >> using the t-values. > >> Since I'm dealing with an N400-like component, I've got good > >> reasons to expect the effect to be localised (mainly) to left > >> temporal areas. > >> > >> So I tried adding this to my cfg: > >> > >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; > >> cfgst.avgoverroi = 'yes'; > >> cfgst.hemisphere = 'left'; > >> cfgst.inputcoord = 'mni' ; > >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > >> > >> If cfgst.avgoverroi == 'yes'; I get the following error: > >> > >> ??? In an assignment A(:) = B, the number of elements in A and B > >> must be the same. > >> Error in ==> clusterstat at 187 > >> tmp(cfg.inside) = postailobs; > >> Error in ==> ft_statistics_montecarlo at 326 > >> [stat, cfg] = clusterstat(cfg, statrand, > >> statobs,'issource',issource); > >> Error in ==> statistics_wrapper at 298 > >> [stat, cfg] = statmethod(cfg, dat, design, > >> 'issource',issource); > >> Error in ==> ft_sourcestatistics at 107 > >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > >> > >> If cfgst.avgoverroi == 'no'; > >> ft outputs "found positive clusters in observed data" and > >> stat.posclusters/negclusters is only NaN. This is regardless of > >> whether cfgst.roi is one label or a cell array. > >> > >> Does anyone know what I'm doing wrong? > >> I've been completely stuck on source statistics for these MNEs for > >> days, so any help would be highly appreciated, even if it is to > >> suggest another way to do the stats! > >> > >> Thanks a lot, Vit?ria > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > J?rn M. Horschig > > PhD Student > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Neuronal Oscillations Group > > FieldTrip Development Team > > > > P.O. Box 9101 > > NL-6500 HB Nijmegen > > The Netherlands > > > > Contact: > > E-Mail: jm.horschig at donders.ru.nl > > Tel: +31-(0)24-36-68493 > > Web: http://www.ru.nl/donders > > > > Visiting address: > > Trigon, room 2.30 > > Kapittelweg 29 > > NL-6525 EN Nijmegen > > The Netherlands > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131016/239e9cf4/attachment.html > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 35, Issue 29 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 12:32:36 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 12:32:36 +0200 Subject: [FieldTrip] source statistics with ROI yields NaN clusters In-Reply-To: References: Message-ID: <525FBCC4.7050502@donders.ru.nl> Hi Vitoria, the change should be from September 24, when we had our last bug binge. the xgrid, ygrid and zgrid variables should not matter - actually that should be deleted from the tutorial. However, what I meant was not that you build the grids in MNI space, but interpolate the grid with a 1cm or0.8cm resolution to the full MNI template using ft_sourceinterpolate, just like you would before plotting. But, I have no clue what has changed in the code, so this is just a desperate idea :) I think it would be wise to check with JM when he is back, as he is the source-guru. Could you open up a new bug for this? Then it might be easier for us (i.e. JM) to work on this. Best, Jörn On 10/17/2013 10:30 AM, Vitória Piai wrote: > > Hi Roey and Joern, > > Joern, my subjects' data are interpolated to the MNI template, as far > as I understand. I'm using a code that Jan-Mathijs and I worked on > some time ago, so what I'm doing should be really close to what's in > the tutorial. The only thing I can tell that is in the tutorial but > not in my code is the following: > "After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field > from the template_grid onto the subjects's source, which is thereby in > MNI coordinates." > In my code, we only copied .pos and .dim from the template to the > subjects, but not .xgrid, .ygrid, .zgrid. Would that explain the error? > I think I was using an FT version from the beginning of October when I > got the error (running in my PC, so not the DCCN's... sorry, I cannot > look that up now). When were the changes made you are referring to? I > could look up which version I was using (sorry for missing this very > crucial information in my last email), but it might as well be the > case, as you mentioned, that Roey and I are the first ones to try it > out in this particular way ;) > Let me know if you need more info. Btw, I have these data in a hard > disk at the DCCN if you need to have a look. > > Roey, yes, I'm using an MNI grid per subject (similar to the tutorial: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Make the individual subjects' grid). > > Cheers, Vitoria > > > ------------------------------ > > > > Message: 3 > > Date: Wed, 16 Oct 2013 20:10:20 +0300 > > From: Roey > > > To: FieldTrip discussion list > > > Subject: Re: [FieldTrip] source statistics with ROI yields NaN > > clusters > > Message-ID: > > > Content-Type: text/plain; charset="utf-8" > > > > Hi Vitoria and everyone else, > > > > I agree with J?rn (thank you!) , indeed it seems this is the same > > problem. Hopefully I'll get back to it next week and maybe figure it > > out. Right now it seems like the A side consists of all the > > inside-voxels, whereas the B side consists of the different ROIs, and > > hence the mismatch. > > > > A possible solution could be having the atlas we are using available > > to that function, and translating the B side to the voxel space. > > > > By the way, are you using an MNI grid per subject? > > > > Best, > > roey > > > > > > > > ?-16 ???? 2013, ???? 17:07, "J?rn M. Horschig" > > > ???/?: > > > > > Hi Vitoria, > > > > > > I guess that is the same error that Roey Schurr described a few days > > > back. There were some changes recently in the atlas lookup function > > > (we replaced one function and made another more general). Apparently > > > that broke some things, or you two just happen to do this as the > > > first ever ;) > > > The only thing I can think of is that you might need to interpolate > > > to the MNI template so that the dimensions are matched between the > > > atlas and your source structures. Could you give that a try and let > > > us know whether that helps? > > > > > > Best, > > > J?rn > > > > > > > > > On 10/16/2013 11:19 AM, Vit?ria Magalh?es Piai wrote: > > >> Dear all, > > >> > > >> I'm trying to run ft_sourcestatistics with a specified ROI. It's > > >> data (MNEs) averaged over time. > > >> > > >> If I run ft_sourcestatistics without an ROI, I get a cluster with > > >> prob = .178. It looks like this (figure attached), where I masked > > >> using the t-values. > > >> Since I'm dealing with an N400-like component, I've got good > > >> reasons to expect the effect to be localised (mainly) to left > > >> temporal areas. > > >> > > >> So I tried adding this to my cfg: > > >> > > >> cfgst.atlas = 'aal\ROI_MNI_V4.nii'; > > >> cfgst.roi = {'Temporal_Mid_L' 'Temporal_Sup_L' 'Temporal_Inf_L' }; > > >> cfgst.avgoverroi = 'yes'; > > >> cfgst.hemisphere = 'left'; > > >> cfgst.inputcoord = 'mni' ; > > >> stat = ft_sourcestatistics(cfgst, iRel{:}, iIde{:}); > > >> > > >> If cfgst.avgoverroi == 'yes'; I get the following error: > > >> > > >> ??? In an assignment A(:) = B, the number of elements in A and B > > >> must be the same. > > >> Error in ==> clusterstat at 187 > > >> tmp(cfg.inside) = postailobs; > > >> Error in ==> ft_statistics_montecarlo at 326 > > >> [stat, cfg] = clusterstat(cfg, statrand, > > >> statobs,'issource',issource); > > >> Error in ==> statistics_wrapper at 298 > > >> [stat, cfg] = statmethod(cfg, dat, design, > > >> 'issource',issource); > > >> Error in ==> ft_sourcestatistics at 107 > > >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > >> > > >> If cfgst.avgoverroi == 'no'; > > >> ft outputs "found positive clusters in observed data" and > > >> stat.posclusters/negclusters is only NaN. This is regardless of > > >> whether cfgst.roi is one label or a cell array. > > >> > > >> Does anyone know what I'm doing wrong? > > >> I've been completely stuck on source statistics for these MNEs for > > >> days, so any help would be highly appreciated, even if it is to > > >> suggest another way to do the stats! > > >> > > >> Thanks a lot, Vit?ria > > >> > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > > -- > > > J?rn M. Horschig > > > PhD Student > > > Donders Institute for Brain, Cognition and Behaviour > > > Centre for Cognitive Neuroimaging > > > Radboud University Nijmegen > > > Neuronal Oscillations Group > > > FieldTrip Development Team > > > > > > P.O. Box 9101 > > > NL-6500 HB Nijmegen > > > The Netherlands > > > > > > Contact: > > > E-Mail: jm.horschig at donders.ru.nl > > > Tel: +31-(0)24-36-68493 > > > Web: http://www.ru.nl/donders > > > > > > Visiting address: > > > Trigon, room 2.30 > > > Kapittelweg 29 > > > NL-6525 EN Nijmegen > > > The Netherlands > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 35, Issue 29 > > ***************************************** > > > > _______________________________________________ > 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 tahere.toosi at gmail.com Thu Oct 17 15:07:18 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Thu, 17 Oct 2013 16:37:18 +0330 Subject: [FieldTrip] Problem using ft_multiplotER - warning about color Message-ID: Hi fieldtripers I am trying to perform event-related averaging on my EEG data. My problem is when I use ft_multiplotER to plot ERPs, the plot shows up but only the ERP curves can't be seen (everything else is ok) and I receive the following warning: Warning: do not know how to plot the lines in the appropriate color > In ft_plot_vector at 393 In ft_multiplotER at 635 Even when I try the fieldtrip example, I receive the same warning and still no ERP. %the code just like example cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; cfg.layout = 'CTF151.lay'; cfg.ylim = [-3e-13 3e-13]; ft_multiplotER(cfg, avgFIC); Could you please help me? Best, Tahereh -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 17 15:42:42 2013 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Thu, 17 Oct 2013 15:42:42 +0200 (CEST) Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: Message-ID: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> Hi Tahereh, Could you please provide information about what your data looks like? i.e. what is the data structure of avgFIC? Best, Nietzsche ----- Original Message ----- > From: "Tahereh Toosi" > To: "FieldTrip discussion list" > Sent: Thursday, 17 October, 2013 3:07:18 PM > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > Hi fieldtripers > > > I am trying to perform event-related averaging on my EEG data. > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > up but only the ERP curves can't be seen (everything else is ok) and I > receive the following warning: > > > > Warning: do not know how to plot the lines in the appropriate color > > In ft_plot_vector at 393 > In ft_multiplotER at 635 > > > Even when I try the fieldtrip example, I receive the same warning and > still no ERP. > > > %the code just like example > > cfg = []; > cfg.showlabels = 'yes'; > cfg.fontsize = 6; > cfg.layout = 'CTF151.lay'; > cfg.ylim = [-3e-13 3e-13]; > ft_multiplotER(cfg, avgFIC); > > > Could you please help me? > > > Best, > Tahereh > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From tahere.toosi at gmail.com Thu Oct 17 15:59:58 2013 From: tahere.toosi at gmail.com (Tahereh Toosi) Date: Thu, 17 Oct 2013 17:29:58 +0330 Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> References: <889137090.3672407.1382017362184.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hi Nietzsche, Thank you for your response. I have this problem even when I try the fieldtrip example here . So data structure avgFIC is exactly the same as example, like below: avgFIC = avg: [149x900 double] var: [149x900 double] time: [1x900 double] dof: [149x900 double] label: {149x1 cell} dimord: 'chan_time' grad: [1x1 struct] cfg: [1x1 struct] On Thu, Oct 17, 2013 at 5:12 PM, Lam, N.H.L. (Nietzsche) < n.lam at fcdonders.ru.nl> wrote: > Hi Tahereh, > > Could you please provide information about what your data looks like? i.e. > what is the data structure of avgFIC? > > Best, > Nietzsche > > ----- Original Message ----- > > From: "Tahereh Toosi" > > To: "FieldTrip discussion list" > > Sent: Thursday, 17 October, 2013 3:07:18 PM > > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > > Hi fieldtripers > > > > > > I am trying to perform event-related averaging on my EEG data. > > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > > up but only the ERP curves can't be seen (everything else is ok) and I > > receive the following warning: > > > > > > > > Warning: do not know how to plot the lines in the appropriate color > > > In ft_plot_vector at 393 > > In ft_multiplotER at 635 > > > > > > Even when I try the fieldtrip example, I receive the same warning and > > still no ERP. > > > > > > %the code just like example > > > > cfg = []; > > cfg.showlabels = 'yes'; > > cfg.fontsize = 6; > > cfg.layout = 'CTF151.lay'; > > cfg.ylim = [-3e-13 3e-13]; > > ft_multiplotER(cfg, avgFIC); > > > > > > Could you please help me? > > > > > > Best, > > Tahereh > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > 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 hweeling.lee at gmail.com Thu Oct 17 16:02:32 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:02:32 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue Message-ID: Hi! I'm using the command ft_artifact_zvalue, and would like to use the interactive mode. However, I keep getting an error message: Error using ft_artifact_zvalue (line 216) no channels selected. I wonder if I require to specify the channels manually. Thanks! Here's my script: clear all; close all; clc; warning off; fs = filesep; % loading eeg files for fieldtrip cfg = []; cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; % loading stimulus information cfg.trialfun = 'my_trialfun_name'; % self-made function located in D:\New_Scripts_2013\my_trialfun_name.m cfg.trialdef.pre = 1.0; cfg.trialdef.post = 1.0; cfg = ft_definetrial(cfg); [data] = ft_preprocessing(cfg); % loading eeg data into memory % to filter 50 Hz 'humming' of electric power supply cfg.bsfiler = 'yes'; cfg.bsfreq = [49 51; 99 100; 149 151]; [data] = ft_preprocessing(cfg); % loading eeg data into memory % automatic artifact rejection cfg.artfctdef.zvalue.channel = 'eeg'; cfg.artfctdef.zvalue.cutoff = 0.5; cfg.artfctdef.zvalue.trlpadding = 0; cfg.artfctdef.zvalue.fltpadding = 0; cfg.artfctdef.zvalue.artpadding = 0; [cfg, artifact] = ft_artifact_zvalue(cfg, data); -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 17 16:04:08 2013 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Thu, 17 Oct 2013 16:04:08 +0200 (CEST) Subject: [FieldTrip] Problem using ft_multiplotER - warning about color In-Reply-To: Message-ID: <527130139.3673130.1382018648204.JavaMail.root@indus.zimbra.ru.nl> Hi Tehareh, Actually it does seem that the issue is with the plotting function, and not so much what data type is being used. I've also managed to plot the figure, and have the axes plotted, but not ERP/ERF waveform. I will file a bug for our developement team, and then take a deeper look into it. Thanks for pointing this out to us! Best, Nietzsche ----- Original Message ----- > From: "Tahereh Toosi" > To: "FieldTrip discussion list" > Sent: Thursday, 17 October, 2013 3:07:18 PM > Subject: [FieldTrip] Problem using ft_multiplotER - warning about color > Hi fieldtripers > > > I am trying to perform event-related averaging on my EEG data. > My problem is when I use ft_multiplotER to plot ERPs, the plot shows > up but only the ERP curves can't be seen (everything else is ok) and I > receive the following warning: > > > > Warning: do not know how to plot the lines in the appropriate color > > In ft_plot_vector at 393 > In ft_multiplotER at 635 > > > Even when I try the fieldtrip example, I receive the same warning and > still no ERP. > > > %the code just like example > > cfg = []; > cfg.showlabels = 'yes'; > cfg.fontsize = 6; > cfg.layout = 'CTF151.lay'; > cfg.ylim = [-3e-13 3e-13]; > ft_multiplotER(cfg, avgFIC); > > > Could you please help me? > > > Best, > Tahereh > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From zizlsperger at gmail.com Thu Oct 17 16:17:45 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Thu, 17 Oct 2013 16:17:45 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP Message-ID: Hi all, I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): In my example the two datasets have the structure: disp(EEG1_HC35_GA_JD_ICA_Coh5cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [314x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [314x32 double] cfg: [1x1 struct] disp(EEG1_HC35_GA_JD_ICA_Coh70cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [206x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [206x32 double] cfg: [1x1 struct] When I try to do the sourceanalysis by: cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); save source sourceCoh5 sourceCoh70; I get the error: the input is timelock data with 32 channels and 7000 timebins using headmodel specified in the configuration using electrodes specified in the configuration determining source compartment (3) projecting electrodes on skin surface combining electrode transfer and system matrix creating dipole grid based on user specified dipole positions using headmodel specified in the configuration using gradiometers specified in the configuration 8196 dipoles inside, 0 dipoles outside brain the call to "ft_prepare_sourcemodel" took 0 seconds estimating current density distribution for repetition 1 using pre-computed leadfields: some of the specified options will not have an effect Warning: computing a unregularised minimum norm solution. This typically does not work due to numerical accuracy problems > In minimumnormestimate at 150 In ft_sourceanalysis at 856 ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> minimumnormestimate at 226 mom = w * dat; Error in ==> ft_sourceanalysis at 856 dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Is this due to the different trial numbers of the datasets or does it point to another problem? Thanks in advance Best Leo RWTH Aachen Neurology -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Thu Oct 17 16:21:03 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Thu, 17 Oct 2013 16:21:03 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: References: Message-ID: I think "cfg.artfctdef.zvalue.channel" should be a SINGLE channel (use labels or ordinal numbers) cheers, T 2013/10/17 Hwee Ling Lee > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 16:28:54 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 16:28:54 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: References: Message-ID: <525FF426.6030200@donders.ru.nl> Hi, try using the upper-case abbreviation 'EEG'. Groetjes Jörn On 10/17/2013 4:02 PM, Hwee Ling Lee wrote: > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > > _______________________________________________ > 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 hweeling.lee at gmail.com Thu Oct 17 16:30:51 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:30:51 +0200 Subject: [FieldTrip] error using ft_artifact_zvalue In-Reply-To: <525FF426.6030200@donders.ru.nl> References: <525FF426.6030200@donders.ru.nl> Message-ID: thanks to all, for helpful suggestions! On 17 October 2013 16:28, "Jörn M. Horschig" wrote: > Hi, > > try using the upper-case abbreviation 'EEG'. > > Groetjes > Jörn > > > On 10/17/2013 4:02 PM, Hwee Ling Lee wrote: > > Hi! > > I'm using the command ft_artifact_zvalue, and would like to use the > interactive mode. > > However, I keep getting an error message: > > Error using ft_artifact_zvalue (line 216) > no channels selected. > > I wonder if I require to specify the channels manually. Thanks! > > Here's my script: > clear all; close all; clc; > warning off; > > fs = filesep; > > % loading eeg files for fieldtrip > cfg = []; > cfg.dataset = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.eeg'; > cfg.event = 'D:\Data\DBSmechanisms_v2\export\gudin-stimrec.vmrk'; > > % loading stimulus information > cfg.trialfun = 'my_trialfun_name'; % self-made function located in > D:\New_Scripts_2013\my_trialfun_name.m > cfg.trialdef.pre = 1.0; > cfg.trialdef.post = 1.0; > cfg = ft_definetrial(cfg); > > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % to filter 50 Hz 'humming' of electric power supply > cfg.bsfiler = 'yes'; > cfg.bsfreq = [49 51; 99 100; 149 151]; > [data] = ft_preprocessing(cfg); % loading eeg data into memory > > % automatic artifact rejection > cfg.artfctdef.zvalue.channel = 'eeg'; > cfg.artfctdef.zvalue.cutoff = 0.5; > cfg.artfctdef.zvalue.trlpadding = 0; > cfg.artfctdef.zvalue.fltpadding = 0; > cfg.artfctdef.zvalue.artpadding = 0; > > [cfg, artifact] = ft_artifact_zvalue(cfg, data); > > > _______________________________________________ > 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 > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Thu Oct 17 16:48:49 2013 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 17 Oct 2013 16:48:49 +0200 Subject: [FieldTrip] another question regarding display of ICA results Message-ID: Hi all, My data has only 13 channels for ICA preprocessing, and I would like to display the components from the ICA preprocessing. I use this: cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blcoksize = 50; cfg.channels = [1:13]; ft_databrowser(cfg,ic_data); However, I was prompted an error message: cannot infer sensor type. Is it possible to display the components using a generic layout? How can I resolve this issue? Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Oct 17 17:18:50 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 17 Oct 2013 17:18:50 +0200 Subject: [FieldTrip] another question regarding display of ICA results In-Reply-To: References: Message-ID: <525FFFDA.6010806@donders.ru.nl> Dear Hweeling, for EEG data, you always need to specify a layout manually when plotting topographies. Layouts can be found in fieldtrip/template/layout. A generic layout is EEG1020.lay. For more information, check our wikipage: http://fieldtrip.fcdonders.nl/?do=search&id=layout Best, Jörn On 10/17/2013 4:48 PM, Hwee Ling Lee wrote: > > Hi all, > > My data has only 13 channels for ICA preprocessing, and I would like > to display the components from the ICA preprocessing. > > I use this: > > cfg.viewmode = 'component'; > cfg.continuous = 'no'; > cfg.blcoksize = 50; > cfg.channels = [1:13]; > ft_databrowser(cfg,ic_data); > > However, I was prompted an error message: cannot infer sensor type. > > Is it possible to display the components using a generic layout? > > How can I resolve this issue? > > Thanks. > > Best regards, > Hweeling > > > > _______________________________________________ > 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 ben.vanlier at bsse.ethz.ch Thu Oct 17 18:20:40 2013 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Thu, 17 Oct 2013 16:20:40 +0000 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there Message-ID: Hi all, I am trying to show an increase in gamma oscillations. According to literature they should be there without a doubt. But, I am not too sure about the actual recording - i have the feeling i was just recording noise. When i eyeball raw traces, i do not see a difference between condition 1 and 2. Same for the PSD and spectrograms, just the 1/f noise. My question is, could there still be (eg low amplitude) oscillation in the data that you just wont see by eye? what is your experience in this? Using freqstatistics, some channels do show significance but im a bit skeptical. I have been playing around with freqstatistics and simulated data from freqsimulation and the stats only made sense when i could clearly see it by eye in the spectrogram as well... Cheers, Ben From Don.Rojas at ucdenver.edu Thu Oct 17 19:04:22 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 17 Oct 2013 11:04:22 -0600 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there In-Reply-To: References: Message-ID: <4DCE7020-FA7C-4704-8AD9-52F24016CA10@ucdenver.edu> Ben, Gamma oscillations are tiny and the 1/f characteristic normally obscures them in fft plots. I don't think that gamma is a particularly convincing oscillation that you would expect to see in a raw waveform because 1) it is so small and 2) it is a rather broad band that doesn't look like a sinusoid. Since you have two conditions to compare, one of which you expect to see greater gamma for, use ft_math to create a difference spectrum, which will remove much of the 1/f characteristic and emphasize the condition differences. Also, if you don't see condition differences, you can try computing the same thing for post-stimulus vs. pre-stimulus fft. The same logic would apply to your spectrograms. Best, Don On Oct 17, 2013, at 10:20 AM, "van Lier Ben" wrote: > Hi all, > > I am trying to show an increase in gamma oscillations. According to literature they should be there without a doubt. But, I am not too sure about the actual recording - i have the feeling i was just recording noise. > > When i eyeball raw traces, i do not see a difference between condition 1 and 2. Same for the PSD and spectrograms, just the 1/f noise. > > My question is, could there still be (eg low amplitude) oscillation in the data that you just wont see by eye? what is your experience in this? > > Using freqstatistics, some channels do show significance but im a bit skeptical. I have been playing around with freqstatistics and simulated data from freqsimulation and the stats only made sense when i could clearly see it by eye in the spectrogram as well... > > Cheers, > Ben > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From poil.simonshlomo at gmail.com Fri Oct 18 10:52:21 2013 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Fri, 18 Oct 2013 10:52:21 +0200 Subject: [FieldTrip] gamma oscillations, how to prove they are (not) there In-Reply-To: References: Message-ID: Hi Ben, Eyeballing data is a good start. But sometimes your eyes see something which is not really there (i.e. significant), or they might miss something (such as gamma). I think these tutorials would be relevant for you to read: http://www.nbtwiki.net/doku.php?id=tutorial:amplitude_in_classical_frequency_bands#.UmD1liQmyIA http://www.nbtwiki.net/doku.php?id=tutorial:power_spectra_wavelet_analysis_and_coherence#.UmD1NiQmyIA http://www.nbtwiki.net/doku.php?id=tutorial:compute_statistics#.UmD2NSQmyIA Good luck Simon -- Simon-Shlomo Poil, Dr. 2013/10/17 van Lier Ben > Hi all, > > I am trying to show an increase in gamma oscillations. According to > literature they should be there without a doubt. But, I am not too sure > about the actual recording - i have the feeling i was just recording noise. > > When i eyeball raw traces, i do not see a difference between condition 1 > and 2. Same for the PSD and spectrograms, just the 1/f noise. > > My question is, could there still be (eg low amplitude) oscillation in the > data that you just wont see by eye? what is your experience in this? > > Using freqstatistics, some channels do show significance but im a bit > skeptical. I have been playing around with freqstatistics and simulated > data from freqsimulation and the stats only made sense when i could clearly > see it by eye in the spectrogram as well... > > Cheers, > Ben > > > > _______________________________________________ > 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 zizlsperger at gmail.com Mon Oct 21 11:52:30 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Mon, 21 Oct 2013 11:52:30 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: References: Message-ID: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Dear all, no suggestions so far? Am I missing something obvious? In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) Would love to hear your ideas... Best Leo On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > Hi all, > I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): > In my example the two datasets have the structure: > > disp(EEG1_HC35_GA_JD_ICA_Coh5cov); > avg: [32x7000 double] > var: [32x7000 double] > time: [1x7000 double] > dof: [32x7000 double] > label: {32x1 cell} > trial: [314x32x7000 double] > dimord: 'rpt_chan_time' > trialinfo: [314x32 double] > cfg: [1x1 struct] > > > disp(EEG1_HC35_GA_JD_ICA_Coh70cov); > avg: [32x7000 double] > var: [32x7000 double] > time: [1x7000 double] > dof: [32x7000 double] > label: {32x1 cell} > trial: [206x32x7000 double] > dimord: 'rpt_chan_time' > trialinfo: [206x32 double] > cfg: [1x1 struct] > > When I try to do the sourceanalysis by: > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); > sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); > > save source sourceCoh5 sourceCoh70; > > I get the error: > > the input is timelock data with 32 channels and 7000 timebins > using headmodel specified in the configuration > using electrodes specified in the configuration > determining source compartment (3) > projecting electrodes on skin surface > combining electrode transfer and system matrix > creating dipole grid based on user specified dipole positions > using headmodel specified in the configuration > using gradiometers specified in the configuration > 8196 dipoles inside, 0 dipoles outside brain > the call to "ft_prepare_sourcemodel" took 0 seconds > estimating current density distribution for repetition 1 > using pre-computed leadfields: some of the specified options will not have an effect > Warning: computing a unregularised minimum norm solution. This typically does not work > due to numerical accuracy problems > > In minimumnormestimate at 150 > In ft_sourceanalysis at 856 > ??? Error using ==> mtimes > Inner matrix dimensions must agree. > > Error in ==> minimumnormestimate at 226 > mom = w * dat; > > Error in ==> ft_sourceanalysis at 856 > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); > > > > Is this due to the different trial numbers of the datasets or does it point to another problem? > Thanks in advance > Best > > Leo > RWTH Aachen Neurology > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Mon Oct 21 12:31:49 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Mon, 21 Oct 2013 12:31:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Message-ID: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: > Dear all, > no suggestions so far? Am I missing something obvious? > In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) > Would love to hear your ideas... > Best > Leo > > > > > On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > >> Hi all, >> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >> In my example the two datasets have the structure: >> >> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [314x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [314x32 double] >> cfg: [1x1 struct] >> >> >> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [206x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [206x32 double] >> cfg: [1x1 struct] >> >> When I try to do the sourceanalysis by: >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >> >> save source sourceCoh5 sourceCoh70; >> >> I get the error: >> >> the input is timelock data with 32 channels and 7000 timebins >> using headmodel specified in the configuration >> using electrodes specified in the configuration >> determining source compartment (3) >> projecting electrodes on skin surface >> combining electrode transfer and system matrix >> creating dipole grid based on user specified dipole positions >> using headmodel specified in the configuration >> using gradiometers specified in the configuration >> 8196 dipoles inside, 0 dipoles outside brain >> the call to "ft_prepare_sourcemodel" took 0 seconds >> estimating current density distribution for repetition 1 >> using pre-computed leadfields: some of the specified options will not have an effect >> Warning: computing a unregularised minimum norm solution. This typically does not work >> due to numerical accuracy problems >> > In minimumnormestimate at 150 >> In ft_sourceanalysis at 856 >> ??? Error using ==> mtimes >> Inner matrix dimensions must agree. >> >> Error in ==> minimumnormestimate at 226 >> mom = w * dat; >> >> Error in ==> ft_sourceanalysis at 856 >> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >> >> >> >> Is this due to the different trial numbers of the datasets or does it point to another problem? >> Thanks in advance >> Best >> >> Leo >> RWTH Aachen Neurology >> >> >> >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Mon Oct 21 12:31:49 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Mon, 21 Oct 2013 12:31:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> Message-ID: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: > Dear all, > no suggestions so far? Am I missing something obvious? > In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) > Would love to hear your ideas... > Best > Leo > > > > > On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: > >> Hi all, >> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >> In my example the two datasets have the structure: >> >> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [314x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [314x32 double] >> cfg: [1x1 struct] >> >> >> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >> avg: [32x7000 double] >> var: [32x7000 double] >> time: [1x7000 double] >> dof: [32x7000 double] >> label: {32x1 cell} >> trial: [206x32x7000 double] >> dimord: 'rpt_chan_time' >> trialinfo: [206x32 double] >> cfg: [1x1 struct] >> >> When I try to do the sourceanalysis by: >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >> >> save source sourceCoh5 sourceCoh70; >> >> I get the error: >> >> the input is timelock data with 32 channels and 7000 timebins >> using headmodel specified in the configuration >> using electrodes specified in the configuration >> determining source compartment (3) >> projecting electrodes on skin surface >> combining electrode transfer and system matrix >> creating dipole grid based on user specified dipole positions >> using headmodel specified in the configuration >> using gradiometers specified in the configuration >> 8196 dipoles inside, 0 dipoles outside brain >> the call to "ft_prepare_sourcemodel" took 0 seconds >> estimating current density distribution for repetition 1 >> using pre-computed leadfields: some of the specified options will not have an effect >> Warning: computing a unregularised minimum norm solution. This typically does not work >> due to numerical accuracy problems >> > In minimumnormestimate at 150 >> In ft_sourceanalysis at 856 >> ??? Error using ==> mtimes >> Inner matrix dimensions must agree. >> >> Error in ==> minimumnormestimate at 226 >> mom = w * dat; >> >> Error in ==> ft_sourceanalysis at 856 >> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >> >> >> >> Is this due to the different trial numbers of the datasets or does it point to another problem? >> Thanks in advance >> Best >> >> Leo >> RWTH Aachen Neurology >> >> >> >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 21 14:07:56 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 21 Oct 2013 14:07:56 +0200 Subject: [FieldTrip] fieldtrip website down for maintenance on October 22nd Message-ID: <5222E964-0CC2-4573-9A6C-14EE79D00DE9@donders.ru.nl> Dear all, Tomorrow morning, October 22nd, general DCCN network maintenance is needed and the FieldTrip website, the ftp, svn and the bugzilla server will all be down between 6:30AM and 9:00AM (CET). Hopefully the maintenance will be without issues and the downtime will be a bit shorter than this. If you know that you are going to need certain documentation, please save the html page or print it to a pdf file. best regards, Robert From Don.Rojas at ucdenver.edu Mon Oct 21 17:18:57 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 21 Oct 2013 09:18:57 -0600 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Message-ID: Based on past experience, I'd think that Stephan's suggestion is a good one to resolve the inner matrix dimension agreement error. You may have a pre-prepared leadfield with a different number of channels than the number you supply for the source solution. Check your cfg.elec.label field and see if it is the same length as the 1st dimension of EEG1_HC35_GA_JD_ICA_Coh5cov.avg. You might have left an ECG, EMG or EOG channel in the call to ft_prepare_leadfield. On Oct 21, 2013, at 4:31 AM, "smoratti at psi.ucm.es" > wrote: Dear Leopold, First, you have to regularise your MNE solution. Otherwise you get unstable results. Second, the error occurs in mom = w*dat; I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. ________________________________________________________ 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: Dear all, no suggestions so far? Am I missing something obvious? In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) Would love to hear your ideas... Best Leo On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold > wrote: Hi all, I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): In my example the two datasets have the structure: disp(EEG1_HC35_GA_JD_ICA_Coh5cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [314x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [314x32 double] cfg: [1x1 struct] disp(EEG1_HC35_GA_JD_ICA_Coh70cov); avg: [32x7000 double] var: [32x7000 double] time: [1x7000 double] dof: [32x7000 double] label: {32x1 cell} trial: [206x32x7000 double] dimord: 'rpt_chan_time' trialinfo: [206x32 double] cfg: [1x1 struct] When I try to do the sourceanalysis by: cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); save source sourceCoh5 sourceCoh70; I get the error: the input is timelock data with 32 channels and 7000 timebins using headmodel specified in the configuration using electrodes specified in the configuration determining source compartment (3) projecting electrodes on skin surface combining electrode transfer and system matrix creating dipole grid based on user specified dipole positions using headmodel specified in the configuration using gradiometers specified in the configuration 8196 dipoles inside, 0 dipoles outside brain the call to "ft_prepare_sourcemodel" took 0 seconds estimating current density distribution for repetition 1 using pre-computed leadfields: some of the specified options will not have an effect Warning: computing a unregularised minimum norm solution. This typically does not work due to numerical accuracy problems > In minimumnormestimate at 150 In ft_sourceanalysis at 856 ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> minimumnormestimate at 226 mom = w * dat; Error in ==> ft_sourceanalysis at 856 dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Is this due to the different trial numbers of the datasets or does it point to another problem? Thanks in advance Best Leo RWTH Aachen Neurology _______________________________________________ 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 m.stoica at uke.de Mon Oct 21 17:37:07 2013 From: m.stoica at uke.de (Stoica, Mircea) Date: Mon, 21 Oct 2013 15:37:07 +0000 Subject: [FieldTrip] Normality assumptions behind FT's statistics Message-ID: Dear all, does FieldTrip perform any transform on coherence/power spectra before ft_freqstatistics? If so, it should be documented so users would not apply the transform prior to the test. If not, t-tests cannot and should not be applied to this kind of data. Best regards, Mircea -- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From annevanhoogmoed at email.arizona.edu Tue Oct 22 00:59:51 2013 From: annevanhoogmoed at email.arizona.edu (van Hoogmoed, Anne H - (annevanhoogmoed)) Date: Mon, 21 Oct 2013 22:59:51 +0000 Subject: [FieldTrip] question for using ft_timelockgrandaverage Message-ID: Dear all, I'm using ft_timelockgrandaverage to make a grand average of my ERP data. However, the order of the channels is different for some people I want to include in the average. Does ft_timelockgrandaverage take this into account (i.e. does it average on channel name or on channel order)? Or do the channels need to be ordered the same for each participant. And if so, how should I do this? Thanks for your help, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 22 02:20:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Tue, 22 Oct 2013 02:20:49 +0200 Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: Dear Anne, I think ft_timelockgrandaverage expects your individual average (iavg) data structures to have equal label fields. I know that trying to "grandaverage" iavgs with different channel labels led to grand averages data structures with empty-matrix as values. If fieldtrip find labels common to all the iavg data structures they will be averaged. They are averaged on a "label" name basis, not on an ordinal basis. If you set cfg.channel to, say 1:3, and the first three channels of all your iavg datas do not have exactly the same label names it will return an empty matrix or throw an error. Hence, if you want to grand average iavgs with different channel labels, you need to previously manually change the labels so they are the same (maybe there is a more elegant solution than this workaround). I hope it was helpful, and correct, otherwise, I wish I will be corrected; Always give it a try first. It may work, it may throw an error, but understanding it you will be nearer to the solution 2013/10/22 van Hoogmoed, Anne H - (annevanhoogmoed) < annevanhoogmoed at email.arizona.edu> > Dear all,**** > > ** ** > > I’m using ft_timelockgrandaverage to make a grand average of my ERP data. > However, the order of the channels is different for some people I want to > include in the average. Does ft_timelockgrandaverage take this into account > (i.e. does it average on channel name or on channel order)? Or do the > channels need to be ordered the same for each participant. And if so, how > should I do this?**** > > ** ** > > Thanks for your help,**** > > ** ** > > Anne**** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 22 02:20:49 2013 From: constantino.mendezbertolo at ctb.upm.es (=?ISO-8859-1?Q?Constantino_M=E9ndez_B=E9rtolo?=) Date: Tue, 22 Oct 2013 02:20:49 +0200 Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: Dear Anne, I think ft_timelockgrandaverage expects your individual average (iavg) data structures to have equal label fields. I know that trying to "grandaverage" iavgs with different channel labels led to grand averages data structures with empty-matrix as values. If fieldtrip find labels common to all the iavg data structures they will be averaged. They are averaged on a "label" name basis, not on an ordinal basis. If you set cfg.channel to, say 1:3, and the first three channels of all your iavg datas do not have exactly the same label names it will return an empty matrix or throw an error. Hence, if you want to grand average iavgs with different channel labels, you need to previously manually change the labels so they are the same (maybe there is a more elegant solution than this workaround). I hope it was helpful, and correct, otherwise, I wish I will be corrected; Always give it a try first. It may work, it may throw an error, but understanding it you will be nearer to the solution 2013/10/22 van Hoogmoed, Anne H - (annevanhoogmoed) < annevanhoogmoed at email.arizona.edu> > Dear all,**** > > ** ** > > I’m using ft_timelockgrandaverage to make a grand average of my ERP data. > However, the order of the channels is different for some people I want to > include in the average. Does ft_timelockgrandaverage take this into account > (i.e. does it average on channel name or on channel order)? Or do the > channels need to be ordered the same for each participant. And if so, how > should I do this?**** > > ** ** > > Thanks for your help,**** > > ** ** > > Anne**** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Tue Oct 22 09:09:20 2013 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Tue, 22 Oct 2013 09:09:20 +0200 Subject: [FieldTrip] grad information lost after ICA Message-ID: Hi all, When I use the external 20131017FT version to do ICA analysis , the structure grad is gone . However , everything is OK if do it on the DCCN menta . Any ideas ? 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: From j.herring at fcdonders.ru.nl Tue Oct 22 09:13:27 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Tue, 22 Oct 2013 09:13:27 +0200 (CEST) Subject: [FieldTrip] question for using ft_timelockgrandaverage In-Reply-To: References: Message-ID: <010f01cecef6$33f2a620$9bd7f260$@herring@fcdonders.ru.nl> Hi Anne, Yes, ft_timelockgrandaverage takes this into account. This used to be a problem in earlier versions of Fieldtrip (~ a year ago) but has been fixed. If you want to make sure you can always specify cfg.keepindividual = 'yes'; and see whether the channels are ordered correctly. Alternatively you could replace the data for one channel in each subject with, for example, ones and see whether ft_timelockgrandaverage produces that channel with a mean of 1 with no variation as well. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of van Hoogmoed, Anne H - (annevanhoogmoed) Sent: dinsdag 22 oktober 2013 1:00 To: fieldtrip at donders.ru.nl Subject: [FieldTrip] question for using ft_timelockgrandaverage Dear all, I'm using ft_timelockgrandaverage to make a grand average of my ERP data. However, the order of the channels is different for some people I want to include in the average. Does ft_timelockgrandaverage take this into account (i.e. does it average on channel name or on channel order)? Or do the channels need to be ordered the same for each participant. And if so, how should I do this? Thanks for your help, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Tue Oct 22 09:23:01 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Tue, 22 Oct 2013 09:23:01 +0200 Subject: [FieldTrip] grad information lost after ICA (Haiteng Jiang) In-Reply-To: References: Message-ID: <526627D5.70705@gmail.com> Hi Haiteng, It's got to do with some recent changes to low-level functions. You have to run "runica" on the latest FT version, and then you'll get the grad structure back. It worked for me that way! Cheers, Vitória On 10/22/2013 9:13 AM, fieldtrip-request at science.ru.nl wrote: > Hi all, > When I use the external 20131017FT version to do ICA analysis , the > structure grad is gone . However , everything is OK if do it on the > DCCN menta . > Any ideas ? > Best, Haiteng > > > From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 14:48:45 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke van Dijk) Date: Tue, 22 Oct 2013 14:48:45 +0200 Subject: [FieldTrip] neuromag306 sources look vertically smeared. Message-ID: Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_vertical.jpg Type: image/jpeg Size: 95892 bytes Desc: not available URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 15:00:43 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke.vanDijk at med.uni-duesseldorf.de) Date: Tue, 22 Oct 2013 13:00:43 +0000 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? Message-ID: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke __________________________________________ Hanneke van Dijk, PhD http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html Institute for Clinical Neuroscience, Heinrich Heine Universität Düsseldorf, Germany Hanneke.vanDijk at med.uni-duesseldorf.de Tel. +49 (0) 211 81 13074 __________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Tue Oct 22 15:02:30 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke.vanDijk at med.uni-duesseldorf.de) Date: Tue, 22 Oct 2013 13:02:30 +0000 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> Message-ID: <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> Dear all, My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... I am wondering if any of you has an idea where I should look to find a solution. Further information: I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). Then compute the fourier, and do sourceanalysis as follows: cfg = []; cfg.method = 'dics'; cfg.grid = mni_grid; cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter cfg.grid.leadfield = source.leadfield; cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... cfg.vol.unit = 'cm'; cfg.frequency = 60; cfg.latency = 3; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '0.05%'; cfg.dics.normalize = 'yes'; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; % project each single trial through the filter s = ft_sourceanalysis(cfg, f); Thanks in advance for any suggestion! Groetjes Hanneke __________________________________________ Hanneke van Dijk, PhD http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html Institute for Clinical Neuroscience, Heinrich Heine Universität Düsseldorf, Germany Hanneke.vanDijk at med.uni-duesseldorf.de Tel. +49 (0) 211 81 13074 __________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source_vertical.jpg Type: image/jpeg Size: 95892 bytes Desc: source_vertical.jpg URL: From jan.schoffelen at donders.ru.nl Tue Oct 22 15:13:27 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 22 Oct 2013 15:13:27 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> Message-ID: <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Hi Hanneke, I don't know what you expect to see, but to me it is not clear what quantity you are visualizing here (given the units). Also, note that when you put precomputed spatial filters in the cfg, the lambda specified for the second round of ft_sourceanalysis is not going to change the spatial structure of the result, because the spatial filters are fixed. Also, note that specifying '0.05%' leads to a very tiny regularization. I think that you wanted to specify '5%', which translates to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol will not be used in the second round of ft_sourceanalysis (nor in the first one if you used precomputed leadfields) I don't see the point in fiddling around with the metric units (converting it to 'mm'), but then explicitly stating them to be in 'cm'. Did you not do this when actually computing the leadfields? I hope not. Best, Jan-Mathijs On Oct 22, 2013, at 3:02 PM, wrote: > Dear all, > > My data (that are recorded with a neuromag306 system) look vertically smeared after sourceanalysis (see attached picture). The sources look like columns. The location (when plotted with method 'surface') looks comparable to the sensor analysis so I am not worried about that. > > The noise projection (cfg.dics.lambda) is something that I have been playing around with, but other then 'nai amplitude' de- or increases, this does not change the sources 'verticallness'. This indicates to me that this might be the problem... > > I am wondering if any of you has an idea where I should look to find a solution. > > Further information: > > I am using a mni-normalised headmodel such as described on the site: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but adapted to the neuromag system (I will make changes to the specific site :-) ). > > Then compute the fourier, and do sourceanalysis as follows: > > cfg = []; > cfg.method = 'dics'; > cfg.grid = mni_grid; > cfg.grid.filter = source.avg.filter; % precomputed filter and leadfield to project all trials through the same filter > cfg.grid.leadfield = source.leadfield; > cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is needed somehow... > cfg.vol.unit = 'cm'; > cfg.frequency = 60; > cfg.latency = 3; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = '0.05%'; > cfg.dics.normalize = 'yes'; > cfg.keeptrials = 'yes'; > cfg.rawtrial = 'yes'; % project each single trial through the filter > s = ft_sourceanalysis(cfg, f); > > Thanks in advance for any suggestion! > > Groetjes Hanneke > > > __________________________________________ > > Hanneke van Dijk, PhD > http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html > Institute for Clinical Neuroscience, > Heinrich Heine Universität Düsseldorf, Germany > Hanneke.vanDijk at med.uni-duesseldorf.de > Tel. +49 (0) 211 81 13074 > __________________________________________ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From hanneke.p.van.dijk at gmail.com Tue Oct 22 16:53:56 2013 From: hanneke.p.van.dijk at gmail.com (Hanneke van Dijk) Date: Tue, 22 Oct 2013 16:53:56 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Thanks for your quick reply. I will go through your comments one by one: 1. The plot shows the nai, and in stead of these straight vertical lines going even into the center of the brain, I expected to see blobs. 2. In the precomputed filters I have used the same lambda, I should remove the cfg from this part. I have used cfg.dics.lambda from 0.05 to 50 and as I said this only changes the 'power' but not the structure of the data. 3. About the cfg.vol. I have been fidling around with the units for quite some time, but this is the only way the functional data will not end up the size of a pea in the anatomical data. I think this has to do with ctf/neuromag/spm coordinate system differences that are not yet fixed in FieldTrip? But it seems that there is no obvious thing that could be happening then? Groetjes Hanneke On Tue, Oct 22, 2013 at 3:13 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Hanneke, > > I don't know what you expect to see, but to me it is not clear what > quantity you are visualizing here (given the units). > Also, note that when you put precomputed spatial filters in the cfg, the > lambda specified for the second round of ft_sourceanalysis is not going to > change the spatial structure of the result, because the spatial filters are > fixed. Also, note that specifying '0.05%' leads to a very tiny > regularization. I think that you wanted to specify '5%', which translates > to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol > will not be used in the second round of ft_sourceanalysis (nor in the first > one if you used precomputed leadfields) I don't see the point in fiddling > around with the metric units (converting it to 'mm'), but then explicitly > stating them to be in 'cm'. Did you not do this when actually computing the > leadfields? I hope not. > > Best, > Jan-Mathijs > > > > On Oct 22, 2013, at 3:02 PM, < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > > Dear all,**** > ** ** > My data (that are recorded with a neuromag306 system) look vertically > smeared after sourceanalysis (see attached picture). The sources look like > columns. The location (when plotted with method 'surface') looks comparable > to the sensor analysis so I am not worried about that. **** > ** ** > The noise projection (cfg.dics.lambda) is something that I have been > playing around with, but other then 'nai amplitude' de- or increases, this > does not change the sources 'verticallness'. This indicates to me that this > might be the problem... **** > ** ** > I am wondering if any of you has an idea where I should look to find a > solution. **** > ** ** > Further information:**** > ** ** > I am using a mni-normalised headmodel such as described on the site: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but > adapted to the neuromag system (I will make changes to the specific site > :-) ).**** > ** ** > Then compute the fourier, and do sourceanalysis as follows:**** > ** ** > cfg = [];**** > cfg.method = 'dics';**** > cfg.grid = mni_grid;**** > cfg.grid.filter = source.avg.filter; % precomputed filter and > leadfield to project all trials through the same filter**** > cfg.grid.leadfield = source.leadfield;**** > cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is > needed somehow...**** > cfg.vol.unit = 'cm';**** > cfg.frequency = 60;**** > cfg.latency = 3;**** > cfg.dics.projectnoise = 'yes';**** > cfg.dics.lambda = '0.05%';**** > cfg.dics.normalize = 'yes';**** > cfg.keeptrials = 'yes';**** > cfg.rawtrial = 'yes'; % project each single trial through > the filter**** > s = ft_sourceanalysis(cfg, f);**** > ** ** > Thanks in advance for any suggestion!**** > ** ** > Groetjes Hanneke**** > ** ** > ** ** > __________________________________________**** > ** ** > Hanneke van Dijk, PhD**** > > http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html > **** > Institute for Clinical Neuroscience,**** > Heinrich Heine Universität Düsseldorf, Germany**** > Hanneke.vanDijk at med.uni-duesseldorf.de**** > Tel. +49 (0) 211 81 13074 **** > > __________________________________________ > **** > ** ** > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hanneke.p.van.dijk at gmail.com Tue Oct 22 17:08:28 2013 From: hanneke.p.van.dijk at gmail.com (Hanneke van Dijk) Date: Tue, 22 Oct 2013 17:08:28 +0200 Subject: [FieldTrip] [Fieldtrip] neuromag source data vertically smeared? In-Reply-To: References: <495873C58A622E45A3ABF4813B9451EC6E3E6D51@MAIL3-UKD.VMED.UKD> <495873C58A622E45A3ABF4813B9451EC6E3E6D62@MAIL3-UKD.VMED.UKD> <7042E34F-AC33-4967-9B51-28F70EB6EF7E@donders.ru.nl> Message-ID: Hi Jan-Mathijs, schaam schaam, The unit thing must have been fixed! So problem fixed, thanks so much! Groetjes uit Duesseldorf! Hanneke Groetjes Hanneke On Tue, Oct 22, 2013 at 4:53 PM, Hanneke van Dijk < hanneke.p.van.dijk at gmail.com> wrote: > Hi Jan-Mathijs, > > Thanks for your quick reply. I will go through your comments one by one: > > 1. The plot shows the nai, and in stead of these straight vertical lines > going even into the center of the brain, I expected to see blobs. > 2. In the precomputed filters I have used the same lambda, I should remove > the cfg from this part. I have used cfg.dics.lambda from 0.05 to 50 and as > I said this only changes the 'power' but not the structure of the data. > 3. About the cfg.vol. I have been fidling around with the units for quite > some time, but this is the only way the functional data will not end up the > size of a pea in the anatomical data. I think this has to do with > ctf/neuromag/spm coordinate system differences that are not yet fixed in > FieldTrip? > > But it seems that there is no obvious thing that could be happening then? > > Groetjes Hanneke > > > > > > > On Tue, Oct 22, 2013 at 3:13 PM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Hanneke, >> >> I don't know what you expect to see, but to me it is not clear what >> quantity you are visualizing here (given the units). >> Also, note that when you put precomputed spatial filters in the cfg, the >> lambda specified for the second round of ft_sourceanalysis is not going to >> change the spatial structure of the result, because the spatial filters are >> fixed. Also, note that specifying '0.05%' leads to a very tiny >> regularization. I think that you wanted to specify '5%', which translates >> to 0.05 times the trace of the csd matrix. Also, even though the cfg.vol >> will not be used in the second round of ft_sourceanalysis (nor in the first >> one if you used precomputed leadfields) I don't see the point in fiddling >> around with the metric units (converting it to 'mm'), but then explicitly >> stating them to be in 'cm'. Did you not do this when actually computing the >> leadfields? I hope not. >> >> Best, >> Jan-Mathijs >> >> >> >> On Oct 22, 2013, at 3:02 PM, < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >> Dear all,**** >> ** ** >> My data (that are recorded with a neuromag306 system) look vertically >> smeared after sourceanalysis (see attached picture). The sources look like >> columns. The location (when plotted with method 'surface') looks comparable >> to the sensor analysis so I am not worried about that. **** >> ** ** >> The noise projection (cfg.dics.lambda) is something that I have been >> playing around with, but other then 'nai amplitude' de- or increases, this >> does not change the sources 'verticallness'. This indicates to me that this >> might be the problem... **** >> ** ** >> I am wondering if any of you has an idea where I should look to find a >> solution. **** >> ** ** >> Further information:**** >> ** ** >> I am using a mni-normalised headmodel such as described on the site: >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space but >> adapted to the neuromag system (I will make changes to the specific site >> :-) ).**** >> ** ** >> Then compute the fourier, and do sourceanalysis as follows:**** >> ** ** >> cfg = [];**** >> cfg.method = 'dics';**** >> cfg.grid = mni_grid;**** >> cfg.grid.filter = source.avg.filter; % precomputed filter and >> leadfield to project all trials through the same filter**** >> cfg.grid.leadfield = source.leadfield;**** >> cfg.vol = ft_convert_units(mni_vol,'mm'); % this step is >> needed somehow...**** >> cfg.vol.unit = 'cm';**** >> cfg.frequency = 60;**** >> cfg.latency = 3;**** >> cfg.dics.projectnoise = 'yes';**** >> cfg.dics.lambda = '0.05%';**** >> cfg.dics.normalize = 'yes';**** >> cfg.keeptrials = 'yes';**** >> cfg.rawtrial = 'yes'; % project each single trial through >> the filter**** >> s = ft_sourceanalysis(cfg, f);**** >> ** ** >> Thanks in advance for any suggestion!**** >> ** ** >> Groetjes Hanneke**** >> ** ** >> ** ** >> __________________________________________**** >> ** ** >> Hanneke van Dijk, PhD**** >> >> http://www.uniklinik-duesseldorf.de/deutsch/unternehmen/institute/KlinNeurowiss/Team/HannekevanDijk/page.html >> **** >> Institute for Clinical Neuroscience,**** >> Heinrich Heine Universität Düsseldorf, Germany**** >> Hanneke.vanDijk at med.uni-duesseldorf.de**** >> Tel. +49 (0) 211 81 13074 **** >> >> __________________________________________ >> **** >> ** ** >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haristz at gmail.com Wed Oct 23 02:00:01 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Tue, 22 Oct 2013 19:00:01 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS Message-ID: Hi There, I have a question regarding ft_sourceanalysis: I in fact seem to be getting conflicting results depending on the beamformer I use . In summary (and of course, provided I have not made an error somewhere!), for a given frequency band and a predefined filter LCMV seems to output results that look more as if they are based on the covariance matrix estimated on the evoked response (ie not the covariance matrix coming from averaging one way or the other the covariance matrices resulting from individual trials as is the case with the other beamformers). So in its "vanilla" form, when I test it against SAM and DICS, LCMV gives different results. When I comment out the part of the ft_sourceanalysis code that is executed for LCMV when a filter is input with cfg (this seems to be done to speed up the process), then the results are comparable for all 3 beamformers. More in detail (apologies for the rather lenthy post): We are using a motor task and studying beta descynchronisation. The images I link to are "gradnaveraged" relative changes in beta power between a period during baseline and a period during "task" over 10 subjects. I first deform the MNI grid to individual subjects' brains so everything takes place in MNI space.For all 3 beamformers the leadfield and headmodels are calculated in the same way (except for SAM where the singleshell model is unavailable and I used localspheres instead). All this was done with fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in the code for the beamformers or ft_sourceanalysis. We used DICS (centered on an appororiately chosen frequency), SAM and LCMV with the same data and intervals. For the latter 2 I first bandpass filter the data to the beta band during ft_preprocessing. For the DICS analysis I use exactly the same procedure as in the relevant tutorial. For SAM and LCMV I do the same with the minor change that the common filter is calculated over a much larger interval that includes the "baseline" and "task" intervals at its edges, instead of creating a dataset through concatenation of the "baseline" and "task" intervals compared. So code-wise (and per subject), for DICS this is: and then: cfg = []; cfg.frequency = freq_cmb.freq; cfg.grad = senscm; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freq_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; and for SAM and LCMV: cfg=[]; cfg.bpfilter='yes'; cfg.bpfreq =[freq-fsmth freq+fsmth]; cfg.channel=params.chan; datf=ft_preprocessing(cfg,dat); cfg = []; cfg.toilim = tb; dataPre = ft_redefinetrial(cfg, datf); cfg = []; cfg.toilim = ta; dataPost = ft_redefinetrial(cfg, datf); cfg=[]; cfg.toilim = [tb(1,1) ta(1,2)]; data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength = 2; further down but this would change the solution very little clear('dat'); cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); cfg = []; cfg.grad = senscm; cfg.method = 'lcmv';% (or 'sam') cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.lambda ='5%';%relevant code added to beamformer_sam to handle this cfg.keepfilter = 'yes'; cfg.fixedori = 'yes'; cfg.projectnoise='yes'; source = ft_sourceanalysis(cfg, d_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; The results for SAM (https://db.tt/fhvEAJN0) and DICS ( https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense physiologically). LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact similar to what you'd get if using the covariance matrix of the ERP average, ie: data_cmb = ft_timelockanalysis([], data_cmb); dataPre = ft_timelockanalysis([], dataPre); dataPost = ft_timelockanalysis([], dataPost); and then (as above) cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is similar to LCMV above. This is however not what we wanted. Going through the code in ft_sourceanalysis I see there is a part (only for LCMV and when a filter is provided) where the data and covariance matrix are treated differently. I can't say I fully understand the algorithm there but when I commented out that part my LCMV results are in very good agreement with DICS and SAM ( https://db.tt/aNz11ntb). I would as always be grateful for your feedback and opinions. Am I committing an error somewhere? - should the code behave differently there? With Thanks and Best Wishes, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center -------------- next part -------------- An HTML attachment was scrubbed... URL: From haristz at gmail.com Wed Oct 23 03:02:25 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Tue, 22 Oct 2013 20:02:25 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: ...sorry, forgot to add to my post that for SAM I use the option cfg.fixedori = 'robert'; Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 22 October 2013 19:00, Charidimos Tzagarakis wrote: > Hi There, > I have a question regarding ft_sourceanalysis: I in fact seem to be > getting conflicting results depending on the beamformer I use . > > In summary (and of course, provided I have not made an error somewhere!), > for a given frequency band and a predefined filter LCMV seems to output > results that look more as if they are based on the covariance matrix > estimated on the evoked response (ie not the covariance matrix coming from > averaging one way or the other the covariance matrices resulting from > individual trials as is the case with the other beamformers). So in its > "vanilla" form, when I test it against SAM and DICS, LCMV gives different > results. When I comment out the part of the ft_sourceanalysis code that is > executed for LCMV when a filter is input with cfg (this seems to be done to > speed up the process), then the results are comparable for all 3 > beamformers. > > More in detail (apologies for the rather lenthy post): > We are using a motor task and studying beta descynchronisation. The images > I link to are "gradnaveraged" relative changes in beta power between a > period during baseline and a period during "task" over 10 subjects. I first > deform the MNI grid to individual subjects' brains so everything takes > place in MNI space.For all 3 beamformers the leadfield and headmodels are > calculated in the same way (except for SAM where the singleshell model is > unavailable and I used localspheres instead). All this was done with > fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in > the code for the beamformers or ft_sourceanalysis. > > We used DICS (centered on an appororiately chosen frequency), SAM and LCMV > with the same data and intervals. For the latter 2 I first bandpass filter > the data to the beta band during ft_preprocessing. For the DICS analysis I > use exactly the same procedure as in the relevant tutorial. For SAM and > LCMV I do the same with the minor change that the common filter is > calculated over a much larger interval that includes the "baseline" and > "task" intervals at its edges, instead of creating a dataset through > concatenation of the "baseline" and "task" intervals compared. > So code-wise (and per subject), for DICS this is: > > > and then: > > cfg = []; > cfg.frequency = freq_cmb.freq; > cfg.grad = senscm; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf; > cfg.vol = volfcm; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > > source = ft_sourceanalysis(cfg, freq_cmb); > with source_Pre and source_Post calculated with the above cfg *plus* using > the filter estimated at "source". > cfg.grid.filter = source.avg.filter; > > and for SAM and LCMV: > cfg=[]; > > cfg.bpfilter='yes'; > cfg.bpfreq =[freq-fsmth freq+fsmth]; > cfg.channel=params.chan; > datf=ft_preprocessing(cfg,dat); > > > cfg = []; > cfg.toilim = tb; > dataPre = ft_redefinetrial(cfg, datf); > cfg = []; > cfg.toilim = ta; > dataPost = ft_redefinetrial(cfg, datf); > cfg=[]; > cfg.toilim = [tb(1,1) ta(1,2)]; > data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done > data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength > = 2; further down but this would change the solution very little > > clear('dat'); > > > cfg = []; > cfg.covariance = 'yes'; > cfg.channel = params.chan; > cfg.covariancewindow = 'all'; > cfg.removemean='no'; > cfg.keeptrials ='yes'; > %keyboard > d_cmb = ft_timelockanalysis(cfg, data_cmb); > d_Pre = ft_timelockanalysis(cfg, dataPre); > d_Post = ft_timelockanalysis(cfg, dataPost); > > > cfg = []; > cfg.grad = senscm; > cfg.method = 'lcmv';% (or 'sam') > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf; > cfg.vol = volfcm; > cfg.lambda ='5%';%relevant code added to beamformer_sam to handle > this > cfg.keepfilter = 'yes'; > cfg.fixedori = 'yes'; > cfg.projectnoise='yes'; > source = ft_sourceanalysis(cfg, d_cmb); > > with source_Pre and source_Post calculated with the above cfg *plus* using > the filter estimated at "source". > cfg.grid.filter = source.avg.filter; > > > The results for SAM (https://db.tt/fhvEAJN0) and DICS ( > https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense > physiologically). > LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact > similar to what you'd get if using the covariance matrix of the ERP > average, ie: > data_cmb = ft_timelockanalysis([], data_cmb); > dataPre = ft_timelockanalysis([], dataPre); > dataPost = ft_timelockanalysis([], dataPost); > and then (as above) > cfg = []; > cfg.covariance = 'yes'; > cfg.channel = params.chan; > cfg.covariancewindow = 'all'; > cfg.removemean='no'; > cfg.keeptrials ='yes'; > %keyboard > d_cmb = ft_timelockanalysis(cfg, data_cmb); > d_Pre = ft_timelockanalysis(cfg, dataPre); > d_Post = ft_timelockanalysis(cfg, dataPost); > > I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is > similar to LCMV above. > > This is however not what we wanted. Going through the code in > ft_sourceanalysis I see there is a part (only for LCMV and when a filter is > provided) where the data and covariance matrix are treated differently. I > can't say I fully understand the algorithm there but when I commented out > that part my LCMV results are in very good agreement with DICS and SAM ( > https://db.tt/aNz11ntb). > > I would as always be grateful for your feedback and opinions. Am I > committing an error somewhere? - should the code behave differently there? > With Thanks and Best Wishes, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Wed Oct 23 20:21:25 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 23 Oct 2013 12:21:25 -0600 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: <665BB2E0-A03D-4AE2-BF14-0F7F8A422E8E@ucdenver.edu> Haris, It is a lengthy post, so forgive me if I do not understand your question very well. I take it that you are somewhat confused by the LCMV result compared to the SAM and DICS beamformers. I think that you probably have a good grasp of what is happening though. The LCMV beamformer is a time-domain beamformer, not a frequency domain beamformer, and you would normally be using it to produce a source analysis of an averaged evoked field. The SAM and DICS beamformers are both operate in the frequency domain and are likely better able to pick up non-phase-locked, or induced changes, of the type you see associated with motor beta ERD/ERS. It seems to me that it would be possible to force most of these beamformers to produce similar results. The question I have is why? Is there something particular about the LCMV option that you want to use that isn't available with the other two that are producing better results with less tinkering? To me, it seems like the particular question you have lends itself quite well to the DICS or SAM approach, both of which have been used successfully to examine sources for beta ERD prior to movement onset. Since the ERD and ERS related to motor movement is induced (not phase-locked), beamforming the time locked average is not going to be a productive strategy whether or not you calculate the covariance matrix on individual trials or on the average response. In other words, if you average the response in the time-domain rather than the frequency domain, there will be very little power change evident in beta. Best, Don On Oct 22, 2013, at 7:02 PM, Charidimos Tzagarakis > wrote: ...sorry, forgot to add to my post that for SAM I use the option cfg.fixedori = 'robert'; Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 22 October 2013 19:00, Charidimos Tzagarakis > wrote: Hi There, I have a question regarding ft_sourceanalysis: I in fact seem to be getting conflicting results depending on the beamformer I use . In summary (and of course, provided I have not made an error somewhere!), for a given frequency band and a predefined filter LCMV seems to output results that look more as if they are based on the covariance matrix estimated on the evoked response (ie not the covariance matrix coming from averaging one way or the other the covariance matrices resulting from individual trials as is the case with the other beamformers). So in its "vanilla" form, when I test it against SAM and DICS, LCMV gives different results. When I comment out the part of the ft_sourceanalysis code that is executed for LCMV when a filter is input with cfg (this seems to be done to speed up the process), then the results are comparable for all 3 beamformers. More in detail (apologies for the rather lenthy post): We are using a motor task and studying beta descynchronisation. The images I link to are "gradnaveraged" relative changes in beta power between a period during baseline and a period during "task" over 10 subjects. I first deform the MNI grid to individual subjects' brains so everything takes place in MNI space.For all 3 beamformers the leadfield and headmodels are calculated in the same way (except for SAM where the singleshell model is unavailable and I used localspheres instead). All this was done with fieldtrip-20130823 but looking at fieldtrip-20131021 I see no changes in the code for the beamformers or ft_sourceanalysis. We used DICS (centered on an appororiately chosen frequency), SAM and LCMV with the same data and intervals. For the latter 2 I first bandpass filter the data to the beta band during ft_preprocessing. For the DICS analysis I use exactly the same procedure as in the relevant tutorial. For SAM and LCMV I do the same with the minor change that the common filter is calculated over a much larger interval that includes the "baseline" and "task" intervals at its edges, instead of creating a dataset through concatenation of the "baseline" and "task" intervals compared. So code-wise (and per subject), for DICS this is: and then: cfg = []; cfg.frequency = freq_cmb.freq; cfg.grad = senscm; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source = ft_sourceanalysis(cfg, freq_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; and for SAM and LCMV: cfg=[]; cfg.bpfilter='yes'; cfg.bpfreq =[freq-fsmth freq+fsmth]; cfg.channel=params.chan; datf=ft_preprocessing(cfg,dat); cfg = []; cfg.toilim = tb; dataPre = ft_redefinetrial(cfg, datf); cfg = []; cfg.toilim = ta; dataPost = ft_redefinetrial(cfg, datf); cfg=[]; cfg.toilim = [tb(1,1) ta(1,2)]; data_cmb=ft_redefinetrial(cfg,datf); % so here I could have also done data_cmb=ft_appenddata(cfg,dataPre,dataPost) and set cfg.vartrllength = 2; further down but this would change the solution very little clear('dat'); cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); cfg = []; cfg.grad = senscm; cfg.method = 'lcmv';% (or 'sam') cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf; cfg.vol = volfcm; cfg.lambda ='5%';%relevant code added to beamformer_sam to handle this cfg.keepfilter = 'yes'; cfg.fixedori = 'yes'; cfg.projectnoise='yes'; source = ft_sourceanalysis(cfg, d_cmb); with source_Pre and source_Post calculated with the above cfg *plus* using the filter estimated at "source". cfg.grid.filter = source.avg.filter; The results for SAM (https://db.tt/fhvEAJN0) and DICS (https://db.tt/nOxIDA5Y) are in fact in good agreement (and make sense physiologically). LCMV was initially quite different (https://db.tt/LXCBivfc) and in fact similar to what you'd get if using the covariance matrix of the ERP average, ie: data_cmb = ft_timelockanalysis([], data_cmb); dataPre = ft_timelockanalysis([], dataPre); dataPost = ft_timelockanalysis([], dataPost); and then (as above) cfg = []; cfg.covariance = 'yes'; cfg.channel = params.chan; cfg.covariancewindow = 'all'; cfg.removemean='no'; cfg.keeptrials ='yes'; %keyboard d_cmb = ft_timelockanalysis(cfg, data_cmb); d_Pre = ft_timelockanalysis(cfg, dataPre); d_Post = ft_timelockanalysis(cfg, dataPost); I in fact tried this with SAM (https://db.tt/Djy54qgs) and the result is similar to LCMV above. This is however not what we wanted. Going through the code in ft_sourceanalysis I see there is a part (only for LCMV and when a filter is provided) where the data and covariance matrix are treated differently. I can't say I fully understand the algorithm there but when I commented out that part my LCMV results are in very good agreement with DICS and SAM (https://db.tt/aNz11ntb). I would as always be grateful for your feedback and opinions. Am I committing an error somewhere? - should the code behave differently there? With Thanks and Best Wishes, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center _______________________________________________ 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 Wed Oct 23 20:31:06 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 23 Oct 2013 12:31:06 -0600 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: Message-ID: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Haris, Sorry - In my last post, I mistakenly put DICS and the Fieldtrip implementation of SAM into the same frequency domain category. In Fieldtrip, SAM is a time-domain technique and is not the same as the implementation of SAM that has been used in the published literature for beta ERD. So, are you then wondering why the two time-domain approaches produce differing results? That probably does depend on how the covariance matrix is calculated. Although I still think it is a bad idea to use a time-domain beamformer on motor beta ERD/ERS. Best, Don From haristz at gmail.com Wed Oct 23 21:43:24 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Wed, 23 Oct 2013 14:43:24 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Don, Thanks for your reply. I do agree that some of these beamformers are probably better suited than others to study beta desynchronisation, or generally questions in the frequency domain. I in fact started from DICS. The reason I looked at LCMV and SAM is to be sure that I get consistent results (and also because my experiment can also address some additional time domain questions, so I wanted to see what happens when my data goes from one to the other). I therefore tried to set them up so I that the results from all 3 are similar. So you are correct in pointing out that my question is why SAM and LCMV produce different results. Based on their description within the fieldtrip website and mailing list (if I have interpreted these correctly) they should be treating the covariance matrix in the same way (to get a true evoked response covariance matrix you would normally need the extra call to ft_timelockanalysis that I show at the last piece of code in my post). Also , if the covariance matrix is indeed the issue, it seems that the change in how it is treated in the ft_sourceanalysis code (based on the "hack" I described) is unique to LCMV (none of the other beamformer options share that piece of code) and is active only when LCMV is given a precomputed filter which is (I think) unusual. Hence my question! Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 23 October 2013 13:31, Rojas, Don wrote: > Haris, > > Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > implementation of SAM into the same frequency domain category. In > Fieldtrip, SAM is a time-domain technique and is not the same as the > implementation of SAM that has been used in the published literature for > beta ERD. So, are you then wondering why the two time-domain approaches > produce differing results? That probably does depend on how the covariance > matrix is calculated. Although I still think it is a bad idea to use a > time-domain beamformer on motor beta ERD/ERS. > > Best, > > Don > > > > _______________________________________________ > 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 Thu Oct 24 10:08:44 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 24 Oct 2013 10:08:44 +0200 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Charidimos, Thanks for your elaborate e-mail. We discussed this issue in yesterday's FieldTrip meeting. It is very reasonable that you expect the three methods to produce the same results, and the code/interface indeed suggests that this would be the case. In other words, we need to clean up this part of the code to produce consistent results; however, this might take a while. We believe the discrepancy is caused by the fact that you compute the covariance while specifying cfg.keeptrials = 'yes', which is unnecessary while computing the filter. This results in a covariance matrix with dimensions trial X channel X channel, which then is subsequently averaged over trials during ft_sourceanalysis. Likely the filter is still in fact computed on the averaged covariance, as it should be. However, the subsequent projection of data through the filter will not first average the covariance, and will in essence only project the first trial through the filter. (This is because the dip{} fields will be struct arrays of dimension nTrial X 1, and in an assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so everything but the first element of a struct array is ignored in an assignment statement.) Could you try to compute the covariance with cfg.keeptrials = 'no' and then run LCMV again? This will still compute the covariance on the raw traces, not on the average. If our hunch is right, you should get the correct results then. As said, this is indeed messy and unclear, our apologies for that. Finally, could you tell us what part of the code you commented out to make the results consistent? We suspect it will be between lines 790 and 835, but it would be helpful to know for sure. Best, Eelke On 23 October 2013 21:43, Charidimos Tzagarakis wrote: > Hi Don, > Thanks for your reply. I do agree that some of these beamformers > are probably better suited than others to study beta desynchronisation, or > generally questions in the frequency domain. I in fact started from DICS. > The reason I looked at LCMV and SAM is to be sure that I get consistent > results (and also because my experiment can also address some additional > time domain questions, so I wanted to see what happens when my data goes > from one to the other). I therefore tried to set them up so I that the > results from all 3 are similar. So you are correct in pointing out that my > question is why SAM and LCMV produce different results. Based on their > description within the fieldtrip website and mailing list (if I have > interpreted these correctly) they should be treating the covariance matrix > in the same way (to get a true evoked response covariance matrix you would > normally need the extra call to ft_timelockanalysis that I show at the last > piece of code in my post). Also , if the covariance matrix is indeed the > issue, it seems that the change in how it is treated in the > ft_sourceanalysis code (based on the "hack" I described) is unique to LCMV > (none of the other beamformer options share that piece of code) and is > active only when LCMV is given a precomputed filter which is (I think) > unusual. > Hence my question! > Best, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > On 23 October 2013 13:31, Rojas, Don wrote: >> >> Haris, >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip >> implementation of SAM into the same frequency domain category. In Fieldtrip, >> SAM is a time-domain technique and is not the same as the implementation of >> SAM that has been used in the published literature for beta ERD. So, are you >> then wondering why the two time-domain approaches produce differing results? >> That probably does depend on how the covariance matrix is calculated. >> Although I still think it is a bad idea to use a time-domain beamformer on >> motor beta ERD/ERS. >> >> Best, >> >> Don >> >> >> >> _______________________________________________ >> 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 zizlsperger at gmail.com Thu Oct 24 13:32:49 2013 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Thu, 24 Oct 2013 13:32:49 +0200 Subject: [FieldTrip] problem with source reconstruction of ERP In-Reply-To: References: <77869CF7-9D92-4623-81B2-46CE95E32C7C@gmail.com> <0C4EDF8B-B901-432B-8CAA-472F47957571@psi.ucm.es> Message-ID: <0DEFB7B6-FE48-43EF-88BC-3982D815F4F7@gmail.com> Hello thanks, Stephan and Don, that resolved the issue. Regularisation was good advice, too. Best Leo On Oct 21, 2013, at 5:18 PM, Rojas, Don wrote: > Based on past experience, I'd think that Stephan's suggestion is a good one to resolve the inner matrix dimension agreement error. You may have a pre-prepared leadfield with a different number of channels than the number you supply for the source solution. Check your cfg.elec.label field and see if it is the same length as the 1st dimension of EEG1_HC35_GA_JD_ICA_Coh5cov.avg. You might have left an ECG, EMG or EOG channel in the call to ft_prepare_leadfield. > > On Oct 21, 2013, at 4:31 AM, "smoratti at psi.ucm.es" wrote: > >> Dear Leopold, >> >> First, you have to regularise your MNE solution. Otherwise you get unstable results. >> Second, the error occurs in mom = w*dat; >> I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem. >> >> >> ________________________________________________________ >> 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 21/10/2013, a las 11:52, Zizlsperger Leopold escribió: >> >>> Dear all, >>> no suggestions so far? Am I missing something obvious? >>> In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below) >>> Would love to hear your ideas... >>> Best >>> Leo >>> >>> >>> >>> >>> On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold wrote: >>> >>>> Hi all, >>>> I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes): >>>> In my example the two datasets have the structure: >>>> >>>> disp(EEG1_HC35_GA_JD_ICA_Coh5cov); >>>> avg: [32x7000 double] >>>> var: [32x7000 double] >>>> time: [1x7000 double] >>>> dof: [32x7000 double] >>>> label: {32x1 cell} >>>> trial: [314x32x7000 double] >>>> dimord: 'rpt_chan_time' >>>> trialinfo: [314x32 double] >>>> cfg: [1x1 struct] >>>> >>>> >>>> disp(EEG1_HC35_GA_JD_ICA_Coh70cov); >>>> avg: [32x7000 double] >>>> var: [32x7000 double] >>>> time: [1x7000 double] >>>> dof: [32x7000 double] >>>> label: {32x1 cell} >>>> trial: [206x32x7000 double] >>>> dimord: 'rpt_chan_time' >>>> trialinfo: [206x32 double] >>>> cfg: [1x1 struct] >>>> >>>> When I try to do the sourceanalysis by: >>>> >>>> cfg = []; >>>> cfg.method = 'mne'; >>>> cfg.elec = elec_aligned; >>>> cfg.grid = leadfield; >>>> cfg.vol = vol; >>>> cfg.mne.prewhiten = 'yes'; >>>> cfg.mne.lambda = 3; >>>> cfg.mne.scalesourcecov = 'yes'; >>>> sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov); >>>> sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov); >>>> >>>> save source sourceCoh5 sourceCoh70; >>>> >>>> I get the error: >>>> >>>> the input is timelock data with 32 channels and 7000 timebins >>>> using headmodel specified in the configuration >>>> using electrodes specified in the configuration >>>> determining source compartment (3) >>>> projecting electrodes on skin surface >>>> combining electrode transfer and system matrix >>>> creating dipole grid based on user specified dipole positions >>>> using headmodel specified in the configuration >>>> using gradiometers specified in the configuration >>>> 8196 dipoles inside, 0 dipoles outside brain >>>> the call to "ft_prepare_sourcemodel" took 0 seconds >>>> estimating current density distribution for repetition 1 >>>> using pre-computed leadfields: some of the specified options will not have an effect >>>> Warning: computing a unregularised minimum norm solution. This typically does not work >>>> due to numerical accuracy problems >>>> > In minimumnormestimate at 150 >>>> In ft_sourceanalysis at 856 >>>> ??? Error using ==> mtimes >>>> Inner matrix dimensions must agree. >>>> >>>> Error in ==> minimumnormestimate at 226 >>>> mom = w * dat; >>>> >>>> Error in ==> ft_sourceanalysis at 856 >>>> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); >>>> >>>> >>>> >>>> Is this due to the different trial numbers of the datasets or does it point to another problem? >>>> Thanks in advance >>>> Best >>>> >>>> Leo >>>> RWTH Aachen Neurology >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> _______________________________________________ >>> 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 vitoria.piai at gmail.com Thu Oct 24 13:40:51 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Thu, 24 Oct 2013 13:40:51 +0200 Subject: [FieldTrip] Rank deficiency in ft_regressconfound: worrisome? Message-ID: <52690743.6000806@gmail.com> Hi all, and maybe more specifically Arjen, I want to compare effects on 3 different tasks on the participant level. So I'm giving ft_regressconfound a try, following the tutorial, 'cause I thought that should improve the comparability of each participant's topographies across tasks. I'm just wondering how much I should worry about the warning of "Rank deficient" when running ft_regressconfound. Any thoughts on it and on what the consequences are of having a rank deficient model for the type of comparison I'm planning to make? Thanks a lot, groetjes, Vitória -- ** Please consider the environment - do you really need to print? ** From haristz at gmail.com Fri Oct 25 01:06:19 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Thu, 24 Oct 2013 18:06:19 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Eelke, Thank you for looking into this! The piece of code I commented out is indeed [790:836] (changing line 784 accordingly or alternatively adding a copy of 785-789 after 790). I did try running ft_timelockanalysis with keeptrials='no' for all 3 calls and that resulted in the same behaviour as before for LCMV (ie not the "correct" one). I also tried it setting keeptrials='no' in ft_sourceanalysis at the same time (ie keeptrials='no' for both ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I actually had run these tests before posting but wanted to 2ble check). I may however be confused here because there are some other possible combinations with keeptrials since for each subject there is a total of 6 calls to functions that accept it as an input and the filter is estimated with only 2 of them. Do let me know if there is another combination I should run and I will do that. Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 24 October 2013 03:08, Eelke Spaak wrote: > Hi Charidimos, > > Thanks for your elaborate e-mail. We discussed this issue in > yesterday's FieldTrip meeting. It is very reasonable that you expect > the three methods to produce the same results, and the code/interface > indeed suggests that this would be the case. In other words, we need > to clean up this part of the code to produce consistent results; > however, this might take a while. > > We believe the discrepancy is caused by the fact that you compute the > covariance while specifying cfg.keeptrials = 'yes', which is > unnecessary while computing the filter. This results in a covariance > matrix with dimensions trial X channel X channel, which then is > subsequently averaged over trials during ft_sourceanalysis. Likely the > filter is still in fact computed on the averaged covariance, as it > should be. However, the subsequent projection of data through the > filter will not first average the covariance, and will in essence only > project the first trial through the filter. (This is because the dip{} > fields will be struct arrays of dimension nTrial X 1, and in an > assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so > everything but the first element of a struct array is ignored in an > assignment statement.) > > Could you try to compute the covariance with cfg.keeptrials = 'no' and > then run LCMV again? This will still compute the covariance on the raw > traces, not on the average. If our hunch is right, you should get the > correct results then. > > As said, this is indeed messy and unclear, our apologies for that. > > Finally, could you tell us what part of the code you commented out to > make the results consistent? We suspect it will be between lines 790 > and 835, but it would be helpful to know for sure. > > Best, > Eelke > > > On 23 October 2013 21:43, Charidimos Tzagarakis wrote: > > Hi Don, > > Thanks for your reply. I do agree that some of these beamformers > > are probably better suited than others to study beta desynchronisation, > or > > generally questions in the frequency domain. I in fact started from DICS. > > The reason I looked at LCMV and SAM is to be sure that I get consistent > > results (and also because my experiment can also address some additional > > time domain questions, so I wanted to see what happens when my data goes > > from one to the other). I therefore tried to set them up so I that the > > results from all 3 are similar. So you are correct in pointing out that > my > > question is why SAM and LCMV produce different results. Based on their > > description within the fieldtrip website and mailing list (if I have > > interpreted these correctly) they should be treating the covariance > matrix > > in the same way (to get a true evoked response covariance matrix you > would > > normally need the extra call to ft_timelockanalysis that I show at the > last > > piece of code in my post). Also , if the covariance matrix is indeed the > > issue, it seems that the change in how it is treated in the > > ft_sourceanalysis code (based on the "hack" I described) is unique to > LCMV > > (none of the other beamformer options share that piece of code) and is > > active only when LCMV is given a precomputed filter which is (I think) > > unusual. > > Hence my question! > > Best, > > Haris > > > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > > > > > On 23 October 2013 13:31, Rojas, Don wrote: > >> > >> Haris, > >> > >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > >> implementation of SAM into the same frequency domain category. In > Fieldtrip, > >> SAM is a time-domain technique and is not the same as the > implementation of > >> SAM that has been used in the published literature for beta ERD. So, > are you > >> then wondering why the two time-domain approaches produce differing > results? > >> That probably does depend on how the covariance matrix is calculated. > >> Although I still think it is a bad idea to use a time-domain beamformer > on > >> motor beta ERD/ERS. > >> > >> Best, > >> > >> Don > >> > >> > >> > >> _______________________________________________ > >> 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 c.kung at donders.ru.nl Fri Oct 25 16:18:30 2013 From: c.kung at donders.ru.nl (Carmen Kung) Date: Fri, 25 Oct 2013 16:18:30 +0200 Subject: [FieldTrip] Reject components on unfiltered data Message-ID: <526A7DB6.2080405@donders.ru.nl> Dear all, I wonder if it is possible to first filter the data with a bandpass filter between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the ICA on filtered data to look for the components containing artefacts, then use the projection to reject the components in the original (unfiltered) data. Thank you very much in advance, Carmen -- Carmen Kung Donders Institute for Brain, Cognition, and Behaviour Radboud University Nijmegen P. O. Box 9104, 6500 HE Nijmegen, The Netherlands Tel: +31 24 36 12634 From eelke.spaak at donders.ru.nl Fri Oct 25 16:31:42 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 25 Oct 2013 16:31:42 +0200 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: <526A7DB6.2080405@donders.ru.nl> References: <526A7DB6.2080405@donders.ru.nl> Message-ID: Dear Carmen, Yes, that is possible; if you specify your original unfiltered data as the third input argument to ft_rejectcomponent this data will be projected through the unmixing matrix (and remixed after component rejection). Is that detailed enough to help you? Best, Eelke On 25 October 2013 16:18, Carmen Kung wrote: > Dear all, > > I wonder if it is possible to first filter the data with a bandpass filter > between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the > ICA on filtered data to look for the components containing artefacts, then > use the projection to reject the components in the original (unfiltered) > data. > > Thank you very much in advance, > Carmen > > > -- > Carmen Kung > Donders Institute for Brain, Cognition, and Behaviour > Radboud University Nijmegen > P. O. Box 9104, 6500 HE Nijmegen, The Netherlands > Tel: +31 24 36 12634 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Oct 28 11:26:14 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 28 Oct 2013 11:26:14 +0100 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Charidimos, If I understand you correctly, you specified cfg.keeptrials = 'no' in the calls to ft_timelockanalysis prior to the *first* call of ft_sourceanalysis, right? Could you try what happens when you specify it in ft_timelockanalysis prior to the second call to ft_sourceanalysis (so the step where the precomputed filter is applied)? Thanks, Eelke On 25 October 2013 01:06, Charidimos Tzagarakis wrote: > Hi Eelke, > Thank you for looking into this! > The piece of code I commented out is indeed [790:836] (changing line 784 > accordingly or alternatively adding a copy of 785-789 after 790). > I did try running ft_timelockanalysis with keeptrials='no' for all 3 calls > and that resulted in the same behaviour as before for LCMV (ie not the > "correct" one). I also tried it setting keeptrials='no' in > ft_sourceanalysis at the same time (ie keeptrials='no' for both > ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I > actually had run these tests before posting but wanted to 2ble check). > I may however be confused here because there are some other possible > combinations with keeptrials since for each subject there is a total of 6 > calls to functions that accept it as an input and the filter is estimated > with only 2 of them. > Do let me know if there is another combination I should run and I will do > that. > Best, > Haris > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > On 24 October 2013 03:08, Eelke Spaak wrote: >> >> Hi Charidimos, >> >> Thanks for your elaborate e-mail. We discussed this issue in >> yesterday's FieldTrip meeting. It is very reasonable that you expect >> the three methods to produce the same results, and the code/interface >> indeed suggests that this would be the case. In other words, we need >> to clean up this part of the code to produce consistent results; >> however, this might take a while. >> >> We believe the discrepancy is caused by the fact that you compute the >> covariance while specifying cfg.keeptrials = 'yes', which is >> unnecessary while computing the filter. This results in a covariance >> matrix with dimensions trial X channel X channel, which then is >> subsequently averaged over trials during ft_sourceanalysis. Likely the >> filter is still in fact computed on the averaged covariance, as it >> should be. However, the subsequent projection of data through the >> filter will not first average the covariance, and will in essence only >> project the first trial through the filter. (This is because the dip{} >> fields will be struct arrays of dimension nTrial X 1, and in an >> assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so >> everything but the first element of a struct array is ignored in an >> assignment statement.) >> >> Could you try to compute the covariance with cfg.keeptrials = 'no' and >> then run LCMV again? This will still compute the covariance on the raw >> traces, not on the average. If our hunch is right, you should get the >> correct results then. >> >> As said, this is indeed messy and unclear, our apologies for that. >> >> Finally, could you tell us what part of the code you commented out to >> make the results consistent? We suspect it will be between lines 790 >> and 835, but it would be helpful to know for sure. >> >> Best, >> Eelke >> >> >> On 23 October 2013 21:43, Charidimos Tzagarakis wrote: >> > Hi Don, >> > Thanks for your reply. I do agree that some of these beamformers >> > are probably better suited than others to study beta desynchronisation, >> > or >> > generally questions in the frequency domain. I in fact started from >> > DICS. >> > The reason I looked at LCMV and SAM is to be sure that I get consistent >> > results (and also because my experiment can also address some additional >> > time domain questions, so I wanted to see what happens when my data goes >> > from one to the other). I therefore tried to set them up so I that the >> > results from all 3 are similar. So you are correct in pointing out that >> > my >> > question is why SAM and LCMV produce different results. Based on their >> > description within the fieldtrip website and mailing list (if I have >> > interpreted these correctly) they should be treating the covariance >> > matrix >> > in the same way (to get a true evoked response covariance matrix you >> > would >> > normally need the extra call to ft_timelockanalysis that I show at the >> > last >> > piece of code in my post). Also , if the covariance matrix is indeed the >> > issue, it seems that the change in how it is treated in the >> > ft_sourceanalysis code (based on the "hack" I described) is unique to >> > LCMV >> > (none of the other beamformer options share that piece of code) and is >> > active only when LCMV is given a precomputed filter which is (I think) >> > unusual. >> > Hence my question! >> > Best, >> > Haris >> > >> > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych >> > University of Minnesota Dept of Neuroscience and Brain Sciences Center >> > >> > >> > >> > On 23 October 2013 13:31, Rojas, Don wrote: >> >> >> >> Haris, >> >> >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip >> >> implementation of SAM into the same frequency domain category. In >> >> Fieldtrip, >> >> SAM is a time-domain technique and is not the same as the >> >> implementation of >> >> SAM that has been used in the published literature for beta ERD. So, >> >> are you >> >> then wondering why the two time-domain approaches produce differing >> >> results? >> >> That probably does depend on how the covariance matrix is calculated. >> >> Although I still think it is a bad idea to use a time-domain beamformer >> >> on >> >> motor beta ERD/ERS. >> >> >> >> Best, >> >> >> >> Don >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From c.kung at donders.ru.nl Mon Oct 28 12:39:52 2013 From: c.kung at donders.ru.nl (Carmen Kung) Date: Mon, 28 Oct 2013 12:39:52 +0100 Subject: [FieldTrip] Reject components on unfiltered data Message-ID: <526E4D08.4050600@donders.ru.nl> Hi Eelke, Thanks a lot for the info! That's specific enough. Cheers, Carmen -- Carmen Kung Donders Institute for Brain, Cognition, and Behaviour Radboud University Nijmegen P. O. Box 9104, 6500 HE Nijmegen, The Netherlands Tel: +31 24 36 12634 From tkietzma at uos.de Mon Oct 28 13:28:13 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Mon, 28 Oct 2013 13:28:13 +0100 Subject: [FieldTrip] repeated measures ANOVA (statfun_depsamplesF): dfdenom problems Message-ID: <1CE38208-EFC7-4AB0-A221-B5177D80CCFF@uos.de> Dear fieldtrip discussion list, We have recently run into problems using the implementation of a repeated measures ANOVA in statfun_depsamplesF.m. In our experiment, we have recorded data of 16 subjects, and the factor of the repeated-measures ANOVA has 37 levels (admittedly quite a few but that's just how it is). Now if I am not mistaken, then for a repeated measures ANOVA, the degrees of freedom in above case should be: df1 = 36 and df2 = 540 (this is in line with the results of SPSS, too). However, the statfun_depsamplesF.m function seems to compute dfdenom as nunits - ncontrasts (nunits is the number of subjects, and ncontrasts is nlevels-1). This of course leads to a different value as compared to SPSS and what I found in the literature, in which dfdenom is computed as (K-1)*(n-1), so in the current case as (nunits-1)*ncontrasts. For a one-factor repeated measures ANOVA, I could so far not find a principled reason why the number of levels should not exceed the number of subjects (which is the error message we get). In fact, SPSS works just fine in above scenario. Could someone please explain the logic behind the dfdenom computation in fieldtrip? Could it be that there is an error in how the degrees of freedom are computed, or am I missing something obvious here? For a MANOVA, the story would be different of course. I should add that we are currently interfacing fieldtrip from eeglab and get above error only if we choose the nonparametric fieldtrip statistics (with cluster correction), but the parametric tests implemented in eeglab work just fine. Thank you very much for your help, I am looking forward to your responses Tim From rajatthomas at gmail.com Mon Oct 28 14:39:23 2013 From: rajatthomas at gmail.com (Rajat Thomas) Date: Mon, 28 Oct 2013 14:39:23 +0100 Subject: [FieldTrip] Channel layout FT to EEGLAB Message-ID: Dear all, I made a layout file using the image of the ecog array I had, just like described in the tutorial. I would like to port this to EEGLAB, so that I can use the various ICA options to plot the components at the channel locations and so on. Could anyone either point me to a file that does this conversion? or Any way of using ICA within fieldtrip to plot the various components on the different channels using the layout file? I know it is used for channel rejection and so on but any help on plotting the components back on the ICA would be appreciated. Thanks a lot in advance. Rajat -- Rajat Mani Thomas Netherlands Institute for Neuroscience Amsterdam, The Netherlands http://www.cita.utoronto.ca/~thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 28 15:05:04 2013 From: mcantor at umich.edu (Max Cantor) Date: Mon, 28 Oct 2013 10:05:04 -0400 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: The fieldtrip tutorial has a section on ICA correction for both EOG and ECG. The ECG tutorial assumes you have an ECG channel, whereas the EOG channel uses ICA to find artifacts within your components, but obviously those can be reversed. http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Hopefully this helps, I can try to help if you have any specific questions since I was just working on this myself, but there may be somebody with greater expertise who can help you. On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like > described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on > the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting > the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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 bibi.raquel at gmail.com Mon Oct 28 15:36:18 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 28 Oct 2013 10:36:18 -0400 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: Hi Rajat, I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. Best, Raquel On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like > described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on > the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting > the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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 bibi.raquel at gmail.com Mon Oct 28 15:40:09 2013 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 28 Oct 2013 10:40:09 -0400 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: <526E4D08.4050600@donders.ru.nl> References: <526E4D08.4050600@donders.ru.nl> Message-ID: Hi Eelke, I often wonder if it is better to filter or not filter prior to ICA. While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? Best, Raquel On Mon, Oct 28, 2013 at 7:39 AM, Carmen Kung wrote: > Hi Eelke, > > Thanks a lot for the info! That's specific enough. > > Cheers, > > Carmen > > -- > Carmen Kung > Donders Institute for Brain, Cognition, and Behaviour > Radboud University Nijmegen > P. O. Box 9104, 6500 HE Nijmegen, The Netherlands > Tel: +31 24 36 12634 > > ______________________________**_________________ > 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 mcantor at umich.edu Mon Oct 28 19:46:16 2013 From: mcantor at umich.edu (Max Cantor) Date: Mon, 28 Oct 2013 14:46:16 -0400 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526E4D08.4050600@donders.ru.nl> Message-ID: I can't speak for everyone, but we are filtering before ICA as of now. By having the data filtered, the components created should be a better representation of the actual effects rather than performing ICA on data not filtered, and thus more efficient. We also perform epoching and baselining, as well as a automatic artifact rejection of jump and muscle artifacts, and one visual artifact rejection check to get rid of any extremely noisy trials or channels. On Mon, Oct 28, 2013 at 10:40 AM, Raquel Bibi wrote: > Hi Eelke, > I often wonder if it is better to filter or not filter prior to ICA. > While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? > > Best, > > Raquel > > > On Mon, Oct 28, 2013 at 7:39 AM, Carmen Kung wrote: > >> Hi Eelke, >> >> Thanks a lot for the info! That's specific enough. >> >> Cheers, >> >> Carmen >> >> -- >> Carmen Kung >> Donders Institute for Brain, Cognition, and Behaviour >> Radboud University Nijmegen >> P. O. Box 9104, 6500 HE Nijmegen, The Netherlands >> Tel: +31 24 36 12634 >> >> ______________________________**_________________ >> 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 haristz at gmail.com Tue Oct 29 00:02:25 2013 From: haristz at gmail.com (Charidimos Tzagarakis) Date: Mon, 28 Oct 2013 18:02:25 -0500 Subject: [FieldTrip] LCMV giving conflicting results vs SAM and DICS In-Reply-To: References: <6D713918-6272-4E96-8CDF-0ECE2B95DE5A@ucdenver.edu> Message-ID: Hi Eelke, I have now run a test which I think does what you describe. cfg.keeptrials='yes' for the calls to ft_timelockanalysis and ft_sourcenalysis that generate the filter. cfg.keeptrials='no' for all the other calls to these 2 functions (those that generate the 2 conditions to be compared). The result is still the same (ie not what I would call the 'correct' one, but rather what seems to be based on an evoked response covariance matrix). I should stress again that how I set keeptrials in ft_timelockanalysis is also how I set it for the "matched" call to ft_sourceanalysis (It didn't seem to me that this matters anyway as unless cfg.rawtrial='yes', ft_sourceanalysis handles both cases so that what is used further down is the same but I may be wrong in this) . Best, Haris Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych University of Minnesota Dept of Neuroscience and Brain Sciences Center On 28 October 2013 05:26, Eelke Spaak wrote: > Hi Charidimos, > > If I understand you correctly, you specified cfg.keeptrials = 'no' in > the calls to ft_timelockanalysis prior to the *first* call of > ft_sourceanalysis, right? Could you try what happens when you specify > it in ft_timelockanalysis prior to the second call to > ft_sourceanalysis (so the step where the precomputed filter is > applied)? > > Thanks, > Eelke > > On 25 October 2013 01:06, Charidimos Tzagarakis wrote: > > Hi Eelke, > > Thank you for looking into this! > > The piece of code I commented out is indeed [790:836] (changing line 784 > > accordingly or alternatively adding a copy of 785-789 after 790). > > I did try running ft_timelockanalysis with keeptrials='no' for all 3 > calls > > and that resulted in the same behaviour as before for LCMV (ie not the > > "correct" one). I also tried it setting keeptrials='no' in > > ft_sourceanalysis at the same time (ie keeptrials='no' for both > > ft_timelockanalysis and ft_sourceanalysis) which had the same outcome (I > > actually had run these tests before posting but wanted to 2ble check). > > I may however be confused here because there are some other possible > > combinations with keeptrials since for each subject there is a total of 6 > > calls to functions that accept it as an input and the filter is estimated > > with only 2 of them. > > Do let me know if there is another combination I should run and I will do > > that. > > Best, > > Haris > > > > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > > University of Minnesota Dept of Neuroscience and Brain Sciences Center > > > > > > On 24 October 2013 03:08, Eelke Spaak wrote: > >> > >> Hi Charidimos, > >> > >> Thanks for your elaborate e-mail. We discussed this issue in > >> yesterday's FieldTrip meeting. It is very reasonable that you expect > >> the three methods to produce the same results, and the code/interface > >> indeed suggests that this would be the case. In other words, we need > >> to clean up this part of the code to produce consistent results; > >> however, this might take a while. > >> > >> We believe the discrepancy is caused by the fact that you compute the > >> covariance while specifying cfg.keeptrials = 'yes', which is > >> unnecessary while computing the filter. This results in a covariance > >> matrix with dimensions trial X channel X channel, which then is > >> subsequently averaged over trials during ft_sourceanalysis. Likely the > >> filter is still in fact computed on the averaged covariance, as it > >> should be. However, the subsequent projection of data through the > >> filter will not first average the covariance, and will in essence only > >> project the first trial through the filter. (This is because the dip{} > >> fields will be struct arrays of dimension nTrial X 1, and in an > >> assignment a(1).b = 2; a(2).b = 3; x = a; then x will be 2, so > >> everything but the first element of a struct array is ignored in an > >> assignment statement.) > >> > >> Could you try to compute the covariance with cfg.keeptrials = 'no' and > >> then run LCMV again? This will still compute the covariance on the raw > >> traces, not on the average. If our hunch is right, you should get the > >> correct results then. > >> > >> As said, this is indeed messy and unclear, our apologies for that. > >> > >> Finally, could you tell us what part of the code you commented out to > >> make the results consistent? We suspect it will be between lines 790 > >> and 835, but it would be helpful to know for sure. > >> > >> Best, > >> Eelke > >> > >> > >> On 23 October 2013 21:43, Charidimos Tzagarakis > wrote: > >> > Hi Don, > >> > Thanks for your reply. I do agree that some of these beamformers > >> > are probably better suited than others to study beta > desynchronisation, > >> > or > >> > generally questions in the frequency domain. I in fact started from > >> > DICS. > >> > The reason I looked at LCMV and SAM is to be sure that I get > consistent > >> > results (and also because my experiment can also address some > additional > >> > time domain questions, so I wanted to see what happens when my data > goes > >> > from one to the other). I therefore tried to set them up so I that the > >> > results from all 3 are similar. So you are correct in pointing out > that > >> > my > >> > question is why SAM and LCMV produce different results. Based on their > >> > description within the fieldtrip website and mailing list (if I have > >> > interpreted these correctly) they should be treating the covariance > >> > matrix > >> > in the same way (to get a true evoked response covariance matrix you > >> > would > >> > normally need the extra call to ft_timelockanalysis that I show at the > >> > last > >> > piece of code in my post). Also , if the covariance matrix is indeed > the > >> > issue, it seems that the change in how it is treated in the > >> > ft_sourceanalysis code (based on the "hack" I described) is unique to > >> > LCMV > >> > (none of the other beamformer options share that piece of code) and is > >> > active only when LCMV is given a precomputed filter which is (I think) > >> > unusual. > >> > Hence my question! > >> > Best, > >> > Haris > >> > > >> > Charidimos [Haris] Tzagarakis MD, PhD, MRCPsych > >> > University of Minnesota Dept of Neuroscience and Brain Sciences Center > >> > > >> > > >> > > >> > On 23 October 2013 13:31, Rojas, Don wrote: > >> >> > >> >> Haris, > >> >> > >> >> Sorry - In my last post, I mistakenly put DICS and the Fieldtrip > >> >> implementation of SAM into the same frequency domain category. In > >> >> Fieldtrip, > >> >> SAM is a time-domain technique and is not the same as the > >> >> implementation of > >> >> SAM that has been used in the published literature for beta ERD. So, > >> >> are you > >> >> then wondering why the two time-domain approaches produce differing > >> >> results? > >> >> That probably does depend on how the covariance matrix is calculated. > >> >> Although I still think it is a bad idea to use a time-domain > beamformer > >> >> on > >> >> motor beta ERD/ERS. > >> >> > >> >> Best, > >> >> > >> >> Don > >> >> > >> >> > >> >> > >> >> _______________________________________________ > >> >> 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 -------------- An HTML attachment was scrubbed... URL: From arno at cerco.ups-tlse.fr Tue Oct 29 01:27:53 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Mon, 28 Oct 2013 17:27:53 -0700 Subject: [FieldTrip] Channel layout FT to EEGLAB In-Reply-To: References: Message-ID: Dear Rajat, this old function transforms EEG data contained in the Fieldtrip structure into an EEGLAB structure. After you have done that, to transform a channel location file, simply type in EEG.chanlocs = struct('labels', cfg.elec.label, 'X', mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', mattocell(cfg.elec.pnt(3,:))); EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); This code is untested. You might have to switch X, Y and Z to obtain the correct orientation for the electrode cap. Best, Arno On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > Hi Rajat, > I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. > > Best, > > Raquel > > > On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: > Dear all, > > I made a layout file using the image of the ecog array I had, just like described in the > tutorial. > > I would like to port this to EEGLAB, so that I can use the various ICA options to plot > the components at the channel locations and so on. > > Could anyone either point me to a file that does this conversion? or > Any way of using ICA within fieldtrip to plot the various components on the different > channels using the layout file? > > I know it is used for channel rejection and so on but any help on plotting the components > back on the ICA would be appreciated. > > Thanks a lot in advance. > > Rajat > > -- > Rajat Mani Thomas > Netherlands Institute for Neuroscience > Amsterdam, The Netherlands > http://www.cita.utoronto.ca/~thomas > > _______________________________________________ > 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: fieldtrip2eeglab.m Type: application/octet-stream Size: 1141 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From zizlsperger at gmail.com Tue Oct 29 10:30:42 2013 From: zizlsperger at gmail.com (Leopold Zizlsperger) Date: Tue, 29 Oct 2013 10:30:42 +0100 Subject: [FieldTrip] visualize source localization data Message-ID: Dear all, I have a question concerning source localization implementation. I need help in the very last step of visualizing a difference between 2 conditions over time: I get there by using the tutorial steps on single subject functional EEG data (*fieldtrip-20130914; *tried both WIN and MAC): *clear all;* *load('F:\fieldtrip-20130914\EEG1_HC35_GA_XY_ICA_rHFdemeanktkt.mat')* *load('F:\fieldtrip-20130914\EEG1_HC35_GA_XY_ICA_lHFdemeanktkt.mat')* *load leadfield;* *load vol;* *load elec_aligned;* * * * * *cfg = [];* * cfg.method = 'mne';* *cfg.elec = elec_aligned;* *cfg.grid = leadfield;* *cfg.vol = vol;* *cfg.mne.prewhiten = 'yes';* *cfg.mne.lambda = 3;* *cfg.mne.scalesourcecov = 'yes';* *cfg.mne.normalize = 'yes';* *sourcerHF = ft_sourceanalysis(cfg, EEG1_HC35_GA_XY_ICA_rHFdemeanktkt);* *sourcelHF = ft_sourceanalysis(cfg, EEG1_HC35_GA_XY_ICA_lHFdemeanktkt);* * * *save source sourcerHF sourcelHF;* * * *clear all;* *load source;* *load sourcespace;* * * *bnd.pnt = sourcespace.pnt;* *bnd.tri = sourcespace.tri;* *m=sourcerHF.avg.pow(:,1200);* *ft_plot_mesh(bnd, 'vertexcolor', m);* * * * * * * *> In ft_defaults at 74* * In ft_sourceanalysis at 146* *the input is timelock data with 32 channels and 7000 timebins* *using headmodel specified in the configuration* *using electrodes specified in the configuration* *determining source compartment (3)* *projecting electrodes on skin surface* *combining electrode transfer and system matrix* *creating dipole grid based on user specified dipole positions* *using headmodel specified in the configuration* *using gradiometers specified in the configuration* *8196 dipoles inside, 0 dipoles outside brain* *the call to "ft_prepare_sourcemodel" took 0 seconds* *estimating current density distribution for repetition 1* *using pre-computed leadfields: some of the specified options will not have an effect* *computing the solution where the noise covariance is used for regularisation* *prewhitening the leadfields using the noise covariance* *scaling the source covariance* *the call to "ft_sourceanalysis" took 10 seconds* *the input is timelock data with 32 channels and 7000 timebins* *using headmodel specified in the configuration* *using electrodes specified in the configuration* *determining source compartment (3)* *projecting electrodes on skin surface* *combining electrode transfer and system matrix* *creating dipole grid based on user specified dipole positions* *using headmodel specified in the configuration* *using gradiometers specified in the configuration* *8196 dipoles inside, 0 dipoles outside brain* *the call to "ft_prepare_sourcemodel" took 0 seconds* *estimating current density distribution for repetition 1* *using pre-computed leadfields: some of the specified options will not have an effect* *computing the solution where the noise covariance is used for regularisation* *prewhitening the leadfields using the noise covariance* *scaling the source covariance* *the call to "ft_sourceanalysis" took 87 seconds* *>> * * * *cfg = [];* *cfg.projectmom = 'yes';* *sdrHF = ft_sourcedescriptives(cfg,sourcerHF);* *sdlHF = ft_sourcedescriptives(cfg, sourcelHF);* * * *sdDIFF = sdrHF;* *sdDIFF.avg.pow = sdrHF.avg.pow - sdlHF.avg.pow;* *sdDIFF.tri = sourcespace.tri;* * * *save sd sdrHF sdlHF sdDIFF;* Then I tried different suggestions from the tutorial or the mailing list: *cfg = [];* *cfg.mask = 'avg.pow';* *ft_sourcemovie(cfg,sdDIFF);* * * *the input is source data with 8196 positions* *baseline correcting dipole moments [--------------------------------------\]* * projecting dipole moment [------------------------------------------------/]* *computing power [---------------------------------------------------------|]* *the call to "ft_sourcedescriptives" took 32 seconds* *the input is source data with 8196 positions* *baseline correcting dipole moments [---------------------------------------]* *projecting dipole moment [------------------------------------------------\]* *computing power [----------------------------------------------------------]* *the call to "ft_sourcedescriptives" took 33 seconds* *the input is source data with 8196 vertex positions and 16384 triangles* *Warning: use cfg.maskparameter instead of cfg.mask * *> In ft_checkconfig at 120* * In ft_sourcemovie at 48* *??? Error using ==> set* *Bad property value found.* *Object Name : axes* *Property Name : 'CLim'* *Values must be increasing and non-NaN.* * * *Error in ==> caxis at 80* * set(ax,'CLim',arg);* * * *Error in ==> ft_sourcemovie at 263* *caxis(cfg.zlim);* If I set a break before this point I can see that "arg" indeed contains two NaNs only. Do you have any suggestions why the script above fails to determine the axes properties? Alternatively I tried: *figure* *sdDIFF.tri = sourcespace.tri;* *cfg = [];* *cfg.alim = [0 0.5];* *cfg.zlim = [0 0.5];* *cfg.maskparameter = 'avg.pow';* *ft_sourcemovie(cfg,sdDIFF);* That results in a GUI that does seem to work but in the time course there is no activity displayed. Any advice how to visualize the difference properly? Thanks in advance. Best Leo RWTH Aachen Neurology P.S. structure of the difference *sdDIFF*: *time: [1x7000 double]* * pos: [8196x3 double]* * inside: [8196x1 double]* * outside: [1x0 double]* * method: 'average'* * avg: [1x1 struct]* * cfg: [1x1 struct]* * tri: [16384x3 int32]* -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Tue Oct 29 13:46:28 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Tue, 29 Oct 2013 13:46:28 +0100 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526E4D08.4050600@donders.ru.nl> Message-ID: <526FAE24.9040605@uni-leipzig.de> On 28/10/2013 15:40, Raquel Bibi wrote: > Hi Eelke, > I often wonder if it is better to filter or not filter prior to ICA. > While Carmen never asked, I wonder what is the 'Fieldtrip' Donders' view? > > Best, > > Raquel > Hi Raquel, all, I can't speak for the Donders' view, but a high-pass filter (0.5 Hz, typically) before ICA often improves the quality of decompositions, since it improves the stationarity of the data by removing slow drifts. It's fine to then apply the weights from the resulting decomposition to the unfiltered dataset. I'd be cautious about applying too drastic a lowpass filter, as it tends to make the data from the various channels more similar and thus less independent from each other - it sometimes reduces the rank of the data, and ICA can behave a little weirdly with data which isn't full rank. Another handy thing to do is remove the mean of the whole epoch before running the ICA - see this paper from Groppe et al. (2009) http://dx.doi.org/10.1016/j.neuroimage.2008.12.038 Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Neumarkt 9-19, 04109 Leipzig, Germany Phone: +49 341 973 95 44 From anne.klepp at hhu.de Wed Oct 30 11:27:28 2013 From: anne.klepp at hhu.de (Anne Klepp) Date: Wed, 30 Oct 2013 11:27:28 +0100 Subject: [FieldTrip] Reject components on unfiltered data In-Reply-To: References: <526A7DB6.2080405@donders.ru.nl> Message-ID: <5270DF10.1030506@hhu.de> Dear all, I will jump on the bandwagon here to ask what exactly the difference is between using the third input argument or not. With my data, using the data from the step right before ICA (so not actual raw/unfiltered data) as the third argument changes the output data.grad, but also changes the data itself. (This data is from after automatic artifact rejection, preprocessed including lp- and hp-filters, and has some repaired channels. Data is from a Neuromag306, with the gradiometers rejected during preprocessing, so there are 204 MEG channels plus 3 EOG/EMG.) I tried using fastica as well as specifying cfg.runica.pca=100 with runica. 2 components were rejected. To clarify what I mean by my data being changed I attached some files of what data look like in rejectvisual for all channels and in two example channels, for both ICA methods. I'm afraid I don't quite understand the consequences for my data by the information given in the FT help "In that case (3 arguments) componentanalysis will do a subspace projection of the input data onto the space which is spanned by the topographies in the unmixing matrix in comp, after removal of the artifact components. Please use this option of including data as input, if you wish to use the output data.grad in further computation, for example for leadfield computation." I suppose it makes sense data are different after (subspace) back projection, but what are the implications? If I don't want to do sourceanalysis, is there an advantage of sticking with 2 input arguments? I'd be thrilled if someone could offer some insight into this, best, Anne Am 25.10.2013 16:31, schrieb Eelke Spaak: > Dear Carmen, > > Yes, that is possible; if you specify your original unfiltered data as > the third input argument to ft_rejectcomponent this data will be > projected through the unmixing matrix (and remixed after component > rejection). > > Is that detailed enough to help you? > > Best, > Eelke > > On 25 October 2013 16:18, Carmen Kung wrote: >> Dear all, >> >> I wonder if it is possible to first filter the data with a bandpass filter >> between 0.5 hz and 30 hz (suggested by the ICA tutorial of eeglab), run the >> ICA on filtered data to look for the components containing artefacts, then >> use the projection to reject the components in the original (unfiltered) >> data. >> >> Thank you very much in advance, >> Carmen >> >> >> -- >> Carmen Kung >> Donders Institute for Brain, Cognition, and Behaviour >> Radboud University Nijmegen >> P. O. Box 9104, 6500 HE Nijmegen, The Netherlands >> Tel: +31 24 36 12634 >> >> _______________________________________________ >> 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 -- Anne Klepp (M.Sc. Psychologie) Institute of Clinical Neuroscience and Medical Psychology Heinrich-Heine-University Düsseldorf Universitätsstraße 1 40225 Düsseldorf, Germany Email: anne.klepp at hhu.de -------------- next part -------------- A non-text attachment was scrubbed... Name: ICA_data_2or3args.7z Type: application/octet-stream Size: 378658 bytes Desc: not available URL: From michielb at tcd.ie Wed Oct 30 13:22:56 2013 From: michielb at tcd.ie (Bart Michiels) Date: Wed, 30 Oct 2013 12:22:56 +0000 Subject: [FieldTrip] connectivity analysis Message-ID: Hi, I have 30 patients and 30 controls and I'm investigating their coherence (EEG, 128 electrodes). Every patient has ~30 trials resting state eyes open consisting of 7 frequency bins with 7 frequencies in each bin. My goal is to show connectivity differences between different brain regions in the control and patient group (doing electrode-level analysis now, source-level analysis is next step). - Is it more appropriate to keep the averaging step as the latest step (ie. calculate all coherence for all the different subjects, for all trials, for all different frequencies in frequency bins) or is it better to do the averaging asap (ie. average all frequencies in 1 frequency bin at the time-frequency analysis step, average all trials at the ft_freqdescriptives step, ...) - Is there any better way to do some statistics on the 128x128x7x7 (128 electrodes, 7 frequency bins, 7 frequencies in each bin) besides using the ttest2() matlab function? Any tips & tricks are more then welcome! Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.vanlier at bsse.ethz.ch Wed Oct 30 16:01:17 2013 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Wed, 30 Oct 2013 15:01:17 +0000 Subject: [FieldTrip] maximum statistic in cluster correction Message-ID: Hi all, I am trying to understand how the permutation test and cluster correction work. the Maris 2007 and 2012 papers along with the tutorials on the fieldtrip site helped a lot. However, i cant seem to grasp the idea behind the max stat very well. let me summarize how i think i understand things so far so you can see where i go wrong. Per channel per trial (a sample), we calculate the t statistic between conditions. This is the observed statistic. Next, we collect all the trials (or samples?) from both conditions and put them into 1 set. We randomly draw trials from this set and put them into subsets of the same size as the original condition sets, this is called a random partition. A t statistic is calculated on the difference between the two subsets. This process is repeated a large number of times and the results are put in a histogram. The histogram is called the permutation distribution. Find the proportion of random partitions that show a smaller t statistic than the observed t statistic. This is the monte carlo estimate. For example, if 97% of your draws from the permutation distribution show a smaller t statistic then the one you originally observed, you have a monte carlo p value of 0.03. Cluster based correction means that you take all the samples that show a t value that exceeds a certain threshold (ie the significant differences) and cluster them on the basis of temporal (and spatial) adjacency. The idea is that samples that are close together (in space or in time) show a similar effect. The next step is to sum the t values within each cluster and find the cluster with the largest sum (the maximum statistic). Here is where i don't understand the next step. You take the permutation distribution of the cluster with the maximum statistic? This means basically that you redo the permutation test but this time only with trials that fall within that cluster? Summing the t values from each partition would then give the permutation distribution of your max stat cluster. If you have other clusters, you plug their summed t value into that permutation distribution and compare the p value with your alpha value to see if they are significant as well. But if you do that for say 20 clusters you're still not controlling the FA rate? I'm at the point where the more i think about it the less things make sense, so i must be missing something upstream...? Best, Ben From ktyler at swin.edu.au Thu Oct 31 00:44:04 2013 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 30 Oct 2013 23:44:04 +0000 Subject: [FieldTrip] event related fields from source space Message-ID: FieldTripers, I am wanting to reconstruct event related fields from source space and have been beamforming with ft_sourceanalysis using cfg.method='lcmv'. I have not been able to find any clear instructors on this, but can any one tell me, does ft_sourceanalysis output 'data.avg.mom' contain the averaged ERPs reconstructed in source space? data.avg.mom appears to be a column of cells, one cell for each point in my 3d grid, with each cell containing 3 time series (ERFs), one for each 3d orientation??, x, y, z? Can any one tell me if this is indeed what I am looking at in data.avg.mom? Regards, Kaelasha Tyler PhD candidate Swinbunre University of Technology Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Oct 31 01:35:55 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Wed, 30 Oct 2013 18:35:55 -0600 Subject: [FieldTrip] event related fields from source space In-Reply-To: References: Message-ID: <72ECAF5C-D649-4C69-9AAA-A199E9F36452@ucdenver.edu> Kaelasha, That is exactly what you are looking at for data.avg.mom (x y and z dipole moments for your vector beamformer solution, for each grid point in your 3d source space). Best, Don ----------------------- Don Rojas, Ph.D. Associate Professor of Psychiatry U. of Colorado Denver Anschutz Medical Campus Director, UCD Magnetoencephalography Lab On Oct 30, 2013, at 5:44 PM, Kaelasha Tyler > wrote: FieldTripers, I am wanting to reconstruct event related fields from source space and have been beamforming with ft_sourceanalysis using cfg.method='lcmv'. I have not been able to find any clear instructors on this, but can any one tell me, does ft_sourceanalysis output 'data.avg.mom' contain the averaged ERPs reconstructed in source space? data.avg.mom appears to be a column of cells, one cell for each point in my 3d grid, with each cell containing 3 time series (ERFs), one for each 3d orientation??, x, y, z? Can any one tell me if this is indeed what I am looking at in data.avg.mom? Regards, Kaelasha Tyler PhD candidate Swinbunre University of Technology Australia _______________________________________________ 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 Oct 31 16:31:04 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Thu, 31 Oct 2013 16:31:04 +0100 (CET) Subject: [FieldTrip] maximum statistic in cluster correction In-Reply-To: References: Message-ID: <02b801ced64e$3615e200$a241a600$@maris@psych.ru.nl> Hi Ben, > I am trying to understand how the permutation test and cluster > correction work. the Maris 2007 and 2012 papers along with the > tutorials on the fieldtrip site helped a lot. However, i cant seem to > grasp the idea behind the max stat very well. let me summarize how i > think i understand things so far so you can see where i go wrong. > > Per channel per trial (a sample), we calculate the t statistic between > conditions. This is the observed statistic. Next, we collect all the > trials (or samples?) from both conditions and put them into 1 set. We > randomly draw trials from this set and put them into subsets of the > same size as the original condition sets, this is called a random > partition. A t statistic is calculated on the difference between the > two subsets. This process is repeated a large number of times and the > results are put in a histogram. The histogram is called the permutation > distribution. > > > Find the proportion of random partitions that show a smaller t > statistic than the observed t statistic. This is the monte carlo > estimate. For example, if 97% of your draws from the permutation > distribution show a smaller t statistic then the one you originally > observed, you have a monte carlo p value of 0.03. > > > Cluster based correction means that you take all the samples that show > a t value that exceeds a certain threshold (ie the significant > differences) and cluster them on the basis of temporal (and spatial) > adjacency. The idea is that samples that are close together (in space > or in time) show a similar effect. The next step is to sum the t values > within each cluster and find the cluster with the largest sum (the > maximum statistic). > > Here is where i don't understand the next step. You take the > permutation distribution of the cluster with the maximum statistic? > This means basically that you redo the permutation test but this time > only with trials that fall within that cluster? No. The relevant distribution is the permutation distribution of the "maximum cluster statistic". Over random permutations, the spatiotemporal extent of the cluster with largest cluster-level statistic varies. However, the only thing that we need is the value (one number) of the maximum cluster statistic. Best, Eric Maris Summing the t values > from each partition would then give the permutation distribution of > your max stat cluster. If you have other clusters, you plug their > summed t value into that permutation distribution and compare the p > value with your alpha value to see if they are significant as well. But > if you do that for say 20 clusters you're still not controlling the FA > rate? I'm at the point where the more i think about it the less things > make sense, so i must be missing something upstream...? > > > Best, > > Ben > From tkietzma at uos.de Thu Oct 31 16:34:10 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Thu, 31 Oct 2013 16:34:10 +0100 Subject: [FieldTrip] repeated measures ANOVA (statfun_depsamplesF): dfdenom problems Message-ID: <008D1219-3AC8-4011-985E-7396B0A9D64C@uos.de> Professor Maris asked me to repost this email to the list, so his response gets archived and accessible to everyone. Best regards and thanks Tim %% Dear fieldtrip discussion list, We have recently run into problems using the implementation of a repeated measures ANOVA in statfun_depsamplesF.m. In our experiment, we have recorded data of 16 subjects, and the factor of the repeated-measures ANOVA has 37 levels (admittedly quite a few but that's just how it is). Now if I am not mistaken, then for a repeated measures ANOVA, the degrees of freedom in above case should be: df1 = 36 and df2 = 540 (this is in line with the results of SPSS, too). However, the statfun_depsamplesF.m function seems to compute dfdenom as nunits - ncontrasts (nunits is the number of subjects, and ncontrasts is nlevels-1). This of course leads to a different value as compared to SPSS and what I found in the literature, in which dfdenom is computed as (K-1)*(n-1), so in the current case as (nunits-1)*ncontrasts. For a one-factor repeated measures ANOVA, I could so far not find a principled reason why the number of levels should not exceed the number of subjects (which is the error message we get). In fact, SPSS works just fine in above scenario. Could someone please explain the logic behind the dfdenom computation in fieldtrip? Could it be that there is an error in how the degrees of freedom are computed, or am I missing something obvious here? For a MANOVA, the story would be different of course. I should add that we are currently interfacing fieldtrip from eeglab and get above error only if we choose the nonparametric fieldtrip statistics (with cluster correction), but the parametric tests implemented in eeglab work just fine. Thank you very much for your help, I am looking forward to your responses Tim From aestnth at hum.au.dk Thu Oct 31 17:16:06 2013 From: aestnth at hum.au.dk (Niels Trusbak Haumann) Date: Thu, 31 Oct 2013 17:16:06 +0100 Subject: [FieldTrip] Reading data and trigger events from Neuromag fif dataset splitted into 2 files Message-ID: Dear FieldTrip community. Is it possible to read the data and trial events from a single continuous Neuromag fif dataset, which was automatically split into two separate fif files during recording, because it exceeeded the standard 2 GB file size limitation? The second of the two splitted fif files contains relevant information showing that the second file continues at the time in seconds at which the first file ended. However, if the two fif files are read separately into Field Trip format this information seems to be lost. FieldTrip seems to support reading in CTF datasets, which have been split into more files due to the 2 GB file size limitation, but I don't know whether there is a method for handling this problem with Neuromag fif data. ( [ http://fieldtrip.fcdonders.nl/getting_started/ctf?s[]=ctf ]http://fieldtrip.fcdonders.nl/getting_started/ctf?s[]=ctf ) I presume that it is a general problem that Neuromag fif datasets with 306 channel data sampled at 1 kHz 32 bit floats are splitted into more files, since only ca. 16-18 minutes raw data can be recorded before it is automatically splitted into two files. The large file size is not a problem after applying MaxFilter procedures to remove high frequency cHPI signals..., etc., and thereafter downsampling e.g. to 16 bit integers sampled at 250 Hz. I see from a previous discussion in another forum that it is not possible to merge (or append) the splitted files with the MaxFilter software. When reading triggers from splitted fif files there is usually one trial, which starts in the end of the first file and ends in the start of the second file, which cannot be correctly recognized, if the files are treated separately. This is however just a minor problem of loosing a single trial. I have a few wrong detections, probably because a few trials are both defined by up-going signals and down-going signals. Would ft_preprocessing (and the sub-routines that it calls) take this into consideration, if you e.g. specificy cfg.detectflank = 'up' ? I'm looking forward to hear any comments, suggestions or solutions. Greetings Niels. Niels Trusbak Haumann M.A. / PhD student Department of Aesthetic Studies / Center of Functionally Integrative Neuroscience Aarhus University / Aarhus University Hospital Denmark E-mail: aestnth at hum.au.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmuehl at gmail.com Thu Oct 31 16:31:30 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Thu, 31 Oct 2013 16:31:30 +0100 Subject: [FieldTrip] Call for Papers for BCI journal special issue on affective brain-computer interfaces Message-ID: -------------------------------------- Call for Papers - Special Issue on Affective Brain-Computer Interfaces (aBCI) Brain-Computer Interfaces Journal -------------------------------------- You are cordially invited to make a contribution to a special issue of Brain-Computer Interfaces (http://tinyurl.com/BCIjournal), entitled “ Affective Brain-Computer Interfaces”. The special issue is a follow-up to the successful 3rd aBCI workshop held at the ACII conference in Geneva, in September 2013 (http://hmi.ewi.utwente.nl/abci2013). But, this Call is open for every researcher working in the field of affective brain-computer interfacing and interested to contribute. Affective BCI aims at the detection of affective states, such as emotions or moods, from neuro-physiological signals. Such systems, allowing users to control computer games by their emotions, 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: encouraging affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. This special issue on aBCI explores the current possibilities and limitations of using neuro-physiological signals as a modality for the recognition of affective/cognitive states, and looks at visions for the use of this information about the user state in applications for domains like health, arts, and entertainment. We are seeking theoretical, methodological, and empirical papers dealing with different topics that include, but are not limited to: - novel methods and protocols for affective/cognitive state induction and data collection for aBCI, addressing challenges such as generalization/specificity of mental state classification; - the detection of affective/cognitive states via neurophysiological activity; - the incorporation of additional modalities, such as physiological sensors, video, or audio, to support the aBCI calibration and validation; - innovative concepts for communication or adaptive interfaces using aBCI. SCHEDULE FOR SUBMISSION - Deadline for Full Paper Submission: November 22, 2013 - Notification of 1st review outcome: December 15, 2013 - First Revision Due: January 15, 2014 - Notification of 2nd review outcome: February 01, 2014 - Camera-ready Papers due: February 15, 2014 - Expected publication: June 2014 Manuscripts should be submitted to abci at ewi.utwente.nl Manuscripts should follow the journal’s guidelines: http://www.tandfonline.com/action/authorSubmission?journalCode=tbci SPECIAL ISSUE GUEST EDITORS Authors are requested to inform the Special Issue Guest Editors about their intention to submit. Please direct any inquiries, including those about the suitability of your possible paper, to the Special-Issue Guest Editors via abci at ewi.utwente.nl : - Brendan Allison, University of California San Diego, USA - Guillaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland - Christian Mühl, INRIA Bordeaux - Sud-Ouest, France - Anton Nijholt, University of Twente, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: