From daria.laptinskaya at googlemail.com Tue Dec 1 09:58:46 2015 From: daria.laptinskaya at googlemail.com (Daria Laptinskaya) Date: Tue, 1 Dec 2015 09:58:46 +0100 Subject: [FieldTrip] SCD and coherence analysis In-Reply-To: <52d6-565c1c80-25-55c3b400@102538225> References: <52d6-565c1c80-25-55c3b400@102538225> Message-ID: Hi Barbara, try this: sens=ft_read_sens('GSN-HydroCel-257.sfp'); cfg=[]; cfg.elec=sens; Hope it helps :-) Daria 2015-11-30 10:52 GMT+01:00 Barbara Schorr : > Dear Fieltripers, > > I would like to do coherence analysis. I did a SCD analysis on my data > first ('finite' method), and want to run ft_mvaranalysis now. I get > the error > > Error using ft_datatype_sens (line 186) > inconsistent number of channels in sensor description > > As cfg.elec I use the GSN-HydroCel-257.sfp file which is included in > fieldtrip (my raw data set has 257 channels), but there are only 256 > channels left after the SCD analysis. Can this cause the problem? > > Has anyone had this problem before and can provide a solution? I only > found one prior entry with this topic, but there was no final solution for > it. > > > Thanks and all the best, > Barbara > > > _______________________________________________ > 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 barbara.schorr at uni-ulm.de Tue Dec 1 15:18:31 2015 From: barbara.schorr at uni-ulm.de (Barbara Schorr) Date: Tue, 01 Dec 2015 15:18:31 +0100 Subject: [FieldTrip] =?utf-8?q?SCD_and_coherence_analysis?= In-Reply-To: Message-ID: <38ba-565dac00-3-4dd4ed00@147935417> Dear Daria, I did exactly this. The problem occurs afterwards, when I want to run ft_mvaranalysis on the data that result from ft_scalpcurrentdensity. In the fieldtrip document it states, that the output data of ft_scalpcurrentdensity has the same format as the input data. When I run ft_mvaranalysis on the original data, everything works fine, but with the SCD data I get this error that the number of channels in sensor description is inconsistent. Has anyone else experienced this problem? Best, Barbara Am Dienstag, 01. Dezember 2015 12:00 CET, fieldtrip-request at science.ru.nl schrieb: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: power suppression during DICS beamforming ? > (Mait? Crespo Garc?a) > 2. Re: SCD and coherence analysis (Daria Laptinskaya) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 30 Nov 2015 15:31:20 +0000 (UTC) > From: Mait? Crespo Garc?a > To: FieldTrip discussion list > Subject: Re: [FieldTrip] power suppression during DICS beamforming ? > Message-ID: > <1881724873.21184223.1448897480847.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fr?d?ri, > maybe you have the solution already. > In case not, could you explain how did you get the last two plots? Are spectra computed after averaging across all virtual channel spectra or you are representing the spectrum of the source with maximal power? > Best,Maite > > > > El Jueves 26 de noviembre de 2015 13:55, Fr?d?ric Roux escribi?: > > > Dear all, > > I am observing a counter-intuitive result after applying the spatial filters obtained from DICS beamforming to my MEG data. > > The plot in the attachment summarizes the issue: The raw data shows a clear peak of activity at 10 Hz, however, after applying the spatial filter to the MEG data the spectrum of the virtual channels shows that power in this frequency band is reduced. The same also happens when I apply a spatial filter in the gamma range for power at 70 Hz to the raw MEG signals. > > Is this something that falls out of the beamformer math due to the fact how the algorithm suppresses power at all locations by minimizing the noise level, or is there something wrong with my code? I (maybe naively) assumed that the results should come out the opposite. On the other hand, when plotting the noise normalized maps (NAI) of both the alpha and gamma beamformers the sources look quite accurate. Should I normalize with the level of noise first before plotting the spectrum to see the expected results (ie an upregulation of power instead of a downregulation of power)? > > The code that I use to generate the figures is: > > % 1) compute CSD matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.foilim = [10 10]; > cfg.tapsmofrq = 2; > cfg.pad = 'maxperlen'; > cfg.taper = 'dpss'; > > [csd] = ft_freqanalysis(cfg,meg_data); > > > % 2) compute DICS filter > cfg = []; > cfg.method = 'dics'; > cfg.grad = meg_data.grad; > cfg.headmodel = vol; > cfg.frequency = csd.freq; > > cfg.dics.realfiter = 'yes'; > cfg.dics.fixedori = 'yes'; > > [alpha_filter]= ft_sourceanalysis(cfg,csd); > > % 3) compute the virtual channel data > > VC = meg_data; > VC.trial = cell(1,length(meg_data.trial)); > VC.label = cell(1,length(alpha_filter.avg.pow)); > > for i = 1:length(VC.trial) > ? for j = 1:length(VC.label) > > ? ? ? VC.trial{i}(j,:) = alpha_filter{j}*meg_data.trial{i}; > ? ? ? VC.label(j) = {['virtual_channel',num2str(j)]}; > ? end; > end; > > % 4) compute the spectrum of the virtual channel data > cfg = []; > cfg.method = 'mtmfft'; > cfg.pad = 'maxperlen'; > cfg.taper = 'dpss'; > cfg.tapsmofrq = 1; > cfg.foi = 0.1:100; > > [pow] = ft_freqanalysis(cfg,VC); > > > Any help or suggestions would be greatly appreciated. > > Fred > > -- > Fr?d?ric Roux > Postdoctoral Scientist, Marie-Curie fellow > BCBL. Basque Center on Cognition, Brain & Language. > > f.roux at bcbl.eu > Tel: +34 943 309 300 Ext 211 > Fax: +34 943 309 052 > > Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer > --------------------------------------------------------------------------- > > ?The probability of success is difficult to estimate; but if we never search the chance of success is zero.? > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Tue, 1 Dec 2015 09:58:46 +0100 > From: Daria Laptinskaya > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SCD and coherence analysis > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Barbara, > > try this: > sens=ft_read_sens('GSN-HydroCel-257.sfp'); > cfg=[]; > cfg.elec=sens; > > Hope it helps :-) > Daria > > > > > > > 2015-11-30 10:52 GMT+01:00 Barbara Schorr : > > > Dear Fieltripers, > > > > I would like to do coherence analysis. I did a SCD analysis on my data > > first ('finite' method), and want to run ft_mvaranalysis now. I get > > the error > > > > Error using ft_datatype_sens (line 186) > > inconsistent number of channels in sensor description > > > > As cfg.elec I use the GSN-HydroCel-257.sfp file which is included in > > fieldtrip (my raw data set has 257 channels), but there are only 256 > > channels left after the SCD analysis. Can this cause the problem? > > > > Has anyone had this problem before and can provide a solution? I only > > found one prior entry with this topic, but there was no final solution for > > it. > > > > > > Thanks and all the best, > > Barbara > > > > > > _______________________________________________ > > 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 61, Issue 1 > **************************************** From eriksenj at ohsu.edu Wed Dec 2 03:04:56 2015 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 2 Dec 2015 02:04:56 +0000 Subject: [FieldTrip] accommodating air pockets in FEM head model Message-ID: Hi, I am reading the FieldTrip documentation on creating an FEM model and see that the following tissue types are output from the segmentation process: Gray White Csf Skull Scalp Q1: Since I am using a 256 channel EGI system with electrodes over the lower part of the head and face, I absolutely need to be able to include air voxels as well. Anyone have any knowledge of such a possibility? Q2: Beyond that I would also like to include other tissue types such as fat, muscle, and eyeball (vitrious). I suppose I could find other segmentation software to simply create a more varied segmentation and insert it in the processing pipeline, but would like to know if that would mess anything up. Q3: Next, can the FEM handle anisotropic conductivities for white matter and skull? Q4: has anyone out there actually used the FDM model? Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From carsten.wolters at uni-muenster.de Wed Dec 2 08:53:17 2015 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 2 Dec 2015 08:53:17 +0100 Subject: [FieldTrip] accommodating air pockets in FEM head model In-Reply-To: References: Message-ID: <565EA36D.5030005@uni-muenster.de> Hi Jeff, Q3: yes, FEM can model anisotropy and white matter is anisotropic, but skull is a three-layered-structure consisting of spongiosa and compacta, see http://www.ncbi.nlm.nih.gov/pubmed/20690140 For Q4: FEM allows geometry-adaptation, see http://www.ncbi.nlm.nih.gov/pubmed/17694865 As far as I know, modeling using irregular meshes might get difficult to implement within an FDM framework. For Q1 and Q2: Mainly tissues between sources and electrodes are important to be modeled (so white matter anisotropy is only important for deeper sources) and FSL and freesurfer can do a good job on segmentation. Air-compartments can possibly best be modeled by hand-correction of the FSL output. Please see http://www.ncbi.nlm.nih.gov/pubmed/24671208 on how we solve forward modeling to be able to combine EEG and MEG. More infos are available in the two following theses: http://www.sci.utah.edu/~wolters/PaperWolters/2014/Lanfer_Dissertation_July2-2014.pdf http://www.sci.utah.edu/~wolters/PaperWolters/2015/Umit_Aydin_Dissertation_2015.pdf Best regards Carsten Am 02.12.2015 um 03:04 schrieb K Jeffrey Eriksen: > > Hi, > > I am reading the FieldTrip documentation on creating an FEM model and > see that the following tissue types are output from the segmentation > process: > > Gray > > White > > Csf > > Skull > > Scalp > > Q1: Since I am using a 256 channel EGI system with electrodes over the > lower part of the head and face, I absolutely need to be able to > include air voxels as well. Anyone have any knowledge of such a > possibility? > > Q2: Beyond that I would also like to include other tissue types such > as fat, muscle, and eyeball (vitrious). I suppose I could find other > segmentation software to simply create a more varied segmentation and > insert it in the processing pipeline, but would like to know if that > would mess anything up. > > Q3: Next, can the FEM handle anisotropic conductivities for white > matter and skull? > > Q4: has anyone out there actually used the FDM model? > > Thanks, > > -Jeff Eriksen > > > > _______________________________________________ > 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: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Wed Dec 2 14:55:57 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Wed, 2 Dec 2015 13:55:57 +0000 Subject: [FieldTrip] Head segmentation Message-ID: Jeff The resources from Carsten Wolters and the answers were right on. We have a 128 channel system. We add “nasal cavity” which includes nasal, throat, and sinuses in our FEM model. We do a lot of the segmenting with FSL (bet, fast, betsur, SPMf) and custom programs, and then do manual editing to identify the air passages. The separate segments are then put together with a custom program. The air cavities might be important for the 256-channel EGI system, where on the sides and front of the face the electrodes could have some dipolar sources and the places in between would affect the source estimation. Anything below the skull, not air cavity, we give a conductivity of muscle, which is very close to scalp; again the electrodes below the skull are over something and I presume would need a realistic estimated head media and conductivity. As I wrote earlier, we have been using FT for FEM recently; also have gotten good (similar to FEM) results with the Dipoli BEM model. I have one already-published supplemental information that briefly describes our FEM model, and one in-press supplemental information, both articles using the EMSE program. I am working on our first publication using the FEM from FT. Re “Mainly tissues between sources and electrodes are important to be modeled (so white matter anisotropy is only important for deeper sources)”. This may be practically correct, but I have suspected (and EGI’s rationale for whole-head coverage) that to get a good measure of a dipolar source whose positive or negative pole land somewhere below the skull area, one needs a good model of the head over all the places where the current flow is manifested. We have some prefrontal sources with large negative potentials exhibiting on the frontal-central 10-10 electrodes, and which have a large positive scalp potential on the “Oz” electrodes. However, it turns out these potentials show up on Iz and in the EGI electrodes below Iz (128 channel), so having a model for scalp and muscle over the neck might be important. I don’t know what the effect is of leaving these out, but I have preferred to do the whole head segmentation in case these have some effect. One last consideration. Most BEM and FEM models on the FT site use the segmentation of the brain, skull, and scalp about at the level of the MNI head. This does not include the electrodes below the horizon of the MNI head, and there is a lot of area below the MNI head that is covered by the EGI 128 and 256 channel systems. This adds significantly to the volume of the voxels used for the FEM estimation. For BEM models we cut the head off at about 10% below the level of the lowest EGI 128 channel electrodes, and generally have done so also for the FEM models we use in FT. The electrodes are located on the places below the MNI head, so one has to have a “head” model with positions below those typically used in the FT’s demo programs. We do a whole head MRI down to the neck, and then use a custom program to get a MRI volume with a head that extends about 10% lower than the lowest EGI-128 electrodes. John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.tadel at mcgill.ca Wed Dec 2 22:03:33 2015 From: francois.tadel at mcgill.ca (=?UTF-8?Q?Fran=c3=a7ois_Tadel?=) Date: Wed, 2 Dec 2015 16:03:33 -0500 Subject: [FieldTrip] Error in ft_dipolefitting.m ? Message-ID: <565F5CA5.9080409@mcgill.ca> Hello, When fitting single dipoles on multiple time points at once, I have an error line 578: source.dip.unit = headmodel.unit; The syntax is incorrect that source.dip is an array with multiple dipoles. Should this be replaced with the following line ? [source.dip.unit] = deal(headmodel.unit); Cheers, Francois From erin.white at sickkids.ca Wed Dec 2 22:55:40 2015 From: erin.white at sickkids.ca (Erin White) Date: Wed, 2 Dec 2015 21:55:40 +0000 Subject: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images In-Reply-To: References: Message-ID: <0D4EE8880DEE3047BEC905C0EC463F8C2769EBD7@SKMBXX03.sickkids.ca> Hi Steve, Thanks so much for your helpful comment! I'll give this a try! All the best Erin ---------------------------------------------------- Erin White, PhD Post-Doctoral Research Fellow Neurosciences and Mental Health The Hospital for Sick Children 555 University Avenue Toronto, Ontario Canada Telephone: (647)834-7813 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Stephen Politzer-Ahles [stephen.politzer-ahles at ling-phil.ox.ac.uk] Sent: November 27, 2015 7:28 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images Hi Erin, I don't use the multiplot functions much, so my solution is clunky and there may be others on the list with a better way to do this. But just in case, here's how I do it: Rather than using multiplot, I make each plot individually, and use the subplot() command to arrange multiple plots into a figure. Within each subplot, I just use some custom code to draw the ticks. For example: tickspots = [-200:200:1000]; % one tick every 200 ms, from -200 to 1000 ms tickheight = [-.5 .5]; % how high and low the ticks will go for tickspots = tickspot % iterate through tick spots plot( [tickspot tickspot], tickheight, 'k' ); % plot each tick as a black line end; Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ ------------------------------ Message: 2 Date: Thu, 26 Nov 2015 12:48:25 +0000 From: Erin White > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images Message-ID: <0D4EE8880DEE3047BEC905C0EC463F8C2769D79D at SKMBXX03.sickkids.ca> Content-Type: text/plain; charset="iso-8859-1" Hi, I'm new at programming and was wondering if someone could help with something that I'm sure is simple. I'd like to add tick marks to my multiplotER and multiplotTFR figures so that the timing and amplitude (for multiplotER) and timing and frequency (for multiplotTFR) scales are presented clearly. For example, I'd like a tick mark on my X axes every 200 ms, and on the y axes, every 2 mV for ER images and every 5 Hz for TFR images. Could anyone suggest what I should add to my code to show this? Thanks very much! Erin ---------------------------------------------------- Erin White, PhD Post-Doctoral Research Fellow Neurosciences and Mental Health The Hospital for Sick Children 555 University Avenue Toronto, Ontario Canada Telephone: (647)834-7813 ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- 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 60, Issue 23 ***************************************** ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.babaeeghazvini at vu.nl Fri Dec 4 20:14:26 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Fri, 4 Dec 2015 19:14:26 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronny.ibrahim at mq.edu.au Mon Dec 7 05:36:14 2015 From: ronny.ibrahim at mq.edu.au (Ronny Ibrahim) Date: Mon, 7 Dec 2015 15:36:14 +1100 Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data Message-ID: Dear fellow fieldtrip users, I would like to implement a clusterstatistics independentT test on a time-frequency datasets that I've acquired using the ft_freqanalysis function. When I run ft_freqstatistics on the data it would give me stats result which is based on comparing the absolute values of power spectrum instead the relative change with respect to the baseline. I have tried to perform to do my relative change power spectrum data manually but it seems that when I run the ft_freqstatistics it produces an error of which I could not figure out on why. Here is my code: C_1 = {outP10{1} outP10{2} outP10{3} outP10{4} outP10{5} outP10{6} outP10{7} outP10{8} outP10{9} outP10{10} outP10{11} outP10{12} outP10{13} outP10{14} outP10{15} outP10{16} outP10{17} outP10{18}}; C_2 = {outM10{1} outM10{2} outM10{3} outM10{4} outM10{5} outM10{6} outM10{7} outM10{8} outM10{9} outM10{10} outM10{11} outM10{12} outM10{13} outM10{14} outM10{15} outM10{16} outM10{17} outM10{18}}; %% Performing cluster statistics for the paradigm cfg = []; cfg.layout = 'EEG_KR.lay'; lay = ft_prepare_layout(cfg); % Needs to change this cfg.latency = [0 0.6]; %Need to look this up according to what cfg.frequency = [8 12];% Need to do it for different frequency bands (theta, alpha, beta, gamma). cfg.channel = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'ft_statfun_indepsamplesT'; cfg.numrandomization = 1000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 3; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg_neighb.layout = lay; cfg_neighb.method = 'triangulation'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb); cfg.ivar = 1; cfg.design = [ones(1,18) 2*ones(1,18)]; stat = ft_freqstatistics(cfg, C_2{:}, C_1{:}); %% Plotting significant clusters cfg = []; cfg.alpha = 0.05; cfg.parameter = 'stat'; cfg.layout = lay; ft_clusterplot(cfg, stat); where the variable out is essentially my time-frequency data output structure. I would greatly appreciate the input and assistance. Thank you. Kind Regards, Ronny -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at donders.ru.nl Mon Dec 7 09:24:32 2015 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 7 Dec 2015 08:24:32 +0000 Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data In-Reply-To: References: Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB279C7AFB@exprd01.hosting.ru.nl> Dear Ronny, What error do you get when running this code? You can perform a (relative) baseline correction using ft_freqbaseline with cfg.baselinetype = ‘relative’ or ‘relchange’ and cfg.baseline = [your baseline window];. If your code works on absolute values it should also work on baseline-corrected values using ft_freqbaseline. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ronny Ibrahim Sent: maandag 7 december 2015 5:36 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data Dear fellow fieldtrip users, I would like to implement a clusterstatistics independentT test on a time-frequency datasets that I've acquired using the ft_freqanalysis function. When I run ft_freqstatistics on the data it would give me stats result which is based on comparing the absolute values of power spectrum instead the relative change with respect to the baseline. I have tried to perform to do my relative change power spectrum data manually but it seems that when I run the ft_freqstatistics it produces an error of which I could not figure out on why. Here is my code: C_1 = {outP10{1} outP10{2} outP10{3} outP10{4} outP10{5} outP10{6} outP10{7} outP10{8} outP10{9} outP10{10} outP10{11} outP10{12} outP10{13} outP10{14} outP10{15} outP10{16} outP10{17} outP10{18}}; C_2 = {outM10{1} outM10{2} outM10{3} outM10{4} outM10{5} outM10{6} outM10{7} outM10{8} outM10{9} outM10{10} outM10{11} outM10{12} outM10{13} outM10{14} outM10{15} outM10{16} outM10{17} outM10{18}}; %% Performing cluster statistics for the paradigm cfg = []; cfg.layout = 'EEG_KR.lay'; lay = ft_prepare_layout(cfg); % Needs to change this cfg.latency = [0 0.6]; %Need to look this up according to what cfg.frequency = [8 12];% Need to do it for different frequency bands (theta, alpha, beta, gamma). cfg.channel = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'ft_statfun_indepsamplesT'; cfg.numrandomization = 1000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 3; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg_neighb.layout = lay; cfg_neighb.method = 'triangulation'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb); cfg.ivar = 1; cfg.design = [ones(1,18) 2*ones(1,18)]; stat = ft_freqstatistics(cfg, C_2{:}, C_1{:}); %% Plotting significant clusters cfg = []; cfg.alpha = 0.05; cfg.parameter = 'stat'; cfg.layout = lay; ft_clusterplot(cfg, stat); where the variable out is essentially my time-frequency data output structure. I would greatly appreciate the input and assistance. Thank you. Kind Regards, Ronny -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Dec 7 09:30:25 2015 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 7 Dec 2015 09:30:25 +0100 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> Message-ID: <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: > Hello > > I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = hdm; > cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); > cfg.grid.inside = 1:size(cfg.grid.pos, 1); > cfg.grid.outside = []; > cfg.keepfilter = 'yes'; > source_idx = ft_sourceanalysis(cfg, tlock); > Not from the voxel indicating maximum power ([maxval, > maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos > = sourcemodel.pos([maxcohindx maxpowindx], :)). > > Regards, > Parinaz. > _______________________________________________ > 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: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From p.babaeeghazvini at vu.nl Mon Dec 7 12:52:55 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Mon, 7 Dec 2015 11:52:55 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> Hi Julian, Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: cfg = [] cfg.atlas = atlas; cfg.roi = atlas.tissuelabel(1) cfg.inputcoord = 'mni'; mas = ft_volumelookup(cfg,grid); cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.xgrid = cfg.grid.ygrid = cfg.grid.zgrid = cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. an other question that I have is that: when I compute the maximum index from [maxvalr, maxpowindxr] = max(srcetask.avg.pow) How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) Regards, Parinaz. From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 9:30 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. _______________________________________________ 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 Mon Dec 7 17:57:10 2015 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 7 Dec 2015 17:57:10 +0100 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> Message-ID: Hi Parinaz, > My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. You don't. You compute your virtual channels for a regular grid (something like -20:1:20 for x,y and z) and select the virtual channels in your ROI in a second step. This might be a bit of an overkill, as you don't use most of your channels later on, but maybe you want to extend your analysis to other cortical areas - you never know. Anyways, to be more clear: You compute your virtual electrodes on a predefined grid. To find your ROI, you use ft_volumelookup to get a binary matrix which tells you, which voxels of the standard MRI are in your ROI. Then you build a high-resolution grid based on the standard MRI (It's important to use one grid point per voxel). Using pythagoras, you can now find the closest high-resolution grid points for each of your virtual electrodes. As soon as you have these, you can see which of them have a value of 1 in your binary matrix of ft_volumelookup. Now you know which virtual electrodes are inside your ROI. So for example, you have 2000 virtual electrodes on a -20:1:20 regular grid. You then compute a binary matrix and a high-resolution grid based on the standard MRI resulting in ~900000 grid points on a 91x109x91 grid. Using pythagoras, you find that grid point 6000 is closest to virtual electrode #1. Then you can see if element 6000 from your binary matrix is a 1. If so, your virtual electrode #1 is in your ROI, if not, your virtual electrode is not in your ROI. > How I can find the atlas position to this maximum point in my code Do you want to have the coordinates or the actual label? A while ago, I hacked the ft_sourceplot-function to give me the coordinate position as an output, but I can't find the code anymore. I'm sure you can edit the function to also output the label, as this has to be included as a text element somewhere in the function. But please be aware that editing the FT-functions can severely compromise the functionality. Good luck, Julian Am 07.12.2015 um 12:52 schrieb Babaeeghazvini, P.: > Hi Julian, > > Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: > > cfg = [] > > cfg.atlas = atlas; > > cfg.roi = atlas.tissuelabel(1) > > cfg.inputcoord = 'mni'; > > mas = ft_volumelookup(cfg,grid); > > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = hdm; > cfg.grid.xgrid = > > cfg.grid.ygrid = > > cfg.grid.zgrid = > > cfg.grid.inside = 1:size(cfg.grid.pos, 1); > cfg.grid.outside = []; > cfg.keepfilter = 'yes'; > source_idx = ft_sourceanalysis(cfg, tlock); > > My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. > > an other question that I have is that: when I compute the maximum index from > [maxvalr, maxpowindxr] = max(srcetask.avg.pow) > > How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) > > Regards, > Parinaz. > > > > > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] > Sent: Monday, December 07, 2015 9:30 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch > > Hi Parinaz, > > I'm not sure if I understood your question correctly. > Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? > > In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. > In the second case, it's a tad more complicated, but here's how I do it: > 1. Compute the virtual channels for all grid points in the cortex > 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) > 3. Build a high-resolution 3D-Grid on the standard MRI > 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) > 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. > > I hope this helps, let me know otherwise. > > Julian > > Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: > >> Hello >> >> I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.vol = hdm; >> cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); >> cfg.grid.inside = 1:size(cfg.grid.pos, 1); >> cfg.grid.outside = []; >> cfg.keepfilter = 'yes'; >> source_idx = ft_sourceanalysis(cfg, tlock); >> Not from the voxel indicating maximum power ([maxval, >> maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos >> = sourcemodel.pos([maxcohindx maxpowindx], :)). >> >> Regards, >> Parinaz. >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From p.babaeeghazvini at vu.nl Mon Dec 7 20:20:15 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Mon, 7 Dec 2015 19:20:15 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local>, Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C29CB@PEXMB100A.vu.local> Hi Julian, Thank you very much for your help now it is completely clear for me. Parinaz. ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 5:57 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. You don't. You compute your virtual channels for a regular grid (something like -20:1:20 for x,y and z) and select the virtual channels in your ROI in a second step. This might be a bit of an overkill, as you don't use most of your channels later on, but maybe you want to extend your analysis to other cortical areas - you never know. Anyways, to be more clear: You compute your virtual electrodes on a predefined grid. To find your ROI, you use ft_volumelookup to get a binary matrix which tells you, which voxels of the standard MRI are in your ROI. Then you build a high-resolution grid based on the standard MRI (It's important to use one grid point per voxel). Using pythagoras, you can now find the closest high-resolution grid points for each of your virtual electrodes. As soon as you have these, you can see which of them have a value of 1 in your binary matrix of ft_volumelookup. Now you know which virtual electrodes are inside your ROI. So for example, you have 2000 virtual electrodes on a -20:1:20 regular grid. You then compute a binary matrix and a high-resolution grid based on the standard MRI resulting in ~900000 grid points on a 91x109x91 grid. Using pythagoras, you find that grid point 6000 is closest to virtual electrode #1. Then you can see if element 6000 from your binary matrix is a 1. If so, your virtual electrode #1 is in your ROI, if not, your virtual electrode is not in your ROI. How I can find the atlas position to this maximum point in my code Do you want to have the coordinates or the actual label? A while ago, I hacked the ft_sourceplot-function to give me the coordinate position as an output, but I can't find the code anymore. I'm sure you can edit the function to also output the label, as this has to be included as a text element somewhere in the function. But please be aware that editing the FT-functions can severely compromise the functionality. Good luck, Julian Am 07.12.2015 um 12:52 schrieb Babaeeghazvini, P.: Hi Julian, Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: cfg = [] cfg.atlas = atlas; cfg.roi = atlas.tissuelabel(1) cfg.inputcoord = 'mni'; mas = ft_volumelookup(cfg,grid); cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.xgrid = cfg.grid.ygrid = cfg.grid.zgrid = cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. an other question that I have is that: when I compute the maximum index from [maxvalr, maxpowindxr] = max(srcetask.avg.pow) How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) Regards, Parinaz. From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 9:30 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 amickan1990 at gmail.com Thu Dec 10 18:14:10 2015 From: amickan1990 at gmail.com (Anne Mickan) Date: Thu, 10 Dec 2015 18:14:10 +0100 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test Message-ID: Dear all, I'm just starting to work on a cluster-based permutation test script based on the tutorial for within-subject designs on the fieldtrip website. I ran into an issue when computing the [stat] matrix. I used the code as it was on the website: [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); with the Correct and Incorrect matrices looking as follows: Correct{1} avg: [34x600 double] time: [1x600 double] fsample: '500' label: {34x1 cell} dimord: 'chan_time' dof: [34x600 double] var: [34x600 double] The function runs without problems, i.e I don't get any error messages. However, the result seems incomplete. stat = prob: [25x1 double] posclusters: [] posclusterslabelmat: [25x1 double] posdistribution: [1x500 double] negclusters: [1x1 struct] negclusterslabelmat: [25x1 double] negdistribution: [1x500 double] cirange: [25x1 double] mask: [25x1 logical] stat: [25x1 double] ref: [25x1 double] dimord: 'chan_time' label: {25x1 cell} time: 0 cfg: [1x1 struct] Specifically, I later run into trouble with the stat.posclusterslabelmat and stat.negclusterslabelmat matrices which should apparantly contain far more values something more like 25x500 instead of 25x1. When calling neg_int = all(neg(:, m(k):m(k+1)), 2) I get the "Index exceeds matrix dimensions" error message which I assume has to do with the fact that "neg" does not have the appropriate matrix dimensions (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) Where is the error / where should I look for the error? Some further design details: Nsubj = 24 2 conditions = Correct, Incorrect Within-subject design sampling rate = 500 34 channels I hope I gave enough / the necessary information for someone to help me out. Thanks in advance! Best, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.peatfield at gmail.com Thu Dec 10 20:13:10 2015 From: nick.peatfield at gmail.com (Nicholas A. Peatfield) Date: Thu, 10 Dec 2015 11:13:10 -0800 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test In-Reply-To: References: Message-ID: Hi Anne, To get an answer/suggestion you should provide the part of your script detailing your cfg inputs. Cheers, Nick On 10 December 2015 at 09:14, Anne Mickan wrote: > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Nicholas Peatfield, PhD -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Dec 10 20:36:45 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Dec 2015 19:36:45 +0000 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test In-Reply-To: References: Message-ID: <7CAF2781-D756-4C0B-9B56-F05642437AF9@fcdonders.ru.nl> Hi Anne, I agree with Nick, some more information would be helpful. At this stage my wild guess (assuming that you did not constrain your ‘search space’, using cfg.channel and cfg.latency before calling ft_timelockstatistics) would be that there’s a major discrepancy in the descriptive dimensions of your data (i.e. the ‘labels’ and the time points) across the input arguments. FieldTrip does an explicit check on the labels and time points, it only proceeds to do calculations on the channels and time points that are present in each and every input argument. With respect to time points: this could even mean that numerical inaccuracies are the showstopper here. These inaccuracies could be easily introduced when e.g. downsampling. Best, Jan-Mathijs On Dec 10, 2015, at 8:13 PM, Nicholas A. Peatfield > wrote: Hi Anne, To get an answer/suggestion you should provide the part of your script detailing your cfg inputs. Cheers, Nick On 10 December 2015 at 09:14, Anne Mickan > wrote: Dear all, I'm just starting to work on a cluster-based permutation test script based on the tutorial for within-subject designs on the fieldtrip website. I ran into an issue when computing the [stat] matrix. I used the code as it was on the website: [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); with the Correct and Incorrect matrices looking as follows: Correct{1} avg: [34x600 double] time: [1x600 double] fsample: '500' label: {34x1 cell} dimord: 'chan_time' dof: [34x600 double] var: [34x600 double] The function runs without problems, i.e I don't get any error messages. However, the result seems incomplete. stat = prob: [25x1 double] posclusters: [] posclusterslabelmat: [25x1 double] posdistribution: [1x500 double] negclusters: [1x1 struct] negclusterslabelmat: [25x1 double] negdistribution: [1x500 double] cirange: [25x1 double] mask: [25x1 logical] stat: [25x1 double] ref: [25x1 double] dimord: 'chan_time' label: {25x1 cell} time: 0 cfg: [1x1 struct] Specifically, I later run into trouble with the stat.posclusterslabelmat and stat.negclusterslabelmat matrices which should apparantly contain far more values something more like 25x500 instead of 25x1. When calling neg_int = all(neg(:, m(k):m(k+1)), 2) I get the "Index exceeds matrix dimensions" error message which I assume has to do with the fact that "neg" does not have the appropriate matrix dimensions (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) Where is the error / where should I look for the error? Some further design details: Nsubj = 24 2 conditions = Correct, Incorrect Within-subject design sampling rate = 500 34 channels I hope I gave enough / the necessary information for someone to help me out. Thanks in advance! Best, Anne _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nicholas Peatfield, PhD _______________________________________________ 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 aishwaryaselvaraj1708 at gmail.com Fri Dec 11 07:30:39 2015 From: aishwaryaselvaraj1708 at gmail.com (aishwarya selvaraj) Date: Fri, 11 Dec 2015 12:00:39 +0530 Subject: [FieldTrip] filed trip In-Reply-To: References: <5bd6dabc93ec431694d6c282894f6b62@EXPRD02.hosting.ru.nl> Message-ID: do you still have that m file with you?? could you share ?? On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra wrote: > Hi Aishwarya, > > I faced the similar problem. You are supposed to change your data > (.mat format) in a data structure that is read by fieldtrip. For that > you need at least following information > 1. Channel label and their location (If you don't have this file you > can use standard file available in Fieldtrip and you can include only > those electrode that you have been using in your experiment) > 2. sampling rate of the data (that you would have done while recording the > data) > 3. time vector > 4. no. of trials > > You can create them in MATLAB and put them together in a structure > along with your recorded data. This worked for me. > > -- > Ashutosh Mishra > 5th year Integrated BS-MS student > Department of Physical Sciences > Indian Institute of Science Education and Research, Kolkata > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Regards, Aishwarya Selvaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Fri Dec 11 09:09:14 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 11 Dec 2015 08:09:14 +0000 Subject: [FieldTrip] filed trip In-Reply-To: References: <5bd6dabc93ec431694d6c282894f6b62@EXPRD02.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A2801E0@exprd03.hosting.ru.nl> Dear Aishwarya, The data structure should look something like this: % 1. Load data load EEGdata.mat % 2. Make FieldTrip structure, manually data.label={'Channel1Name’,’Channel2Name’,’Channel3Name’}; %your channel names data.trial{1}=[Channel1Data; Channel2Data; Channel3Data]'; % do for each trial: channelsxtimepoints data data.fsample=500; %your recording sampling frequency data.time{1}=[Trial1Timepoints]; % for each trial: timepoints per data sample (e.g: [0 0.02 0.04 0.06 etc]) Going through the Walktrough Tutorial will be the best starting point when you just started to use FieldTrip: http://www.fieldtriptoolbox.org/walkthrough After that, you may go through the other Tutorial documentation or Example Matlab scripts. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of aishwarya selvaraj Sent: vrijdag 11 december 2015 7:31 To: FieldTrip discussion list Subject: Re: [FieldTrip] filed trip do you still have that m file with you?? could you share ?? On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: Hi Aishwarya, I faced the similar problem. You are supposed to change your data (.mat format) in a data structure that is read by fieldtrip. For that you need at least following information 1. Channel label and their location (If you don't have this file you can use standard file available in Fieldtrip and you can include only those electrode that you have been using in your experiment) 2. sampling rate of the data (that you would have done while recording the data) 3. time vector 4. no. of trials You can create them in MATLAB and put them together in a structure along with your recorded data. This worked for me. -- Ashutosh Mishra 5th year Integrated BS-MS student Department of Physical Sciences Indian Institute of Science Education and Research, Kolkata _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Regards, Aishwarya Selvaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From juangpc at gmail.com Fri Dec 11 11:43:05 2015 From: juangpc at gmail.com (Juan) Date: Fri, 11 Dec 2015 11:43:05 +0100 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel Message-ID: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data ​" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates% the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid .resolution = 1; cfg.grid .tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole gridfigure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight ; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Dec 11 11:54:54 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Dec 2015 10:54:54 +0000 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: References: Message-ID: <93DA3667-0D6E-45A6-8387-1C01B51D7925@fcdonders.ru.nl> Hi Juan, We’ll look into this specific issue soon, it should work without specifying sensor positions. However, for now and in general I would recommend just using a pre-cooked template grid. These can be found in fieldtrip/template/sourcemodel. This is mentioned in the tutorial, and I will make this more explicit shortly. Best, Jan-Mathijs On Dec 11, 2015, at 11:43 AM, Juan > wrote: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.resolution = 1; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Dec 11 13:19:39 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Dec 2015 12:19:39 +0000 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: References: Message-ID: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> Hi Juan, I could reproduce your issue, and have done 2 things: - I updated the wiki to make it clear that it would be easier to use a pre-cooked grid. - I adjusted ft_prepare_sourcemodel so that it also works when only providing the template_headmodel, as per the example code. The new version of ft_prepare_sourcemodel will become available in tonight’s release on the ftp-server. Best wishes, and thanks for noticing. Jan-Mathijs On Dec 11, 2015, at 11:43 AM, Juan > wrote: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.resolution = 1; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan _______________________________________________ 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 juangpc at gmail.com Fri Dec 11 13:55:57 2015 From: juangpc at gmail.com (Juan) Date: Fri, 11 Dec 2015 13:55:57 +0100 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> References: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> Message-ID: Hi Jan-Mathijs, Thanks for your quick response, H2H. I've actually learned about precooked models with your answer. Many thanks. In the same page, in the part "Make the individual subjects' grid", there seems to be a unit-related problem. One can find this code % read the single subject anatomical MRI mri = ft_read_mri('Subject01.mri'); % segment the anatomical MRI cfg = []; cfg.output = 'brain'; seg = ft_volumesegment(cfg, mri); % construct the volume conductor model (i.e. head model) for each subject% this is optional, and for the purpose of this tutorial only required for% plotting, later on cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, seg); % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid .warpmni = 'yes'; cfg.grid .template = template_grid; cfg.grid .nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri;grid = ft_prepare_sourcemodel(cfg); % make a figure of the single subject headmodel, and grid positionsfigure ; hold on; ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); ft_plot_mesh(grid .pos(grid .inside,:)); When executing it, there seems to be a problem with dimensions. "headmodel" struct is in mm and "grid" struct is in cm. So unfortunately the resulting figure ends up being something like [image: Inline image 1] I've tested to specify 'mm' units in the configuration struct before calling ft_prepare_sourcemodel: cfg.grid.unit='mm'; Or by calling ft_convert_units right after ft_prepare_sourcemodel. grid=ft_convert_units(grid,'mm'); Both solutions work fine, producing a figure very similar to the one in the tutorial. I've included the first solution in the wiki. I hope this is ok. Best, Juan On Fri, Dec 11, 2015 at 1:19 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Juan, > > I could reproduce your issue, and have done 2 things: > - I updated the wiki to make it clear that it would be easier to use a > pre-cooked grid. > - I adjusted ft_prepare_sourcemodel so that it also works when only > providing the template_headmodel, as per the example code. > The new version of ft_prepare_sourcemodel will become available in > tonight’s release on the ftp-server. > > Best wishes, and thanks for noticing. > Jan-Mathijs > > > On Dec 11, 2015, at 11:43 AM, Juan wrote: > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ​ " > ​​ > > ​ ​when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ​" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ​Code: > > % NOTE: the path to the template file is user-specific > template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system > % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. > % construct the dipole grid in the template brain coordinates% the negative inwardshift means an outward shift of the brain surface for inside/outside detection > cfg = []; > cfg.grid .resolution = 1; > cfg.grid .tight = 'yes'; > cfg.inwardshift = -1.5; > ​​ > cfg.headmodel = template_headmodel; > > The problem occurs when I execute ​this line: > > ​ > ​ > ​ > ​ > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ​ > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ​ > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > template_grid = ft_prepare_sourcemodel(cfg); > % make a figure with the template head model and dipole gridfigure hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight ; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > > My questions: > > ​Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because​ my solution depends on where > one is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ​ I figure this can be interesting to other people.​ > ​ > ​ > > Best, > > > Juan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 8130 bytes Desc: not available URL: From frsantos at fpce.up.pt Fri Dec 11 13:57:52 2015 From: frsantos at fpce.up.pt (Fernando Ferreira-Santos) Date: Fri, 11 Dec 2015 12:57:52 +0000 Subject: [FieldTrip] 3rd International Conference of the ESCAN Message-ID: <2BAB036A9BAEA44984A131DFCE446108010BFD7B96@SRVMBX01.fpceup.psi.up.pt> Dear Colleagues, The 3rd International Conference of the European Society for Cognitive and Affective Neuroscience (ESCAN) is accepting submissions for symposia and oral/poster presentations. The conference will take place in that will take place in Porto, Portugal, between 23-26 of June, 2016, at the Porto Palácio Congress Hotel & Spa (http://www.hotelportopalacio.com/en/hotel-overview.html). The submission deadline is the 8th of January, 2016. Please find all the details in the conference website: www.escan2016.eu We would appreciate it if you could pass this information along to other colleagues and students. Attached you may find a poster with the call for submissions. We are looking forward to seeing you in Porto in 2016! Fernando Babosa and Fernando Ferreira-Santos (University of Porto) Chairs of the Local Organizing Committee P.S.: Apologies if you get multiple postings of this announcement. -- Laboratory of Neuropsychophysiology Faculty of Psychology and Education Sciences University of Porto Rua Alfredo Allen, 4200-135 Porto (Portugal) Tel.: +351 226079700 http://www.fpce.up.pt/labpsi/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: escan2016_announce_call.pdf Type: application/pdf Size: 295799 bytes Desc: escan2016_announce_call.pdf URL: From marlene.boenstrup at googlemail.com Fri Dec 11 21:30:46 2015 From: marlene.boenstrup at googlemail.com (=?UTF-8?Q?Marlene_B=C3=B6nstrup?=) Date: Fri, 11 Dec 2015 21:30:46 +0100 Subject: [FieldTrip] ft_sourceinterpolate fails when cfg.moveinward and cfg.inwardshift was used to create sourcemodel Message-ID: Dear fieldtrip-community, I struggle at plotting source reconstruction results, and my routine even fails when using the template structural data. I think it is based on a shortcoming of the ft_sourceinterpolation function. This is why I am optimistic to find help in this platform: I prepare the leadfields based on the standard_sourcemodel3d6mm, the vol called standard_bem.mat, the electrode positions defined in standard_1005.elc. Since some of the dipoles that are assigned as "inside" in the sourcemodel3d6mm are actually sticking out of the inner bem boundary, leading to distorted leadfields, I re-prepare the sourcemodel based on the following specifications: mri=ft_read_mri('single_subj_T1.nii'); mri.coordsys = 'spm'; mri = ft_volumereslice([], mri); cfg=[]; cfg.mri = mri; cfg.elec=elec; cfg.vol=vol; cfg.grid.warpmni = 'yes'; cfg.grid.template = grid; % sourcemodel3d6mm cfg.grid.nonlinear = 'no'; cfg.moveinward=5; cfg.inwardshift=0; grid = ft_prepare_sourcemodel(cfg); this comes out with a vector of positions in three dimensional space, all of them being assigned to inside and none of them as outside. The leadfields prepared based on this sourcemodel look very convincing and the ft_sourceanalysis function also works. But the problem is to interpolate this on the anatomical image: Nested in the function ft_sourceinterpolate, the function ft_checkdata, specifically the subfunction source2volume leads to a misconfiguration with all the positions of the functional data being distributed in to a full 3D volume. In the end the orthoplot of the brain is a big fully activated cube. I hope someone has a good idea how to deal with this issue in fieldtrip and shares his/her expertise with us. Many greetings, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From amickan1990 at gmail.com Sat Dec 12 16:12:57 2015 From: amickan1990 at gmail.com (Anne Mickan) Date: Sat, 12 Dec 2015 16:12:57 +0100 Subject: [FieldTrip] fieldtrip Digest, Vol 61, Issue 7 In-Reply-To: References: Message-ID: Dear Nick and Jan-Mathijs, thanks for your emails. Here is the part of the code that details the cfg inputs. I basically stuck to what was in the tutorial: cfg = []; cfg.channel = 'all'; % prepare neighbouring channels cfg_neighb = []; cfg_neighb.method = 'distance'; cfg.channel = 'all'; cfg_neighb.feedback = 'yes'; cfg_neighb.layout = 'easycapM3.mat'; neighbours = ft_prepare_neighbours(cfg_neighb, Correct{1}); % settings for statistics cfg = []; cfg.channel = {'EEG'}; cfg.latency = [0 1]; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.neighbours = neighbours; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.5; cfg.numrandomization = 500; % prepare design subj = 24; design = zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; Best, Anne On Fri, Dec 11, 2015 at 12:00 PM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Stats matrix incomplete - cluster-based permutation test > (Anne Mickan) > 2. Re: Stats matrix incomplete - cluster-based permutation test > (Nicholas A. Peatfield) > 3. Re: Stats matrix incomplete - cluster-based permutation > test > (Schoffelen, J.M. (Jan Mathijs)) > 4. Re: filed trip (aishwarya selvaraj) > 5. Re: filed trip (Pelt, S. van (Stan)) > 6. possible bug in tutorial code for creating sourcemodel (Juan) > 7. Re: possible bug in tutorial code for creating sourcemodel > (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 10 Dec 2015 18:14:10 +0100 > From: Anne Mickan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > < > CANX43OJN4h_1jEuDKMNwQC4sHeW+E2_StnS3WLkEbOkVpMerQA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/6dea45e9/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Dec 2015 11:13:10 -0800 > From: "Nicholas A. Peatfield" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > 3Ew0_4-mB9CxchT0CSQSKDo4e1JCkEtmdCxp-CWhYtQ at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Anne, > > To get an answer/suggestion you should provide the part of your script > detailing your cfg inputs. > > Cheers, > > Nick > > On 10 December 2015 at 09:14, Anne Mickan wrote: > > > Dear all, > > > > I'm just starting to work on a cluster-based permutation test script > based > > on the tutorial for within-subject designs on the fieldtrip website. I > ran > > into an issue when computing the [stat] matrix. I used the code as it was > > on the website: > > > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > > > with the Correct and Incorrect matrices looking as follows: > > > > Correct{1} > > > > avg: [34x600 double] > > time: [1x600 double] > > fsample: '500' > > label: {34x1 cell} > > dimord: 'chan_time' > > dof: [34x600 double] > > var: [34x600 double] > > > > The function runs without problems, i.e I don't get any error messages. > > However, the result seems incomplete. > > > > stat = > > prob: [25x1 double] > > posclusters: [] > > posclusterslabelmat: [25x1 double] > > posdistribution: [1x500 double] > > negclusters: [1x1 struct] > > negclusterslabelmat: [25x1 double] > > negdistribution: [1x500 double] > > cirange: [25x1 double] > > mask: [25x1 logical] > > stat: [25x1 double] > > ref: [25x1 double] > > dimord: 'chan_time' > > label: {25x1 cell} > > time: 0 > > cfg: [1x1 struct] > > > > Specifically, I later run into trouble with the stat.posclusterslabelmat > > and stat.negclusterslabelmat matrices which should apparantly contain far > > more values something more like 25x500 instead of 25x1. When calling > > neg_int = all(neg(:, m(k):m(k+1)), 2) > > I get the "Index exceeds matrix dimensions" error message which I assume > > has to do with the fact that "neg" does not have the appropriate matrix > > dimensions > > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > > > Where is the error / where should I look for the error? > > > > Some further design details: > > Nsubj = 24 > > 2 conditions = Correct, Incorrect > > Within-subject design > > sampling rate = 500 > > 34 channels > > > > I hope I gave enough / the necessary information for someone to help me > > out. > > > > Thanks in advance! > > > > Best, > > Anne > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > Nicholas Peatfield, PhD > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/6503aa5f/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Thu, 10 Dec 2015 19:36:45 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: <7CAF2781-D756-4C0B-9B56-F05642437AF9 at fcdonders.ru.nl> > Content-Type: text/plain; charset="windows-1252" > > Hi Anne, > > I agree with Nick, some more information would be helpful. At this stage > my wild guess (assuming that you did not constrain your ?search space?, > using cfg.channel and cfg.latency before calling ft_timelockstatistics) > would be that there?s a major discrepancy in the descriptive dimensions of > your data (i.e. the ?labels? and the time points) across the input > arguments. FieldTrip does an explicit check on the labels and time points, > it only proceeds to do calculations on the channels and time points that > are present in each and every input argument. With respect to time points: > this could even mean that numerical inaccuracies are the showstopper here. > These inaccuracies could be easily introduced when e.g. downsampling. > > Best, > Jan-Mathijs > > > On Dec 10, 2015, at 8:13 PM, Nicholas A. Peatfield < > nick.peatfield at gmail.com> wrote: > > Hi Anne, > > To get an answer/suggestion you should provide the part of your script > detailing your cfg inputs. > > Cheers, > > Nick > > On 10 December 2015 at 09:14, Anne Mickan amickan1990 at gmail.com>> wrote: > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Nicholas Peatfield, PhD > > _______________________________________________ > 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/20151210/deacc96c/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Fri, 11 Dec 2015 12:00:39 +0530 > From: aishwarya selvaraj > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > Message-ID: > < > CACWTKSojvkrwtTLFGpsh2H6CtHXY7-krT7C5-NBjqXdHPs1Ljg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > do you still have that m file with you?? > could you share ?? > > On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: > > > Hi Aishwarya, > > > > I faced the similar problem. You are supposed to change your data > > (.mat format) in a data structure that is read by fieldtrip. For that > > you need at least following information > > 1. Channel label and their location (If you don't have this file you > > can use standard file available in Fieldtrip and you can include only > > those electrode that you have been using in your experiment) > > 2. sampling rate of the data (that you would have done while recording > the > > data) > > 3. time vector > > 4. no. of trials > > > > You can create them in MATLAB and put them together in a structure > > along with your recorded data. This worked for me. > > > > -- > > Ashutosh Mishra > > 5th year Integrated BS-MS student > > Department of Physical Sciences > > Indian Institute of Science Education and Research, Kolkata > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > Regards, > Aishwarya Selvaraj > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/0e2bdbaf/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Fri, 11 Dec 2015 08:09:14 +0000 > From: "Pelt, S. van (Stan)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > Message-ID: > <7CCA2706D7A4DA45931A892DF3C2894C2A2801E0 at exprd03.hosting.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Dear Aishwarya, > > The data structure should look something like this: > > % 1. Load data > load EEGdata.mat > > % 2. Make FieldTrip structure, manually > data.label={'Channel1Name?,?Channel2Name?,?Channel3Name?}; %your channel > names > data.trial{1}=[Channel1Data; Channel2Data; Channel3Data]'; % do for each > trial: channelsxtimepoints data > data.fsample=500; %your recording sampling frequency > data.time{1}=[Trial1Timepoints]; % for each trial: timepoints per data > sample (e.g: [0 0.02 0.04 0.06 etc]) > > Going through the Walktrough Tutorial will be the best starting point when > you just started to use FieldTrip: > http://www.fieldtriptoolbox.org/walkthrough > After that, you may go through the other Tutorial documentation or Example > Matlab scripts. > > Best, > Stan > > -- > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour > Radboud University > Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > From: fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] On Behalf Of aishwarya selvaraj > Sent: vrijdag 11 december 2015 7:31 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > > do you still have that m file with you?? > could you share ?? > > On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: > Hi Aishwarya, > > I faced the similar problem. You are supposed to change your data > (.mat format) in a data structure that is read by fieldtrip. For that > you need at least following information > 1. Channel label and their location (If you don't have this file you > can use standard file available in Fieldtrip and you can include only > those electrode that you have been using in your experiment) > 2. sampling rate of the data (that you would have done while recording the > data) > 3. time vector > 4. no. of trials > > You can create them in MATLAB and put them together in a structure > along with your recorded data. This worked for me. > > -- > Ashutosh Mishra > 5th year Integrated BS-MS student > Department of Physical Sciences > Indian Institute of Science Education and Research, Kolkata > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Regards, > Aishwarya Selvaraj > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/5309b65c/attachment-0001.html > > > > ------------------------------ > > Message: 6 > Date: Fri, 11 Dec 2015 11:43:05 +0100 > From: Juan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] possible bug in tutorial code for creating > sourcemodel > Message-ID: > XT8P5jeAp7-C4TDBNN1Aoe8X_mtYLh8w at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ?" > ?? > > ? ?when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ?" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ?Code: > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret > the coordinate system > % segment the template brain and construct a volume conduction model > (i.e. head model): % this is needed to describe the boundary that > define which dipole locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % > Convert the vol to cm, because the CTF convenction is to express > everything in cm. > % construct the dipole grid in the template brain coordinates% the > negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid < > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html > >.resolution > = 1; > cfg.grid < > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.tight > = 'yes'; > cfg.inwardshift = -1.5; > ?? > cfg.headmodel = template_headmodel; > > The problem occurs when I execute ?this line: > > ? > ? > ? > ? > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ? > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ? > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > ?cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > template_grid = ft_prepare_sourcemodel(cfg); > % make a figure with the template head model and dipole gridfigure > >hold > > on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight > ; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > > My questions: > > ?Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because? my solution depends on where one > is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ? I figure this can be interesting to other people.? > ? > ? > > Best, > > > Juan > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/fee4d5ef/attachment-0001.html > > > > ------------------------------ > > Message: 7 > Date: Fri, 11 Dec 2015 10:54:54 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] possible bug in tutorial code for creating > sourcemodel > Message-ID: <93DA3667-0D6E-45A6-8387-1C01B51D7925 at fcdonders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Juan, > > We?ll look into this specific issue soon, it should work without > specifying sensor positions. However, for now and in general I would > recommend just using a pre-cooked template grid. These can be found in > fieldtrip/template/sourcemodel. This is mentioned in the tutorial, and I > will make this more explicit shortly. > > Best, > > Jan-Mathijs > > On Dec 11, 2015, at 11:43 AM, Juan juangpc at gmail.com>> wrote: > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ?" > ?? > > ? ?when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ?" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ?Code: > > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): > % this is needed to describe the boundary that define which dipole > locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert > the vol to cm, because the CTF convenction is to express everything in cm. > > % construct the dipole grid in the template brain coordinates > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.resolution > = 1; > cfg.grid< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.tight > = 'yes'; > cfg.inwardshift = -1.5; > > ?? > cfg.headmodel = template_headmodel; > > > The problem occurs when I execute ?this line: > > > ? > ? > ? > ? > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ? > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ? > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > > ?cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure.html> > hold > on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/camlight.html>; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > My questions: > > ?Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because? my solution depends on where > one is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ? I figure this can be interesting to other people.? > ? > ? > > Best, > > > Juan > > _______________________________________________ > 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/20151211/346949fd/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 61, Issue 7 > **************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From LordJojo at gmx.de Sat Dec 12 19:59:26 2015 From: LordJojo at gmx.de (Jojo Klemt) Date: Sat, 12 Dec 2015 19:59:26 +0100 Subject: [FieldTrip] channel problem ft_freqstatistics Message-ID: An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Dec 13 12:12:40 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 13 Dec 2015 11:12:40 +0000 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test Message-ID: Hi Anne, It looks like you're running stats on grand-average structures created with cfg.keepindividual='no' (because your Correct and Incorrect structures have an .avg field). I always do stats on a grand-average structure created with cfg.keepindividual='yes' (which will yield a structure with no .avg field, and instead an .individual field, which in your case will be 24x34x600, since you have participants). Do things work out better if you try it that way? Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 1 > Date: Thu, 10 Dec 2015 18:14:10 +0100 > From: Anne Mickan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > < > CANX43OJN4h_1jEuDKMNwQC4sHeW+E2_StnS3WLkEbOkVpMerQA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From recasensmarc at gmail.com Sun Dec 13 16:07:08 2015 From: recasensmarc at gmail.com (Marc Recasens) Date: Sun, 13 Dec 2015 15:07:08 +0000 Subject: [FieldTrip] channel problem ft_freqstatistics In-Reply-To: References: Message-ID: Hi Johannes, I think the same problem has been reported before in: http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009789.html Roy Cox looked into the problem with quite detail and found the bug in the ft_get_selection function, line 630-631 during a call to "*label = union(label, selchannel);"*. I recently had the same problem and it was solved after commenting that line. However it might be better if you update FieldTrip to the last version where this issue is fixed. Hope that helps. Best wishes Marc On Sat, Dec 12, 2015 at 6:59 PM, Jojo Klemt wrote: > Dear community > > My name is Johannes Klemt and I'm analysing eeg/emg-power data of patients > and healthy controls for my medical doctorate in Tübingen. > I have a small problem using ft_freqstatistics. After performing an > independent samples t-test, the channels are suddenly ordered alphabeticaly. > The preprocessing and power analysis were not performed in field trip. > The electrode labels and neighbours were defined and put into the > following cfg: > cfg.elec > cfg.neighbours > The statistics were then calculated using montecarlo method, but the > channel order in stat.label is changed into alphabetical order, so the stat > plot looks nice but is quite useless. > Colleagues of mine used ft_freqgrandaverage as input data and did not have > the problem, but I can't find the bug. > I designed a file containing the layout structure and tried putting it in > by using > cfg.layout > but it was ignored. > > Any help would be deeply appreciated. > > Yours sincerely > > Johannes Klemt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 12:30:33 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 12:30:33 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Message-ID: Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From Elana.Harris at cchmc.org Mon Dec 14 13:12:29 2015 From: Elana.Harris at cchmc.org (Harris, Elana) Date: Mon, 14 Dec 2015 12:12:29 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: Message-ID: cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Mon Dec 14 13:21:41 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Mon, 14 Dec 2015 12:21:41 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Dear Elana, The 50ms timesteps result in the 41 timebins. Per timebin, the average power spectrum (TFRhann.powspctrm) is computed over all trials that have data in that specific time bin. In your case, the power in the earlier time bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that of the later ones (e.g. 1.95-2.0s), because of your variable trial length. If you specify cfg.keeptrials=’yes’, you can see that the individual trial’s TFRs will have different amount of data points. Hope that helps. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Harris, Elana Sent: maandag 14 december 2015 13:12 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 13:41:27 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 13:41:27 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Message-ID: Dear Stan and Elana, thank you very much for your answers and help. Just another question: if I understood correctly, there's no way to compute fft for single trials, since TFRhann.powspctrm is by definition an average along trials. Is that true? Thanks again. Bests, Federica 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) : > Dear Elana, > > > > The 50ms timesteps result in the 41 timebins. Per timebin, the average > power spectrum (TFRhann.powspctrm) is computed over all trials that have > data in that specific time bin. In your case, the power in the earlier time > bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that > of the later ones (e.g. 1.95-2.0s), because of your variable trial length. > > > > If you specify cfg.keeptrials=’yes’, you can see that the individual > trial’s TFRs will have different amount of data points. > > > > Hope that helps. > > > > Best, > > Stan > > > > -- > > Stan van Pelt, PhD > > Donders Institute for Brain, Cognition and Behaviour > > Radboud University > > Montessorilaan 3, B.01.34 > > 6525 HR Nijmegen, the Netherlands > > tel: +31 24 3616288 > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Harris, Elana > *Sent:* maandag 14 december 2015 13:12 > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > > > I just noticed this line has an error should be -0.5:0.5:2 > > > > Sorry, I am new to fieldtrip myself and can't be more helpful yet. > > > > Cheers, > > > > Elana > ------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Federica Mauro [federica.ma at gmail.com] > *Sent:* Monday, December 14, 2015 6:30 AM > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Number of epochs in the ft_freqanalysis output > > Dear all, > > > > I'm having a problem in using the ft_freqanalysis function, so I'm writing > to ask your help. > > I'm trying to get power data for each 2-seconds epochs of my eeg files. > > My eeg files are not of the same length (they don't have the same number > of epochs), however the output of the function (namely TFRhann.powspctrm) > always gives me power data for the same number of epochs, namely 41, > unregarding of the effective number of epochs. > > > > Here is the code I'm using: > > > > cfg = []; > > cfg.output = 'pow'; > > % cfg.channel > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 4:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window > = 0.5 sec > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > TFRhann = ft_freqanalysis(cfg, eeg); > > > > Do you have any suggestion about it? > > Thank you very much for your attention. > > > > Worm regards, > > Federica > > > > > > _______________________________________________ > 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 stan.vanpelt at donders.ru.nl Mon Dec 14 14:30:32 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Mon, 14 Dec 2015 13:30:32 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> Hi Federica, If you want to have an estimate for each trial separately, you should specify cfg.keeptrials=’yes’ when calling ft_freqanalysis. See also http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip? Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Federica Mauro Sent: maandag 14 december 2015 13:41 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear Stan and Elana, thank you very much for your answers and help. Just another question: if I understood correctly, there's no way to compute fft for single trials, since TFRhann.powspctrm is by definition an average along trials. Is that true? Thanks again. Bests, Federica 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) >: Dear Elana, The 50ms timesteps result in the 41 timebins. Per timebin, the average power spectrum (TFRhann.powspctrm) is computed over all trials that have data in that specific time bin. In your case, the power in the earlier time bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that of the later ones (e.g. 1.95-2.0s), because of your variable trial length. If you specify cfg.keeptrials=’yes’, you can see that the individual trial’s TFRs will have different amount of data points. Hope that helps. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Harris, Elana Sent: maandag 14 december 2015 13:12 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica _______________________________________________ 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 LordJojo at gmx.de Mon Dec 14 15:24:32 2015 From: LordJojo at gmx.de (Jojo Klemt) Date: Mon, 14 Dec 2015 15:24:32 +0100 Subject: [FieldTrip] channel problem ft_freqstatistics In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 22:51:26 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 22:51:26 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> Message-ID: Hi Stan, thank you, it was really helpful. Best, Federica 2015-12-14 14:30 GMT+01:00 Pelt, S. van (Stan) : > Hi Federica, > > > > If you want to have an estimate for each trial separately, you should > specify cfg.keeptrials=’yes’ when calling ft_freqanalysis. See also > http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip > ? > > > > Best, > > Stan > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Federica Mauro > *Sent:* maandag 14 december 2015 13:41 > > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > Dear Stan and Elana, thank you very much for your answers and help. > > > > Just another question: if I understood correctly, there's no way to > compute fft for single trials, since TFRhann.powspctrm is by definition an > average along trials. Is that true? > > > > Thanks again. > > > > Bests, > > Federica > > > > 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) >: > > Dear Elana, > > > > The 50ms timesteps result in the 41 timebins. Per timebin, the average > power spectrum (TFRhann.powspctrm) is computed over all trials that have > data in that specific time bin. In your case, the power in the earlier time > bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that > of the later ones (e.g. 1.95-2.0s), because of your variable trial length. > > > > If you specify cfg.keeptrials=’yes’, you can see that the individual > trial’s TFRs will have different amount of data points. > > > > Hope that helps. > > > > Best, > > Stan > > > > -- > > Stan van Pelt, PhD > > Donders Institute for Brain, Cognition and Behaviour > > Radboud University > > Montessorilaan 3, B.01.34 > > 6525 HR Nijmegen, the Netherlands > > tel: +31 24 3616288 > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Harris, Elana > *Sent:* maandag 14 december 2015 13:12 > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > > > I just noticed this line has an error should be -0.5:0.5:2 > > > > Sorry, I am new to fieldtrip myself and can't be more helpful yet. > > > > Cheers, > > > > Elana > ------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Federica Mauro [federica.ma at gmail.com] > *Sent:* Monday, December 14, 2015 6:30 AM > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Number of epochs in the ft_freqanalysis output > > Dear all, > > > > I'm having a problem in using the ft_freqanalysis function, so I'm writing > to ask your help. > > I'm trying to get power data for each 2-seconds epochs of my eeg files. > > My eeg files are not of the same length (they don't have the same number > of epochs), however the output of the function (namely TFRhann.powspctrm) > always gives me power data for the same number of epochs, namely 41, > unregarding of the effective number of epochs. > > > > Here is the code I'm using: > > > > cfg = []; > > cfg.output = 'pow'; > > % cfg.channel > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 4:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window > = 0.5 sec > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > TFRhann = ft_freqanalysis(cfg, eeg); > > > > Do you have any suggestion about it? > > Thank you very much for your attention. > > > > Worm regards, > > Federica > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From S.Hanslmayr at bham.ac.uk Wed Dec 16 12:50:48 2015 From: S.Hanslmayr at bham.ac.uk (Simon Hanslmayr) Date: Wed, 16 Dec 2015 11:50:48 +0000 Subject: [FieldTrip] PhD studentship available at University of Birmingham Message-ID: <257F6C65A372A04CA41056EACC0DE7CED841AC9A@EX8.adf.bham.ac.uk> Dear Fieldtrip Community, I take this opportunity to announce a PhD studentship that is available for talented students to work in the labs of Joff Lee and Simon Hanslmayr on a memory project involving invasive recordings of oscillations in rodents. More information about the project and instructions on how to apply can be found here: http://www.birmingham.ac.uk/research/activity/mrc-impact/imaging.aspx. Deadline for applicants is Sunday 10 January 2016. For any questions about the project please write an email to Dr Joff Lee (J.L.C.Lee at bham.ac.uk) or myself (simon.hanslmayr at bham.ac.uk). Seasonal greetings, Simon Dr. Simon Hanslmayr Senior Lecturer School of Psychology University of Birmingham Edgbaston Birmingham B15 2TT UK Tel +44 121 4146203 http://www.memorybham.com/people/#/simon-hanslmayr/ [http://www.nature.com/content/sr/ebm/1248_2014_Branded_Sig_460x80_v1.gif] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 8560 bytes Desc: image001.gif URL: From luke.bloy at gmail.com Wed Dec 16 22:29:17 2015 From: luke.bloy at gmail.com (Luke Bloy) Date: Wed, 16 Dec 2015 21:29:17 +0000 Subject: [FieldTrip] Question about ft_statfun_actvsblT Message-ID: Sorry if this is missing something fundamental but I'm abit confused about the use of ft_statfun_actvsblT for frequency analysis and how it compares to ft_statfun_depsamplesT. It seems from http://www.fieldtriptoolbox.org/tutorial/salzburg (and from trying to use it) that inorder to use ft_statfun_actvsblT the active and baseline freq structures need to have the same time dimension. Based on this I'm assuming that the active vs baseline comparison happens at each time x frequency pair, but isn't this what ft_statfun_depsamplesT does? So I guess my question is what is the difference between the two? What exactly is the comparison being performed by ft_statfun_actvsblT? Thanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 10:43:43 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) Subject: [FieldTrip] importing large edf data References: <807603762.476165.1450431823359.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo@mail.yahoo.com> Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.  So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403)   dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622)     dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566)       dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary',       strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load : filename     = 'mydata.edf'  hdr   = ft_read_header(filename);  sample.start=1  sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403)   dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622)     dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100')   >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri Dec 18 13:37:52 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 18 Dec 2015 12:37:52 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 61, Issue 14 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.pflug at musterkind.eu Fri Dec 18 14:06:32 2015 From: anja.pflug at musterkind.eu (Anja Pflug) Date: Fri, 18 Dec 2015 14:06:32 +0100 (CET) Subject: [FieldTrip] Importing large edf data In-Reply-To: References: Message-ID: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 14:13:16 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:13:16 +0000 (UTC) Subject: [FieldTrip] Importing large edf data In-Reply-To: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> Message-ID: <1753128777.512946.1450444396047.JavaMail.yahoo@mail.yahoo.com>  Thanks for your reply Anja.I need to have all the channel information at a segment of time to decide if it there is seizure occurring.  Down sampling will loose the information and I am not sure if I want to go that way, as I need to do some feature extractions/classification etc on the data. Not sure how I could cut the data in fieldtrip. Do you know?ThanksBest regards ___________________________________________________ Leila Ayoubian From: Anja Pflug To: fieldtrip at science.ru.nl Sent: Friday, December 18, 2015 1:06 PM Subject: [FieldTrip] Importing large edf data Hello Leila, have you tried to import only one of your 51 channels? If this works you  could cut the data or downsample it and then combine all channels in a later step. Best, Anja fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ 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 jorn at artinis.com Fri Dec 18 14:17:34 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Fri, 18 Dec 2015 14:17:34 +0100 Subject: [FieldTrip] Importing large edf data In-Reply-To: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> Message-ID: <007301d13996$7573dc60$605b9520$@artinis.com> Hi all, I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension. Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes. Best of luck ;) Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug Sent: Friday, December 18, 2015 14:07 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Importing large edf data Hello Leila, have you tried to import only one of your 51 channels? If this works you could cut the data or downsample it and then combine all channels in a later step. Best, Anja fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian > To: "fieldtrip at science.ru.nl " > Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com > Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 14:40:59 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <2054001626.533069.1450446059200.JavaMail.yahoo@mail.yahoo.com>  Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.  Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get:    hdr: [1x1 struct]          label: {51x1 cell}           time: {1x50710 cell}          trial: {1x50710 cell}        fsample: 1024     sampleinfo: [50710x2 double]            cfg: [1x1 struct] so the actual data which is in data.trial  is this in both cases! size(data.trial) ans =            1       50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Friday, December 18, 2015 12:37 PM Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to         fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit         http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to         fieldtrip-request at science.ru.nl You can reach the person managing the list at         fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics:    1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID:         <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ 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 leilayou_54 at yahoo.com Fri Dec 18 14:55:18 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:55:18 +0000 (UTC) Subject: [FieldTrip] Importing large edf data In-Reply-To: <007301d13996$7573dc60$605b9520$@artinis.com> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> <007301d13996$7573dc60$605b9520$@artinis.com> Message-ID: <778201681.538338.1450446918121.JavaMail.yahoo@mail.yahoo.com> Thanks Jorn. Appreciate your feedback.  __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Jörn M. Horschig To: 'FieldTrip discussion list' Sent: Friday, December 18, 2015 1:17 PM Subject: Re: [FieldTrip] Importing large edf data #yiv8769305188 #yiv8769305188 -- _filtered #yiv8769305188 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv8769305188 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv8769305188 {font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv8769305188 #yiv8769305188 p.yiv8769305188MsoNormal, #yiv8769305188 li.yiv8769305188MsoNormal, #yiv8769305188 div.yiv8769305188MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv8769305188 a:link, #yiv8769305188 span.yiv8769305188MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv8769305188 a:visited, #yiv8769305188 span.yiv8769305188MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv8769305188 p {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv8769305188 span.yiv8769305188EmailStyle18 {color:#1F497D;}#yiv8769305188 .yiv8769305188MsoChpDefault {font-size:10.0pt;} _filtered #yiv8769305188 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv8769305188 div.yiv8769305188WordSection1 {}#yiv8769305188 Hi all,  I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension.  Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes.  Best of luck ;)Jörn-- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems  |  +31 481 350 980  From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug Sent: Friday, December 18, 2015 14:07 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Importing large edf data  Hello Leila,have you tried to import only one of your 51 channels?If this works you  could cut the data or downsample it and then combine all channels in a later step.Best,Anja   fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Fri Dec 18 18:51:20 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Fri, 18 Dec 2015 07:51:20 -1000 Subject: [FieldTrip] Importing large edf data In-Reply-To: <007301d13996$7573dc60$605b9520$@artinis.com> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> <007301d13996$7573dc60$605b9520$@artinis.com> Message-ID: <81DC3EE6-21D4-4BB7-80B8-AF642B616768@gmail.com> Hi all, Perhaps this links helps: http://www.fieldtriptoolbox.org/getting_started/edf Arjen > On Dec 18, 2015, at 3:17 AM, Jörn M. Horschig wrote: > > Hi all, > > I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension. > > Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes. > > Best of luck ;) > Jörn > -- > Jörn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug > Sent: Friday, December 18, 2015 14:07 > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Importing large edf data > > Hello Leila, > > have you tried to import only one of your 51 channels? > > If this works you could cut the data or downsample it and then combine all channels in a later step. > > Best, > > Anja > > > > fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: > > > 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. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- 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 61, Issue 14 > ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sat Dec 19 15:06:46 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sat, 19 Dec 2015 14:06:46 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = hdr: [1x1 struct] label: {37x1 cell} time: {[1x500 double]} trial: {[37x500 double]} fsample: 200 sampleinfo: [1 500] cfg: [1x1 struct] >> data_1000samples data_1000samples = hdr: [1x1 struct] label: {37x1 cell} time: {[1x1000 double]} trial: {[37x1000 double]} fsample: 200 sampleinfo: [1 1000] cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Friday, December 18, 2015 12:37 PM > Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From senakahks at gmail.com Sun Dec 20 12:51:47 2015 From: senakahks at gmail.com (Senaka Amarakeerthi) Date: Sun, 20 Dec 2015 17:21:47 +0530 Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data structure. Message-ID: Dear all, I am new to FieldTrip and trying to process offline Emotive Epoc EEG data. The file I am trying to process is a single trial. The code I tried is: %% import data from testbench emotiv edf file [hdr, data_eeg] = edfread('emotive.edf'); %% Rearrange data to match FieldTrip Format % Remove unnecessary columns data.trial = data_eeg([3:16,39], : ); % Cell-array containing strings, Nchan X 1 % Based on https://emotiv.com/forum/forum14/topic1817/messages/ data.label = {'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6' 'F4' 'F8' 'AF4' 'MARKER'}; % Sampling frequency in Hz, single number data.fsample = 128; % Setting time [x, filelength] = size(data.trial); data.time{1} = [1:filelength]./data.fsample; %% Using the rearranged data % Set the trial column name and event value (what you enter to the last column. % here enter number 1 as the marker) cfg.trialdef.eventtype = 'MARKER'; cfg.trialdef.eventvalue = 1; cfg.trialdef.eventtype = '?'; ft_definetrial(cfg); %% Preprocessing cfg = []; cfg.channel = 'AF3'; cfg.lpfilter = 'yes'; cfg.hpfilter = 'yes'; cfg.bsfilter = 'yes'; cfg.lpfreq = 100; cfg.hpfreq = 10; cfg.bsfreq = [59 61]; cfg.lpfiltord = 4; cfg.hpfiltord = 4; cfg.bpfiltord = 4; cfg.lpfilttype = 'but'; cfg.hpfilttype = 'but'; ecog = ft_preprocessing(cfg,data); When I run the script. I am getting the following error. Error in ft_trialfun_general (line 78) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Do I need to set the header structure as well? Can somebody help me to get this fixed. I am reading the documentation but it seems start is bit hard! Appreciate your support -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Mon Dec 21 10:36:27 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <1459455402.1301519.1450690587900.JavaMail.yahoo@mail.yahoo.com> Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;  there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference? Thanks again.Kind regards  __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Saturday, December 19, 2015 2:06 PM Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples =            hdr: [1x1 struct]          label: {37x1 cell}           time: {[1x500 double]}          trial: {[37x500 double]}        fsample: 200     sampleinfo: [1 500]            cfg: [1x1 struct] >> data_1000samples data_1000samples =            hdr: [1x1 struct]          label: {37x1 cell}           time: {[1x1000 double]}          trial: {[37x1000 double]}        fsample: 200     sampleinfo: [1 1000]            cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/  ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Friday, December 18, 2015 12:37 PM  Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Mon Dec 21 12:35:23 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Mon, 21 Dec 2015 11:35:23 +0000 Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data structure Message-ID: Hello Senaka, I think you might be making your life more difficult by trying to directly call edfread(), which is a low-level function. Have you tried just using ft_preprocessing(), the high-level wrapper function, as described in the tutorial on the fieldtrip wiki? In my experience, this function reads EDF data straightforwardly. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 20 Dec 2015 17:21:47 +0530 > From: Senaka Amarakeerthi > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data > structure. > Message-ID: > J-1ensqWCTreAGdsHovwSavJA5sAG6i1nDGg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I am new to FieldTrip and trying to process offline Emotive Epoc EEG data. > The file I am trying to process is a single trial. > > The code I tried is: > > %% import data from testbench emotiv edf file > > [hdr, data_eeg] = edfread('emotive.edf'); > > > > %% Rearrange data to match FieldTrip Format > > % Remove unnecessary columns > > data.trial = data_eeg([3:16,39], : ); > > > > > > % Cell-array containing strings, Nchan X 1 > > % Based on https://emotiv.com/forum/forum14/topic1817/messages/ > > data.label = {'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6' > 'F4' > 'F8' 'AF4' 'MARKER'}; > > > > % Sampling frequency in Hz, single number > > data.fsample = 128; > > > > % Setting time > > [x, filelength] = size(data.trial); > > data.time{1} = [1:filelength]./data.fsample; > > %% Using the rearranged data > > > > > > % Set the trial column name and event value (what you enter to the last > column. > > % here enter number 1 as the marker) > > cfg.trialdef.eventtype = 'MARKER'; > > cfg.trialdef.eventvalue = 1; > > cfg.trialdef.eventtype = '?'; > > ft_definetrial(cfg); > > > %% Preprocessing > > cfg = []; > > cfg.channel = 'AF3'; > > cfg.lpfilter = 'yes'; > > cfg.hpfilter = 'yes'; > > cfg.bsfilter = 'yes'; > > cfg.lpfreq = 100; > > cfg.hpfreq = 10; > > cfg.bsfreq = [59 61]; > > cfg.lpfiltord = 4; > > cfg.hpfiltord = 4; > > cfg.bpfiltord = 4; > > cfg.lpfilttype = 'but'; > > cfg.hpfilttype = 'but'; > > ecog = ft_preprocessing(cfg,data); > > > When I run the script. I am getting the following error. > > Error in ft_trialfun_general (line 78) > hdr = ft_read_header(cfg.headerfile, 'headerformat', > cfg.headerformat); > > Do I need to set the header structure as well? Can somebody help me to get > this fixed. I am reading the documentation but it seems start is bit hard! > > Appreciate your support > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151220/7c7feda3/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Mon Dec 21 12:39:56 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Mon, 21 Dec 2015 11:39:56 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 2 > Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I > got a different result at first. > But now I see thecfg2.trialdef.triallength = 1;? > there is no difference in the way data is loaded once I change the number > to let's say 5! Where should I see that difference??Thanks again.Kind > regards > ?__________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Saturday, December 19, 2015 2:06 PM > Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > I'm not sure why it didn't work for you. I tried the following code (on a > sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and > it worked perfectly for me: > > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 500 0]; > cfg.continuous = 'yes'; > data_500samples = ft_preprocessing(cfg); > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 1000 0]; > cfg.continuous = 'yes'; > data_1000samples = ft_preprocessing(cfg); > > > > Here's the output: > >> data_500samples > > data_500samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x500 double]} > ???????? trial: {[37x500 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 500] > ?????????? cfg: [1x1 struct] > > >> data_1000samples > > data_1000samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x1000 double]} > ???????? trial: {[37x1000 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 1000] > ?????????? cfg: [1x1 struct] > > > Best, > Steve > > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/? > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Friday, December 18, 2015 12:37 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Mon Dec 21 13:04:36 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 12:04:36 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <1581782628.1312312.1450699476132.JavaMail.yahoo@mail.yahoo.com>  You are absolutely right. It is either using the fix cfg.trl to choose the begining and end of the samples or to choose the cfg2.trialdef.triallength =5. In your initial code you had them together, and that is why I was confused. So basically there are two ways to segment the file. Thanks you very much. You have been very helpful. My questions are endless. I have another one for you! Sorry! When loading edf+ the events are lost. using cfg2.trialdef.eventtype  = '?' gives me no events detected. Any idea how I could go about it? Thanks again for your help. I really appreciate it.Best regards __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Monday, December 21, 2015 11:39 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/   Message: 2 Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;? there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference??Thanks again.Kind regards ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Saturday, December 19, 2015 2:06 PM  Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x500 double]} ???????? trial: {[37x500 double]} ?????? fsample: 200 ??? sampleinfo: [1 500] ?????????? cfg: [1x1 struct] >> data_1000samples data_1000samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x1000 double]} ???????? trial: {[37x1000 double]} ?????? fsample: 200 ??? sampleinfo: [1 1000] ?????????? cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/? ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian ? ? ? From: Stephen Politzer-Ahles ?To: fieldtrip at science.ru.nl ?Sent: Friday, December 18, 2015 12:37 PM ?Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------   _______________________________________________ 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 leilayou_54 at yahoo.com Mon Dec 21 13:59:38 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 12:59:38 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <916358647.1306232.1450702778200.JavaMail.yahoo@mail.yahoo.com> Dear Steve,I have shared my data file in drop box with you. I am trying to read the events in this file and I get 0 events. cfg2.trialdef.eventtype  = '?' Could you please help me out? Thanks __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Monday, December 21, 2015 11:39 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/   Message: 2 Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;? there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference??Thanks again.Kind regards ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Saturday, December 19, 2015 2:06 PM  Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x500 double]} ???????? trial: {[37x500 double]} ?????? fsample: 200 ??? sampleinfo: [1 500] ?????????? cfg: [1x1 struct] >> data_1000samples data_1000samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x1000 double]} ???????? trial: {[37x1000 double]} ?????? fsample: 200 ??? sampleinfo: [1 1000] ?????????? cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/? ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian ? ? ? From: Stephen Politzer-Ahles ?To: fieldtrip at science.ru.nl ?Sent: Friday, December 18, 2015 12:37 PM ?Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------   _______________________________________________ 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 leilayou_54 at yahoo.com Mon Dec 21 16:49:12 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 15:49:12 +0000 (UTC) Subject: [FieldTrip] EDF+ annotations References: <782532884.1387709.1450712952642.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <782532884.1387709.1450712952642.JavaMail.yahoo@mail.yahoo.com> Hi all,I am new to fieldtrip .I am trying to load some edf+ file to Matlab and read the events/annotations. These annotations are usually seizure, or spikes.... The files are EEG data from nicollet one, lengthy data for epileptic patients. This is how I try to look at the events: cfg2 = []; cfg2.dataset = 'For leila.edf'; cfg2.trialdef.eventtype  = '?' cfg2 = ft_definetrial( cfg2 ); cfg2.continuous = 'yes'; data2 = ft_preprocessing(cfg2); However the output for events are always empty.Does anyone have an idea how I could extract the events/annotation on these files? Thanks in advance for your assistance. Best regards __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London -------------- next part -------------- An HTML attachment was scrubbed... URL: From weston.pack at yale.edu Mon Dec 21 18:56:11 2015 From: weston.pack at yale.edu (Pack, Weston) Date: Mon, 21 Dec 2015 17:56:11 +0000 Subject: [FieldTrip] How to implement the .pl2 patch for Plexon data Message-ID: <46289A1970E74F4888AA0D7E75AAB1E6210097A4@x10-mbx13.yu.yale.edu> Greetings FieldTrip community, I am new to using FieldTrip, but am well versed in Matlab. I would like to use FieldTrip to analyze Plexon data from LFP recordings and am working with the .pl2 format. I have read through the current documentation (very short) about the patch for loading .pl2 files, but I still have no idea how to install and use the patch as this is not documented (that I can find). The following is provided but with no explanation of how to implement it: “ (filetype = plexon_plx_v2) “ I have added the path of the Plexon SDK folder using: “ addpath ('E:\MatlabOfflineFilesSDK')” I have download the .diff patch file as well as the .zip folder “ft_plexon” but I don’t know where to put them. Does the “plexon” folder inside go in the main FieldTrip directory, the main Plexon SDK directory (currently listed above), or somewhere else? The same question applies to the .diff file. Thank you in advance for your assistance. Once I get FieldTrip figured out, I intend to create a thorough, novice-friendly tutorial with step-by-step instructions how to work with .pl2 files for LFP analysis. I’ve spent the better part a week fumbling through the tutorials and I’m certain I can write a novice-friendly tutorial on the wiki that will only take a few hours at most for beginners to master. My goal is first to understand how to utilize FieldTrip, at which point I can document my struggles and successes so that future users (especially my lab-mates) can obtain competency with far more efficiency. Thanks again in advance. I hope to contribute significantly to the community. Happy Holidays! Weston Pack, PhD -------------- next part -------------- An HTML attachment was scrubbed... URL: From jochem.rieger at uni-oldenburg.de Mon Dec 21 20:00:15 2015 From: jochem.rieger at uni-oldenburg.de (Jochem Rieger) Date: Mon, 21 Dec 2015 20:00:15 +0100 Subject: [FieldTrip] Job vacancies: MEG-physicist/engineer and MRI-physicist/engineer at Oldenburg University, Germany Message-ID: <56784C3F.4050501@uni-oldenburg.de> The newly founded Neuroimaging Center at the University of Oldenburg, Germany, offers the following two positions *1. MEG-Physicist/Engineer (E13/TV-L, initially 3 years) * * * *2. MRI-Physicist/Engineer (E13/TV-L, initially 3 years)* The positions are suitable for part-time work. The Neuroimaging Center hosts a state of the art magnetoencephalograph (ElektaTriux) and a magnetic resonance tomograph (Siemens Prisma 3T) and is embedded in an excellent interdisciplinary scientific environment with a strong research focus on neurosensory, neurocognitive, and medical research. We seek for highly motivated post-doctoral candidates (with PhD) with an academic university degree in physics, engineering or related fields, with documented research experience in magnetoencephalography (position 1) or magnetic resonance imaging (position 2). For both positions, fluency in English is necessary. German and experience in the design of neurocognitive experiments are desirable. Successful candidates will be responsible for the operation and administration of the MEG-system and MRI-system respectively, their infrastructure, the development and improvement of measurement and analyses techniques and user consultancy. The University of Oldenburg is rapidly growing and offers a vibrant scientific environment with strong foci on cognitive and sensory neuroscience and a new medical school. The European Medical School is a cooperation project between the Universities of Oldenburg and Groningen and three local hospitals. Oldenburg is an attractive city in Germany's northwest with excellent quality of life. It is close to Bremen, Hamburg, Groningen, and approx. 1 h from the north sea. The University of Oldenburg is dedicated to increasing the percentage of women in science. Therefore, female candidates are particularly encouraged to apply and will be given preference in cases of equal qualification. Handicapped applicants will be given preference if equally qualified. Electronic applications (one pdf file) are preferred and can be send to: Professor Dr. JochemRieger: Jochem.rieger at uni-oldenburg.de Applications by mail should be sent to Prof. Jochem Rieger Universität Oldenburg Kuepkersweg 74 (W30) 26129 Oldenburg Germany The application process is open until January 31st 2016. Applications should include your CV, a list of most recent publications, and a statement (max. 3 pages). -------------- next part -------------- An HTML attachment was scrubbed... URL: From plyons at udel.edu Mon Dec 21 20:39:59 2015 From: plyons at udel.edu (Peter Lyons) Date: Mon, 21 Dec 2015 14:39:59 -0500 Subject: [FieldTrip] Clarification on plotting WPLI Message-ID: Hello Everyone, I have a question regarding the interpretation of negative values in the debiased wPLI. Although the reference page on the debiased wPLI notes that estimates are computed by squaring the wPLI values, I and others have noticed that some of the values in the debiased wPLI spectrum are negative. How should these negative values be interpreted in reference to 0? To view the results of the debiased wPLI connectivity analysis (ft_connectivity analysis with cfg.method = 'wpli_debiased'), I've been using the ft_topoplotER function. However, I'm concerned that the default scaling (zlim = 'maxmin') of the plot does not seem to register the negative values in the debiased wPLI spectrum. That is, the negative values are not being plotted. It is curious, however, that the ft_topoplotER does register the negative values in the *non-debiased *wPLI spectrum. Is there a reason why the ft_topoplotER function is treating the negative values from the debiased vs. non-debiased wPLI spectrums differently? Is there perhaps a more appropriate plotting function I should be using to view the debiased wPLI output? I would greatly appreciate any guidance in this. Thank you! Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From shlomitbeker at gmail.com Tue Dec 22 07:42:31 2015 From: shlomitbeker at gmail.com (Shlomit Beker) Date: Tue, 22 Dec 2015 06:42:31 +0000 Subject: [FieldTrip] Please remove me from mailing list Message-ID: <7fa9847a19964083a25ceb552d18577f@EXPRD01.hosting.ru.nl> -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Tue Dec 22 18:48:01 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Tue, 22 Dec 2015 12:48:01 -0500 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, According to the warning messages that pop up, the annotation channel is not being read because it is at a different sampling rate than the data. >From what I can tell, this appears to be a common problem. http://www.fieldtriptoolbox.org/getting_started/edf explains a workaround; have you tried this? Alternatively, you could consider trying some other toolboxes---I believe mne-python is capable of handling this issue with EDF triggers straightforwardly, or you could use one of the softwares that is specifically made for EDF (such as EDFViewer or EDFBrowser) to export your annotations into a format that is more easily readable and then use that to create your cfg.trl structure for Fieldtrip. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 4 > Date: Mon, 21 Dec 2015 12:59:38 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <916358647.1306232.1450702778200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear Steve,I have shared my data file in drop box with you. > I am trying to read the events in this file and I get 0 events. > cfg2.trialdef.eventtype? = '?' > Could you please help me out? > Thanks?__________________________________________________ Leila Ayoubian, > PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Monday, December 21, 2015 11:39 AM > Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not > needed if all you want to do is read a single segment of continuous data > based on predetermined latencies; you may notice that, in the sample code > snippets I sent in my last message, I did not use this function at all, I > just hard-coded the latency range in cfg.trl (and then passed this cfg > structure to ft_preprocessing() ). So, if this is all you need to do, there > is no need to worry about these additional parameters. > > If you are trying to read multiple segments of data as separate epochs > into one dataset (which is what you would accomplish by using > cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why > it's not working for you at the moment; I would have to see your code to be > able to diagnose what might be going on. > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > ? > > Message: 2 > Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I > got a different result at first. > But now I see thecfg2.trialdef.triallength = 1;? > there is no difference in the way data is loaded once I change the number > to let's say 5! Where should I see that difference??Thanks again.Kind > regards > ?__________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Saturday, December 19, 2015 2:06 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > I'm not sure why it didn't work for you. I tried the following code (on a > sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and > it worked perfectly for me: > > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 500 0]; > cfg.continuous = 'yes'; > data_500samples = ft_preprocessing(cfg); > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 1000 0]; > cfg.continuous = 'yes'; > data_1000samples = ft_preprocessing(cfg); > > > > Here's the output: > >> data_500samples > > data_500samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x500 double]} > ???????? trial: {[37x500 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 500] > ?????????? cfg: [1x1 struct] > > >> data_1000samples > > data_1000samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x1000 double]} > ???????? trial: {[37x1000 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 1000] > ?????????? cfg: [1x1 struct] > > > Best, > Steve > > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/? > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Friday, December 18, 2015 12:37 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > > > > > ? > _______________________________________________ > 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/20151221/7403e94b/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Mon, 21 Dec 2015 15:49:12 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] EDF+ annotations > Message-ID: > <782532884.1387709.1450712952642.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi all,I am new to fieldtrip .I am trying to load some edf+ file to Matlab > and read the events/annotations. These annotations are usually seizure, or > spikes.... > The files are EEG data from nicollet one, lengthy data for epileptic > patients. > This is how I try to look at the events: > > cfg2 = []; > > cfg2.dataset = 'For leila.edf'; > cfg2.trialdef.eventtype? = '?' > cfg2 = ft_definetrial( cfg2 ); > > > cfg2.continuous = 'yes'; > data2 = ft_preprocessing(cfg2); > However the output for events are always empty.Does anyone have an idea > how I could extract the events/annotation on these files? > > Thanks in advance for your assistance. > Best regards > __________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151221/7d290354/attachment-0001.html > > > > ------------------------------ > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fanshine at yeah.net Wed Dec 23 09:55:28 2015 From: fanshine at yeah.net (Hanson) Date: Wed, 23 Dec 2015 16:55:28 +0800 (CST) Subject: [FieldTrip] Make a custom layout Message-ID: <7af7ec0c.1eaf.151ce0cdf79.Coremail.fanshine@yeah.net> Dear all, I am new to FieldTrip and trying to do the time-frequency analysis of my eeg data , however it seems that no suitable layout. And I use ft_prepare_layout function to make a custom layout(electrode_position32.mat). %% Time-frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:2:30; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.toi = -0.5:0.05:1.5; TFRhann = ft_freqanalysis(cfg, data); cfg = []; cfg.showlabels = 'yes'; cfg.layout = 'electrode_position32.mat'; figure ft_multiplotTFR(cfg, TFRhann); cfg = []; cfg.channel = 'C4'; figure ft_singleplotTFR(cfg, TFRhann); cfg = []; cfg.layout = 'electrode_position32.mat'; figure ft_topoplotTFR(cfg, TFRhann); When I run the script. I am getting the following error. Warning: (one of the) axis is/are not evenly spaced, but plots are made as if axis are linear > In ft_multiplotTFR at 405 In TFanalysis_zhs_2 at 52 the call to "ft_multiplotTFR" took 0 seconds the call to "ft_singleplotTFR" took 0 seconds reading layout from file electrode_position32.mat the call to "ft_prepare_layout" took 0 seconds Warning: Some points fall outside the outline, please consider using another layout > In ft_plot_topo at 171 In fieldtrip\private\topoplot_common at 731 In ft_topoplotTFR at 192 In TFanalysis_zhs_2 at 62 Index exceeds matrix dimensions. Error in ft_plot_topo (line 182) mask{i}(end+1, :) = mask{i}(1, :); % force them to be closed Error in topoplot_common (line 731) ft_plot_topo(chanX,chanY,datavector,opt{:}); Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in TFanalysis_zhs_2 (line 62) ft_topoplotTFR(cfg, TFRhann); Do you have any suggestion about it? Thank you very much for your attention. Kind Regards, Hanson -------------- next part -------------- An HTML attachment was scrubbed... URL: From daria.laptinskaya at googlemail.com Tue Dec 1 09:58:46 2015 From: daria.laptinskaya at googlemail.com (Daria Laptinskaya) Date: Tue, 1 Dec 2015 09:58:46 +0100 Subject: [FieldTrip] SCD and coherence analysis In-Reply-To: <52d6-565c1c80-25-55c3b400@102538225> References: <52d6-565c1c80-25-55c3b400@102538225> Message-ID: Hi Barbara, try this: sens=ft_read_sens('GSN-HydroCel-257.sfp'); cfg=[]; cfg.elec=sens; Hope it helps :-) Daria 2015-11-30 10:52 GMT+01:00 Barbara Schorr : > Dear Fieltripers, > > I would like to do coherence analysis. I did a SCD analysis on my data > first ('finite' method), and want to run ft_mvaranalysis now. I get > the error > > Error using ft_datatype_sens (line 186) > inconsistent number of channels in sensor description > > As cfg.elec I use the GSN-HydroCel-257.sfp file which is included in > fieldtrip (my raw data set has 257 channels), but there are only 256 > channels left after the SCD analysis. Can this cause the problem? > > Has anyone had this problem before and can provide a solution? I only > found one prior entry with this topic, but there was no final solution for > it. > > > Thanks and all the best, > Barbara > > > _______________________________________________ > 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 barbara.schorr at uni-ulm.de Tue Dec 1 15:18:31 2015 From: barbara.schorr at uni-ulm.de (Barbara Schorr) Date: Tue, 01 Dec 2015 15:18:31 +0100 Subject: [FieldTrip] =?utf-8?q?SCD_and_coherence_analysis?= In-Reply-To: Message-ID: <38ba-565dac00-3-4dd4ed00@147935417> Dear Daria, I did exactly this. The problem occurs afterwards, when I want to run ft_mvaranalysis on the data that result from ft_scalpcurrentdensity. In the fieldtrip document it states, that the output data of ft_scalpcurrentdensity has the same format as the input data. When I run ft_mvaranalysis on the original data, everything works fine, but with the SCD data I get this error that the number of channels in sensor description is inconsistent. Has anyone else experienced this problem? Best, Barbara Am Dienstag, 01. Dezember 2015 12:00 CET, fieldtrip-request at science.ru.nl schrieb: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: power suppression during DICS beamforming ? > (Mait? Crespo Garc?a) > 2. Re: SCD and coherence analysis (Daria Laptinskaya) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 30 Nov 2015 15:31:20 +0000 (UTC) > From: Mait? Crespo Garc?a > To: FieldTrip discussion list > Subject: Re: [FieldTrip] power suppression during DICS beamforming ? > Message-ID: > <1881724873.21184223.1448897480847.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fr?d?ri, > maybe you have the solution already. > In case not, could you explain how did you get the last two plots? Are spectra computed after averaging across all virtual channel spectra or you are representing the spectrum of the source with maximal power? > Best,Maite > > > > El Jueves 26 de noviembre de 2015 13:55, Fr?d?ric Roux escribi?: > > > Dear all, > > I am observing a counter-intuitive result after applying the spatial filters obtained from DICS beamforming to my MEG data. > > The plot in the attachment summarizes the issue: The raw data shows a clear peak of activity at 10 Hz, however, after applying the spatial filter to the MEG data the spectrum of the virtual channels shows that power in this frequency band is reduced. The same also happens when I apply a spatial filter in the gamma range for power at 70 Hz to the raw MEG signals. > > Is this something that falls out of the beamformer math due to the fact how the algorithm suppresses power at all locations by minimizing the noise level, or is there something wrong with my code? I (maybe naively) assumed that the results should come out the opposite. On the other hand, when plotting the noise normalized maps (NAI) of both the alpha and gamma beamformers the sources look quite accurate. Should I normalize with the level of noise first before plotting the spectrum to see the expected results (ie an upregulation of power instead of a downregulation of power)? > > The code that I use to generate the figures is: > > % 1) compute CSD matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.foilim = [10 10]; > cfg.tapsmofrq = 2; > cfg.pad = 'maxperlen'; > cfg.taper = 'dpss'; > > [csd] = ft_freqanalysis(cfg,meg_data); > > > % 2) compute DICS filter > cfg = []; > cfg.method = 'dics'; > cfg.grad = meg_data.grad; > cfg.headmodel = vol; > cfg.frequency = csd.freq; > > cfg.dics.realfiter = 'yes'; > cfg.dics.fixedori = 'yes'; > > [alpha_filter]= ft_sourceanalysis(cfg,csd); > > % 3) compute the virtual channel data > > VC = meg_data; > VC.trial = cell(1,length(meg_data.trial)); > VC.label = cell(1,length(alpha_filter.avg.pow)); > > for i = 1:length(VC.trial) > ? for j = 1:length(VC.label) > > ? ? ? VC.trial{i}(j,:) = alpha_filter{j}*meg_data.trial{i}; > ? ? ? VC.label(j) = {['virtual_channel',num2str(j)]}; > ? end; > end; > > % 4) compute the spectrum of the virtual channel data > cfg = []; > cfg.method = 'mtmfft'; > cfg.pad = 'maxperlen'; > cfg.taper = 'dpss'; > cfg.tapsmofrq = 1; > cfg.foi = 0.1:100; > > [pow] = ft_freqanalysis(cfg,VC); > > > Any help or suggestions would be greatly appreciated. > > Fred > > -- > Fr?d?ric Roux > Postdoctoral Scientist, Marie-Curie fellow > BCBL. Basque Center on Cognition, Brain & Language. > > f.roux at bcbl.eu > Tel: +34 943 309 300 Ext 211 > Fax: +34 943 309 052 > > Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer > --------------------------------------------------------------------------- > > ?The probability of success is difficult to estimate; but if we never search the chance of success is zero.? > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Tue, 1 Dec 2015 09:58:46 +0100 > From: Daria Laptinskaya > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SCD and coherence analysis > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Barbara, > > try this: > sens=ft_read_sens('GSN-HydroCel-257.sfp'); > cfg=[]; > cfg.elec=sens; > > Hope it helps :-) > Daria > > > > > > > 2015-11-30 10:52 GMT+01:00 Barbara Schorr : > > > Dear Fieltripers, > > > > I would like to do coherence analysis. I did a SCD analysis on my data > > first ('finite' method), and want to run ft_mvaranalysis now. I get > > the error > > > > Error using ft_datatype_sens (line 186) > > inconsistent number of channels in sensor description > > > > As cfg.elec I use the GSN-HydroCel-257.sfp file which is included in > > fieldtrip (my raw data set has 257 channels), but there are only 256 > > channels left after the SCD analysis. Can this cause the problem? > > > > Has anyone had this problem before and can provide a solution? I only > > found one prior entry with this topic, but there was no final solution for > > it. > > > > > > Thanks and all the best, > > Barbara > > > > > > _______________________________________________ > > 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 61, Issue 1 > **************************************** From eriksenj at ohsu.edu Wed Dec 2 03:04:56 2015 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 2 Dec 2015 02:04:56 +0000 Subject: [FieldTrip] accommodating air pockets in FEM head model Message-ID: Hi, I am reading the FieldTrip documentation on creating an FEM model and see that the following tissue types are output from the segmentation process: Gray White Csf Skull Scalp Q1: Since I am using a 256 channel EGI system with electrodes over the lower part of the head and face, I absolutely need to be able to include air voxels as well. Anyone have any knowledge of such a possibility? Q2: Beyond that I would also like to include other tissue types such as fat, muscle, and eyeball (vitrious). I suppose I could find other segmentation software to simply create a more varied segmentation and insert it in the processing pipeline, but would like to know if that would mess anything up. Q3: Next, can the FEM handle anisotropic conductivities for white matter and skull? Q4: has anyone out there actually used the FDM model? Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From carsten.wolters at uni-muenster.de Wed Dec 2 08:53:17 2015 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 2 Dec 2015 08:53:17 +0100 Subject: [FieldTrip] accommodating air pockets in FEM head model In-Reply-To: References: Message-ID: <565EA36D.5030005@uni-muenster.de> Hi Jeff, Q3: yes, FEM can model anisotropy and white matter is anisotropic, but skull is a three-layered-structure consisting of spongiosa and compacta, see http://www.ncbi.nlm.nih.gov/pubmed/20690140 For Q4: FEM allows geometry-adaptation, see http://www.ncbi.nlm.nih.gov/pubmed/17694865 As far as I know, modeling using irregular meshes might get difficult to implement within an FDM framework. For Q1 and Q2: Mainly tissues between sources and electrodes are important to be modeled (so white matter anisotropy is only important for deeper sources) and FSL and freesurfer can do a good job on segmentation. Air-compartments can possibly best be modeled by hand-correction of the FSL output. Please see http://www.ncbi.nlm.nih.gov/pubmed/24671208 on how we solve forward modeling to be able to combine EEG and MEG. More infos are available in the two following theses: http://www.sci.utah.edu/~wolters/PaperWolters/2014/Lanfer_Dissertation_July2-2014.pdf http://www.sci.utah.edu/~wolters/PaperWolters/2015/Umit_Aydin_Dissertation_2015.pdf Best regards Carsten Am 02.12.2015 um 03:04 schrieb K Jeffrey Eriksen: > > Hi, > > I am reading the FieldTrip documentation on creating an FEM model and > see that the following tissue types are output from the segmentation > process: > > Gray > > White > > Csf > > Skull > > Scalp > > Q1: Since I am using a 256 channel EGI system with electrodes over the > lower part of the head and face, I absolutely need to be able to > include air voxels as well. Anyone have any knowledge of such a > possibility? > > Q2: Beyond that I would also like to include other tissue types such > as fat, muscle, and eyeball (vitrious). I suppose I could find other > segmentation software to simply create a more varied segmentation and > insert it in the processing pipeline, but would like to know if that > would mess anything up. > > Q3: Next, can the FEM handle anisotropic conductivities for white > matter and skull? > > Q4: has anyone out there actually used the FDM model? > > Thanks, > > -Jeff Eriksen > > > > _______________________________________________ > 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: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Wed Dec 2 14:55:57 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Wed, 2 Dec 2015 13:55:57 +0000 Subject: [FieldTrip] Head segmentation Message-ID: Jeff The resources from Carsten Wolters and the answers were right on. We have a 128 channel system. We add “nasal cavity” which includes nasal, throat, and sinuses in our FEM model. We do a lot of the segmenting with FSL (bet, fast, betsur, SPMf) and custom programs, and then do manual editing to identify the air passages. The separate segments are then put together with a custom program. The air cavities might be important for the 256-channel EGI system, where on the sides and front of the face the electrodes could have some dipolar sources and the places in between would affect the source estimation. Anything below the skull, not air cavity, we give a conductivity of muscle, which is very close to scalp; again the electrodes below the skull are over something and I presume would need a realistic estimated head media and conductivity. As I wrote earlier, we have been using FT for FEM recently; also have gotten good (similar to FEM) results with the Dipoli BEM model. I have one already-published supplemental information that briefly describes our FEM model, and one in-press supplemental information, both articles using the EMSE program. I am working on our first publication using the FEM from FT. Re “Mainly tissues between sources and electrodes are important to be modeled (so white matter anisotropy is only important for deeper sources)”. This may be practically correct, but I have suspected (and EGI’s rationale for whole-head coverage) that to get a good measure of a dipolar source whose positive or negative pole land somewhere below the skull area, one needs a good model of the head over all the places where the current flow is manifested. We have some prefrontal sources with large negative potentials exhibiting on the frontal-central 10-10 electrodes, and which have a large positive scalp potential on the “Oz” electrodes. However, it turns out these potentials show up on Iz and in the EGI electrodes below Iz (128 channel), so having a model for scalp and muscle over the neck might be important. I don’t know what the effect is of leaving these out, but I have preferred to do the whole head segmentation in case these have some effect. One last consideration. Most BEM and FEM models on the FT site use the segmentation of the brain, skull, and scalp about at the level of the MNI head. This does not include the electrodes below the horizon of the MNI head, and there is a lot of area below the MNI head that is covered by the EGI 128 and 256 channel systems. This adds significantly to the volume of the voxels used for the FEM estimation. For BEM models we cut the head off at about 10% below the level of the lowest EGI 128 channel electrodes, and generally have done so also for the FEM models we use in FT. The electrodes are located on the places below the MNI head, so one has to have a “head” model with positions below those typically used in the FT’s demo programs. We do a whole head MRI down to the neck, and then use a custom program to get a MRI volume with a head that extends about 10% lower than the lowest EGI-128 electrodes. John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.tadel at mcgill.ca Wed Dec 2 22:03:33 2015 From: francois.tadel at mcgill.ca (=?UTF-8?Q?Fran=c3=a7ois_Tadel?=) Date: Wed, 2 Dec 2015 16:03:33 -0500 Subject: [FieldTrip] Error in ft_dipolefitting.m ? Message-ID: <565F5CA5.9080409@mcgill.ca> Hello, When fitting single dipoles on multiple time points at once, I have an error line 578: source.dip.unit = headmodel.unit; The syntax is incorrect that source.dip is an array with multiple dipoles. Should this be replaced with the following line ? [source.dip.unit] = deal(headmodel.unit); Cheers, Francois From erin.white at sickkids.ca Wed Dec 2 22:55:40 2015 From: erin.white at sickkids.ca (Erin White) Date: Wed, 2 Dec 2015 21:55:40 +0000 Subject: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images In-Reply-To: References: Message-ID: <0D4EE8880DEE3047BEC905C0EC463F8C2769EBD7@SKMBXX03.sickkids.ca> Hi Steve, Thanks so much for your helpful comment! I'll give this a try! All the best Erin ---------------------------------------------------- Erin White, PhD Post-Doctoral Research Fellow Neurosciences and Mental Health The Hospital for Sick Children 555 University Avenue Toronto, Ontario Canada Telephone: (647)834-7813 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Stephen Politzer-Ahles [stephen.politzer-ahles at ling-phil.ox.ac.uk] Sent: November 27, 2015 7:28 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images Hi Erin, I don't use the multiplot functions much, so my solution is clunky and there may be others on the list with a better way to do this. But just in case, here's how I do it: Rather than using multiplot, I make each plot individually, and use the subplot() command to arrange multiple plots into a figure. Within each subplot, I just use some custom code to draw the ticks. For example: tickspots = [-200:200:1000]; % one tick every 200 ms, from -200 to 1000 ms tickheight = [-.5 .5]; % how high and low the ticks will go for tickspots = tickspot % iterate through tick spots plot( [tickspot tickspot], tickheight, 'k' ); % plot each tick as a black line end; Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ ------------------------------ Message: 2 Date: Thu, 26 Nov 2015 12:48:25 +0000 From: Erin White > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images Message-ID: <0D4EE8880DEE3047BEC905C0EC463F8C2769D79D at SKMBXX03.sickkids.ca> Content-Type: text/plain; charset="iso-8859-1" Hi, I'm new at programming and was wondering if someone could help with something that I'm sure is simple. I'd like to add tick marks to my multiplotER and multiplotTFR figures so that the timing and amplitude (for multiplotER) and timing and frequency (for multiplotTFR) scales are presented clearly. For example, I'd like a tick mark on my X axes every 200 ms, and on the y axes, every 2 mV for ER images and every 5 Hz for TFR images. Could anyone suggest what I should add to my code to show this? Thanks very much! Erin ---------------------------------------------------- Erin White, PhD Post-Doctoral Research Fellow Neurosciences and Mental Health The Hospital for Sick Children 555 University Avenue Toronto, Ontario Canada Telephone: (647)834-7813 ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- 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 60, Issue 23 ***************************************** ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.babaeeghazvini at vu.nl Fri Dec 4 20:14:26 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Fri, 4 Dec 2015 19:14:26 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronny.ibrahim at mq.edu.au Mon Dec 7 05:36:14 2015 From: ronny.ibrahim at mq.edu.au (Ronny Ibrahim) Date: Mon, 7 Dec 2015 15:36:14 +1100 Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data Message-ID: Dear fellow fieldtrip users, I would like to implement a clusterstatistics independentT test on a time-frequency datasets that I've acquired using the ft_freqanalysis function. When I run ft_freqstatistics on the data it would give me stats result which is based on comparing the absolute values of power spectrum instead the relative change with respect to the baseline. I have tried to perform to do my relative change power spectrum data manually but it seems that when I run the ft_freqstatistics it produces an error of which I could not figure out on why. Here is my code: C_1 = {outP10{1} outP10{2} outP10{3} outP10{4} outP10{5} outP10{6} outP10{7} outP10{8} outP10{9} outP10{10} outP10{11} outP10{12} outP10{13} outP10{14} outP10{15} outP10{16} outP10{17} outP10{18}}; C_2 = {outM10{1} outM10{2} outM10{3} outM10{4} outM10{5} outM10{6} outM10{7} outM10{8} outM10{9} outM10{10} outM10{11} outM10{12} outM10{13} outM10{14} outM10{15} outM10{16} outM10{17} outM10{18}}; %% Performing cluster statistics for the paradigm cfg = []; cfg.layout = 'EEG_KR.lay'; lay = ft_prepare_layout(cfg); % Needs to change this cfg.latency = [0 0.6]; %Need to look this up according to what cfg.frequency = [8 12];% Need to do it for different frequency bands (theta, alpha, beta, gamma). cfg.channel = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'ft_statfun_indepsamplesT'; cfg.numrandomization = 1000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 3; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg_neighb.layout = lay; cfg_neighb.method = 'triangulation'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb); cfg.ivar = 1; cfg.design = [ones(1,18) 2*ones(1,18)]; stat = ft_freqstatistics(cfg, C_2{:}, C_1{:}); %% Plotting significant clusters cfg = []; cfg.alpha = 0.05; cfg.parameter = 'stat'; cfg.layout = lay; ft_clusterplot(cfg, stat); where the variable out is essentially my time-frequency data output structure. I would greatly appreciate the input and assistance. Thank you. Kind Regards, Ronny -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at donders.ru.nl Mon Dec 7 09:24:32 2015 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 7 Dec 2015 08:24:32 +0000 Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data In-Reply-To: References: Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB279C7AFB@exprd01.hosting.ru.nl> Dear Ronny, What error do you get when running this code? You can perform a (relative) baseline correction using ft_freqbaseline with cfg.baselinetype = ‘relative’ or ‘relchange’ and cfg.baseline = [your baseline window];. If your code works on absolute values it should also work on baseline-corrected values using ft_freqbaseline. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ronny Ibrahim Sent: maandag 7 december 2015 5:36 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data Dear fellow fieldtrip users, I would like to implement a clusterstatistics independentT test on a time-frequency datasets that I've acquired using the ft_freqanalysis function. When I run ft_freqstatistics on the data it would give me stats result which is based on comparing the absolute values of power spectrum instead the relative change with respect to the baseline. I have tried to perform to do my relative change power spectrum data manually but it seems that when I run the ft_freqstatistics it produces an error of which I could not figure out on why. Here is my code: C_1 = {outP10{1} outP10{2} outP10{3} outP10{4} outP10{5} outP10{6} outP10{7} outP10{8} outP10{9} outP10{10} outP10{11} outP10{12} outP10{13} outP10{14} outP10{15} outP10{16} outP10{17} outP10{18}}; C_2 = {outM10{1} outM10{2} outM10{3} outM10{4} outM10{5} outM10{6} outM10{7} outM10{8} outM10{9} outM10{10} outM10{11} outM10{12} outM10{13} outM10{14} outM10{15} outM10{16} outM10{17} outM10{18}}; %% Performing cluster statistics for the paradigm cfg = []; cfg.layout = 'EEG_KR.lay'; lay = ft_prepare_layout(cfg); % Needs to change this cfg.latency = [0 0.6]; %Need to look this up according to what cfg.frequency = [8 12];% Need to do it for different frequency bands (theta, alpha, beta, gamma). cfg.channel = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'ft_statfun_indepsamplesT'; cfg.numrandomization = 1000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 3; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg_neighb.layout = lay; cfg_neighb.method = 'triangulation'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb); cfg.ivar = 1; cfg.design = [ones(1,18) 2*ones(1,18)]; stat = ft_freqstatistics(cfg, C_2{:}, C_1{:}); %% Plotting significant clusters cfg = []; cfg.alpha = 0.05; cfg.parameter = 'stat'; cfg.layout = lay; ft_clusterplot(cfg, stat); where the variable out is essentially my time-frequency data output structure. I would greatly appreciate the input and assistance. Thank you. Kind Regards, Ronny -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Dec 7 09:30:25 2015 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 7 Dec 2015 09:30:25 +0100 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> Message-ID: <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: > Hello > > I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = hdm; > cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); > cfg.grid.inside = 1:size(cfg.grid.pos, 1); > cfg.grid.outside = []; > cfg.keepfilter = 'yes'; > source_idx = ft_sourceanalysis(cfg, tlock); > Not from the voxel indicating maximum power ([maxval, > maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos > = sourcemodel.pos([maxcohindx maxpowindx], :)). > > Regards, > Parinaz. > _______________________________________________ > 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: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From p.babaeeghazvini at vu.nl Mon Dec 7 12:52:55 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Mon, 7 Dec 2015 11:52:55 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> Hi Julian, Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: cfg = [] cfg.atlas = atlas; cfg.roi = atlas.tissuelabel(1) cfg.inputcoord = 'mni'; mas = ft_volumelookup(cfg,grid); cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.xgrid = cfg.grid.ygrid = cfg.grid.zgrid = cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. an other question that I have is that: when I compute the maximum index from [maxvalr, maxpowindxr] = max(srcetask.avg.pow) How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) Regards, Parinaz. From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 9:30 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. _______________________________________________ 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 Mon Dec 7 17:57:10 2015 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 7 Dec 2015 17:57:10 +0100 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> Message-ID: Hi Parinaz, > My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. You don't. You compute your virtual channels for a regular grid (something like -20:1:20 for x,y and z) and select the virtual channels in your ROI in a second step. This might be a bit of an overkill, as you don't use most of your channels later on, but maybe you want to extend your analysis to other cortical areas - you never know. Anyways, to be more clear: You compute your virtual electrodes on a predefined grid. To find your ROI, you use ft_volumelookup to get a binary matrix which tells you, which voxels of the standard MRI are in your ROI. Then you build a high-resolution grid based on the standard MRI (It's important to use one grid point per voxel). Using pythagoras, you can now find the closest high-resolution grid points for each of your virtual electrodes. As soon as you have these, you can see which of them have a value of 1 in your binary matrix of ft_volumelookup. Now you know which virtual electrodes are inside your ROI. So for example, you have 2000 virtual electrodes on a -20:1:20 regular grid. You then compute a binary matrix and a high-resolution grid based on the standard MRI resulting in ~900000 grid points on a 91x109x91 grid. Using pythagoras, you find that grid point 6000 is closest to virtual electrode #1. Then you can see if element 6000 from your binary matrix is a 1. If so, your virtual electrode #1 is in your ROI, if not, your virtual electrode is not in your ROI. > How I can find the atlas position to this maximum point in my code Do you want to have the coordinates or the actual label? A while ago, I hacked the ft_sourceplot-function to give me the coordinate position as an output, but I can't find the code anymore. I'm sure you can edit the function to also output the label, as this has to be included as a text element somewhere in the function. But please be aware that editing the FT-functions can severely compromise the functionality. Good luck, Julian Am 07.12.2015 um 12:52 schrieb Babaeeghazvini, P.: > Hi Julian, > > Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: > > cfg = [] > > cfg.atlas = atlas; > > cfg.roi = atlas.tissuelabel(1) > > cfg.inputcoord = 'mni'; > > mas = ft_volumelookup(cfg,grid); > > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = hdm; > cfg.grid.xgrid = > > cfg.grid.ygrid = > > cfg.grid.zgrid = > > cfg.grid.inside = 1:size(cfg.grid.pos, 1); > cfg.grid.outside = []; > cfg.keepfilter = 'yes'; > source_idx = ft_sourceanalysis(cfg, tlock); > > My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. > > an other question that I have is that: when I compute the maximum index from > [maxvalr, maxpowindxr] = max(srcetask.avg.pow) > > How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) > > Regards, > Parinaz. > > > > > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] > Sent: Monday, December 07, 2015 9:30 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch > > Hi Parinaz, > > I'm not sure if I understood your question correctly. > Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? > > In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. > In the second case, it's a tad more complicated, but here's how I do it: > 1. Compute the virtual channels for all grid points in the cortex > 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) > 3. Build a high-resolution 3D-Grid on the standard MRI > 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) > 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. > > I hope this helps, let me know otherwise. > > Julian > > Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: > >> Hello >> >> I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.vol = hdm; >> cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); >> cfg.grid.inside = 1:size(cfg.grid.pos, 1); >> cfg.grid.outside = []; >> cfg.keepfilter = 'yes'; >> source_idx = ft_sourceanalysis(cfg, tlock); >> Not from the voxel indicating maximum power ([maxval, >> maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos >> = sourcemodel.pos([maxcohindx maxpowindx], :)). >> >> Regards, >> Parinaz. >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From p.babaeeghazvini at vu.nl Mon Dec 7 20:20:15 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Mon, 7 Dec 2015 19:20:15 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local>, Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C29CB@PEXMB100A.vu.local> Hi Julian, Thank you very much for your help now it is completely clear for me. Parinaz. ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 5:57 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. You don't. You compute your virtual channels for a regular grid (something like -20:1:20 for x,y and z) and select the virtual channels in your ROI in a second step. This might be a bit of an overkill, as you don't use most of your channels later on, but maybe you want to extend your analysis to other cortical areas - you never know. Anyways, to be more clear: You compute your virtual electrodes on a predefined grid. To find your ROI, you use ft_volumelookup to get a binary matrix which tells you, which voxels of the standard MRI are in your ROI. Then you build a high-resolution grid based on the standard MRI (It's important to use one grid point per voxel). Using pythagoras, you can now find the closest high-resolution grid points for each of your virtual electrodes. As soon as you have these, you can see which of them have a value of 1 in your binary matrix of ft_volumelookup. Now you know which virtual electrodes are inside your ROI. So for example, you have 2000 virtual electrodes on a -20:1:20 regular grid. You then compute a binary matrix and a high-resolution grid based on the standard MRI resulting in ~900000 grid points on a 91x109x91 grid. Using pythagoras, you find that grid point 6000 is closest to virtual electrode #1. Then you can see if element 6000 from your binary matrix is a 1. If so, your virtual electrode #1 is in your ROI, if not, your virtual electrode is not in your ROI. How I can find the atlas position to this maximum point in my code Do you want to have the coordinates or the actual label? A while ago, I hacked the ft_sourceplot-function to give me the coordinate position as an output, but I can't find the code anymore. I'm sure you can edit the function to also output the label, as this has to be included as a text element somewhere in the function. But please be aware that editing the FT-functions can severely compromise the functionality. Good luck, Julian Am 07.12.2015 um 12:52 schrieb Babaeeghazvini, P.: Hi Julian, Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: cfg = [] cfg.atlas = atlas; cfg.roi = atlas.tissuelabel(1) cfg.inputcoord = 'mni'; mas = ft_volumelookup(cfg,grid); cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.xgrid = cfg.grid.ygrid = cfg.grid.zgrid = cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. an other question that I have is that: when I compute the maximum index from [maxvalr, maxpowindxr] = max(srcetask.avg.pow) How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) Regards, Parinaz. From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 9:30 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 amickan1990 at gmail.com Thu Dec 10 18:14:10 2015 From: amickan1990 at gmail.com (Anne Mickan) Date: Thu, 10 Dec 2015 18:14:10 +0100 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test Message-ID: Dear all, I'm just starting to work on a cluster-based permutation test script based on the tutorial for within-subject designs on the fieldtrip website. I ran into an issue when computing the [stat] matrix. I used the code as it was on the website: [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); with the Correct and Incorrect matrices looking as follows: Correct{1} avg: [34x600 double] time: [1x600 double] fsample: '500' label: {34x1 cell} dimord: 'chan_time' dof: [34x600 double] var: [34x600 double] The function runs without problems, i.e I don't get any error messages. However, the result seems incomplete. stat = prob: [25x1 double] posclusters: [] posclusterslabelmat: [25x1 double] posdistribution: [1x500 double] negclusters: [1x1 struct] negclusterslabelmat: [25x1 double] negdistribution: [1x500 double] cirange: [25x1 double] mask: [25x1 logical] stat: [25x1 double] ref: [25x1 double] dimord: 'chan_time' label: {25x1 cell} time: 0 cfg: [1x1 struct] Specifically, I later run into trouble with the stat.posclusterslabelmat and stat.negclusterslabelmat matrices which should apparantly contain far more values something more like 25x500 instead of 25x1. When calling neg_int = all(neg(:, m(k):m(k+1)), 2) I get the "Index exceeds matrix dimensions" error message which I assume has to do with the fact that "neg" does not have the appropriate matrix dimensions (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) Where is the error / where should I look for the error? Some further design details: Nsubj = 24 2 conditions = Correct, Incorrect Within-subject design sampling rate = 500 34 channels I hope I gave enough / the necessary information for someone to help me out. Thanks in advance! Best, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.peatfield at gmail.com Thu Dec 10 20:13:10 2015 From: nick.peatfield at gmail.com (Nicholas A. Peatfield) Date: Thu, 10 Dec 2015 11:13:10 -0800 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test In-Reply-To: References: Message-ID: Hi Anne, To get an answer/suggestion you should provide the part of your script detailing your cfg inputs. Cheers, Nick On 10 December 2015 at 09:14, Anne Mickan wrote: > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Nicholas Peatfield, PhD -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Dec 10 20:36:45 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Dec 2015 19:36:45 +0000 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test In-Reply-To: References: Message-ID: <7CAF2781-D756-4C0B-9B56-F05642437AF9@fcdonders.ru.nl> Hi Anne, I agree with Nick, some more information would be helpful. At this stage my wild guess (assuming that you did not constrain your ‘search space’, using cfg.channel and cfg.latency before calling ft_timelockstatistics) would be that there’s a major discrepancy in the descriptive dimensions of your data (i.e. the ‘labels’ and the time points) across the input arguments. FieldTrip does an explicit check on the labels and time points, it only proceeds to do calculations on the channels and time points that are present in each and every input argument. With respect to time points: this could even mean that numerical inaccuracies are the showstopper here. These inaccuracies could be easily introduced when e.g. downsampling. Best, Jan-Mathijs On Dec 10, 2015, at 8:13 PM, Nicholas A. Peatfield > wrote: Hi Anne, To get an answer/suggestion you should provide the part of your script detailing your cfg inputs. Cheers, Nick On 10 December 2015 at 09:14, Anne Mickan > wrote: Dear all, I'm just starting to work on a cluster-based permutation test script based on the tutorial for within-subject designs on the fieldtrip website. I ran into an issue when computing the [stat] matrix. I used the code as it was on the website: [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); with the Correct and Incorrect matrices looking as follows: Correct{1} avg: [34x600 double] time: [1x600 double] fsample: '500' label: {34x1 cell} dimord: 'chan_time' dof: [34x600 double] var: [34x600 double] The function runs without problems, i.e I don't get any error messages. However, the result seems incomplete. stat = prob: [25x1 double] posclusters: [] posclusterslabelmat: [25x1 double] posdistribution: [1x500 double] negclusters: [1x1 struct] negclusterslabelmat: [25x1 double] negdistribution: [1x500 double] cirange: [25x1 double] mask: [25x1 logical] stat: [25x1 double] ref: [25x1 double] dimord: 'chan_time' label: {25x1 cell} time: 0 cfg: [1x1 struct] Specifically, I later run into trouble with the stat.posclusterslabelmat and stat.negclusterslabelmat matrices which should apparantly contain far more values something more like 25x500 instead of 25x1. When calling neg_int = all(neg(:, m(k):m(k+1)), 2) I get the "Index exceeds matrix dimensions" error message which I assume has to do with the fact that "neg" does not have the appropriate matrix dimensions (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) Where is the error / where should I look for the error? Some further design details: Nsubj = 24 2 conditions = Correct, Incorrect Within-subject design sampling rate = 500 34 channels I hope I gave enough / the necessary information for someone to help me out. Thanks in advance! Best, Anne _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nicholas Peatfield, PhD _______________________________________________ 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 aishwaryaselvaraj1708 at gmail.com Fri Dec 11 07:30:39 2015 From: aishwaryaselvaraj1708 at gmail.com (aishwarya selvaraj) Date: Fri, 11 Dec 2015 12:00:39 +0530 Subject: [FieldTrip] filed trip In-Reply-To: References: <5bd6dabc93ec431694d6c282894f6b62@EXPRD02.hosting.ru.nl> Message-ID: do you still have that m file with you?? could you share ?? On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra wrote: > Hi Aishwarya, > > I faced the similar problem. You are supposed to change your data > (.mat format) in a data structure that is read by fieldtrip. For that > you need at least following information > 1. Channel label and their location (If you don't have this file you > can use standard file available in Fieldtrip and you can include only > those electrode that you have been using in your experiment) > 2. sampling rate of the data (that you would have done while recording the > data) > 3. time vector > 4. no. of trials > > You can create them in MATLAB and put them together in a structure > along with your recorded data. This worked for me. > > -- > Ashutosh Mishra > 5th year Integrated BS-MS student > Department of Physical Sciences > Indian Institute of Science Education and Research, Kolkata > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Regards, Aishwarya Selvaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Fri Dec 11 09:09:14 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 11 Dec 2015 08:09:14 +0000 Subject: [FieldTrip] filed trip In-Reply-To: References: <5bd6dabc93ec431694d6c282894f6b62@EXPRD02.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A2801E0@exprd03.hosting.ru.nl> Dear Aishwarya, The data structure should look something like this: % 1. Load data load EEGdata.mat % 2. Make FieldTrip structure, manually data.label={'Channel1Name’,’Channel2Name’,’Channel3Name’}; %your channel names data.trial{1}=[Channel1Data; Channel2Data; Channel3Data]'; % do for each trial: channelsxtimepoints data data.fsample=500; %your recording sampling frequency data.time{1}=[Trial1Timepoints]; % for each trial: timepoints per data sample (e.g: [0 0.02 0.04 0.06 etc]) Going through the Walktrough Tutorial will be the best starting point when you just started to use FieldTrip: http://www.fieldtriptoolbox.org/walkthrough After that, you may go through the other Tutorial documentation or Example Matlab scripts. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of aishwarya selvaraj Sent: vrijdag 11 december 2015 7:31 To: FieldTrip discussion list Subject: Re: [FieldTrip] filed trip do you still have that m file with you?? could you share ?? On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: Hi Aishwarya, I faced the similar problem. You are supposed to change your data (.mat format) in a data structure that is read by fieldtrip. For that you need at least following information 1. Channel label and their location (If you don't have this file you can use standard file available in Fieldtrip and you can include only those electrode that you have been using in your experiment) 2. sampling rate of the data (that you would have done while recording the data) 3. time vector 4. no. of trials You can create them in MATLAB and put them together in a structure along with your recorded data. This worked for me. -- Ashutosh Mishra 5th year Integrated BS-MS student Department of Physical Sciences Indian Institute of Science Education and Research, Kolkata _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Regards, Aishwarya Selvaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From juangpc at gmail.com Fri Dec 11 11:43:05 2015 From: juangpc at gmail.com (Juan) Date: Fri, 11 Dec 2015 11:43:05 +0100 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel Message-ID: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data ​" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates% the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid .resolution = 1; cfg.grid .tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole gridfigure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight ; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Dec 11 11:54:54 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Dec 2015 10:54:54 +0000 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: References: Message-ID: <93DA3667-0D6E-45A6-8387-1C01B51D7925@fcdonders.ru.nl> Hi Juan, We’ll look into this specific issue soon, it should work without specifying sensor positions. However, for now and in general I would recommend just using a pre-cooked template grid. These can be found in fieldtrip/template/sourcemodel. This is mentioned in the tutorial, and I will make this more explicit shortly. Best, Jan-Mathijs On Dec 11, 2015, at 11:43 AM, Juan > wrote: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.resolution = 1; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Dec 11 13:19:39 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Dec 2015 12:19:39 +0000 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: References: Message-ID: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> Hi Juan, I could reproduce your issue, and have done 2 things: - I updated the wiki to make it clear that it would be easier to use a pre-cooked grid. - I adjusted ft_prepare_sourcemodel so that it also works when only providing the template_headmodel, as per the example code. The new version of ft_prepare_sourcemodel will become available in tonight’s release on the ftp-server. Best wishes, and thanks for noticing. Jan-Mathijs On Dec 11, 2015, at 11:43 AM, Juan > wrote: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.resolution = 1; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan _______________________________________________ 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 juangpc at gmail.com Fri Dec 11 13:55:57 2015 From: juangpc at gmail.com (Juan) Date: Fri, 11 Dec 2015 13:55:57 +0100 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> References: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> Message-ID: Hi Jan-Mathijs, Thanks for your quick response, H2H. I've actually learned about precooked models with your answer. Many thanks. In the same page, in the part "Make the individual subjects' grid", there seems to be a unit-related problem. One can find this code % read the single subject anatomical MRI mri = ft_read_mri('Subject01.mri'); % segment the anatomical MRI cfg = []; cfg.output = 'brain'; seg = ft_volumesegment(cfg, mri); % construct the volume conductor model (i.e. head model) for each subject% this is optional, and for the purpose of this tutorial only required for% plotting, later on cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, seg); % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid .warpmni = 'yes'; cfg.grid .template = template_grid; cfg.grid .nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri;grid = ft_prepare_sourcemodel(cfg); % make a figure of the single subject headmodel, and grid positionsfigure ; hold on; ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); ft_plot_mesh(grid .pos(grid .inside,:)); When executing it, there seems to be a problem with dimensions. "headmodel" struct is in mm and "grid" struct is in cm. So unfortunately the resulting figure ends up being something like [image: Inline image 1] I've tested to specify 'mm' units in the configuration struct before calling ft_prepare_sourcemodel: cfg.grid.unit='mm'; Or by calling ft_convert_units right after ft_prepare_sourcemodel. grid=ft_convert_units(grid,'mm'); Both solutions work fine, producing a figure very similar to the one in the tutorial. I've included the first solution in the wiki. I hope this is ok. Best, Juan On Fri, Dec 11, 2015 at 1:19 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Juan, > > I could reproduce your issue, and have done 2 things: > - I updated the wiki to make it clear that it would be easier to use a > pre-cooked grid. > - I adjusted ft_prepare_sourcemodel so that it also works when only > providing the template_headmodel, as per the example code. > The new version of ft_prepare_sourcemodel will become available in > tonight’s release on the ftp-server. > > Best wishes, and thanks for noticing. > Jan-Mathijs > > > On Dec 11, 2015, at 11:43 AM, Juan wrote: > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ​ " > ​​ > > ​ ​when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ​" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ​Code: > > % NOTE: the path to the template file is user-specific > template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system > % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. > % construct the dipole grid in the template brain coordinates% the negative inwardshift means an outward shift of the brain surface for inside/outside detection > cfg = []; > cfg.grid .resolution = 1; > cfg.grid .tight = 'yes'; > cfg.inwardshift = -1.5; > ​​ > cfg.headmodel = template_headmodel; > > The problem occurs when I execute ​this line: > > ​ > ​ > ​ > ​ > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ​ > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ​ > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > template_grid = ft_prepare_sourcemodel(cfg); > % make a figure with the template head model and dipole gridfigure hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight ; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > > My questions: > > ​Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because​ my solution depends on where > one is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ​ I figure this can be interesting to other people.​ > ​ > ​ > > Best, > > > Juan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 8130 bytes Desc: not available URL: From frsantos at fpce.up.pt Fri Dec 11 13:57:52 2015 From: frsantos at fpce.up.pt (Fernando Ferreira-Santos) Date: Fri, 11 Dec 2015 12:57:52 +0000 Subject: [FieldTrip] 3rd International Conference of the ESCAN Message-ID: <2BAB036A9BAEA44984A131DFCE446108010BFD7B96@SRVMBX01.fpceup.psi.up.pt> Dear Colleagues, The 3rd International Conference of the European Society for Cognitive and Affective Neuroscience (ESCAN) is accepting submissions for symposia and oral/poster presentations. The conference will take place in that will take place in Porto, Portugal, between 23-26 of June, 2016, at the Porto Palácio Congress Hotel & Spa (http://www.hotelportopalacio.com/en/hotel-overview.html). The submission deadline is the 8th of January, 2016. Please find all the details in the conference website: www.escan2016.eu We would appreciate it if you could pass this information along to other colleagues and students. Attached you may find a poster with the call for submissions. We are looking forward to seeing you in Porto in 2016! Fernando Babosa and Fernando Ferreira-Santos (University of Porto) Chairs of the Local Organizing Committee P.S.: Apologies if you get multiple postings of this announcement. -- Laboratory of Neuropsychophysiology Faculty of Psychology and Education Sciences University of Porto Rua Alfredo Allen, 4200-135 Porto (Portugal) Tel.: +351 226079700 http://www.fpce.up.pt/labpsi/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: escan2016_announce_call.pdf Type: application/pdf Size: 295799 bytes Desc: escan2016_announce_call.pdf URL: From marlene.boenstrup at googlemail.com Fri Dec 11 21:30:46 2015 From: marlene.boenstrup at googlemail.com (=?UTF-8?Q?Marlene_B=C3=B6nstrup?=) Date: Fri, 11 Dec 2015 21:30:46 +0100 Subject: [FieldTrip] ft_sourceinterpolate fails when cfg.moveinward and cfg.inwardshift was used to create sourcemodel Message-ID: Dear fieldtrip-community, I struggle at plotting source reconstruction results, and my routine even fails when using the template structural data. I think it is based on a shortcoming of the ft_sourceinterpolation function. This is why I am optimistic to find help in this platform: I prepare the leadfields based on the standard_sourcemodel3d6mm, the vol called standard_bem.mat, the electrode positions defined in standard_1005.elc. Since some of the dipoles that are assigned as "inside" in the sourcemodel3d6mm are actually sticking out of the inner bem boundary, leading to distorted leadfields, I re-prepare the sourcemodel based on the following specifications: mri=ft_read_mri('single_subj_T1.nii'); mri.coordsys = 'spm'; mri = ft_volumereslice([], mri); cfg=[]; cfg.mri = mri; cfg.elec=elec; cfg.vol=vol; cfg.grid.warpmni = 'yes'; cfg.grid.template = grid; % sourcemodel3d6mm cfg.grid.nonlinear = 'no'; cfg.moveinward=5; cfg.inwardshift=0; grid = ft_prepare_sourcemodel(cfg); this comes out with a vector of positions in three dimensional space, all of them being assigned to inside and none of them as outside. The leadfields prepared based on this sourcemodel look very convincing and the ft_sourceanalysis function also works. But the problem is to interpolate this on the anatomical image: Nested in the function ft_sourceinterpolate, the function ft_checkdata, specifically the subfunction source2volume leads to a misconfiguration with all the positions of the functional data being distributed in to a full 3D volume. In the end the orthoplot of the brain is a big fully activated cube. I hope someone has a good idea how to deal with this issue in fieldtrip and shares his/her expertise with us. Many greetings, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From amickan1990 at gmail.com Sat Dec 12 16:12:57 2015 From: amickan1990 at gmail.com (Anne Mickan) Date: Sat, 12 Dec 2015 16:12:57 +0100 Subject: [FieldTrip] fieldtrip Digest, Vol 61, Issue 7 In-Reply-To: References: Message-ID: Dear Nick and Jan-Mathijs, thanks for your emails. Here is the part of the code that details the cfg inputs. I basically stuck to what was in the tutorial: cfg = []; cfg.channel = 'all'; % prepare neighbouring channels cfg_neighb = []; cfg_neighb.method = 'distance'; cfg.channel = 'all'; cfg_neighb.feedback = 'yes'; cfg_neighb.layout = 'easycapM3.mat'; neighbours = ft_prepare_neighbours(cfg_neighb, Correct{1}); % settings for statistics cfg = []; cfg.channel = {'EEG'}; cfg.latency = [0 1]; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.neighbours = neighbours; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.5; cfg.numrandomization = 500; % prepare design subj = 24; design = zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; Best, Anne On Fri, Dec 11, 2015 at 12:00 PM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Stats matrix incomplete - cluster-based permutation test > (Anne Mickan) > 2. Re: Stats matrix incomplete - cluster-based permutation test > (Nicholas A. Peatfield) > 3. Re: Stats matrix incomplete - cluster-based permutation > test > (Schoffelen, J.M. (Jan Mathijs)) > 4. Re: filed trip (aishwarya selvaraj) > 5. Re: filed trip (Pelt, S. van (Stan)) > 6. possible bug in tutorial code for creating sourcemodel (Juan) > 7. Re: possible bug in tutorial code for creating sourcemodel > (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 10 Dec 2015 18:14:10 +0100 > From: Anne Mickan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > < > CANX43OJN4h_1jEuDKMNwQC4sHeW+E2_StnS3WLkEbOkVpMerQA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/6dea45e9/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Dec 2015 11:13:10 -0800 > From: "Nicholas A. Peatfield" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > 3Ew0_4-mB9CxchT0CSQSKDo4e1JCkEtmdCxp-CWhYtQ at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Anne, > > To get an answer/suggestion you should provide the part of your script > detailing your cfg inputs. > > Cheers, > > Nick > > On 10 December 2015 at 09:14, Anne Mickan wrote: > > > Dear all, > > > > I'm just starting to work on a cluster-based permutation test script > based > > on the tutorial for within-subject designs on the fieldtrip website. I > ran > > into an issue when computing the [stat] matrix. I used the code as it was > > on the website: > > > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > > > with the Correct and Incorrect matrices looking as follows: > > > > Correct{1} > > > > avg: [34x600 double] > > time: [1x600 double] > > fsample: '500' > > label: {34x1 cell} > > dimord: 'chan_time' > > dof: [34x600 double] > > var: [34x600 double] > > > > The function runs without problems, i.e I don't get any error messages. > > However, the result seems incomplete. > > > > stat = > > prob: [25x1 double] > > posclusters: [] > > posclusterslabelmat: [25x1 double] > > posdistribution: [1x500 double] > > negclusters: [1x1 struct] > > negclusterslabelmat: [25x1 double] > > negdistribution: [1x500 double] > > cirange: [25x1 double] > > mask: [25x1 logical] > > stat: [25x1 double] > > ref: [25x1 double] > > dimord: 'chan_time' > > label: {25x1 cell} > > time: 0 > > cfg: [1x1 struct] > > > > Specifically, I later run into trouble with the stat.posclusterslabelmat > > and stat.negclusterslabelmat matrices which should apparantly contain far > > more values something more like 25x500 instead of 25x1. When calling > > neg_int = all(neg(:, m(k):m(k+1)), 2) > > I get the "Index exceeds matrix dimensions" error message which I assume > > has to do with the fact that "neg" does not have the appropriate matrix > > dimensions > > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > > > Where is the error / where should I look for the error? > > > > Some further design details: > > Nsubj = 24 > > 2 conditions = Correct, Incorrect > > Within-subject design > > sampling rate = 500 > > 34 channels > > > > I hope I gave enough / the necessary information for someone to help me > > out. > > > > Thanks in advance! > > > > Best, > > Anne > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > Nicholas Peatfield, PhD > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/6503aa5f/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Thu, 10 Dec 2015 19:36:45 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: <7CAF2781-D756-4C0B-9B56-F05642437AF9 at fcdonders.ru.nl> > Content-Type: text/plain; charset="windows-1252" > > Hi Anne, > > I agree with Nick, some more information would be helpful. At this stage > my wild guess (assuming that you did not constrain your ?search space?, > using cfg.channel and cfg.latency before calling ft_timelockstatistics) > would be that there?s a major discrepancy in the descriptive dimensions of > your data (i.e. the ?labels? and the time points) across the input > arguments. FieldTrip does an explicit check on the labels and time points, > it only proceeds to do calculations on the channels and time points that > are present in each and every input argument. With respect to time points: > this could even mean that numerical inaccuracies are the showstopper here. > These inaccuracies could be easily introduced when e.g. downsampling. > > Best, > Jan-Mathijs > > > On Dec 10, 2015, at 8:13 PM, Nicholas A. Peatfield < > nick.peatfield at gmail.com> wrote: > > Hi Anne, > > To get an answer/suggestion you should provide the part of your script > detailing your cfg inputs. > > Cheers, > > Nick > > On 10 December 2015 at 09:14, Anne Mickan amickan1990 at gmail.com>> wrote: > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Nicholas Peatfield, PhD > > _______________________________________________ > 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/20151210/deacc96c/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Fri, 11 Dec 2015 12:00:39 +0530 > From: aishwarya selvaraj > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > Message-ID: > < > CACWTKSojvkrwtTLFGpsh2H6CtHXY7-krT7C5-NBjqXdHPs1Ljg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > do you still have that m file with you?? > could you share ?? > > On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: > > > Hi Aishwarya, > > > > I faced the similar problem. You are supposed to change your data > > (.mat format) in a data structure that is read by fieldtrip. For that > > you need at least following information > > 1. Channel label and their location (If you don't have this file you > > can use standard file available in Fieldtrip and you can include only > > those electrode that you have been using in your experiment) > > 2. sampling rate of the data (that you would have done while recording > the > > data) > > 3. time vector > > 4. no. of trials > > > > You can create them in MATLAB and put them together in a structure > > along with your recorded data. This worked for me. > > > > -- > > Ashutosh Mishra > > 5th year Integrated BS-MS student > > Department of Physical Sciences > > Indian Institute of Science Education and Research, Kolkata > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > Regards, > Aishwarya Selvaraj > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/0e2bdbaf/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Fri, 11 Dec 2015 08:09:14 +0000 > From: "Pelt, S. van (Stan)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > Message-ID: > <7CCA2706D7A4DA45931A892DF3C2894C2A2801E0 at exprd03.hosting.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Dear Aishwarya, > > The data structure should look something like this: > > % 1. Load data > load EEGdata.mat > > % 2. Make FieldTrip structure, manually > data.label={'Channel1Name?,?Channel2Name?,?Channel3Name?}; %your channel > names > data.trial{1}=[Channel1Data; Channel2Data; Channel3Data]'; % do for each > trial: channelsxtimepoints data > data.fsample=500; %your recording sampling frequency > data.time{1}=[Trial1Timepoints]; % for each trial: timepoints per data > sample (e.g: [0 0.02 0.04 0.06 etc]) > > Going through the Walktrough Tutorial will be the best starting point when > you just started to use FieldTrip: > http://www.fieldtriptoolbox.org/walkthrough > After that, you may go through the other Tutorial documentation or Example > Matlab scripts. > > Best, > Stan > > -- > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour > Radboud University > Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > From: fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] On Behalf Of aishwarya selvaraj > Sent: vrijdag 11 december 2015 7:31 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > > do you still have that m file with you?? > could you share ?? > > On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: > Hi Aishwarya, > > I faced the similar problem. You are supposed to change your data > (.mat format) in a data structure that is read by fieldtrip. For that > you need at least following information > 1. Channel label and their location (If you don't have this file you > can use standard file available in Fieldtrip and you can include only > those electrode that you have been using in your experiment) > 2. sampling rate of the data (that you would have done while recording the > data) > 3. time vector > 4. no. of trials > > You can create them in MATLAB and put them together in a structure > along with your recorded data. This worked for me. > > -- > Ashutosh Mishra > 5th year Integrated BS-MS student > Department of Physical Sciences > Indian Institute of Science Education and Research, Kolkata > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Regards, > Aishwarya Selvaraj > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/5309b65c/attachment-0001.html > > > > ------------------------------ > > Message: 6 > Date: Fri, 11 Dec 2015 11:43:05 +0100 > From: Juan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] possible bug in tutorial code for creating > sourcemodel > Message-ID: > XT8P5jeAp7-C4TDBNN1Aoe8X_mtYLh8w at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ?" > ?? > > ? ?when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ?" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ?Code: > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret > the coordinate system > % segment the template brain and construct a volume conduction model > (i.e. head model): % this is needed to describe the boundary that > define which dipole locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % > Convert the vol to cm, because the CTF convenction is to express > everything in cm. > % construct the dipole grid in the template brain coordinates% the > negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid < > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html > >.resolution > = 1; > cfg.grid < > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.tight > = 'yes'; > cfg.inwardshift = -1.5; > ?? > cfg.headmodel = template_headmodel; > > The problem occurs when I execute ?this line: > > ? > ? > ? > ? > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ? > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ? > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > ?cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > template_grid = ft_prepare_sourcemodel(cfg); > % make a figure with the template head model and dipole gridfigure > >hold > > on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight > ; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > > My questions: > > ?Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because? my solution depends on where one > is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ? I figure this can be interesting to other people.? > ? > ? > > Best, > > > Juan > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/fee4d5ef/attachment-0001.html > > > > ------------------------------ > > Message: 7 > Date: Fri, 11 Dec 2015 10:54:54 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] possible bug in tutorial code for creating > sourcemodel > Message-ID: <93DA3667-0D6E-45A6-8387-1C01B51D7925 at fcdonders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Juan, > > We?ll look into this specific issue soon, it should work without > specifying sensor positions. However, for now and in general I would > recommend just using a pre-cooked template grid. These can be found in > fieldtrip/template/sourcemodel. This is mentioned in the tutorial, and I > will make this more explicit shortly. > > Best, > > Jan-Mathijs > > On Dec 11, 2015, at 11:43 AM, Juan juangpc at gmail.com>> wrote: > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ?" > ?? > > ? ?when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ?" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ?Code: > > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): > % this is needed to describe the boundary that define which dipole > locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert > the vol to cm, because the CTF convenction is to express everything in cm. > > % construct the dipole grid in the template brain coordinates > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.resolution > = 1; > cfg.grid< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.tight > = 'yes'; > cfg.inwardshift = -1.5; > > ?? > cfg.headmodel = template_headmodel; > > > The problem occurs when I execute ?this line: > > > ? > ? > ? > ? > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ? > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ? > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > > ?cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure.html> > hold > on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/camlight.html>; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > My questions: > > ?Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because? my solution depends on where > one is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ? I figure this can be interesting to other people.? > ? > ? > > Best, > > > Juan > > _______________________________________________ > 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/20151211/346949fd/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 61, Issue 7 > **************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From LordJojo at gmx.de Sat Dec 12 19:59:26 2015 From: LordJojo at gmx.de (Jojo Klemt) Date: Sat, 12 Dec 2015 19:59:26 +0100 Subject: [FieldTrip] channel problem ft_freqstatistics Message-ID: An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Dec 13 12:12:40 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 13 Dec 2015 11:12:40 +0000 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test Message-ID: Hi Anne, It looks like you're running stats on grand-average structures created with cfg.keepindividual='no' (because your Correct and Incorrect structures have an .avg field). I always do stats on a grand-average structure created with cfg.keepindividual='yes' (which will yield a structure with no .avg field, and instead an .individual field, which in your case will be 24x34x600, since you have participants). Do things work out better if you try it that way? Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 1 > Date: Thu, 10 Dec 2015 18:14:10 +0100 > From: Anne Mickan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > < > CANX43OJN4h_1jEuDKMNwQC4sHeW+E2_StnS3WLkEbOkVpMerQA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From recasensmarc at gmail.com Sun Dec 13 16:07:08 2015 From: recasensmarc at gmail.com (Marc Recasens) Date: Sun, 13 Dec 2015 15:07:08 +0000 Subject: [FieldTrip] channel problem ft_freqstatistics In-Reply-To: References: Message-ID: Hi Johannes, I think the same problem has been reported before in: http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009789.html Roy Cox looked into the problem with quite detail and found the bug in the ft_get_selection function, line 630-631 during a call to "*label = union(label, selchannel);"*. I recently had the same problem and it was solved after commenting that line. However it might be better if you update FieldTrip to the last version where this issue is fixed. Hope that helps. Best wishes Marc On Sat, Dec 12, 2015 at 6:59 PM, Jojo Klemt wrote: > Dear community > > My name is Johannes Klemt and I'm analysing eeg/emg-power data of patients > and healthy controls for my medical doctorate in Tübingen. > I have a small problem using ft_freqstatistics. After performing an > independent samples t-test, the channels are suddenly ordered alphabeticaly. > The preprocessing and power analysis were not performed in field trip. > The electrode labels and neighbours were defined and put into the > following cfg: > cfg.elec > cfg.neighbours > The statistics were then calculated using montecarlo method, but the > channel order in stat.label is changed into alphabetical order, so the stat > plot looks nice but is quite useless. > Colleagues of mine used ft_freqgrandaverage as input data and did not have > the problem, but I can't find the bug. > I designed a file containing the layout structure and tried putting it in > by using > cfg.layout > but it was ignored. > > Any help would be deeply appreciated. > > Yours sincerely > > Johannes Klemt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 12:30:33 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 12:30:33 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Message-ID: Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From Elana.Harris at cchmc.org Mon Dec 14 13:12:29 2015 From: Elana.Harris at cchmc.org (Harris, Elana) Date: Mon, 14 Dec 2015 12:12:29 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: Message-ID: cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Mon Dec 14 13:21:41 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Mon, 14 Dec 2015 12:21:41 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Dear Elana, The 50ms timesteps result in the 41 timebins. Per timebin, the average power spectrum (TFRhann.powspctrm) is computed over all trials that have data in that specific time bin. In your case, the power in the earlier time bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that of the later ones (e.g. 1.95-2.0s), because of your variable trial length. If you specify cfg.keeptrials=’yes’, you can see that the individual trial’s TFRs will have different amount of data points. Hope that helps. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Harris, Elana Sent: maandag 14 december 2015 13:12 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 13:41:27 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 13:41:27 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Message-ID: Dear Stan and Elana, thank you very much for your answers and help. Just another question: if I understood correctly, there's no way to compute fft for single trials, since TFRhann.powspctrm is by definition an average along trials. Is that true? Thanks again. Bests, Federica 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) : > Dear Elana, > > > > The 50ms timesteps result in the 41 timebins. Per timebin, the average > power spectrum (TFRhann.powspctrm) is computed over all trials that have > data in that specific time bin. In your case, the power in the earlier time > bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that > of the later ones (e.g. 1.95-2.0s), because of your variable trial length. > > > > If you specify cfg.keeptrials=’yes’, you can see that the individual > trial’s TFRs will have different amount of data points. > > > > Hope that helps. > > > > Best, > > Stan > > > > -- > > Stan van Pelt, PhD > > Donders Institute for Brain, Cognition and Behaviour > > Radboud University > > Montessorilaan 3, B.01.34 > > 6525 HR Nijmegen, the Netherlands > > tel: +31 24 3616288 > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Harris, Elana > *Sent:* maandag 14 december 2015 13:12 > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > > > I just noticed this line has an error should be -0.5:0.5:2 > > > > Sorry, I am new to fieldtrip myself and can't be more helpful yet. > > > > Cheers, > > > > Elana > ------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Federica Mauro [federica.ma at gmail.com] > *Sent:* Monday, December 14, 2015 6:30 AM > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Number of epochs in the ft_freqanalysis output > > Dear all, > > > > I'm having a problem in using the ft_freqanalysis function, so I'm writing > to ask your help. > > I'm trying to get power data for each 2-seconds epochs of my eeg files. > > My eeg files are not of the same length (they don't have the same number > of epochs), however the output of the function (namely TFRhann.powspctrm) > always gives me power data for the same number of epochs, namely 41, > unregarding of the effective number of epochs. > > > > Here is the code I'm using: > > > > cfg = []; > > cfg.output = 'pow'; > > % cfg.channel > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 4:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window > = 0.5 sec > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > TFRhann = ft_freqanalysis(cfg, eeg); > > > > Do you have any suggestion about it? > > Thank you very much for your attention. > > > > Worm regards, > > Federica > > > > > > _______________________________________________ > 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 stan.vanpelt at donders.ru.nl Mon Dec 14 14:30:32 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Mon, 14 Dec 2015 13:30:32 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> Hi Federica, If you want to have an estimate for each trial separately, you should specify cfg.keeptrials=’yes’ when calling ft_freqanalysis. See also http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip? Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Federica Mauro Sent: maandag 14 december 2015 13:41 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear Stan and Elana, thank you very much for your answers and help. Just another question: if I understood correctly, there's no way to compute fft for single trials, since TFRhann.powspctrm is by definition an average along trials. Is that true? Thanks again. Bests, Federica 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) >: Dear Elana, The 50ms timesteps result in the 41 timebins. Per timebin, the average power spectrum (TFRhann.powspctrm) is computed over all trials that have data in that specific time bin. In your case, the power in the earlier time bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that of the later ones (e.g. 1.95-2.0s), because of your variable trial length. If you specify cfg.keeptrials=’yes’, you can see that the individual trial’s TFRs will have different amount of data points. Hope that helps. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Harris, Elana Sent: maandag 14 december 2015 13:12 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica _______________________________________________ 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 LordJojo at gmx.de Mon Dec 14 15:24:32 2015 From: LordJojo at gmx.de (Jojo Klemt) Date: Mon, 14 Dec 2015 15:24:32 +0100 Subject: [FieldTrip] channel problem ft_freqstatistics In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 22:51:26 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 22:51:26 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> Message-ID: Hi Stan, thank you, it was really helpful. Best, Federica 2015-12-14 14:30 GMT+01:00 Pelt, S. van (Stan) : > Hi Federica, > > > > If you want to have an estimate for each trial separately, you should > specify cfg.keeptrials=’yes’ when calling ft_freqanalysis. See also > http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip > ? > > > > Best, > > Stan > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Federica Mauro > *Sent:* maandag 14 december 2015 13:41 > > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > Dear Stan and Elana, thank you very much for your answers and help. > > > > Just another question: if I understood correctly, there's no way to > compute fft for single trials, since TFRhann.powspctrm is by definition an > average along trials. Is that true? > > > > Thanks again. > > > > Bests, > > Federica > > > > 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) >: > > Dear Elana, > > > > The 50ms timesteps result in the 41 timebins. Per timebin, the average > power spectrum (TFRhann.powspctrm) is computed over all trials that have > data in that specific time bin. In your case, the power in the earlier time > bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that > of the later ones (e.g. 1.95-2.0s), because of your variable trial length. > > > > If you specify cfg.keeptrials=’yes’, you can see that the individual > trial’s TFRs will have different amount of data points. > > > > Hope that helps. > > > > Best, > > Stan > > > > -- > > Stan van Pelt, PhD > > Donders Institute for Brain, Cognition and Behaviour > > Radboud University > > Montessorilaan 3, B.01.34 > > 6525 HR Nijmegen, the Netherlands > > tel: +31 24 3616288 > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Harris, Elana > *Sent:* maandag 14 december 2015 13:12 > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > > > I just noticed this line has an error should be -0.5:0.5:2 > > > > Sorry, I am new to fieldtrip myself and can't be more helpful yet. > > > > Cheers, > > > > Elana > ------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Federica Mauro [federica.ma at gmail.com] > *Sent:* Monday, December 14, 2015 6:30 AM > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Number of epochs in the ft_freqanalysis output > > Dear all, > > > > I'm having a problem in using the ft_freqanalysis function, so I'm writing > to ask your help. > > I'm trying to get power data for each 2-seconds epochs of my eeg files. > > My eeg files are not of the same length (they don't have the same number > of epochs), however the output of the function (namely TFRhann.powspctrm) > always gives me power data for the same number of epochs, namely 41, > unregarding of the effective number of epochs. > > > > Here is the code I'm using: > > > > cfg = []; > > cfg.output = 'pow'; > > % cfg.channel > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 4:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window > = 0.5 sec > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > TFRhann = ft_freqanalysis(cfg, eeg); > > > > Do you have any suggestion about it? > > Thank you very much for your attention. > > > > Worm regards, > > Federica > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From S.Hanslmayr at bham.ac.uk Wed Dec 16 12:50:48 2015 From: S.Hanslmayr at bham.ac.uk (Simon Hanslmayr) Date: Wed, 16 Dec 2015 11:50:48 +0000 Subject: [FieldTrip] PhD studentship available at University of Birmingham Message-ID: <257F6C65A372A04CA41056EACC0DE7CED841AC9A@EX8.adf.bham.ac.uk> Dear Fieldtrip Community, I take this opportunity to announce a PhD studentship that is available for talented students to work in the labs of Joff Lee and Simon Hanslmayr on a memory project involving invasive recordings of oscillations in rodents. More information about the project and instructions on how to apply can be found here: http://www.birmingham.ac.uk/research/activity/mrc-impact/imaging.aspx. Deadline for applicants is Sunday 10 January 2016. For any questions about the project please write an email to Dr Joff Lee (J.L.C.Lee at bham.ac.uk) or myself (simon.hanslmayr at bham.ac.uk). Seasonal greetings, Simon Dr. Simon Hanslmayr Senior Lecturer School of Psychology University of Birmingham Edgbaston Birmingham B15 2TT UK Tel +44 121 4146203 http://www.memorybham.com/people/#/simon-hanslmayr/ [http://www.nature.com/content/sr/ebm/1248_2014_Branded_Sig_460x80_v1.gif] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 8560 bytes Desc: image001.gif URL: From luke.bloy at gmail.com Wed Dec 16 22:29:17 2015 From: luke.bloy at gmail.com (Luke Bloy) Date: Wed, 16 Dec 2015 21:29:17 +0000 Subject: [FieldTrip] Question about ft_statfun_actvsblT Message-ID: Sorry if this is missing something fundamental but I'm abit confused about the use of ft_statfun_actvsblT for frequency analysis and how it compares to ft_statfun_depsamplesT. It seems from http://www.fieldtriptoolbox.org/tutorial/salzburg (and from trying to use it) that inorder to use ft_statfun_actvsblT the active and baseline freq structures need to have the same time dimension. Based on this I'm assuming that the active vs baseline comparison happens at each time x frequency pair, but isn't this what ft_statfun_depsamplesT does? So I guess my question is what is the difference between the two? What exactly is the comparison being performed by ft_statfun_actvsblT? Thanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 10:43:43 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) Subject: [FieldTrip] importing large edf data References: <807603762.476165.1450431823359.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo@mail.yahoo.com> Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.  So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403)   dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622)     dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566)       dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary',       strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load : filename     = 'mydata.edf'  hdr   = ft_read_header(filename);  sample.start=1  sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403)   dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622)     dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100')   >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri Dec 18 13:37:52 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 18 Dec 2015 12:37:52 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 61, Issue 14 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.pflug at musterkind.eu Fri Dec 18 14:06:32 2015 From: anja.pflug at musterkind.eu (Anja Pflug) Date: Fri, 18 Dec 2015 14:06:32 +0100 (CET) Subject: [FieldTrip] Importing large edf data In-Reply-To: References: Message-ID: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 14:13:16 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:13:16 +0000 (UTC) Subject: [FieldTrip] Importing large edf data In-Reply-To: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> Message-ID: <1753128777.512946.1450444396047.JavaMail.yahoo@mail.yahoo.com>  Thanks for your reply Anja.I need to have all the channel information at a segment of time to decide if it there is seizure occurring.  Down sampling will loose the information and I am not sure if I want to go that way, as I need to do some feature extractions/classification etc on the data. Not sure how I could cut the data in fieldtrip. Do you know?ThanksBest regards ___________________________________________________ Leila Ayoubian From: Anja Pflug To: fieldtrip at science.ru.nl Sent: Friday, December 18, 2015 1:06 PM Subject: [FieldTrip] Importing large edf data Hello Leila, have you tried to import only one of your 51 channels? If this works you  could cut the data or downsample it and then combine all channels in a later step. Best, Anja fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ 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 jorn at artinis.com Fri Dec 18 14:17:34 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Fri, 18 Dec 2015 14:17:34 +0100 Subject: [FieldTrip] Importing large edf data In-Reply-To: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> Message-ID: <007301d13996$7573dc60$605b9520$@artinis.com> Hi all, I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension. Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes. Best of luck ;) Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug Sent: Friday, December 18, 2015 14:07 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Importing large edf data Hello Leila, have you tried to import only one of your 51 channels? If this works you could cut the data or downsample it and then combine all channels in a later step. Best, Anja fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian > To: "fieldtrip at science.ru.nl " > Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com > Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 14:40:59 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <2054001626.533069.1450446059200.JavaMail.yahoo@mail.yahoo.com>  Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.  Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get:    hdr: [1x1 struct]          label: {51x1 cell}           time: {1x50710 cell}          trial: {1x50710 cell}        fsample: 1024     sampleinfo: [50710x2 double]            cfg: [1x1 struct] so the actual data which is in data.trial  is this in both cases! size(data.trial) ans =            1       50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Friday, December 18, 2015 12:37 PM Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to         fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit         http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to         fieldtrip-request at science.ru.nl You can reach the person managing the list at         fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics:    1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID:         <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ 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 leilayou_54 at yahoo.com Fri Dec 18 14:55:18 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:55:18 +0000 (UTC) Subject: [FieldTrip] Importing large edf data In-Reply-To: <007301d13996$7573dc60$605b9520$@artinis.com> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> <007301d13996$7573dc60$605b9520$@artinis.com> Message-ID: <778201681.538338.1450446918121.JavaMail.yahoo@mail.yahoo.com> Thanks Jorn. Appreciate your feedback.  __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Jörn M. Horschig To: 'FieldTrip discussion list' Sent: Friday, December 18, 2015 1:17 PM Subject: Re: [FieldTrip] Importing large edf data #yiv8769305188 #yiv8769305188 -- _filtered #yiv8769305188 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv8769305188 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv8769305188 {font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv8769305188 #yiv8769305188 p.yiv8769305188MsoNormal, #yiv8769305188 li.yiv8769305188MsoNormal, #yiv8769305188 div.yiv8769305188MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv8769305188 a:link, #yiv8769305188 span.yiv8769305188MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv8769305188 a:visited, #yiv8769305188 span.yiv8769305188MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv8769305188 p {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv8769305188 span.yiv8769305188EmailStyle18 {color:#1F497D;}#yiv8769305188 .yiv8769305188MsoChpDefault {font-size:10.0pt;} _filtered #yiv8769305188 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv8769305188 div.yiv8769305188WordSection1 {}#yiv8769305188 Hi all,  I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension.  Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes.  Best of luck ;)Jörn-- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems  |  +31 481 350 980  From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug Sent: Friday, December 18, 2015 14:07 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Importing large edf data  Hello Leila,have you tried to import only one of your 51 channels?If this works you  could cut the data or downsample it and then combine all channels in a later step.Best,Anja   fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Fri Dec 18 18:51:20 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Fri, 18 Dec 2015 07:51:20 -1000 Subject: [FieldTrip] Importing large edf data In-Reply-To: <007301d13996$7573dc60$605b9520$@artinis.com> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> <007301d13996$7573dc60$605b9520$@artinis.com> Message-ID: <81DC3EE6-21D4-4BB7-80B8-AF642B616768@gmail.com> Hi all, Perhaps this links helps: http://www.fieldtriptoolbox.org/getting_started/edf Arjen > On Dec 18, 2015, at 3:17 AM, Jörn M. Horschig wrote: > > Hi all, > > I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension. > > Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes. > > Best of luck ;) > Jörn > -- > Jörn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug > Sent: Friday, December 18, 2015 14:07 > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Importing large edf data > > Hello Leila, > > have you tried to import only one of your 51 channels? > > If this works you could cut the data or downsample it and then combine all channels in a later step. > > Best, > > Anja > > > > fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: > > > 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. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- 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 61, Issue 14 > ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sat Dec 19 15:06:46 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sat, 19 Dec 2015 14:06:46 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = hdr: [1x1 struct] label: {37x1 cell} time: {[1x500 double]} trial: {[37x500 double]} fsample: 200 sampleinfo: [1 500] cfg: [1x1 struct] >> data_1000samples data_1000samples = hdr: [1x1 struct] label: {37x1 cell} time: {[1x1000 double]} trial: {[37x1000 double]} fsample: 200 sampleinfo: [1 1000] cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Friday, December 18, 2015 12:37 PM > Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From senakahks at gmail.com Sun Dec 20 12:51:47 2015 From: senakahks at gmail.com (Senaka Amarakeerthi) Date: Sun, 20 Dec 2015 17:21:47 +0530 Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data structure. Message-ID: Dear all, I am new to FieldTrip and trying to process offline Emotive Epoc EEG data. The file I am trying to process is a single trial. The code I tried is: %% import data from testbench emotiv edf file [hdr, data_eeg] = edfread('emotive.edf'); %% Rearrange data to match FieldTrip Format % Remove unnecessary columns data.trial = data_eeg([3:16,39], : ); % Cell-array containing strings, Nchan X 1 % Based on https://emotiv.com/forum/forum14/topic1817/messages/ data.label = {'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6' 'F4' 'F8' 'AF4' 'MARKER'}; % Sampling frequency in Hz, single number data.fsample = 128; % Setting time [x, filelength] = size(data.trial); data.time{1} = [1:filelength]./data.fsample; %% Using the rearranged data % Set the trial column name and event value (what you enter to the last column. % here enter number 1 as the marker) cfg.trialdef.eventtype = 'MARKER'; cfg.trialdef.eventvalue = 1; cfg.trialdef.eventtype = '?'; ft_definetrial(cfg); %% Preprocessing cfg = []; cfg.channel = 'AF3'; cfg.lpfilter = 'yes'; cfg.hpfilter = 'yes'; cfg.bsfilter = 'yes'; cfg.lpfreq = 100; cfg.hpfreq = 10; cfg.bsfreq = [59 61]; cfg.lpfiltord = 4; cfg.hpfiltord = 4; cfg.bpfiltord = 4; cfg.lpfilttype = 'but'; cfg.hpfilttype = 'but'; ecog = ft_preprocessing(cfg,data); When I run the script. I am getting the following error. Error in ft_trialfun_general (line 78) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Do I need to set the header structure as well? Can somebody help me to get this fixed. I am reading the documentation but it seems start is bit hard! Appreciate your support -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Mon Dec 21 10:36:27 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <1459455402.1301519.1450690587900.JavaMail.yahoo@mail.yahoo.com> Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;  there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference? Thanks again.Kind regards  __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Saturday, December 19, 2015 2:06 PM Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples =            hdr: [1x1 struct]          label: {37x1 cell}           time: {[1x500 double]}          trial: {[37x500 double]}        fsample: 200     sampleinfo: [1 500]            cfg: [1x1 struct] >> data_1000samples data_1000samples =            hdr: [1x1 struct]          label: {37x1 cell}           time: {[1x1000 double]}          trial: {[37x1000 double]}        fsample: 200     sampleinfo: [1 1000]            cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/  ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Friday, December 18, 2015 12:37 PM  Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Mon Dec 21 12:35:23 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Mon, 21 Dec 2015 11:35:23 +0000 Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data structure Message-ID: Hello Senaka, I think you might be making your life more difficult by trying to directly call edfread(), which is a low-level function. Have you tried just using ft_preprocessing(), the high-level wrapper function, as described in the tutorial on the fieldtrip wiki? In my experience, this function reads EDF data straightforwardly. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 20 Dec 2015 17:21:47 +0530 > From: Senaka Amarakeerthi > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data > structure. > Message-ID: > J-1ensqWCTreAGdsHovwSavJA5sAG6i1nDGg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I am new to FieldTrip and trying to process offline Emotive Epoc EEG data. > The file I am trying to process is a single trial. > > The code I tried is: > > %% import data from testbench emotiv edf file > > [hdr, data_eeg] = edfread('emotive.edf'); > > > > %% Rearrange data to match FieldTrip Format > > % Remove unnecessary columns > > data.trial = data_eeg([3:16,39], : ); > > > > > > % Cell-array containing strings, Nchan X 1 > > % Based on https://emotiv.com/forum/forum14/topic1817/messages/ > > data.label = {'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6' > 'F4' > 'F8' 'AF4' 'MARKER'}; > > > > % Sampling frequency in Hz, single number > > data.fsample = 128; > > > > % Setting time > > [x, filelength] = size(data.trial); > > data.time{1} = [1:filelength]./data.fsample; > > %% Using the rearranged data > > > > > > % Set the trial column name and event value (what you enter to the last > column. > > % here enter number 1 as the marker) > > cfg.trialdef.eventtype = 'MARKER'; > > cfg.trialdef.eventvalue = 1; > > cfg.trialdef.eventtype = '?'; > > ft_definetrial(cfg); > > > %% Preprocessing > > cfg = []; > > cfg.channel = 'AF3'; > > cfg.lpfilter = 'yes'; > > cfg.hpfilter = 'yes'; > > cfg.bsfilter = 'yes'; > > cfg.lpfreq = 100; > > cfg.hpfreq = 10; > > cfg.bsfreq = [59 61]; > > cfg.lpfiltord = 4; > > cfg.hpfiltord = 4; > > cfg.bpfiltord = 4; > > cfg.lpfilttype = 'but'; > > cfg.hpfilttype = 'but'; > > ecog = ft_preprocessing(cfg,data); > > > When I run the script. I am getting the following error. > > Error in ft_trialfun_general (line 78) > hdr = ft_read_header(cfg.headerfile, 'headerformat', > cfg.headerformat); > > Do I need to set the header structure as well? Can somebody help me to get > this fixed. I am reading the documentation but it seems start is bit hard! > > Appreciate your support > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151220/7c7feda3/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Mon Dec 21 12:39:56 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Mon, 21 Dec 2015 11:39:56 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 2 > Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I > got a different result at first. > But now I see thecfg2.trialdef.triallength = 1;? > there is no difference in the way data is loaded once I change the number > to let's say 5! Where should I see that difference??Thanks again.Kind > regards > ?__________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Saturday, December 19, 2015 2:06 PM > Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > I'm not sure why it didn't work for you. I tried the following code (on a > sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and > it worked perfectly for me: > > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 500 0]; > cfg.continuous = 'yes'; > data_500samples = ft_preprocessing(cfg); > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 1000 0]; > cfg.continuous = 'yes'; > data_1000samples = ft_preprocessing(cfg); > > > > Here's the output: > >> data_500samples > > data_500samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x500 double]} > ???????? trial: {[37x500 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 500] > ?????????? cfg: [1x1 struct] > > >> data_1000samples > > data_1000samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x1000 double]} > ???????? trial: {[37x1000 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 1000] > ?????????? cfg: [1x1 struct] > > > Best, > Steve > > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/? > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Friday, December 18, 2015 12:37 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Mon Dec 21 13:04:36 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 12:04:36 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <1581782628.1312312.1450699476132.JavaMail.yahoo@mail.yahoo.com>  You are absolutely right. It is either using the fix cfg.trl to choose the begining and end of the samples or to choose the cfg2.trialdef.triallength =5. In your initial code you had them together, and that is why I was confused. So basically there are two ways to segment the file. Thanks you very much. You have been very helpful. My questions are endless. I have another one for you! Sorry! When loading edf+ the events are lost. using cfg2.trialdef.eventtype  = '?' gives me no events detected. Any idea how I could go about it? Thanks again for your help. I really appreciate it.Best regards __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Monday, December 21, 2015 11:39 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/   Message: 2 Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;? there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference??Thanks again.Kind regards ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Saturday, December 19, 2015 2:06 PM  Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x500 double]} ???????? trial: {[37x500 double]} ?????? fsample: 200 ??? sampleinfo: [1 500] ?????????? cfg: [1x1 struct] >> data_1000samples data_1000samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x1000 double]} ???????? trial: {[37x1000 double]} ?????? fsample: 200 ??? sampleinfo: [1 1000] ?????????? cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/? ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian ? ? ? From: Stephen Politzer-Ahles ?To: fieldtrip at science.ru.nl ?Sent: Friday, December 18, 2015 12:37 PM ?Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------   _______________________________________________ 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 leilayou_54 at yahoo.com Mon Dec 21 13:59:38 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 12:59:38 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <916358647.1306232.1450702778200.JavaMail.yahoo@mail.yahoo.com> Dear Steve,I have shared my data file in drop box with you. I am trying to read the events in this file and I get 0 events. cfg2.trialdef.eventtype  = '?' Could you please help me out? Thanks __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Monday, December 21, 2015 11:39 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/   Message: 2 Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;? there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference??Thanks again.Kind regards ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Saturday, December 19, 2015 2:06 PM  Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x500 double]} ???????? trial: {[37x500 double]} ?????? fsample: 200 ??? sampleinfo: [1 500] ?????????? cfg: [1x1 struct] >> data_1000samples data_1000samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x1000 double]} ???????? trial: {[37x1000 double]} ?????? fsample: 200 ??? sampleinfo: [1 1000] ?????????? cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/? ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian ? ? ? From: Stephen Politzer-Ahles ?To: fieldtrip at science.ru.nl ?Sent: Friday, December 18, 2015 12:37 PM ?Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------   _______________________________________________ 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 leilayou_54 at yahoo.com Mon Dec 21 16:49:12 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 15:49:12 +0000 (UTC) Subject: [FieldTrip] EDF+ annotations References: <782532884.1387709.1450712952642.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <782532884.1387709.1450712952642.JavaMail.yahoo@mail.yahoo.com> Hi all,I am new to fieldtrip .I am trying to load some edf+ file to Matlab and read the events/annotations. These annotations are usually seizure, or spikes.... The files are EEG data from nicollet one, lengthy data for epileptic patients. This is how I try to look at the events: cfg2 = []; cfg2.dataset = 'For leila.edf'; cfg2.trialdef.eventtype  = '?' cfg2 = ft_definetrial( cfg2 ); cfg2.continuous = 'yes'; data2 = ft_preprocessing(cfg2); However the output for events are always empty.Does anyone have an idea how I could extract the events/annotation on these files? Thanks in advance for your assistance. Best regards __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London -------------- next part -------------- An HTML attachment was scrubbed... URL: From weston.pack at yale.edu Mon Dec 21 18:56:11 2015 From: weston.pack at yale.edu (Pack, Weston) Date: Mon, 21 Dec 2015 17:56:11 +0000 Subject: [FieldTrip] How to implement the .pl2 patch for Plexon data Message-ID: <46289A1970E74F4888AA0D7E75AAB1E6210097A4@x10-mbx13.yu.yale.edu> Greetings FieldTrip community, I am new to using FieldTrip, but am well versed in Matlab. I would like to use FieldTrip to analyze Plexon data from LFP recordings and am working with the .pl2 format. I have read through the current documentation (very short) about the patch for loading .pl2 files, but I still have no idea how to install and use the patch as this is not documented (that I can find). The following is provided but with no explanation of how to implement it: “ (filetype = plexon_plx_v2) “ I have added the path of the Plexon SDK folder using: “ addpath ('E:\MatlabOfflineFilesSDK')” I have download the .diff patch file as well as the .zip folder “ft_plexon” but I don’t know where to put them. Does the “plexon” folder inside go in the main FieldTrip directory, the main Plexon SDK directory (currently listed above), or somewhere else? The same question applies to the .diff file. Thank you in advance for your assistance. Once I get FieldTrip figured out, I intend to create a thorough, novice-friendly tutorial with step-by-step instructions how to work with .pl2 files for LFP analysis. I’ve spent the better part a week fumbling through the tutorials and I’m certain I can write a novice-friendly tutorial on the wiki that will only take a few hours at most for beginners to master. My goal is first to understand how to utilize FieldTrip, at which point I can document my struggles and successes so that future users (especially my lab-mates) can obtain competency with far more efficiency. Thanks again in advance. I hope to contribute significantly to the community. Happy Holidays! Weston Pack, PhD -------------- next part -------------- An HTML attachment was scrubbed... URL: From jochem.rieger at uni-oldenburg.de Mon Dec 21 20:00:15 2015 From: jochem.rieger at uni-oldenburg.de (Jochem Rieger) Date: Mon, 21 Dec 2015 20:00:15 +0100 Subject: [FieldTrip] Job vacancies: MEG-physicist/engineer and MRI-physicist/engineer at Oldenburg University, Germany Message-ID: <56784C3F.4050501@uni-oldenburg.de> The newly founded Neuroimaging Center at the University of Oldenburg, Germany, offers the following two positions *1. MEG-Physicist/Engineer (E13/TV-L, initially 3 years) * * * *2. MRI-Physicist/Engineer (E13/TV-L, initially 3 years)* The positions are suitable for part-time work. The Neuroimaging Center hosts a state of the art magnetoencephalograph (ElektaTriux) and a magnetic resonance tomograph (Siemens Prisma 3T) and is embedded in an excellent interdisciplinary scientific environment with a strong research focus on neurosensory, neurocognitive, and medical research. We seek for highly motivated post-doctoral candidates (with PhD) with an academic university degree in physics, engineering or related fields, with documented research experience in magnetoencephalography (position 1) or magnetic resonance imaging (position 2). For both positions, fluency in English is necessary. German and experience in the design of neurocognitive experiments are desirable. Successful candidates will be responsible for the operation and administration of the MEG-system and MRI-system respectively, their infrastructure, the development and improvement of measurement and analyses techniques and user consultancy. The University of Oldenburg is rapidly growing and offers a vibrant scientific environment with strong foci on cognitive and sensory neuroscience and a new medical school. The European Medical School is a cooperation project between the Universities of Oldenburg and Groningen and three local hospitals. Oldenburg is an attractive city in Germany's northwest with excellent quality of life. It is close to Bremen, Hamburg, Groningen, and approx. 1 h from the north sea. The University of Oldenburg is dedicated to increasing the percentage of women in science. Therefore, female candidates are particularly encouraged to apply and will be given preference in cases of equal qualification. Handicapped applicants will be given preference if equally qualified. Electronic applications (one pdf file) are preferred and can be send to: Professor Dr. JochemRieger: Jochem.rieger at uni-oldenburg.de Applications by mail should be sent to Prof. Jochem Rieger Universität Oldenburg Kuepkersweg 74 (W30) 26129 Oldenburg Germany The application process is open until January 31st 2016. Applications should include your CV, a list of most recent publications, and a statement (max. 3 pages). -------------- next part -------------- An HTML attachment was scrubbed... URL: From plyons at udel.edu Mon Dec 21 20:39:59 2015 From: plyons at udel.edu (Peter Lyons) Date: Mon, 21 Dec 2015 14:39:59 -0500 Subject: [FieldTrip] Clarification on plotting WPLI Message-ID: Hello Everyone, I have a question regarding the interpretation of negative values in the debiased wPLI. Although the reference page on the debiased wPLI notes that estimates are computed by squaring the wPLI values, I and others have noticed that some of the values in the debiased wPLI spectrum are negative. How should these negative values be interpreted in reference to 0? To view the results of the debiased wPLI connectivity analysis (ft_connectivity analysis with cfg.method = 'wpli_debiased'), I've been using the ft_topoplotER function. However, I'm concerned that the default scaling (zlim = 'maxmin') of the plot does not seem to register the negative values in the debiased wPLI spectrum. That is, the negative values are not being plotted. It is curious, however, that the ft_topoplotER does register the negative values in the *non-debiased *wPLI spectrum. Is there a reason why the ft_topoplotER function is treating the negative values from the debiased vs. non-debiased wPLI spectrums differently? Is there perhaps a more appropriate plotting function I should be using to view the debiased wPLI output? I would greatly appreciate any guidance in this. Thank you! Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From shlomitbeker at gmail.com Tue Dec 22 07:42:31 2015 From: shlomitbeker at gmail.com (Shlomit Beker) Date: Tue, 22 Dec 2015 06:42:31 +0000 Subject: [FieldTrip] Please remove me from mailing list Message-ID: <7fa9847a19964083a25ceb552d18577f@EXPRD01.hosting.ru.nl> -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Tue Dec 22 18:48:01 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Tue, 22 Dec 2015 12:48:01 -0500 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, According to the warning messages that pop up, the annotation channel is not being read because it is at a different sampling rate than the data. >From what I can tell, this appears to be a common problem. http://www.fieldtriptoolbox.org/getting_started/edf explains a workaround; have you tried this? Alternatively, you could consider trying some other toolboxes---I believe mne-python is capable of handling this issue with EDF triggers straightforwardly, or you could use one of the softwares that is specifically made for EDF (such as EDFViewer or EDFBrowser) to export your annotations into a format that is more easily readable and then use that to create your cfg.trl structure for Fieldtrip. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 4 > Date: Mon, 21 Dec 2015 12:59:38 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <916358647.1306232.1450702778200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear Steve,I have shared my data file in drop box with you. > I am trying to read the events in this file and I get 0 events. > cfg2.trialdef.eventtype? = '?' > Could you please help me out? > Thanks?__________________________________________________ Leila Ayoubian, > PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Monday, December 21, 2015 11:39 AM > Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not > needed if all you want to do is read a single segment of continuous data > based on predetermined latencies; you may notice that, in the sample code > snippets I sent in my last message, I did not use this function at all, I > just hard-coded the latency range in cfg.trl (and then passed this cfg > structure to ft_preprocessing() ). So, if this is all you need to do, there > is no need to worry about these additional parameters. > > If you are trying to read multiple segments of data as separate epochs > into one dataset (which is what you would accomplish by using > cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why > it's not working for you at the moment; I would have to see your code to be > able to diagnose what might be going on. > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > ? > > Message: 2 > Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I > got a different result at first. > But now I see thecfg2.trialdef.triallength = 1;? > there is no difference in the way data is loaded once I change the number > to let's say 5! Where should I see that difference??Thanks again.Kind > regards > ?__________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Saturday, December 19, 2015 2:06 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > I'm not sure why it didn't work for you. I tried the following code (on a > sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and > it worked perfectly for me: > > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 500 0]; > cfg.continuous = 'yes'; > data_500samples = ft_preprocessing(cfg); > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 1000 0]; > cfg.continuous = 'yes'; > data_1000samples = ft_preprocessing(cfg); > > > > Here's the output: > >> data_500samples > > data_500samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x500 double]} > ???????? trial: {[37x500 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 500] > ?????????? cfg: [1x1 struct] > > >> data_1000samples > > data_1000samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x1000 double]} > ???????? trial: {[37x1000 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 1000] > ?????????? cfg: [1x1 struct] > > > Best, > Steve > > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/? > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Friday, December 18, 2015 12:37 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > > > > > ? > _______________________________________________ > 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/20151221/7403e94b/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Mon, 21 Dec 2015 15:49:12 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] EDF+ annotations > Message-ID: > <782532884.1387709.1450712952642.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi all,I am new to fieldtrip .I am trying to load some edf+ file to Matlab > and read the events/annotations. These annotations are usually seizure, or > spikes.... > The files are EEG data from nicollet one, lengthy data for epileptic > patients. > This is how I try to look at the events: > > cfg2 = []; > > cfg2.dataset = 'For leila.edf'; > cfg2.trialdef.eventtype? = '?' > cfg2 = ft_definetrial( cfg2 ); > > > cfg2.continuous = 'yes'; > data2 = ft_preprocessing(cfg2); > However the output for events are always empty.Does anyone have an idea > how I could extract the events/annotation on these files? > > Thanks in advance for your assistance. > Best regards > __________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151221/7d290354/attachment-0001.html > > > > ------------------------------ > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fanshine at yeah.net Wed Dec 23 09:55:28 2015 From: fanshine at yeah.net (Hanson) Date: Wed, 23 Dec 2015 16:55:28 +0800 (CST) Subject: [FieldTrip] Make a custom layout Message-ID: <7af7ec0c.1eaf.151ce0cdf79.Coremail.fanshine@yeah.net> Dear all, I am new to FieldTrip and trying to do the time-frequency analysis of my eeg data , however it seems that no suitable layout. And I use ft_prepare_layout function to make a custom layout(electrode_position32.mat). %% Time-frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:2:30; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.toi = -0.5:0.05:1.5; TFRhann = ft_freqanalysis(cfg, data); cfg = []; cfg.showlabels = 'yes'; cfg.layout = 'electrode_position32.mat'; figure ft_multiplotTFR(cfg, TFRhann); cfg = []; cfg.channel = 'C4'; figure ft_singleplotTFR(cfg, TFRhann); cfg = []; cfg.layout = 'electrode_position32.mat'; figure ft_topoplotTFR(cfg, TFRhann); When I run the script. I am getting the following error. Warning: (one of the) axis is/are not evenly spaced, but plots are made as if axis are linear > In ft_multiplotTFR at 405 In TFanalysis_zhs_2 at 52 the call to "ft_multiplotTFR" took 0 seconds the call to "ft_singleplotTFR" took 0 seconds reading layout from file electrode_position32.mat the call to "ft_prepare_layout" took 0 seconds Warning: Some points fall outside the outline, please consider using another layout > In ft_plot_topo at 171 In fieldtrip\private\topoplot_common at 731 In ft_topoplotTFR at 192 In TFanalysis_zhs_2 at 62 Index exceeds matrix dimensions. Error in ft_plot_topo (line 182) mask{i}(end+1, :) = mask{i}(1, :); % force them to be closed Error in topoplot_common (line 731) ft_plot_topo(chanX,chanY,datavector,opt{:}); Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in TFanalysis_zhs_2 (line 62) ft_topoplotTFR(cfg, TFRhann); Do you have any suggestion about it? Thank you very much for your attention. Kind Regards, Hanson -------------- next part -------------- An HTML attachment was scrubbed... URL: From daria.laptinskaya at googlemail.com Tue Dec 1 09:58:46 2015 From: daria.laptinskaya at googlemail.com (Daria Laptinskaya) Date: Tue, 1 Dec 2015 09:58:46 +0100 Subject: [FieldTrip] SCD and coherence analysis In-Reply-To: <52d6-565c1c80-25-55c3b400@102538225> References: <52d6-565c1c80-25-55c3b400@102538225> Message-ID: Hi Barbara, try this: sens=ft_read_sens('GSN-HydroCel-257.sfp'); cfg=[]; cfg.elec=sens; Hope it helps :-) Daria 2015-11-30 10:52 GMT+01:00 Barbara Schorr : > Dear Fieltripers, > > I would like to do coherence analysis. I did a SCD analysis on my data > first ('finite' method), and want to run ft_mvaranalysis now. I get > the error > > Error using ft_datatype_sens (line 186) > inconsistent number of channels in sensor description > > As cfg.elec I use the GSN-HydroCel-257.sfp file which is included in > fieldtrip (my raw data set has 257 channels), but there are only 256 > channels left after the SCD analysis. Can this cause the problem? > > Has anyone had this problem before and can provide a solution? I only > found one prior entry with this topic, but there was no final solution for > it. > > > Thanks and all the best, > Barbara > > > _______________________________________________ > 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 barbara.schorr at uni-ulm.de Tue Dec 1 15:18:31 2015 From: barbara.schorr at uni-ulm.de (Barbara Schorr) Date: Tue, 01 Dec 2015 15:18:31 +0100 Subject: [FieldTrip] =?utf-8?q?SCD_and_coherence_analysis?= In-Reply-To: Message-ID: <38ba-565dac00-3-4dd4ed00@147935417> Dear Daria, I did exactly this. The problem occurs afterwards, when I want to run ft_mvaranalysis on the data that result from ft_scalpcurrentdensity. In the fieldtrip document it states, that the output data of ft_scalpcurrentdensity has the same format as the input data. When I run ft_mvaranalysis on the original data, everything works fine, but with the SCD data I get this error that the number of channels in sensor description is inconsistent. Has anyone else experienced this problem? Best, Barbara Am Dienstag, 01. Dezember 2015 12:00 CET, fieldtrip-request at science.ru.nl schrieb: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: power suppression during DICS beamforming ? > (Mait? Crespo Garc?a) > 2. Re: SCD and coherence analysis (Daria Laptinskaya) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 30 Nov 2015 15:31:20 +0000 (UTC) > From: Mait? Crespo Garc?a > To: FieldTrip discussion list > Subject: Re: [FieldTrip] power suppression during DICS beamforming ? > Message-ID: > <1881724873.21184223.1448897480847.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fr?d?ri, > maybe you have the solution already. > In case not, could you explain how did you get the last two plots? Are spectra computed after averaging across all virtual channel spectra or you are representing the spectrum of the source with maximal power? > Best,Maite > > > > El Jueves 26 de noviembre de 2015 13:55, Fr?d?ric Roux escribi?: > > > Dear all, > > I am observing a counter-intuitive result after applying the spatial filters obtained from DICS beamforming to my MEG data. > > The plot in the attachment summarizes the issue: The raw data shows a clear peak of activity at 10 Hz, however, after applying the spatial filter to the MEG data the spectrum of the virtual channels shows that power in this frequency band is reduced. The same also happens when I apply a spatial filter in the gamma range for power at 70 Hz to the raw MEG signals. > > Is this something that falls out of the beamformer math due to the fact how the algorithm suppresses power at all locations by minimizing the noise level, or is there something wrong with my code? I (maybe naively) assumed that the results should come out the opposite. On the other hand, when plotting the noise normalized maps (NAI) of both the alpha and gamma beamformers the sources look quite accurate. Should I normalize with the level of noise first before plotting the spectrum to see the expected results (ie an upregulation of power instead of a downregulation of power)? > > The code that I use to generate the figures is: > > % 1) compute CSD matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.foilim = [10 10]; > cfg.tapsmofrq = 2; > cfg.pad = 'maxperlen'; > cfg.taper = 'dpss'; > > [csd] = ft_freqanalysis(cfg,meg_data); > > > % 2) compute DICS filter > cfg = []; > cfg.method = 'dics'; > cfg.grad = meg_data.grad; > cfg.headmodel = vol; > cfg.frequency = csd.freq; > > cfg.dics.realfiter = 'yes'; > cfg.dics.fixedori = 'yes'; > > [alpha_filter]= ft_sourceanalysis(cfg,csd); > > % 3) compute the virtual channel data > > VC = meg_data; > VC.trial = cell(1,length(meg_data.trial)); > VC.label = cell(1,length(alpha_filter.avg.pow)); > > for i = 1:length(VC.trial) > ? for j = 1:length(VC.label) > > ? ? ? VC.trial{i}(j,:) = alpha_filter{j}*meg_data.trial{i}; > ? ? ? VC.label(j) = {['virtual_channel',num2str(j)]}; > ? end; > end; > > % 4) compute the spectrum of the virtual channel data > cfg = []; > cfg.method = 'mtmfft'; > cfg.pad = 'maxperlen'; > cfg.taper = 'dpss'; > cfg.tapsmofrq = 1; > cfg.foi = 0.1:100; > > [pow] = ft_freqanalysis(cfg,VC); > > > Any help or suggestions would be greatly appreciated. > > Fred > > -- > Fr?d?ric Roux > Postdoctoral Scientist, Marie-Curie fellow > BCBL. Basque Center on Cognition, Brain & Language. > > f.roux at bcbl.eu > Tel: +34 943 309 300 Ext 211 > Fax: +34 943 309 052 > > Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer > --------------------------------------------------------------------------- > > ?The probability of success is difficult to estimate; but if we never search the chance of success is zero.? > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Tue, 1 Dec 2015 09:58:46 +0100 > From: Daria Laptinskaya > To: FieldTrip discussion list > Subject: Re: [FieldTrip] SCD and coherence analysis > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Barbara, > > try this: > sens=ft_read_sens('GSN-HydroCel-257.sfp'); > cfg=[]; > cfg.elec=sens; > > Hope it helps :-) > Daria > > > > > > > 2015-11-30 10:52 GMT+01:00 Barbara Schorr : > > > Dear Fieltripers, > > > > I would like to do coherence analysis. I did a SCD analysis on my data > > first ('finite' method), and want to run ft_mvaranalysis now. I get > > the error > > > > Error using ft_datatype_sens (line 186) > > inconsistent number of channels in sensor description > > > > As cfg.elec I use the GSN-HydroCel-257.sfp file which is included in > > fieldtrip (my raw data set has 257 channels), but there are only 256 > > channels left after the SCD analysis. Can this cause the problem? > > > > Has anyone had this problem before and can provide a solution? I only > > found one prior entry with this topic, but there was no final solution for > > it. > > > > > > Thanks and all the best, > > Barbara > > > > > > _______________________________________________ > > 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 61, Issue 1 > **************************************** From eriksenj at ohsu.edu Wed Dec 2 03:04:56 2015 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 2 Dec 2015 02:04:56 +0000 Subject: [FieldTrip] accommodating air pockets in FEM head model Message-ID: Hi, I am reading the FieldTrip documentation on creating an FEM model and see that the following tissue types are output from the segmentation process: Gray White Csf Skull Scalp Q1: Since I am using a 256 channel EGI system with electrodes over the lower part of the head and face, I absolutely need to be able to include air voxels as well. Anyone have any knowledge of such a possibility? Q2: Beyond that I would also like to include other tissue types such as fat, muscle, and eyeball (vitrious). I suppose I could find other segmentation software to simply create a more varied segmentation and insert it in the processing pipeline, but would like to know if that would mess anything up. Q3: Next, can the FEM handle anisotropic conductivities for white matter and skull? Q4: has anyone out there actually used the FDM model? Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From carsten.wolters at uni-muenster.de Wed Dec 2 08:53:17 2015 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 2 Dec 2015 08:53:17 +0100 Subject: [FieldTrip] accommodating air pockets in FEM head model In-Reply-To: References: Message-ID: <565EA36D.5030005@uni-muenster.de> Hi Jeff, Q3: yes, FEM can model anisotropy and white matter is anisotropic, but skull is a three-layered-structure consisting of spongiosa and compacta, see http://www.ncbi.nlm.nih.gov/pubmed/20690140 For Q4: FEM allows geometry-adaptation, see http://www.ncbi.nlm.nih.gov/pubmed/17694865 As far as I know, modeling using irregular meshes might get difficult to implement within an FDM framework. For Q1 and Q2: Mainly tissues between sources and electrodes are important to be modeled (so white matter anisotropy is only important for deeper sources) and FSL and freesurfer can do a good job on segmentation. Air-compartments can possibly best be modeled by hand-correction of the FSL output. Please see http://www.ncbi.nlm.nih.gov/pubmed/24671208 on how we solve forward modeling to be able to combine EEG and MEG. More infos are available in the two following theses: http://www.sci.utah.edu/~wolters/PaperWolters/2014/Lanfer_Dissertation_July2-2014.pdf http://www.sci.utah.edu/~wolters/PaperWolters/2015/Umit_Aydin_Dissertation_2015.pdf Best regards Carsten Am 02.12.2015 um 03:04 schrieb K Jeffrey Eriksen: > > Hi, > > I am reading the FieldTrip documentation on creating an FEM model and > see that the following tissue types are output from the segmentation > process: > > Gray > > White > > Csf > > Skull > > Scalp > > Q1: Since I am using a 256 channel EGI system with electrodes over the > lower part of the head and face, I absolutely need to be able to > include air voxels as well. Anyone have any knowledge of such a > possibility? > > Q2: Beyond that I would also like to include other tissue types such > as fat, muscle, and eyeball (vitrious). I suppose I could find other > segmentation software to simply create a more varied segmentation and > insert it in the processing pipeline, but would like to know if that > would mess anything up. > > Q3: Next, can the FEM handle anisotropic conductivities for white > matter and skull? > > Q4: has anyone out there actually used the FDM model? > > Thanks, > > -Jeff Eriksen > > > > _______________________________________________ > 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: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Wed Dec 2 14:55:57 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Wed, 2 Dec 2015 13:55:57 +0000 Subject: [FieldTrip] Head segmentation Message-ID: Jeff The resources from Carsten Wolters and the answers were right on. We have a 128 channel system. We add “nasal cavity” which includes nasal, throat, and sinuses in our FEM model. We do a lot of the segmenting with FSL (bet, fast, betsur, SPMf) and custom programs, and then do manual editing to identify the air passages. The separate segments are then put together with a custom program. The air cavities might be important for the 256-channel EGI system, where on the sides and front of the face the electrodes could have some dipolar sources and the places in between would affect the source estimation. Anything below the skull, not air cavity, we give a conductivity of muscle, which is very close to scalp; again the electrodes below the skull are over something and I presume would need a realistic estimated head media and conductivity. As I wrote earlier, we have been using FT for FEM recently; also have gotten good (similar to FEM) results with the Dipoli BEM model. I have one already-published supplemental information that briefly describes our FEM model, and one in-press supplemental information, both articles using the EMSE program. I am working on our first publication using the FEM from FT. Re “Mainly tissues between sources and electrodes are important to be modeled (so white matter anisotropy is only important for deeper sources)”. This may be practically correct, but I have suspected (and EGI’s rationale for whole-head coverage) that to get a good measure of a dipolar source whose positive or negative pole land somewhere below the skull area, one needs a good model of the head over all the places where the current flow is manifested. We have some prefrontal sources with large negative potentials exhibiting on the frontal-central 10-10 electrodes, and which have a large positive scalp potential on the “Oz” electrodes. However, it turns out these potentials show up on Iz and in the EGI electrodes below Iz (128 channel), so having a model for scalp and muscle over the neck might be important. I don’t know what the effect is of leaving these out, but I have preferred to do the whole head segmentation in case these have some effect. One last consideration. Most BEM and FEM models on the FT site use the segmentation of the brain, skull, and scalp about at the level of the MNI head. This does not include the electrodes below the horizon of the MNI head, and there is a lot of area below the MNI head that is covered by the EGI 128 and 256 channel systems. This adds significantly to the volume of the voxels used for the FEM estimation. For BEM models we cut the head off at about 10% below the level of the lowest EGI 128 channel electrodes, and generally have done so also for the FEM models we use in FT. The electrodes are located on the places below the MNI head, so one has to have a “head” model with positions below those typically used in the FT’s demo programs. We do a whole head MRI down to the neck, and then use a custom program to get a MRI volume with a head that extends about 10% lower than the lowest EGI-128 electrodes. John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.tadel at mcgill.ca Wed Dec 2 22:03:33 2015 From: francois.tadel at mcgill.ca (=?UTF-8?Q?Fran=c3=a7ois_Tadel?=) Date: Wed, 2 Dec 2015 16:03:33 -0500 Subject: [FieldTrip] Error in ft_dipolefitting.m ? Message-ID: <565F5CA5.9080409@mcgill.ca> Hello, When fitting single dipoles on multiple time points at once, I have an error line 578: source.dip.unit = headmodel.unit; The syntax is incorrect that source.dip is an array with multiple dipoles. Should this be replaced with the following line ? [source.dip.unit] = deal(headmodel.unit); Cheers, Francois From erin.white at sickkids.ca Wed Dec 2 22:55:40 2015 From: erin.white at sickkids.ca (Erin White) Date: Wed, 2 Dec 2015 21:55:40 +0000 Subject: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images In-Reply-To: References: Message-ID: <0D4EE8880DEE3047BEC905C0EC463F8C2769EBD7@SKMBXX03.sickkids.ca> Hi Steve, Thanks so much for your helpful comment! I'll give this a try! All the best Erin ---------------------------------------------------- Erin White, PhD Post-Doctoral Research Fellow Neurosciences and Mental Health The Hospital for Sick Children 555 University Avenue Toronto, Ontario Canada Telephone: (647)834-7813 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Stephen Politzer-Ahles [stephen.politzer-ahles at ling-phil.ox.ac.uk] Sent: November 27, 2015 7:28 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images Hi Erin, I don't use the multiplot functions much, so my solution is clunky and there may be others on the list with a better way to do this. But just in case, here's how I do it: Rather than using multiplot, I make each plot individually, and use the subplot() command to arrange multiple plots into a figure. Within each subplot, I just use some custom code to draw the ticks. For example: tickspots = [-200:200:1000]; % one tick every 200 ms, from -200 to 1000 ms tickheight = [-.5 .5]; % how high and low the ticks will go for tickspots = tickspot % iterate through tick spots plot( [tickspot tickspot], tickheight, 'k' ); % plot each tick as a black line end; Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ ------------------------------ Message: 2 Date: Thu, 26 Nov 2015 12:48:25 +0000 From: Erin White > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Adding tick marks to the X and Y axes in multiplotER and multiplotTFR images Message-ID: <0D4EE8880DEE3047BEC905C0EC463F8C2769D79D at SKMBXX03.sickkids.ca> Content-Type: text/plain; charset="iso-8859-1" Hi, I'm new at programming and was wondering if someone could help with something that I'm sure is simple. I'd like to add tick marks to my multiplotER and multiplotTFR figures so that the timing and amplitude (for multiplotER) and timing and frequency (for multiplotTFR) scales are presented clearly. For example, I'd like a tick mark on my X axes every 200 ms, and on the y axes, every 2 mV for ER images and every 5 Hz for TFR images. Could anyone suggest what I should add to my code to show this? Thanks very much! Erin ---------------------------------------------------- Erin White, PhD Post-Doctoral Research Fellow Neurosciences and Mental Health The Hospital for Sick Children 555 University Avenue Toronto, Ontario Canada Telephone: (647)834-7813 ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- 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 60, Issue 23 ***************************************** ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.babaeeghazvini at vu.nl Fri Dec 4 20:14:26 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Fri, 4 Dec 2015 19:14:26 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronny.ibrahim at mq.edu.au Mon Dec 7 05:36:14 2015 From: ronny.ibrahim at mq.edu.au (Ronny Ibrahim) Date: Mon, 7 Dec 2015 15:36:14 +1100 Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data Message-ID: Dear fellow fieldtrip users, I would like to implement a clusterstatistics independentT test on a time-frequency datasets that I've acquired using the ft_freqanalysis function. When I run ft_freqstatistics on the data it would give me stats result which is based on comparing the absolute values of power spectrum instead the relative change with respect to the baseline. I have tried to perform to do my relative change power spectrum data manually but it seems that when I run the ft_freqstatistics it produces an error of which I could not figure out on why. Here is my code: C_1 = {outP10{1} outP10{2} outP10{3} outP10{4} outP10{5} outP10{6} outP10{7} outP10{8} outP10{9} outP10{10} outP10{11} outP10{12} outP10{13} outP10{14} outP10{15} outP10{16} outP10{17} outP10{18}}; C_2 = {outM10{1} outM10{2} outM10{3} outM10{4} outM10{5} outM10{6} outM10{7} outM10{8} outM10{9} outM10{10} outM10{11} outM10{12} outM10{13} outM10{14} outM10{15} outM10{16} outM10{17} outM10{18}}; %% Performing cluster statistics for the paradigm cfg = []; cfg.layout = 'EEG_KR.lay'; lay = ft_prepare_layout(cfg); % Needs to change this cfg.latency = [0 0.6]; %Need to look this up according to what cfg.frequency = [8 12];% Need to do it for different frequency bands (theta, alpha, beta, gamma). cfg.channel = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'ft_statfun_indepsamplesT'; cfg.numrandomization = 1000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 3; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg_neighb.layout = lay; cfg_neighb.method = 'triangulation'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb); cfg.ivar = 1; cfg.design = [ones(1,18) 2*ones(1,18)]; stat = ft_freqstatistics(cfg, C_2{:}, C_1{:}); %% Plotting significant clusters cfg = []; cfg.alpha = 0.05; cfg.parameter = 'stat'; cfg.layout = lay; ft_clusterplot(cfg, stat); where the variable out is essentially my time-frequency data output structure. I would greatly appreciate the input and assistance. Thank you. Kind Regards, Ronny -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at donders.ru.nl Mon Dec 7 09:24:32 2015 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 7 Dec 2015 08:24:32 +0000 Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data In-Reply-To: References: Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB279C7AFB@exprd01.hosting.ru.nl> Dear Ronny, What error do you get when running this code? You can perform a (relative) baseline correction using ft_freqbaseline with cfg.baselinetype = ‘relative’ or ‘relchange’ and cfg.baseline = [your baseline window];. If your code works on absolute values it should also work on baseline-corrected values using ft_freqbaseline. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ronny Ibrahim Sent: maandag 7 december 2015 5:36 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Clusterstatistics on relative change (%) time frequency data Dear fellow fieldtrip users, I would like to implement a clusterstatistics independentT test on a time-frequency datasets that I've acquired using the ft_freqanalysis function. When I run ft_freqstatistics on the data it would give me stats result which is based on comparing the absolute values of power spectrum instead the relative change with respect to the baseline. I have tried to perform to do my relative change power spectrum data manually but it seems that when I run the ft_freqstatistics it produces an error of which I could not figure out on why. Here is my code: C_1 = {outP10{1} outP10{2} outP10{3} outP10{4} outP10{5} outP10{6} outP10{7} outP10{8} outP10{9} outP10{10} outP10{11} outP10{12} outP10{13} outP10{14} outP10{15} outP10{16} outP10{17} outP10{18}}; C_2 = {outM10{1} outM10{2} outM10{3} outM10{4} outM10{5} outM10{6} outM10{7} outM10{8} outM10{9} outM10{10} outM10{11} outM10{12} outM10{13} outM10{14} outM10{15} outM10{16} outM10{17} outM10{18}}; %% Performing cluster statistics for the paradigm cfg = []; cfg.layout = 'EEG_KR.lay'; lay = ft_prepare_layout(cfg); % Needs to change this cfg.latency = [0 0.6]; %Need to look this up according to what cfg.frequency = [8 12];% Need to do it for different frequency bands (theta, alpha, beta, gamma). cfg.channel = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'ft_statfun_indepsamplesT'; cfg.numrandomization = 1000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 3; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg_neighb.layout = lay; cfg_neighb.method = 'triangulation'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb); cfg.ivar = 1; cfg.design = [ones(1,18) 2*ones(1,18)]; stat = ft_freqstatistics(cfg, C_2{:}, C_1{:}); %% Plotting significant clusters cfg = []; cfg.alpha = 0.05; cfg.parameter = 'stat'; cfg.layout = lay; ft_clusterplot(cfg, stat); where the variable out is essentially my time-frequency data output structure. I would greatly appreciate the input and assistance. Thank you. Kind Regards, Ronny -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Dec 7 09:30:25 2015 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 7 Dec 2015 09:30:25 +0100 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local> Message-ID: <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: > Hello > > I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = hdm; > cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); > cfg.grid.inside = 1:size(cfg.grid.pos, 1); > cfg.grid.outside = []; > cfg.keepfilter = 'yes'; > source_idx = ft_sourceanalysis(cfg, tlock); > Not from the voxel indicating maximum power ([maxval, > maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos > = sourcemodel.pos([maxcohindx maxpowindx], :)). > > Regards, > Parinaz. > _______________________________________________ > 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: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From p.babaeeghazvini at vu.nl Mon Dec 7 12:52:55 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Mon, 7 Dec 2015 11:52:55 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> Hi Julian, Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: cfg = [] cfg.atlas = atlas; cfg.roi = atlas.tissuelabel(1) cfg.inputcoord = 'mni'; mas = ft_volumelookup(cfg,grid); cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.xgrid = cfg.grid.ygrid = cfg.grid.zgrid = cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. an other question that I have is that: when I compute the maximum index from [maxvalr, maxpowindxr] = max(srcetask.avg.pow) How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) Regards, Parinaz. From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 9:30 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. _______________________________________________ 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 Mon Dec 7 17:57:10 2015 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 7 Dec 2015 17:57:10 +0100 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local> Message-ID: Hi Parinaz, > My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. You don't. You compute your virtual channels for a regular grid (something like -20:1:20 for x,y and z) and select the virtual channels in your ROI in a second step. This might be a bit of an overkill, as you don't use most of your channels later on, but maybe you want to extend your analysis to other cortical areas - you never know. Anyways, to be more clear: You compute your virtual electrodes on a predefined grid. To find your ROI, you use ft_volumelookup to get a binary matrix which tells you, which voxels of the standard MRI are in your ROI. Then you build a high-resolution grid based on the standard MRI (It's important to use one grid point per voxel). Using pythagoras, you can now find the closest high-resolution grid points for each of your virtual electrodes. As soon as you have these, you can see which of them have a value of 1 in your binary matrix of ft_volumelookup. Now you know which virtual electrodes are inside your ROI. So for example, you have 2000 virtual electrodes on a -20:1:20 regular grid. You then compute a binary matrix and a high-resolution grid based on the standard MRI resulting in ~900000 grid points on a 91x109x91 grid. Using pythagoras, you find that grid point 6000 is closest to virtual electrode #1. Then you can see if element 6000 from your binary matrix is a 1. If so, your virtual electrode #1 is in your ROI, if not, your virtual electrode is not in your ROI. > How I can find the atlas position to this maximum point in my code Do you want to have the coordinates or the actual label? A while ago, I hacked the ft_sourceplot-function to give me the coordinate position as an output, but I can't find the code anymore. I'm sure you can edit the function to also output the label, as this has to be included as a text element somewhere in the function. But please be aware that editing the FT-functions can severely compromise the functionality. Good luck, Julian Am 07.12.2015 um 12:52 schrieb Babaeeghazvini, P.: > Hi Julian, > > Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: > > cfg = [] > > cfg.atlas = atlas; > > cfg.roi = atlas.tissuelabel(1) > > cfg.inputcoord = 'mni'; > > mas = ft_volumelookup(cfg,grid); > > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = hdm; > cfg.grid.xgrid = > > cfg.grid.ygrid = > > cfg.grid.zgrid = > > cfg.grid.inside = 1:size(cfg.grid.pos, 1); > cfg.grid.outside = []; > cfg.keepfilter = 'yes'; > source_idx = ft_sourceanalysis(cfg, tlock); > > My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. > > an other question that I have is that: when I compute the maximum index from > [maxvalr, maxpowindxr] = max(srcetask.avg.pow) > > How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) > > Regards, > Parinaz. > > > > > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] > Sent: Monday, December 07, 2015 9:30 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch > > Hi Parinaz, > > I'm not sure if I understood your question correctly. > Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? > > In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. > In the second case, it's a tad more complicated, but here's how I do it: > 1. Compute the virtual channels for all grid points in the cortex > 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) > 3. Build a high-resolution 3D-Grid on the standard MRI > 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) > 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. > > I hope this helps, let me know otherwise. > > Julian > > Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: > >> Hello >> >> I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.vol = hdm; >> cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); >> cfg.grid.inside = 1:size(cfg.grid.pos, 1); >> cfg.grid.outside = []; >> cfg.keepfilter = 'yes'; >> source_idx = ft_sourceanalysis(cfg, tlock); >> Not from the voxel indicating maximum power ([maxval, >> maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos >> = sourcemodel.pos([maxcohindx maxpowindx], :)). >> >> Regards, >> Parinaz. >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From p.babaeeghazvini at vu.nl Mon Dec 7 20:20:15 2015 From: p.babaeeghazvini at vu.nl (Babaeeghazvini, P.) Date: Mon, 7 Dec 2015 19:20:15 +0000 Subject: [FieldTrip] Extracting virtual EEG channel from a patch In-Reply-To: References: <561966C5AD6B9647B14A89A8189322E02F0C01C6@PEXMB100A.vu.local> <561966C5AD6B9647B14A89A8189322E02F0C020E@PEXMB100A.vu.local>, <54D55463-2B37-4AEB-ABA8-0B5EFCAB3564@gmail.com> <561966C5AD6B9647B14A89A8189322E02F0C2859@PEXMB100A.vu.local>, Message-ID: <561966C5AD6B9647B14A89A8189322E02F0C29CB@PEXMB100A.vu.local> Hi Julian, Thank you very much for your help now it is completely clear for me. Parinaz. ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 5:57 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. You don't. You compute your virtual channels for a regular grid (something like -20:1:20 for x,y and z) and select the virtual channels in your ROI in a second step. This might be a bit of an overkill, as you don't use most of your channels later on, but maybe you want to extend your analysis to other cortical areas - you never know. Anyways, to be more clear: You compute your virtual electrodes on a predefined grid. To find your ROI, you use ft_volumelookup to get a binary matrix which tells you, which voxels of the standard MRI are in your ROI. Then you build a high-resolution grid based on the standard MRI (It's important to use one grid point per voxel). Using pythagoras, you can now find the closest high-resolution grid points for each of your virtual electrodes. As soon as you have these, you can see which of them have a value of 1 in your binary matrix of ft_volumelookup. Now you know which virtual electrodes are inside your ROI. So for example, you have 2000 virtual electrodes on a -20:1:20 regular grid. You then compute a binary matrix and a high-resolution grid based on the standard MRI resulting in ~900000 grid points on a 91x109x91 grid. Using pythagoras, you find that grid point 6000 is closest to virtual electrode #1. Then you can see if element 6000 from your binary matrix is a 1. If so, your virtual electrode #1 is in your ROI, if not, your virtual electrode is not in your ROI. How I can find the atlas position to this maximum point in my code Do you want to have the coordinates or the actual label? A while ago, I hacked the ft_sourceplot-function to give me the coordinate position as an output, but I can't find the code anymore. I'm sure you can edit the function to also output the label, as this has to be included as a text element somewhere in the function. But please be aware that editing the FT-functions can severely compromise the functionality. Good luck, Julian Am 07.12.2015 um 12:52 schrieb Babaeeghazvini, P.: Hi Julian, Thank you very much for your kind reply. Yes I want to compute virtual channel from an atlas area like whole Precentral_L (not from one voxel in this area). So your second explanation helps me. If I understood correctly in the code below I should use all grid points belong to atlas: cfg = [] cfg.atlas = atlas; cfg.roi = atlas.tissuelabel(1) cfg.inputcoord = 'mni'; mas = ft_volumelookup(cfg,grid); cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.xgrid = cfg.grid.ygrid = cfg.grid.zgrid = cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); My problem is how I should use the output of volumelookup here for cfg.grid.xgrid, cfg.grid.ygrid and cfg.grid.zgrid. an other question that I have is that: when I compute the maximum index from [maxvalr, maxpowindxr] = max(srcetask.avg.pow) How I can find the atlas position to this maximum point in my code (I can see this atlas label in the figure that I get from sourceplot, but I want to report this label in matlab) Regards, Parinaz. From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: Monday, December 07, 2015 9:30 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Extracting virtual EEG channel from a patch Hi Parinaz, I'm not sure if I understood your question correctly. Do you want to find the atlas label to a given virtual channel? Or do you want to compute a virtual channel on a given atlas label? In the first case, you can simply interpolate your virtual EEG channels to the standard MRI and use source plot with an atlas to find the corresponding label. In the second case, it's a tad more complicated, but here's how I do it: 1. Compute the virtual channels for all grid points in the cortex 2. If you have computed the virtual channels on an individual MRI, make sure that the positions correspond to the standard MRI (I think that's described in the source analysis-tutorial) 3. Build a high-resolution 3D-Grid on the standard MRI 4. Select all grid points from the grid of step 3 which belong to an atlas (see ft_volumelookup) 5. Use pythagoras to find the virtual channels from step 2 closest to the grid points from step 4. I hope this helps, let me know otherwise. Julian Am 04.12.2015 um 20:14 schrieb Babaeeghazvini, P.: Hello I want to reconstruct a source signal the same as below in page http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors cfg = []; cfg.method = 'lcmv'; cfg.vol = hdm; cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :); cfg.grid.inside = 1:size(cfg.grid.pos, 1); cfg.grid.outside = []; cfg.keepfilter = 'yes'; source_idx = ft_sourceanalysis(cfg, tlock); Not from the voxel indicating maximum power ([maxval, maxpowindx] = max(source_diff.avg.pow);), but from the atlas area which this voxel belongs to, such as Supp_Motor_Area_L. So my question is: How I can get the atlas range and atlas label belong to a voxel, and how I can use this atlas area range in this code to reconstruct a signal instead of using (cfg.grid.pos = sourcemodel.pos([maxcohindx maxpowindx], :)). Regards, Parinaz. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 amickan1990 at gmail.com Thu Dec 10 18:14:10 2015 From: amickan1990 at gmail.com (Anne Mickan) Date: Thu, 10 Dec 2015 18:14:10 +0100 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test Message-ID: Dear all, I'm just starting to work on a cluster-based permutation test script based on the tutorial for within-subject designs on the fieldtrip website. I ran into an issue when computing the [stat] matrix. I used the code as it was on the website: [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); with the Correct and Incorrect matrices looking as follows: Correct{1} avg: [34x600 double] time: [1x600 double] fsample: '500' label: {34x1 cell} dimord: 'chan_time' dof: [34x600 double] var: [34x600 double] The function runs without problems, i.e I don't get any error messages. However, the result seems incomplete. stat = prob: [25x1 double] posclusters: [] posclusterslabelmat: [25x1 double] posdistribution: [1x500 double] negclusters: [1x1 struct] negclusterslabelmat: [25x1 double] negdistribution: [1x500 double] cirange: [25x1 double] mask: [25x1 logical] stat: [25x1 double] ref: [25x1 double] dimord: 'chan_time' label: {25x1 cell} time: 0 cfg: [1x1 struct] Specifically, I later run into trouble with the stat.posclusterslabelmat and stat.negclusterslabelmat matrices which should apparantly contain far more values something more like 25x500 instead of 25x1. When calling neg_int = all(neg(:, m(k):m(k+1)), 2) I get the "Index exceeds matrix dimensions" error message which I assume has to do with the fact that "neg" does not have the appropriate matrix dimensions (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) Where is the error / where should I look for the error? Some further design details: Nsubj = 24 2 conditions = Correct, Incorrect Within-subject design sampling rate = 500 34 channels I hope I gave enough / the necessary information for someone to help me out. Thanks in advance! Best, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.peatfield at gmail.com Thu Dec 10 20:13:10 2015 From: nick.peatfield at gmail.com (Nicholas A. Peatfield) Date: Thu, 10 Dec 2015 11:13:10 -0800 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test In-Reply-To: References: Message-ID: Hi Anne, To get an answer/suggestion you should provide the part of your script detailing your cfg inputs. Cheers, Nick On 10 December 2015 at 09:14, Anne Mickan wrote: > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Nicholas Peatfield, PhD -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Dec 10 20:36:45 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Dec 2015 19:36:45 +0000 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test In-Reply-To: References: Message-ID: <7CAF2781-D756-4C0B-9B56-F05642437AF9@fcdonders.ru.nl> Hi Anne, I agree with Nick, some more information would be helpful. At this stage my wild guess (assuming that you did not constrain your ‘search space’, using cfg.channel and cfg.latency before calling ft_timelockstatistics) would be that there’s a major discrepancy in the descriptive dimensions of your data (i.e. the ‘labels’ and the time points) across the input arguments. FieldTrip does an explicit check on the labels and time points, it only proceeds to do calculations on the channels and time points that are present in each and every input argument. With respect to time points: this could even mean that numerical inaccuracies are the showstopper here. These inaccuracies could be easily introduced when e.g. downsampling. Best, Jan-Mathijs On Dec 10, 2015, at 8:13 PM, Nicholas A. Peatfield > wrote: Hi Anne, To get an answer/suggestion you should provide the part of your script detailing your cfg inputs. Cheers, Nick On 10 December 2015 at 09:14, Anne Mickan > wrote: Dear all, I'm just starting to work on a cluster-based permutation test script based on the tutorial for within-subject designs on the fieldtrip website. I ran into an issue when computing the [stat] matrix. I used the code as it was on the website: [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); with the Correct and Incorrect matrices looking as follows: Correct{1} avg: [34x600 double] time: [1x600 double] fsample: '500' label: {34x1 cell} dimord: 'chan_time' dof: [34x600 double] var: [34x600 double] The function runs without problems, i.e I don't get any error messages. However, the result seems incomplete. stat = prob: [25x1 double] posclusters: [] posclusterslabelmat: [25x1 double] posdistribution: [1x500 double] negclusters: [1x1 struct] negclusterslabelmat: [25x1 double] negdistribution: [1x500 double] cirange: [25x1 double] mask: [25x1 logical] stat: [25x1 double] ref: [25x1 double] dimord: 'chan_time' label: {25x1 cell} time: 0 cfg: [1x1 struct] Specifically, I later run into trouble with the stat.posclusterslabelmat and stat.negclusterslabelmat matrices which should apparantly contain far more values something more like 25x500 instead of 25x1. When calling neg_int = all(neg(:, m(k):m(k+1)), 2) I get the "Index exceeds matrix dimensions" error message which I assume has to do with the fact that "neg" does not have the appropriate matrix dimensions (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) Where is the error / where should I look for the error? Some further design details: Nsubj = 24 2 conditions = Correct, Incorrect Within-subject design sampling rate = 500 34 channels I hope I gave enough / the necessary information for someone to help me out. Thanks in advance! Best, Anne _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nicholas Peatfield, PhD _______________________________________________ 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 aishwaryaselvaraj1708 at gmail.com Fri Dec 11 07:30:39 2015 From: aishwaryaselvaraj1708 at gmail.com (aishwarya selvaraj) Date: Fri, 11 Dec 2015 12:00:39 +0530 Subject: [FieldTrip] filed trip In-Reply-To: References: <5bd6dabc93ec431694d6c282894f6b62@EXPRD02.hosting.ru.nl> Message-ID: do you still have that m file with you?? could you share ?? On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra wrote: > Hi Aishwarya, > > I faced the similar problem. You are supposed to change your data > (.mat format) in a data structure that is read by fieldtrip. For that > you need at least following information > 1. Channel label and their location (If you don't have this file you > can use standard file available in Fieldtrip and you can include only > those electrode that you have been using in your experiment) > 2. sampling rate of the data (that you would have done while recording the > data) > 3. time vector > 4. no. of trials > > You can create them in MATLAB and put them together in a structure > along with your recorded data. This worked for me. > > -- > Ashutosh Mishra > 5th year Integrated BS-MS student > Department of Physical Sciences > Indian Institute of Science Education and Research, Kolkata > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Regards, Aishwarya Selvaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Fri Dec 11 09:09:14 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 11 Dec 2015 08:09:14 +0000 Subject: [FieldTrip] filed trip In-Reply-To: References: <5bd6dabc93ec431694d6c282894f6b62@EXPRD02.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A2801E0@exprd03.hosting.ru.nl> Dear Aishwarya, The data structure should look something like this: % 1. Load data load EEGdata.mat % 2. Make FieldTrip structure, manually data.label={'Channel1Name’,’Channel2Name’,’Channel3Name’}; %your channel names data.trial{1}=[Channel1Data; Channel2Data; Channel3Data]'; % do for each trial: channelsxtimepoints data data.fsample=500; %your recording sampling frequency data.time{1}=[Trial1Timepoints]; % for each trial: timepoints per data sample (e.g: [0 0.02 0.04 0.06 etc]) Going through the Walktrough Tutorial will be the best starting point when you just started to use FieldTrip: http://www.fieldtriptoolbox.org/walkthrough After that, you may go through the other Tutorial documentation or Example Matlab scripts. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of aishwarya selvaraj Sent: vrijdag 11 december 2015 7:31 To: FieldTrip discussion list Subject: Re: [FieldTrip] filed trip do you still have that m file with you?? could you share ?? On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: Hi Aishwarya, I faced the similar problem. You are supposed to change your data (.mat format) in a data structure that is read by fieldtrip. For that you need at least following information 1. Channel label and their location (If you don't have this file you can use standard file available in Fieldtrip and you can include only those electrode that you have been using in your experiment) 2. sampling rate of the data (that you would have done while recording the data) 3. time vector 4. no. of trials You can create them in MATLAB and put them together in a structure along with your recorded data. This worked for me. -- Ashutosh Mishra 5th year Integrated BS-MS student Department of Physical Sciences Indian Institute of Science Education and Research, Kolkata _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Regards, Aishwarya Selvaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From juangpc at gmail.com Fri Dec 11 11:43:05 2015 From: juangpc at gmail.com (Juan) Date: Fri, 11 Dec 2015 11:43:05 +0100 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel Message-ID: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data ​" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates% the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid .resolution = 1; cfg.grid .tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole gridfigure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight ; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Dec 11 11:54:54 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Dec 2015 10:54:54 +0000 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: References: Message-ID: <93DA3667-0D6E-45A6-8387-1C01B51D7925@fcdonders.ru.nl> Hi Juan, We’ll look into this specific issue soon, it should work without specifying sensor positions. However, for now and in general I would recommend just using a pre-cooked template grid. These can be found in fieldtrip/template/sourcemodel. This is mentioned in the tutorial, and I will make this more explicit shortly. Best, Jan-Mathijs On Dec 11, 2015, at 11:43 AM, Juan > wrote: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.resolution = 1; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Dec 11 13:19:39 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Dec 2015 12:19:39 +0000 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: References: Message-ID: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> Hi Juan, I could reproduce your issue, and have done 2 things: - I updated the wiki to make it clear that it would be easier to use a pre-cooked grid. - I adjusted ft_prepare_sourcemodel so that it also works when only providing the template_headmodel, as per the example code. The new version of ft_prepare_sourcemodel will become available in tonight’s release on the ftp-server. Best wishes, and thanks for noticing. Jan-Mathijs On Dec 11, 2015, at 11:43 AM, Juan > wrote: Dear Community, My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. Currently I am learning to do beamforming source analysis using Fieldtrip. While following the tutorial: "Creating a sourcemodel for source-reconstruction of MEG or EEG data" ​​ ​ ​when I reach " Subject-specific grids that are equivalent across subjects in normalized space ​" procedure , there is an example code. This code throws an error when I execute it with a version of Fieldtrip I downloaded yesterday. I think I have downloaded correctly all the required info (Subject01.zip). ​Code: % NOTE: the path to the template file is user-specific template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.resolution = 1; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; ​​ cfg.headmodel = template_headmodel; The problem occurs when I execute ​this line: ​ ​ ​ ​ template_grid = ft_prepare_sourcemodel(cfg); Matlab's output: ​ >> template_grid = ft_prepare_sourcemodel(cfg); creating dipole grid based on automatic 3D grid with specified resolution Error using ft_prepare_sourcemodel (line 317) creating a 3D-grid sourcemodel this way requires sensor position information to estimate the extent of the brain ​ I have managed to look around and found that you can specify the required "sensor position information" by executing this code just before (considering the folder with the information downloaded for this subject is located just there: ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; Then the rest of the sample code in the tutorial can be executed with no issues. template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); My questions: ​Is there a better solution for this problem? Maybe I can learn a little bit more about the toolbox with your answers. I didn't want to correct the wiki because​ my solution depends on where one is placing the downloaded subject's data, and it is platform dependent. Should I add something to the tutorial anyway? ​ I figure this can be interesting to other people.​ ​ ​ Best, Juan _______________________________________________ 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 juangpc at gmail.com Fri Dec 11 13:55:57 2015 From: juangpc at gmail.com (Juan) Date: Fri, 11 Dec 2015 13:55:57 +0100 Subject: [FieldTrip] possible bug in tutorial code for creating sourcemodel In-Reply-To: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> References: <1556EC3A-15DD-4A75-BB39-228DB6545073@fcdonders.ru.nl> Message-ID: Hi Jan-Mathijs, Thanks for your quick response, H2H. I've actually learned about precooked models with your answer. Many thanks. In the same page, in the part "Make the individual subjects' grid", there seems to be a unit-related problem. One can find this code % read the single subject anatomical MRI mri = ft_read_mri('Subject01.mri'); % segment the anatomical MRI cfg = []; cfg.output = 'brain'; seg = ft_volumesegment(cfg, mri); % construct the volume conductor model (i.e. head model) for each subject% this is optional, and for the purpose of this tutorial only required for% plotting, later on cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, seg); % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid .warpmni = 'yes'; cfg.grid .template = template_grid; cfg.grid .nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri;grid = ft_prepare_sourcemodel(cfg); % make a figure of the single subject headmodel, and grid positionsfigure ; hold on; ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); ft_plot_mesh(grid .pos(grid .inside,:)); When executing it, there seems to be a problem with dimensions. "headmodel" struct is in mm and "grid" struct is in cm. So unfortunately the resulting figure ends up being something like [image: Inline image 1] I've tested to specify 'mm' units in the configuration struct before calling ft_prepare_sourcemodel: cfg.grid.unit='mm'; Or by calling ft_convert_units right after ft_prepare_sourcemodel. grid=ft_convert_units(grid,'mm'); Both solutions work fine, producing a figure very similar to the one in the tutorial. I've included the first solution in the wiki. I hope this is ok. Best, Juan On Fri, Dec 11, 2015 at 1:19 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Juan, > > I could reproduce your issue, and have done 2 things: > - I updated the wiki to make it clear that it would be easier to use a > pre-cooked grid. > - I adjusted ft_prepare_sourcemodel so that it also works when only > providing the template_headmodel, as per the example code. > The new version of ft_prepare_sourcemodel will become available in > tonight’s release on the ftp-server. > > Best wishes, and thanks for noticing. > Jan-Mathijs > > > On Dec 11, 2015, at 11:43 AM, Juan wrote: > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ​ " > ​​ > > ​ ​when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ​" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ​Code: > > % NOTE: the path to the template file is user-specific > template = ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system > % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. > % construct the dipole grid in the template brain coordinates% the negative inwardshift means an outward shift of the brain surface for inside/outside detection > cfg = []; > cfg.grid .resolution = 1; > cfg.grid .tight = 'yes'; > cfg.inwardshift = -1.5; > ​​ > cfg.headmodel = template_headmodel; > > The problem occurs when I execute ​this line: > > ​ > ​ > ​ > ​ > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ​ > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ​ > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > ​cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > template_grid = ft_prepare_sourcemodel(cfg); > % make a figure with the template head model and dipole gridfigure hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight ; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > > My questions: > > ​Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because​ my solution depends on where > one is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ​ I figure this can be interesting to other people.​ > ​ > ​ > > Best, > > > Juan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 8130 bytes Desc: not available URL: From frsantos at fpce.up.pt Fri Dec 11 13:57:52 2015 From: frsantos at fpce.up.pt (Fernando Ferreira-Santos) Date: Fri, 11 Dec 2015 12:57:52 +0000 Subject: [FieldTrip] 3rd International Conference of the ESCAN Message-ID: <2BAB036A9BAEA44984A131DFCE446108010BFD7B96@SRVMBX01.fpceup.psi.up.pt> Dear Colleagues, The 3rd International Conference of the European Society for Cognitive and Affective Neuroscience (ESCAN) is accepting submissions for symposia and oral/poster presentations. The conference will take place in that will take place in Porto, Portugal, between 23-26 of June, 2016, at the Porto Palácio Congress Hotel & Spa (http://www.hotelportopalacio.com/en/hotel-overview.html). The submission deadline is the 8th of January, 2016. Please find all the details in the conference website: www.escan2016.eu We would appreciate it if you could pass this information along to other colleagues and students. Attached you may find a poster with the call for submissions. We are looking forward to seeing you in Porto in 2016! Fernando Babosa and Fernando Ferreira-Santos (University of Porto) Chairs of the Local Organizing Committee P.S.: Apologies if you get multiple postings of this announcement. -- Laboratory of Neuropsychophysiology Faculty of Psychology and Education Sciences University of Porto Rua Alfredo Allen, 4200-135 Porto (Portugal) Tel.: +351 226079700 http://www.fpce.up.pt/labpsi/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: escan2016_announce_call.pdf Type: application/pdf Size: 295799 bytes Desc: escan2016_announce_call.pdf URL: From marlene.boenstrup at googlemail.com Fri Dec 11 21:30:46 2015 From: marlene.boenstrup at googlemail.com (=?UTF-8?Q?Marlene_B=C3=B6nstrup?=) Date: Fri, 11 Dec 2015 21:30:46 +0100 Subject: [FieldTrip] ft_sourceinterpolate fails when cfg.moveinward and cfg.inwardshift was used to create sourcemodel Message-ID: Dear fieldtrip-community, I struggle at plotting source reconstruction results, and my routine even fails when using the template structural data. I think it is based on a shortcoming of the ft_sourceinterpolation function. This is why I am optimistic to find help in this platform: I prepare the leadfields based on the standard_sourcemodel3d6mm, the vol called standard_bem.mat, the electrode positions defined in standard_1005.elc. Since some of the dipoles that are assigned as "inside" in the sourcemodel3d6mm are actually sticking out of the inner bem boundary, leading to distorted leadfields, I re-prepare the sourcemodel based on the following specifications: mri=ft_read_mri('single_subj_T1.nii'); mri.coordsys = 'spm'; mri = ft_volumereslice([], mri); cfg=[]; cfg.mri = mri; cfg.elec=elec; cfg.vol=vol; cfg.grid.warpmni = 'yes'; cfg.grid.template = grid; % sourcemodel3d6mm cfg.grid.nonlinear = 'no'; cfg.moveinward=5; cfg.inwardshift=0; grid = ft_prepare_sourcemodel(cfg); this comes out with a vector of positions in three dimensional space, all of them being assigned to inside and none of them as outside. The leadfields prepared based on this sourcemodel look very convincing and the ft_sourceanalysis function also works. But the problem is to interpolate this on the anatomical image: Nested in the function ft_sourceinterpolate, the function ft_checkdata, specifically the subfunction source2volume leads to a misconfiguration with all the positions of the functional data being distributed in to a full 3D volume. In the end the orthoplot of the brain is a big fully activated cube. I hope someone has a good idea how to deal with this issue in fieldtrip and shares his/her expertise with us. Many greetings, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From amickan1990 at gmail.com Sat Dec 12 16:12:57 2015 From: amickan1990 at gmail.com (Anne Mickan) Date: Sat, 12 Dec 2015 16:12:57 +0100 Subject: [FieldTrip] fieldtrip Digest, Vol 61, Issue 7 In-Reply-To: References: Message-ID: Dear Nick and Jan-Mathijs, thanks for your emails. Here is the part of the code that details the cfg inputs. I basically stuck to what was in the tutorial: cfg = []; cfg.channel = 'all'; % prepare neighbouring channels cfg_neighb = []; cfg_neighb.method = 'distance'; cfg.channel = 'all'; cfg_neighb.feedback = 'yes'; cfg_neighb.layout = 'easycapM3.mat'; neighbours = ft_prepare_neighbours(cfg_neighb, Correct{1}); % settings for statistics cfg = []; cfg.channel = {'EEG'}; cfg.latency = [0 1]; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.neighbours = neighbours; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.5; cfg.numrandomization = 500; % prepare design subj = 24; design = zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; Best, Anne On Fri, Dec 11, 2015 at 12:00 PM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Stats matrix incomplete - cluster-based permutation test > (Anne Mickan) > 2. Re: Stats matrix incomplete - cluster-based permutation test > (Nicholas A. Peatfield) > 3. Re: Stats matrix incomplete - cluster-based permutation > test > (Schoffelen, J.M. (Jan Mathijs)) > 4. Re: filed trip (aishwarya selvaraj) > 5. Re: filed trip (Pelt, S. van (Stan)) > 6. possible bug in tutorial code for creating sourcemodel (Juan) > 7. Re: possible bug in tutorial code for creating sourcemodel > (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 10 Dec 2015 18:14:10 +0100 > From: Anne Mickan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > < > CANX43OJN4h_1jEuDKMNwQC4sHeW+E2_StnS3WLkEbOkVpMerQA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/6dea45e9/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Dec 2015 11:13:10 -0800 > From: "Nicholas A. Peatfield" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > 3Ew0_4-mB9CxchT0CSQSKDo4e1JCkEtmdCxp-CWhYtQ at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Anne, > > To get an answer/suggestion you should provide the part of your script > detailing your cfg inputs. > > Cheers, > > Nick > > On 10 December 2015 at 09:14, Anne Mickan wrote: > > > Dear all, > > > > I'm just starting to work on a cluster-based permutation test script > based > > on the tutorial for within-subject designs on the fieldtrip website. I > ran > > into an issue when computing the [stat] matrix. I used the code as it was > > on the website: > > > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > > > with the Correct and Incorrect matrices looking as follows: > > > > Correct{1} > > > > avg: [34x600 double] > > time: [1x600 double] > > fsample: '500' > > label: {34x1 cell} > > dimord: 'chan_time' > > dof: [34x600 double] > > var: [34x600 double] > > > > The function runs without problems, i.e I don't get any error messages. > > However, the result seems incomplete. > > > > stat = > > prob: [25x1 double] > > posclusters: [] > > posclusterslabelmat: [25x1 double] > > posdistribution: [1x500 double] > > negclusters: [1x1 struct] > > negclusterslabelmat: [25x1 double] > > negdistribution: [1x500 double] > > cirange: [25x1 double] > > mask: [25x1 logical] > > stat: [25x1 double] > > ref: [25x1 double] > > dimord: 'chan_time' > > label: {25x1 cell} > > time: 0 > > cfg: [1x1 struct] > > > > Specifically, I later run into trouble with the stat.posclusterslabelmat > > and stat.negclusterslabelmat matrices which should apparantly contain far > > more values something more like 25x500 instead of 25x1. When calling > > neg_int = all(neg(:, m(k):m(k+1)), 2) > > I get the "Index exceeds matrix dimensions" error message which I assume > > has to do with the fact that "neg" does not have the appropriate matrix > > dimensions > > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > > > Where is the error / where should I look for the error? > > > > Some further design details: > > Nsubj = 24 > > 2 conditions = Correct, Incorrect > > Within-subject design > > sampling rate = 500 > > 34 channels > > > > I hope I gave enough / the necessary information for someone to help me > > out. > > > > Thanks in advance! > > > > Best, > > Anne > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > Nicholas Peatfield, PhD > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/6503aa5f/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Thu, 10 Dec 2015 19:36:45 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: <7CAF2781-D756-4C0B-9B56-F05642437AF9 at fcdonders.ru.nl> > Content-Type: text/plain; charset="windows-1252" > > Hi Anne, > > I agree with Nick, some more information would be helpful. At this stage > my wild guess (assuming that you did not constrain your ?search space?, > using cfg.channel and cfg.latency before calling ft_timelockstatistics) > would be that there?s a major discrepancy in the descriptive dimensions of > your data (i.e. the ?labels? and the time points) across the input > arguments. FieldTrip does an explicit check on the labels and time points, > it only proceeds to do calculations on the channels and time points that > are present in each and every input argument. With respect to time points: > this could even mean that numerical inaccuracies are the showstopper here. > These inaccuracies could be easily introduced when e.g. downsampling. > > Best, > Jan-Mathijs > > > On Dec 10, 2015, at 8:13 PM, Nicholas A. Peatfield < > nick.peatfield at gmail.com> wrote: > > Hi Anne, > > To get an answer/suggestion you should provide the part of your script > detailing your cfg inputs. > > Cheers, > > Nick > > On 10 December 2015 at 09:14, Anne Mickan amickan1990 at gmail.com>> wrote: > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Nicholas Peatfield, PhD > > _______________________________________________ > 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/20151210/deacc96c/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Fri, 11 Dec 2015 12:00:39 +0530 > From: aishwarya selvaraj > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > Message-ID: > < > CACWTKSojvkrwtTLFGpsh2H6CtHXY7-krT7C5-NBjqXdHPs1Ljg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > do you still have that m file with you?? > could you share ?? > > On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: > > > Hi Aishwarya, > > > > I faced the similar problem. You are supposed to change your data > > (.mat format) in a data structure that is read by fieldtrip. For that > > you need at least following information > > 1. Channel label and their location (If you don't have this file you > > can use standard file available in Fieldtrip and you can include only > > those electrode that you have been using in your experiment) > > 2. sampling rate of the data (that you would have done while recording > the > > data) > > 3. time vector > > 4. no. of trials > > > > You can create them in MATLAB and put them together in a structure > > along with your recorded data. This worked for me. > > > > -- > > Ashutosh Mishra > > 5th year Integrated BS-MS student > > Department of Physical Sciences > > Indian Institute of Science Education and Research, Kolkata > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > Regards, > Aishwarya Selvaraj > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/0e2bdbaf/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Fri, 11 Dec 2015 08:09:14 +0000 > From: "Pelt, S. van (Stan)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > Message-ID: > <7CCA2706D7A4DA45931A892DF3C2894C2A2801E0 at exprd03.hosting.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Dear Aishwarya, > > The data structure should look something like this: > > % 1. Load data > load EEGdata.mat > > % 2. Make FieldTrip structure, manually > data.label={'Channel1Name?,?Channel2Name?,?Channel3Name?}; %your channel > names > data.trial{1}=[Channel1Data; Channel2Data; Channel3Data]'; % do for each > trial: channelsxtimepoints data > data.fsample=500; %your recording sampling frequency > data.time{1}=[Trial1Timepoints]; % for each trial: timepoints per data > sample (e.g: [0 0.02 0.04 0.06 etc]) > > Going through the Walktrough Tutorial will be the best starting point when > you just started to use FieldTrip: > http://www.fieldtriptoolbox.org/walkthrough > After that, you may go through the other Tutorial documentation or Example > Matlab scripts. > > Best, > Stan > > -- > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour > Radboud University > Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > From: fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] On Behalf Of aishwarya selvaraj > Sent: vrijdag 11 december 2015 7:31 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] filed trip > > do you still have that m file with you?? > could you share ?? > > On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra > wrote: > Hi Aishwarya, > > I faced the similar problem. You are supposed to change your data > (.mat format) in a data structure that is read by fieldtrip. For that > you need at least following information > 1. Channel label and their location (If you don't have this file you > can use standard file available in Fieldtrip and you can include only > those electrode that you have been using in your experiment) > 2. sampling rate of the data (that you would have done while recording the > data) > 3. time vector > 4. no. of trials > > You can create them in MATLAB and put them together in a structure > along with your recorded data. This worked for me. > > -- > Ashutosh Mishra > 5th year Integrated BS-MS student > Department of Physical Sciences > Indian Institute of Science Education and Research, Kolkata > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Regards, > Aishwarya Selvaraj > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/5309b65c/attachment-0001.html > > > > ------------------------------ > > Message: 6 > Date: Fri, 11 Dec 2015 11:43:05 +0100 > From: Juan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] possible bug in tutorial code for creating > sourcemodel > Message-ID: > XT8P5jeAp7-C4TDBNN1Aoe8X_mtYLh8w at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ?" > ?? > > ? ?when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ?" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ?Code: > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret > the coordinate system > % segment the template brain and construct a volume conduction model > (i.e. head model): % this is needed to describe the boundary that > define which dipole locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % > Convert the vol to cm, because the CTF convenction is to express > everything in cm. > % construct the dipole grid in the template brain coordinates% the > negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid < > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html > >.resolution > = 1; > cfg.grid < > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.tight > = 'yes'; > cfg.inwardshift = -1.5; > ?? > cfg.headmodel = template_headmodel; > > The problem occurs when I execute ?this line: > > ? > ? > ? > ? > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ? > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ? > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > ?cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > template_grid = ft_prepare_sourcemodel(cfg); > % make a figure with the template head model and dipole gridfigure > >hold > > on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight > ; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > > My questions: > > ?Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because? my solution depends on where one > is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ? I figure this can be interesting to other people.? > ? > ? > > Best, > > > Juan > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/fee4d5ef/attachment-0001.html > > > > ------------------------------ > > Message: 7 > Date: Fri, 11 Dec 2015 10:54:54 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] possible bug in tutorial code for creating > sourcemodel > Message-ID: <93DA3667-0D6E-45A6-8387-1C01B51D7925 at fcdonders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Juan, > > We?ll look into this specific issue soon, it should work without > specifying sensor positions. However, for now and in general I would > recommend just using a pre-cooked template grid. These can be found in > fieldtrip/template/sourcemodel. This is mentioned in the tutorial, and I > will make this more explicit shortly. > > Best, > > Jan-Mathijs > > On Dec 11, 2015, at 11:43 AM, Juan juangpc at gmail.com>> wrote: > > Dear Community, > > My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab. > Currently I am learning to do beamforming source analysis using Fieldtrip. > > While following the tutorial: "Creating a sourcemodel for > source-reconstruction of MEG or EEG data > ?" > ?? > > ? ?when I reach " > Subject-specific grids that are equivalent across subjects in normalized > space > ?" procedure , there is an example code. This code throws an error when I > execute it with a version of Fieldtrip I downloaded yesterday. I think I > have downloaded correctly all the required info (Subject01.zip). > > ?Code: > > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): > % this is needed to describe the boundary that define which dipole > locations are 'inside' the brain. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_headmodel = ft_prepare_headmodel(cfg, template_seg); > template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert > the vol to cm, because the CTF convenction is to express everything in cm. > > % construct the dipole grid in the template brain coordinates > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.resolution > = 1; > cfg.grid< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.tight > = 'yes'; > cfg.inwardshift = -1.5; > > ?? > cfg.headmodel = template_headmodel; > > > The problem occurs when I execute ?this line: > > > ? > ? > ? > ? > template_grid = ft_prepare_sourcemodel(cfg); > > Matlab's output: > ? > >> template_grid = ft_prepare_sourcemodel(cfg); > creating dipole grid based on automatic 3D grid with specified resolution > Error using ft_prepare_sourcemodel (line 317) > creating a 3D-grid sourcemodel this way requires sensor position > information to estimate the extent of the brain > ? > > > I have managed to look around and found that you can specify the required > "sensor position information" by executing this code just before > (considering the folder with the information downloaded for this subject is > located just there: > > > ?cfg.gradfile='Subject01\Subject01.ds\Subject01.res4'; > > > > Then the rest of the sample code in the tutorial can be executed with no > issues. > > > template_grid = ft_prepare_sourcemodel(cfg); > > % make a figure with the template head model and dipole grid > figure< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure.html> > hold > on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight< > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/camlight.html>; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > > My questions: > > ?Is there a better solution for this problem? Maybe I can learn a little > bit more about the toolbox with your answers. > > I didn't want to correct the wiki because? my solution depends on where > one is placing the downloaded subject's data, and it is platform dependent. > Should I add something to the tutorial anyway? > ? I figure this can be interesting to other people.? > ? > ? > > Best, > > > Juan > > _______________________________________________ > 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/20151211/346949fd/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 61, Issue 7 > **************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From LordJojo at gmx.de Sat Dec 12 19:59:26 2015 From: LordJojo at gmx.de (Jojo Klemt) Date: Sat, 12 Dec 2015 19:59:26 +0100 Subject: [FieldTrip] channel problem ft_freqstatistics Message-ID: An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Dec 13 12:12:40 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 13 Dec 2015 11:12:40 +0000 Subject: [FieldTrip] Stats matrix incomplete - cluster-based permutation test Message-ID: Hi Anne, It looks like you're running stats on grand-average structures created with cfg.keepindividual='no' (because your Correct and Incorrect structures have an .avg field). I always do stats on a grand-average structure created with cfg.keepindividual='yes' (which will yield a structure with no .avg field, and instead an .individual field, which in your case will be 24x34x600, since you have participants). Do things work out better if you try it that way? Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 1 > Date: Thu, 10 Dec 2015 18:14:10 +0100 > From: Anne Mickan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Stats matrix incomplete - cluster-based > permutation test > Message-ID: > < > CANX43OJN4h_1jEuDKMNwQC4sHeW+E2_StnS3WLkEbOkVpMerQA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm just starting to work on a cluster-based permutation test script based > on the tutorial for within-subject designs on the fieldtrip website. I ran > into an issue when computing the [stat] matrix. I used the code as it was > on the website: > > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:}); > > with the Correct and Incorrect matrices looking as follows: > > Correct{1} > > avg: [34x600 double] > time: [1x600 double] > fsample: '500' > label: {34x1 cell} > dimord: 'chan_time' > dof: [34x600 double] > var: [34x600 double] > > The function runs without problems, i.e I don't get any error messages. > However, the result seems incomplete. > > stat = > prob: [25x1 double] > posclusters: [] > posclusterslabelmat: [25x1 double] > posdistribution: [1x500 double] > negclusters: [1x1 struct] > negclusterslabelmat: [25x1 double] > negdistribution: [1x500 double] > cirange: [25x1 double] > mask: [25x1 logical] > stat: [25x1 double] > ref: [25x1 double] > dimord: 'chan_time' > label: {25x1 cell} > time: 0 > cfg: [1x1 struct] > > Specifically, I later run into trouble with the stat.posclusterslabelmat > and stat.negclusterslabelmat matrices which should apparantly contain far > more values something more like 25x500 instead of 25x1. When calling > neg_int = all(neg(:, m(k):m(k+1)), 2) > I get the "Index exceeds matrix dimensions" error message which I assume > has to do with the fact that "neg" does not have the appropriate matrix > dimensions > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); ) > > Where is the error / where should I look for the error? > > Some further design details: > Nsubj = 24 > 2 conditions = Correct, Incorrect > Within-subject design > sampling rate = 500 > 34 channels > > I hope I gave enough / the necessary information for someone to help me > out. > > Thanks in advance! > > Best, > Anne > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From recasensmarc at gmail.com Sun Dec 13 16:07:08 2015 From: recasensmarc at gmail.com (Marc Recasens) Date: Sun, 13 Dec 2015 15:07:08 +0000 Subject: [FieldTrip] channel problem ft_freqstatistics In-Reply-To: References: Message-ID: Hi Johannes, I think the same problem has been reported before in: http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009789.html Roy Cox looked into the problem with quite detail and found the bug in the ft_get_selection function, line 630-631 during a call to "*label = union(label, selchannel);"*. I recently had the same problem and it was solved after commenting that line. However it might be better if you update FieldTrip to the last version where this issue is fixed. Hope that helps. Best wishes Marc On Sat, Dec 12, 2015 at 6:59 PM, Jojo Klemt wrote: > Dear community > > My name is Johannes Klemt and I'm analysing eeg/emg-power data of patients > and healthy controls for my medical doctorate in Tübingen. > I have a small problem using ft_freqstatistics. After performing an > independent samples t-test, the channels are suddenly ordered alphabeticaly. > The preprocessing and power analysis were not performed in field trip. > The electrode labels and neighbours were defined and put into the > following cfg: > cfg.elec > cfg.neighbours > The statistics were then calculated using montecarlo method, but the > channel order in stat.label is changed into alphabetical order, so the stat > plot looks nice but is quite useless. > Colleagues of mine used ft_freqgrandaverage as input data and did not have > the problem, but I can't find the bug. > I designed a file containing the layout structure and tried putting it in > by using > cfg.layout > but it was ignored. > > Any help would be deeply appreciated. > > Yours sincerely > > Johannes Klemt > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 12:30:33 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 12:30:33 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Message-ID: Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From Elana.Harris at cchmc.org Mon Dec 14 13:12:29 2015 From: Elana.Harris at cchmc.org (Harris, Elana) Date: Mon, 14 Dec 2015 12:12:29 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: Message-ID: cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Mon Dec 14 13:21:41 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Mon, 14 Dec 2015 12:21:41 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Dear Elana, The 50ms timesteps result in the 41 timebins. Per timebin, the average power spectrum (TFRhann.powspctrm) is computed over all trials that have data in that specific time bin. In your case, the power in the earlier time bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that of the later ones (e.g. 1.95-2.0s), because of your variable trial length. If you specify cfg.keeptrials=’yes’, you can see that the individual trial’s TFRs will have different amount of data points. Hope that helps. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Harris, Elana Sent: maandag 14 december 2015 13:12 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 13:41:27 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 13:41:27 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Message-ID: Dear Stan and Elana, thank you very much for your answers and help. Just another question: if I understood correctly, there's no way to compute fft for single trials, since TFRhann.powspctrm is by definition an average along trials. Is that true? Thanks again. Bests, Federica 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) : > Dear Elana, > > > > The 50ms timesteps result in the 41 timebins. Per timebin, the average > power spectrum (TFRhann.powspctrm) is computed over all trials that have > data in that specific time bin. In your case, the power in the earlier time > bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that > of the later ones (e.g. 1.95-2.0s), because of your variable trial length. > > > > If you specify cfg.keeptrials=’yes’, you can see that the individual > trial’s TFRs will have different amount of data points. > > > > Hope that helps. > > > > Best, > > Stan > > > > -- > > Stan van Pelt, PhD > > Donders Institute for Brain, Cognition and Behaviour > > Radboud University > > Montessorilaan 3, B.01.34 > > 6525 HR Nijmegen, the Netherlands > > tel: +31 24 3616288 > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Harris, Elana > *Sent:* maandag 14 december 2015 13:12 > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > > > I just noticed this line has an error should be -0.5:0.5:2 > > > > Sorry, I am new to fieldtrip myself and can't be more helpful yet. > > > > Cheers, > > > > Elana > ------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Federica Mauro [federica.ma at gmail.com] > *Sent:* Monday, December 14, 2015 6:30 AM > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Number of epochs in the ft_freqanalysis output > > Dear all, > > > > I'm having a problem in using the ft_freqanalysis function, so I'm writing > to ask your help. > > I'm trying to get power data for each 2-seconds epochs of my eeg files. > > My eeg files are not of the same length (they don't have the same number > of epochs), however the output of the function (namely TFRhann.powspctrm) > always gives me power data for the same number of epochs, namely 41, > unregarding of the effective number of epochs. > > > > Here is the code I'm using: > > > > cfg = []; > > cfg.output = 'pow'; > > % cfg.channel > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 4:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window > = 0.5 sec > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > TFRhann = ft_freqanalysis(cfg, eeg); > > > > Do you have any suggestion about it? > > Thank you very much for your attention. > > > > Worm regards, > > Federica > > > > > > _______________________________________________ > 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 stan.vanpelt at donders.ru.nl Mon Dec 14 14:30:32 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Mon, 14 Dec 2015 13:30:32 +0000 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> Hi Federica, If you want to have an estimate for each trial separately, you should specify cfg.keeptrials=’yes’ when calling ft_freqanalysis. See also http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip? Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Federica Mauro Sent: maandag 14 december 2015 13:41 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear Stan and Elana, thank you very much for your answers and help. Just another question: if I understood correctly, there's no way to compute fft for single trials, since TFRhann.powspctrm is by definition an average along trials. Is that true? Thanks again. Bests, Federica 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) >: Dear Elana, The 50ms timesteps result in the 41 timebins. Per timebin, the average power spectrum (TFRhann.powspctrm) is computed over all trials that have data in that specific time bin. In your case, the power in the earlier time bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that of the later ones (e.g. 1.95-2.0s), because of your variable trial length. If you specify cfg.keeptrials=’yes’, you can see that the individual trial’s TFRs will have different amount of data points. Hope that helps. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Harris, Elana Sent: maandag 14 december 2015 13:12 To: FieldTrip discussion list Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) I just noticed this line has an error should be -0.5:0.5:2 Sorry, I am new to fieldtrip myself and can't be more helpful yet. Cheers, Elana ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Federica Mauro [federica.ma at gmail.com] Sent: Monday, December 14, 2015 6:30 AM To: FieldTrip discussion list Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output Dear all, I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help. I'm trying to get power data for each 2-seconds epochs of my eeg files. My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs. Here is the code I'm using: cfg = []; cfg.output = 'pow'; % cfg.channel cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 4:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0:0.05:2; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, eeg); Do you have any suggestion about it? Thank you very much for your attention. Worm regards, Federica _______________________________________________ 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 LordJojo at gmx.de Mon Dec 14 15:24:32 2015 From: LordJojo at gmx.de (Jojo Klemt) Date: Mon, 14 Dec 2015 15:24:32 +0100 Subject: [FieldTrip] channel problem ft_freqstatistics In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Mon Dec 14 22:51:26 2015 From: federica.ma at gmail.com (Federica Mauro) Date: Mon, 14 Dec 2015 22:51:26 +0100 Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output In-Reply-To: <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> References: <7CCA2706D7A4DA45931A892DF3C2894C2A282A3C@exprd03.hosting.ru.nl> <7CCA2706D7A4DA45931A892DF3C2894C2A282AB6@exprd03.hosting.ru.nl> Message-ID: Hi Stan, thank you, it was really helpful. Best, Federica 2015-12-14 14:30 GMT+01:00 Pelt, S. van (Stan) : > Hi Federica, > > > > If you want to have an estimate for each trial separately, you should > specify cfg.keeptrials=’yes’ when calling ft_freqanalysis. See also > http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip > ? > > > > Best, > > Stan > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Federica Mauro > *Sent:* maandag 14 december 2015 13:41 > > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > Dear Stan and Elana, thank you very much for your answers and help. > > > > Just another question: if I understood correctly, there's no way to > compute fft for single trials, since TFRhann.powspctrm is by definition an > average along trials. Is that true? > > > > Thanks again. > > > > Bests, > > Federica > > > > 2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) >: > > Dear Elana, > > > > The 50ms timesteps result in the 41 timebins. Per timebin, the average > power spectrum (TFRhann.powspctrm) is computed over all trials that have > data in that specific time bin. In your case, the power in the earlier time > bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that > of the later ones (e.g. 1.95-2.0s), because of your variable trial length. > > > > If you specify cfg.keeptrials=’yes’, you can see that the individual > trial’s TFRs will have different amount of data points. > > > > Hope that helps. > > > > Best, > > Stan > > > > -- > > Stan van Pelt, PhD > > Donders Institute for Brain, Cognition and Behaviour > > Radboud University > > Montessorilaan 3, B.01.34 > > 6525 HR Nijmegen, the Netherlands > > tel: +31 24 3616288 > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Harris, Elana > *Sent:* maandag 14 december 2015 13:12 > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Number of epochs in the ft_freqanalysis output > > > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > > > I just noticed this line has an error should be -0.5:0.5:2 > > > > Sorry, I am new to fieldtrip myself and can't be more helpful yet. > > > > Cheers, > > > > Elana > ------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Federica Mauro [federica.ma at gmail.com] > *Sent:* Monday, December 14, 2015 6:30 AM > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Number of epochs in the ft_freqanalysis output > > Dear all, > > > > I'm having a problem in using the ft_freqanalysis function, so I'm writing > to ask your help. > > I'm trying to get power data for each 2-seconds epochs of my eeg files. > > My eeg files are not of the same length (they don't have the same number > of epochs), however the output of the function (namely TFRhann.powspctrm) > always gives me power data for the same number of epochs, namely 41, > unregarding of the effective number of epochs. > > > > Here is the code I'm using: > > > > cfg = []; > > cfg.output = 'pow'; > > % cfg.channel > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 4:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window > = 0.5 sec > > cfg.toi = -0:0.05:2; % time window "slides" from > -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > > TFRhann = ft_freqanalysis(cfg, eeg); > > > > Do you have any suggestion about it? > > Thank you very much for your attention. > > > > Worm regards, > > Federica > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From S.Hanslmayr at bham.ac.uk Wed Dec 16 12:50:48 2015 From: S.Hanslmayr at bham.ac.uk (Simon Hanslmayr) Date: Wed, 16 Dec 2015 11:50:48 +0000 Subject: [FieldTrip] PhD studentship available at University of Birmingham Message-ID: <257F6C65A372A04CA41056EACC0DE7CED841AC9A@EX8.adf.bham.ac.uk> Dear Fieldtrip Community, I take this opportunity to announce a PhD studentship that is available for talented students to work in the labs of Joff Lee and Simon Hanslmayr on a memory project involving invasive recordings of oscillations in rodents. More information about the project and instructions on how to apply can be found here: http://www.birmingham.ac.uk/research/activity/mrc-impact/imaging.aspx. Deadline for applicants is Sunday 10 January 2016. For any questions about the project please write an email to Dr Joff Lee (J.L.C.Lee at bham.ac.uk) or myself (simon.hanslmayr at bham.ac.uk). Seasonal greetings, Simon Dr. Simon Hanslmayr Senior Lecturer School of Psychology University of Birmingham Edgbaston Birmingham B15 2TT UK Tel +44 121 4146203 http://www.memorybham.com/people/#/simon-hanslmayr/ [http://www.nature.com/content/sr/ebm/1248_2014_Branded_Sig_460x80_v1.gif] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 8560 bytes Desc: image001.gif URL: From luke.bloy at gmail.com Wed Dec 16 22:29:17 2015 From: luke.bloy at gmail.com (Luke Bloy) Date: Wed, 16 Dec 2015 21:29:17 +0000 Subject: [FieldTrip] Question about ft_statfun_actvsblT Message-ID: Sorry if this is missing something fundamental but I'm abit confused about the use of ft_statfun_actvsblT for frequency analysis and how it compares to ft_statfun_depsamplesT. It seems from http://www.fieldtriptoolbox.org/tutorial/salzburg (and from trying to use it) that inorder to use ft_statfun_actvsblT the active and baseline freq structures need to have the same time dimension. Based on this I'm assuming that the active vs baseline comparison happens at each time x frequency pair, but isn't this what ft_statfun_depsamplesT does? So I guess my question is what is the difference between the two? What exactly is the comparison being performed by ft_statfun_actvsblT? Thanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 10:43:43 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) Subject: [FieldTrip] importing large edf data References: <807603762.476165.1450431823359.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo@mail.yahoo.com> Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.  So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403)   dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622)     dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566)       dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary',       strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load : filename     = 'mydata.edf'  hdr   = ft_read_header(filename);  sample.start=1  sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403)   dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622)     dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100')   >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri Dec 18 13:37:52 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 18 Dec 2015 12:37:52 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 61, Issue 14 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.pflug at musterkind.eu Fri Dec 18 14:06:32 2015 From: anja.pflug at musterkind.eu (Anja Pflug) Date: Fri, 18 Dec 2015 14:06:32 +0100 (CET) Subject: [FieldTrip] Importing large edf data In-Reply-To: References: Message-ID: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 14:13:16 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:13:16 +0000 (UTC) Subject: [FieldTrip] Importing large edf data In-Reply-To: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> Message-ID: <1753128777.512946.1450444396047.JavaMail.yahoo@mail.yahoo.com>  Thanks for your reply Anja.I need to have all the channel information at a segment of time to decide if it there is seizure occurring.  Down sampling will loose the information and I am not sure if I want to go that way, as I need to do some feature extractions/classification etc on the data. Not sure how I could cut the data in fieldtrip. Do you know?ThanksBest regards ___________________________________________________ Leila Ayoubian From: Anja Pflug To: fieldtrip at science.ru.nl Sent: Friday, December 18, 2015 1:06 PM Subject: [FieldTrip] Importing large edf data Hello Leila, have you tried to import only one of your 51 channels? If this works you  could cut the data or downsample it and then combine all channels in a later step. Best, Anja fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ 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 jorn at artinis.com Fri Dec 18 14:17:34 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Fri, 18 Dec 2015 14:17:34 +0100 Subject: [FieldTrip] Importing large edf data In-Reply-To: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> Message-ID: <007301d13996$7573dc60$605b9520$@artinis.com> Hi all, I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension. Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes. Best of luck ;) Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug Sent: Friday, December 18, 2015 14:07 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Importing large edf data Hello Leila, have you tried to import only one of your 51 channels? If this works you could cut the data or downsample it and then combine all channels in a later step. Best, Anja fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian > To: "fieldtrip at science.ru.nl " > Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com > Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Fri Dec 18 14:40:59 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <2054001626.533069.1450446059200.JavaMail.yahoo@mail.yahoo.com>  Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.  Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get:    hdr: [1x1 struct]          label: {51x1 cell}           time: {1x50710 cell}          trial: {1x50710 cell}        fsample: 1024     sampleinfo: [50710x2 double]            cfg: [1x1 struct] so the actual data which is in data.trial  is this in both cases! size(data.trial) ans =            1       50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Friday, December 18, 2015 12:37 PM Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to         fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit         http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to         fieldtrip-request at science.ru.nl You can reach the person managing the list at         fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics:    1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID:         <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ 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 leilayou_54 at yahoo.com Fri Dec 18 14:55:18 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Fri, 18 Dec 2015 13:55:18 +0000 (UTC) Subject: [FieldTrip] Importing large edf data In-Reply-To: <007301d13996$7573dc60$605b9520$@artinis.com> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> <007301d13996$7573dc60$605b9520$@artinis.com> Message-ID: <778201681.538338.1450446918121.JavaMail.yahoo@mail.yahoo.com> Thanks Jorn. Appreciate your feedback.  __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Jörn M. Horschig To: 'FieldTrip discussion list' Sent: Friday, December 18, 2015 1:17 PM Subject: Re: [FieldTrip] Importing large edf data #yiv8769305188 #yiv8769305188 -- _filtered #yiv8769305188 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv8769305188 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv8769305188 {font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv8769305188 #yiv8769305188 p.yiv8769305188MsoNormal, #yiv8769305188 li.yiv8769305188MsoNormal, #yiv8769305188 div.yiv8769305188MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv8769305188 a:link, #yiv8769305188 span.yiv8769305188MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv8769305188 a:visited, #yiv8769305188 span.yiv8769305188MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv8769305188 p {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv8769305188 span.yiv8769305188EmailStyle18 {color:#1F497D;}#yiv8769305188 .yiv8769305188MsoChpDefault {font-size:10.0pt;} _filtered #yiv8769305188 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv8769305188 div.yiv8769305188WordSection1 {}#yiv8769305188 Hi all,  I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension.  Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes.  Best of luck ;)Jörn-- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems  |  +31 481 350 980  From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug Sent: Friday, December 18, 2015 14:07 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Importing large edf data  Hello Leila,have you tried to import only one of your 51 channels?If this works you  could cut the data or downsample it and then combine all channels in a later step.Best,Anja   fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: 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. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- 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 61, Issue 14 ***************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Fri Dec 18 18:51:20 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Fri, 18 Dec 2015 07:51:20 -1000 Subject: [FieldTrip] Importing large edf data In-Reply-To: <007301d13996$7573dc60$605b9520$@artinis.com> References: <232492090.41659.0b573584-8ef2-47e8-9557-3e16f95d6d1d.open-xchange@email.1und1.de> <007301d13996$7573dc60$605b9520$@artinis.com> Message-ID: <81DC3EE6-21D4-4BB7-80B8-AF642B616768@gmail.com> Hi all, Perhaps this links helps: http://www.fieldtriptoolbox.org/getting_started/edf Arjen > On Dec 18, 2015, at 3:17 AM, Jörn M. Horschig wrote: > > Hi all, > > I am not expert in edf data, but it is indeed true that some dataformats allow for reading in single channels, while others do not, and some dataformats allow for reading in only specific time points while others do not. While the FT-end-user may specify these things always, independently of the data format, ‘behind the curtain’ FT may need to read in all data and/or channels and then throw away what the user did NOT ask for. So, while specifying only a second of data for the ft_ high level function, it might be that the specific low-level reading function (mostly written by the manufacturer) does return ALL samples anyways. Same might happen for the channel dimension. > > Most dataformats allow for at least either the one or the other, few for both and few for none. So, if specifying shorter trial lengths does not work, it might be well worth to specify only a single channel (as Anja suggested). But again, I do not know the specifics of edf. I justed wanted to add that to the discussion for educational purposes. > > Best of luck ;) > Jörn > -- > Jörn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Anja Pflug > Sent: Friday, December 18, 2015 14:07 > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Importing large edf data > > Hello Leila, > > have you tried to import only one of your 51 channels? > > If this works you could cut the data or downsample it and then combine all channels in a later step. > > Best, > > Anja > > > > fieldtrip-request at science.ru.nl hat am 18. Dezember 2015 um 12:00 geschrieben: > > > 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. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- 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 61, Issue 14 > ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sat Dec 19 15:06:46 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sat, 19 Dec 2015 14:06:46 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = hdr: [1x1 struct] label: {37x1 cell} time: {[1x500 double]} trial: {[37x500 double]} fsample: 200 sampleinfo: [1 500] cfg: [1x1 struct] >> data_1000samples data_1000samples = hdr: [1x1 struct] label: {37x1 cell} time: {[1x1000 double]} trial: {[37x1000 double]} fsample: 200 sampleinfo: [1 1000] cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Friday, December 18, 2015 12:37 PM > Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From senakahks at gmail.com Sun Dec 20 12:51:47 2015 From: senakahks at gmail.com (Senaka Amarakeerthi) Date: Sun, 20 Dec 2015 17:21:47 +0530 Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data structure. Message-ID: Dear all, I am new to FieldTrip and trying to process offline Emotive Epoc EEG data. The file I am trying to process is a single trial. The code I tried is: %% import data from testbench emotiv edf file [hdr, data_eeg] = edfread('emotive.edf'); %% Rearrange data to match FieldTrip Format % Remove unnecessary columns data.trial = data_eeg([3:16,39], : ); % Cell-array containing strings, Nchan X 1 % Based on https://emotiv.com/forum/forum14/topic1817/messages/ data.label = {'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6' 'F4' 'F8' 'AF4' 'MARKER'}; % Sampling frequency in Hz, single number data.fsample = 128; % Setting time [x, filelength] = size(data.trial); data.time{1} = [1:filelength]./data.fsample; %% Using the rearranged data % Set the trial column name and event value (what you enter to the last column. % here enter number 1 as the marker) cfg.trialdef.eventtype = 'MARKER'; cfg.trialdef.eventvalue = 1; cfg.trialdef.eventtype = '?'; ft_definetrial(cfg); %% Preprocessing cfg = []; cfg.channel = 'AF3'; cfg.lpfilter = 'yes'; cfg.hpfilter = 'yes'; cfg.bsfilter = 'yes'; cfg.lpfreq = 100; cfg.hpfreq = 10; cfg.bsfreq = [59 61]; cfg.lpfiltord = 4; cfg.hpfiltord = 4; cfg.bpfiltord = 4; cfg.lpfilttype = 'but'; cfg.hpfilttype = 'but'; ecog = ft_preprocessing(cfg,data); When I run the script. I am getting the following error. Error in ft_trialfun_general (line 78) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Do I need to set the header structure as well? Can somebody help me to get this fixed. I am reading the documentation but it seems start is bit hard! Appreciate your support -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Mon Dec 21 10:36:27 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <1459455402.1301519.1450690587900.JavaMail.yahoo@mail.yahoo.com> Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;  there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference? Thanks again.Kind regards  __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Saturday, December 19, 2015 2:06 PM Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples =            hdr: [1x1 struct]          label: {37x1 cell}           time: {[1x500 double]}          trial: {[37x500 double]}        fsample: 200     sampleinfo: [1 500]            cfg: [1x1 struct] >> data_1000samples data_1000samples =            hdr: [1x1 struct]          label: {37x1 cell}           time: {[1x1000 double]}          trial: {[37x1000 double]}        fsample: 200     sampleinfo: [1 1000]            cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/  ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Friday, December 18, 2015 12:37 PM  Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Mon Dec 21 12:35:23 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Mon, 21 Dec 2015 11:35:23 +0000 Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data structure Message-ID: Hello Senaka, I think you might be making your life more difficult by trying to directly call edfread(), which is a low-level function. Have you tried just using ft_preprocessing(), the high-level wrapper function, as described in the tutorial on the fieldtrip wiki? In my experience, this function reads EDF data straightforwardly. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 20 Dec 2015 17:21:47 +0530 > From: Senaka Amarakeerthi > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data > structure. > Message-ID: > J-1ensqWCTreAGdsHovwSavJA5sAG6i1nDGg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I am new to FieldTrip and trying to process offline Emotive Epoc EEG data. > The file I am trying to process is a single trial. > > The code I tried is: > > %% import data from testbench emotiv edf file > > [hdr, data_eeg] = edfread('emotive.edf'); > > > > %% Rearrange data to match FieldTrip Format > > % Remove unnecessary columns > > data.trial = data_eeg([3:16,39], : ); > > > > > > % Cell-array containing strings, Nchan X 1 > > % Based on https://emotiv.com/forum/forum14/topic1817/messages/ > > data.label = {'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6' > 'F4' > 'F8' 'AF4' 'MARKER'}; > > > > % Sampling frequency in Hz, single number > > data.fsample = 128; > > > > % Setting time > > [x, filelength] = size(data.trial); > > data.time{1} = [1:filelength]./data.fsample; > > %% Using the rearranged data > > > > > > % Set the trial column name and event value (what you enter to the last > column. > > % here enter number 1 as the marker) > > cfg.trialdef.eventtype = 'MARKER'; > > cfg.trialdef.eventvalue = 1; > > cfg.trialdef.eventtype = '?'; > > ft_definetrial(cfg); > > > %% Preprocessing > > cfg = []; > > cfg.channel = 'AF3'; > > cfg.lpfilter = 'yes'; > > cfg.hpfilter = 'yes'; > > cfg.bsfilter = 'yes'; > > cfg.lpfreq = 100; > > cfg.hpfreq = 10; > > cfg.bsfreq = [59 61]; > > cfg.lpfiltord = 4; > > cfg.hpfiltord = 4; > > cfg.bpfiltord = 4; > > cfg.lpfilttype = 'but'; > > cfg.hpfilttype = 'but'; > > ecog = ft_preprocessing(cfg,data); > > > When I run the script. I am getting the following error. > > Error in ft_trialfun_general (line 78) > hdr = ft_read_header(cfg.headerfile, 'headerformat', > cfg.headerformat); > > Do I need to set the header structure as well? Can somebody help me to get > this fixed. I am reading the documentation but it seems start is bit hard! > > Appreciate your support > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151220/7c7feda3/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Mon Dec 21 12:39:56 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Mon, 21 Dec 2015 11:39:56 +0000 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 2 > Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I > got a different result at first. > But now I see thecfg2.trialdef.triallength = 1;? > there is no difference in the way data is loaded once I change the number > to let's say 5! Where should I see that difference??Thanks again.Kind > regards > ?__________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Saturday, December 19, 2015 2:06 PM > Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > I'm not sure why it didn't work for you. I tried the following code (on a > sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and > it worked perfectly for me: > > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 500 0]; > cfg.continuous = 'yes'; > data_500samples = ft_preprocessing(cfg); > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 1000 0]; > cfg.continuous = 'yes'; > data_1000samples = ft_preprocessing(cfg); > > > > Here's the output: > >> data_500samples > > data_500samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x500 double]} > ???????? trial: {[37x500 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 500] > ?????????? cfg: [1x1 struct] > > >> data_1000samples > > data_1000samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x1000 double]} > ???????? trial: {[37x1000 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 1000] > ?????????? cfg: [1x1 struct] > > > Best, > Steve > > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/? > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Friday, December 18, 2015 12:37 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Mon Dec 21 13:04:36 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 12:04:36 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <1581782628.1312312.1450699476132.JavaMail.yahoo@mail.yahoo.com>  You are absolutely right. It is either using the fix cfg.trl to choose the begining and end of the samples or to choose the cfg2.trialdef.triallength =5. In your initial code you had them together, and that is why I was confused. So basically there are two ways to segment the file. Thanks you very much. You have been very helpful. My questions are endless. I have another one for you! Sorry! When loading edf+ the events are lost. using cfg2.trialdef.eventtype  = '?' gives me no events detected. Any idea how I could go about it? Thanks again for your help. I really appreciate it.Best regards __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Monday, December 21, 2015 11:39 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/   Message: 2 Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;? there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference??Thanks again.Kind regards ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Saturday, December 19, 2015 2:06 PM  Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x500 double]} ???????? trial: {[37x500 double]} ?????? fsample: 200 ??? sampleinfo: [1 500] ?????????? cfg: [1x1 struct] >> data_1000samples data_1000samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x1000 double]} ???????? trial: {[37x1000 double]} ?????? fsample: 200 ??? sampleinfo: [1 1000] ?????????? cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/? ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian ? ? ? From: Stephen Politzer-Ahles ?To: fieldtrip at science.ru.nl ?Sent: Friday, December 18, 2015 12:37 PM ?Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------   _______________________________________________ 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 leilayou_54 at yahoo.com Mon Dec 21 13:59:38 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 12:59:38 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <916358647.1306232.1450702778200.JavaMail.yahoo@mail.yahoo.com> Dear Steve,I have shared my data file in drop box with you. I am trying to read the events in this file and I get 0 events. cfg2.trialdef.eventtype  = '?' Could you please help me out? Thanks __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Monday, December 21, 2015 11:39 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila, cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters. If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/   Message: 2 Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first. But now I see thecfg2.trialdef.triallength = 1;? there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference??Thanks again.Kind regards ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Stephen Politzer-Ahles  To: fieldtrip at science.ru.nl  Sent: Saturday, December 19, 2015 2:06 PM  Subject: Re: [FieldTrip] importing large edf data Hi Leila, I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and it worked perfectly for me: cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 500 0]; cfg.continuous = 'yes'; data_500samples = ft_preprocessing(cfg); cfg = []; cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; cfg.trl = [1 1000 0]; cfg.continuous = 'yes'; data_1000samples = ft_preprocessing(cfg); Here's the output: >> data_500samples data_500samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x500 double]} ???????? trial: {[37x500 double]} ?????? fsample: 200 ??? sampleinfo: [1 500] ?????????? cfg: [1x1 struct] >> data_1000samples data_1000samples = ?????????? hdr: [1x1 struct] ???????? label: {37x1 cell} ????????? time: {[1x1000 double]} ???????? trial: {[37x1000 double]} ?????? fsample: 200 ??? sampleinfo: [1 1000] ?????????? cfg: [1x1 struct] Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/? ------------------------------ Message: 5 Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" ?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same! So this is what I get: ?? hdr: [1x1 struct] ???????? label: {51x1 cell} ????????? time: {1x50710 cell} ???????? trial: {1x50710 cell} ?????? fsample: 1024 ??? sampleinfo: [50710x2 double] ?????????? cfg: [1x1 struct] so the actual data which is in data.trial? is this in both cases! size(data.trial) ans = ?????????? 1?????? 50710 How could that happen if you are segmenting it in two different chunks? Best regards ___________________________________________________ Leila Ayoubian ? ? ? From: Stephen Politzer-Ahles ?To: fieldtrip at science.ru.nl ?Sent: Friday, December 18, 2015 12:37 PM ?Subject: Re: [FieldTrip] importing large edf data Hello Leila, I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size. If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add: cfg.trl = [1 1000 0]; and then use ft_preprocessing. By way of example, here is code that reads in raw data as a series of 1-second "trials": cfg = []; cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters cfg.trialdef.ntrials = Inf; cfg = ft_definetrial( cfg ); cfg.continuous = 'yes'; data = ft_preprocessing(cfg); After doing whatever you need to these trials, you could concatenate them back into continuous data (see http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html for details). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ On Fri, Dec 18, 2015 at 11:00 AM, wrote: Send fieldtrip mailing list submissions to ? ? ? ? fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to ? ? ? ? fieldtrip-request at science.ru.nl You can reach the person managing the list at ? ? ? ? fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: ? ?1. importing large edf data (Leila Ayoubian) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) From: Leila Ayoubian To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] importing large edf data Message-ID: ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi:Thanks for providing us with this amazing toolbox. I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.? So trying to load the data like this: cfg.dataset= ('mydata.edf'); rawdata=ft_preprocessing(cfg); This is the error message I get : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ft_preprocessing (line 566) ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in ReadFedfiles (line 8) rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error. I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf' ?hdr?? = ft_read_header(filename); ?sample.start=1 ?sample.end=100 dat = ft_read_data(filename,'sample.start','1','sample.end','100') and here is again the error message: Error using zeros Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in read_edf (line 403) ? dat = zeros(length(chanindx),nepochs*epochlength); Error in ft_read_data (line 622) ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); Error in ReadFedfiles (line 31) dat = ft_read_data(filename,'sample.start','1','sample.end','100') ? >> Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful. Thanks again for your support and assistance. We appreciate your effort. Kind regards ___________________________________________________ Dr. Leila Ayoubian -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------   _______________________________________________ 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 leilayou_54 at yahoo.com Mon Dec 21 16:49:12 2015 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Mon, 21 Dec 2015 15:49:12 +0000 (UTC) Subject: [FieldTrip] EDF+ annotations References: <782532884.1387709.1450712952642.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <782532884.1387709.1450712952642.JavaMail.yahoo@mail.yahoo.com> Hi all,I am new to fieldtrip .I am trying to load some edf+ file to Matlab and read the events/annotations. These annotations are usually seizure, or spikes.... The files are EEG data from nicollet one, lengthy data for epileptic patients. This is how I try to look at the events: cfg2 = []; cfg2.dataset = 'For leila.edf'; cfg2.trialdef.eventtype  = '?' cfg2 = ft_definetrial( cfg2 ); cfg2.continuous = 'yes'; data2 = ft_preprocessing(cfg2); However the output for events are always empty.Does anyone have an idea how I could extract the events/annotation on these files? Thanks in advance for your assistance. Best regards __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London -------------- next part -------------- An HTML attachment was scrubbed... URL: From weston.pack at yale.edu Mon Dec 21 18:56:11 2015 From: weston.pack at yale.edu (Pack, Weston) Date: Mon, 21 Dec 2015 17:56:11 +0000 Subject: [FieldTrip] How to implement the .pl2 patch for Plexon data Message-ID: <46289A1970E74F4888AA0D7E75AAB1E6210097A4@x10-mbx13.yu.yale.edu> Greetings FieldTrip community, I am new to using FieldTrip, but am well versed in Matlab. I would like to use FieldTrip to analyze Plexon data from LFP recordings and am working with the .pl2 format. I have read through the current documentation (very short) about the patch for loading .pl2 files, but I still have no idea how to install and use the patch as this is not documented (that I can find). The following is provided but with no explanation of how to implement it: “ (filetype = plexon_plx_v2) “ I have added the path of the Plexon SDK folder using: “ addpath ('E:\MatlabOfflineFilesSDK')” I have download the .diff patch file as well as the .zip folder “ft_plexon” but I don’t know where to put them. Does the “plexon” folder inside go in the main FieldTrip directory, the main Plexon SDK directory (currently listed above), or somewhere else? The same question applies to the .diff file. Thank you in advance for your assistance. Once I get FieldTrip figured out, I intend to create a thorough, novice-friendly tutorial with step-by-step instructions how to work with .pl2 files for LFP analysis. I’ve spent the better part a week fumbling through the tutorials and I’m certain I can write a novice-friendly tutorial on the wiki that will only take a few hours at most for beginners to master. My goal is first to understand how to utilize FieldTrip, at which point I can document my struggles and successes so that future users (especially my lab-mates) can obtain competency with far more efficiency. Thanks again in advance. I hope to contribute significantly to the community. Happy Holidays! Weston Pack, PhD -------------- next part -------------- An HTML attachment was scrubbed... URL: From jochem.rieger at uni-oldenburg.de Mon Dec 21 20:00:15 2015 From: jochem.rieger at uni-oldenburg.de (Jochem Rieger) Date: Mon, 21 Dec 2015 20:00:15 +0100 Subject: [FieldTrip] Job vacancies: MEG-physicist/engineer and MRI-physicist/engineer at Oldenburg University, Germany Message-ID: <56784C3F.4050501@uni-oldenburg.de> The newly founded Neuroimaging Center at the University of Oldenburg, Germany, offers the following two positions *1. MEG-Physicist/Engineer (E13/TV-L, initially 3 years) * * * *2. MRI-Physicist/Engineer (E13/TV-L, initially 3 years)* The positions are suitable for part-time work. The Neuroimaging Center hosts a state of the art magnetoencephalograph (ElektaTriux) and a magnetic resonance tomograph (Siemens Prisma 3T) and is embedded in an excellent interdisciplinary scientific environment with a strong research focus on neurosensory, neurocognitive, and medical research. We seek for highly motivated post-doctoral candidates (with PhD) with an academic university degree in physics, engineering or related fields, with documented research experience in magnetoencephalography (position 1) or magnetic resonance imaging (position 2). For both positions, fluency in English is necessary. German and experience in the design of neurocognitive experiments are desirable. Successful candidates will be responsible for the operation and administration of the MEG-system and MRI-system respectively, their infrastructure, the development and improvement of measurement and analyses techniques and user consultancy. The University of Oldenburg is rapidly growing and offers a vibrant scientific environment with strong foci on cognitive and sensory neuroscience and a new medical school. The European Medical School is a cooperation project between the Universities of Oldenburg and Groningen and three local hospitals. Oldenburg is an attractive city in Germany's northwest with excellent quality of life. It is close to Bremen, Hamburg, Groningen, and approx. 1 h from the north sea. The University of Oldenburg is dedicated to increasing the percentage of women in science. Therefore, female candidates are particularly encouraged to apply and will be given preference in cases of equal qualification. Handicapped applicants will be given preference if equally qualified. Electronic applications (one pdf file) are preferred and can be send to: Professor Dr. JochemRieger: Jochem.rieger at uni-oldenburg.de Applications by mail should be sent to Prof. Jochem Rieger Universität Oldenburg Kuepkersweg 74 (W30) 26129 Oldenburg Germany The application process is open until January 31st 2016. Applications should include your CV, a list of most recent publications, and a statement (max. 3 pages). -------------- next part -------------- An HTML attachment was scrubbed... URL: From plyons at udel.edu Mon Dec 21 20:39:59 2015 From: plyons at udel.edu (Peter Lyons) Date: Mon, 21 Dec 2015 14:39:59 -0500 Subject: [FieldTrip] Clarification on plotting WPLI Message-ID: Hello Everyone, I have a question regarding the interpretation of negative values in the debiased wPLI. Although the reference page on the debiased wPLI notes that estimates are computed by squaring the wPLI values, I and others have noticed that some of the values in the debiased wPLI spectrum are negative. How should these negative values be interpreted in reference to 0? To view the results of the debiased wPLI connectivity analysis (ft_connectivity analysis with cfg.method = 'wpli_debiased'), I've been using the ft_topoplotER function. However, I'm concerned that the default scaling (zlim = 'maxmin') of the plot does not seem to register the negative values in the debiased wPLI spectrum. That is, the negative values are not being plotted. It is curious, however, that the ft_topoplotER does register the negative values in the *non-debiased *wPLI spectrum. Is there a reason why the ft_topoplotER function is treating the negative values from the debiased vs. non-debiased wPLI spectrums differently? Is there perhaps a more appropriate plotting function I should be using to view the debiased wPLI output? I would greatly appreciate any guidance in this. Thank you! Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From shlomitbeker at gmail.com Tue Dec 22 07:42:31 2015 From: shlomitbeker at gmail.com (Shlomit Beker) Date: Tue, 22 Dec 2015 06:42:31 +0000 Subject: [FieldTrip] Please remove me from mailing list Message-ID: <7fa9847a19964083a25ceb552d18577f@EXPRD01.hosting.ru.nl> -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Tue Dec 22 18:48:01 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Tue, 22 Dec 2015 12:48:01 -0500 Subject: [FieldTrip] importing large edf data Message-ID: Hi Leila, According to the warning messages that pop up, the annotation channel is not being read because it is at a different sampling rate than the data. >From what I can tell, this appears to be a common problem. http://www.fieldtriptoolbox.org/getting_started/edf explains a workaround; have you tried this? Alternatively, you could consider trying some other toolboxes---I believe mne-python is capable of handling this issue with EDF triggers straightforwardly, or you could use one of the softwares that is specifically made for EDF (such as EDFViewer or EDFBrowser) to export your annotations into a format that is more easily readable and then use that to create your cfg.trl structure for Fieldtrip. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 4 > Date: Mon, 21 Dec 2015 12:59:38 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > <916358647.1306232.1450702778200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear Steve,I have shared my data file in drop box with you. > I am trying to read the events in this file and I get 0 events. > cfg2.trialdef.eventtype? = '?' > Could you please help me out? > Thanks?__________________________________________________ Leila Ayoubian, > PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > To: fieldtrip at science.ru.nl > Sent: Monday, December 21, 2015 11:39 AM > Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not > needed if all you want to do is read a single segment of continuous data > based on predetermined latencies; you may notice that, in the sample code > snippets I sent in my last message, I did not use this function at all, I > just hard-coded the latency range in cfg.trl (and then passed this cfg > structure to ft_preprocessing() ). So, if this is all you need to do, there > is no need to worry about these additional parameters. > > If you are trying to read multiple segments of data as separate epochs > into one dataset (which is what you would accomplish by using > cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why > it's not working for you at the moment; I would have to see your code to be > able to diagnose what might be going on. > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > ? > > Message: 2 > Date: Mon, 21 Dec 2015 09:36:27 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <1459455402.1301519.1450690587900.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I > got a different result at first. > But now I see thecfg2.trialdef.triallength = 1;? > there is no difference in the way data is loaded once I change the number > to let's say 5! Where should I see that difference??Thanks again.Kind > regards > ?__________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Saturday, December 19, 2015 2:06 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hi Leila, > > I'm not sure why it didn't work for you. I tried the following code (on a > sample EDF file I found at http://www.teuniz.net/edf_bdf_testfiles/) and > it worked perfectly for me: > > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 500 0]; > cfg.continuous = 'yes'; > data_500samples = ft_preprocessing(cfg); > > cfg = []; > cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf'; > cfg.trl = [1 1000 0]; > cfg.continuous = 'yes'; > data_1000samples = ft_preprocessing(cfg); > > > > Here's the output: > >> data_500samples > > data_500samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x500 double]} > ???????? trial: {[37x500 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 500] > ?????????? cfg: [1x1 struct] > > >> data_1000samples > > data_1000samples = > > ?????????? hdr: [1x1 struct] > ???????? label: {37x1 cell} > ????????? time: {[1x1000 double]} > ???????? trial: {[37x1000 double]} > ?????? fsample: 200 > ??? sampleinfo: [1 1000] > ?????????? cfg: [1x1 struct] > > > Best, > Steve > > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/? > ------------------------------ > > Message: 5 > Date: Fri, 18 Dec 2015 13:40:59 +0000 (UTC) > From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <2054001626.533069.1450446059200.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > ?Thanks Steve for your reply.I think your code for segmenting the data is > the way to go for me ! :) And I do appreciate you gave me an example.? > Thanks > However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = > [1 10000 0]; to see the results, and it looked the same! > > So this is what I get: > > > ?? hdr: [1x1 struct] > ???????? label: {51x1 cell} > ????????? time: {1x50710 cell} > ???????? trial: {1x50710 cell} > ?????? fsample: 1024 > ??? sampleinfo: [50710x2 double] > ?????????? cfg: [1x1 struct] > > so the actual data which is in data.trial? is this in both cases! > size(data.trial) > > ans = > > ?????????? 1?????? 50710 > > How could that happen if you are segmenting it in two different chunks? > Best regards > > ___________________________________________________ Leila Ayoubian > > > > ? ? ? From: Stephen Politzer-Ahles < > stephen.politzer-ahles at ling-phil.ox.ac.uk> > ?To: fieldtrip at science.ru.nl > ?Sent: Friday, December 18, 2015 12:37 PM > ?Subject: Re: [FieldTrip] importing large edf data > > Hello Leila, > > I think there are a few possible options for you. If you're not interested > in analyzing high frequencies, then you could import the data one sample at > a time, downsampling each channel, and then concatenate the channels into > one structure, as described in > http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory. > I don't know what your sampling rate was, but if your sampling rate was > extremely high then this can save you a lot of space. For example, if > you're only interested in frequencies up to high gamma (around 90-100 Hz), > then your data only need to be sampled at around 250 Hz (per the Nyquist > theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 > Hz (which our EDF system does by default) or 5000 Hz then you have way more > samples than necessary; downsampling like this will greatly reduce your > array size. > > > > If that is not an option, then you can read in a segment of data as a > 'trial'. ft_preprocessing understands trial start and end times from > cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to > read, and the columns are the start sample for each trial, the end sample > for each trial, and the trigger value associated with the trial; you could > just put 0 if there's no trigger). So let's say you want to read the first > through thousandth sample of the recording, then you would set up your cfg > as normal, then add: > > cfg.trl = [1 1000 0]; > > and then use ft_preprocessing. > > By way of example, here is code that reads in raw data as a series of > 1-second "trials": > > cfg = []; > cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr'; > cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for > an explanation of these parameters > cfg.trialdef.ntrials = Inf; > cfg = ft_definetrial( cfg ); > > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > After doing whatever you need to these trials, you could concatenate them > back into continuous data (see > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html > for details). > > Best, > Steve > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > On Fri, Dec 18, 2015 at 11:00 AM, wrote: > > Send fieldtrip mailing list submissions to > ? ? ? ? fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ? http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > ? ? ? ? fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > ? ? ? ? fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > ? ?1. importing large edf data (Leila Ayoubian) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] importing large edf data > Message-ID: > ? ? ? ? <807603762.476165.1450431823359.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi:Thanks for providing us with this amazing toolbox. > I am new to fieldtrip. I am trying to import EEG data in the format of > *.edf for the purpose of seizure detection for epileptic patients. I can't > break up the data as you understand the detection has to have continuous > data. However I could load section of the data at a time and clear what is > already used and reload again.? > So trying to load the data like this: > cfg.dataset= ('mydata.edf'); > rawdata=ft_preprocessing(cfg); > This is the error message I get : > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a long time > and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ft_preprocessing (line 566) > ????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', > ????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); > > Error in ReadFedfiles (line 8) > > rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > I tried the ft_redefinetrial, but since the input to this file is the > output from ft-PREPROCESSING it gives me the same error. > > > I also tried to use ft_read_data to choose the samples I want to load > :?filename???? = 'mydata.edf' > ?hdr?? = ft_read_header(filename); > ?sample.start=1 > ?sample.end=100 > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > and here is again the error message: > Error using zeros > Requested 51x51927040 (19.7GB) array exceeds maximum array size > preference. Creation of arrays greater than this limit may take a > long time and cause MATLAB to become unresponsive. See array size limit or > preference panel for more information. > > Error in read_edf (line 403) > ? dat = zeros(length(chanindx),nepochs*epochlength); > > Error in ft_read_data (line 622) > ??? dat = read_edf(filename, hdr, begsample, endsample, chanindx); > > Error in ReadFedfiles (line 31) > dat = ft_read_data(filename,'sample.start','1','sample.end','100') > ? > >> > > Could you please direct me as to which functions and in which order I > should be using the functions to load data in smaller samples.Some examples > would be useful. > Thanks again for your support and assistance. > We appreciate your effort. > Kind regards > > ___________________________________________________ Dr. Leila Ayoubian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html > > > > ------------------------------ > > > > > > ? > _______________________________________________ > 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/20151221/7403e94b/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Mon, 21 Dec 2015 15:49:12 +0000 (UTC) > From: Leila Ayoubian > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] EDF+ annotations > Message-ID: > <782532884.1387709.1450712952642.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi all,I am new to fieldtrip .I am trying to load some edf+ file to Matlab > and read the events/annotations. These annotations are usually seizure, or > spikes.... > The files are EEG data from nicollet one, lengthy data for epileptic > patients. > This is how I try to look at the events: > > cfg2 = []; > > cfg2.dataset = 'For leila.edf'; > cfg2.trialdef.eventtype? = '?' > cfg2 = ft_definetrial( cfg2 ); > > > cfg2.continuous = 'yes'; > data2 = ft_preprocessing(cfg2); > However the output for events are always empty.Does anyone have an idea > how I could extract the events/annotation on these files? > > Thanks in advance for your assistance. > Best regards > __________________________________________________ Leila Ayoubian, PhD. > Institute of Psychiatry, Psychology and Neuroscience > King's College London > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151221/7d290354/attachment-0001.html > > > > ------------------------------ > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fanshine at yeah.net Wed Dec 23 09:55:28 2015 From: fanshine at yeah.net (Hanson) Date: Wed, 23 Dec 2015 16:55:28 +0800 (CST) Subject: [FieldTrip] Make a custom layout Message-ID: <7af7ec0c.1eaf.151ce0cdf79.Coremail.fanshine@yeah.net> Dear all, I am new to FieldTrip and trying to do the time-frequency analysis of my eeg data , however it seems that no suitable layout. And I use ft_prepare_layout function to make a custom layout(electrode_position32.mat). %% Time-frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:2:30; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.toi = -0.5:0.05:1.5; TFRhann = ft_freqanalysis(cfg, data); cfg = []; cfg.showlabels = 'yes'; cfg.layout = 'electrode_position32.mat'; figure ft_multiplotTFR(cfg, TFRhann); cfg = []; cfg.channel = 'C4'; figure ft_singleplotTFR(cfg, TFRhann); cfg = []; cfg.layout = 'electrode_position32.mat'; figure ft_topoplotTFR(cfg, TFRhann); When I run the script. I am getting the following error. Warning: (one of the) axis is/are not evenly spaced, but plots are made as if axis are linear > In ft_multiplotTFR at 405 In TFanalysis_zhs_2 at 52 the call to "ft_multiplotTFR" took 0 seconds the call to "ft_singleplotTFR" took 0 seconds reading layout from file electrode_position32.mat the call to "ft_prepare_layout" took 0 seconds Warning: Some points fall outside the outline, please consider using another layout > In ft_plot_topo at 171 In fieldtrip\private\topoplot_common at 731 In ft_topoplotTFR at 192 In TFanalysis_zhs_2 at 62 Index exceeds matrix dimensions. Error in ft_plot_topo (line 182) mask{i}(end+1, :) = mask{i}(1, :); % force them to be closed Error in topoplot_common (line 731) ft_plot_topo(chanX,chanY,datavector,opt{:}); Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in TFanalysis_zhs_2 (line 62) ft_topoplotTFR(cfg, TFRhann); Do you have any suggestion about it? Thank you very much for your attention. Kind Regards, Hanson -------------- next part -------------- An HTML attachment was scrubbed... URL: