From jan.schoffelen at donders.ru.nl Sun May 1 18:14:59 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:14:59 +0000 Subject: [FieldTrip] Unit error using ft_topoplotTFR.m References: Message-ID: <6647E974-EBA7-4730-9828-FB272C2C3DBD@donders.ru.nl> Hi Andrew, It seems that FT chokes on some bookkeeping operation (the ‘unbalancing’ stuff), which is known to be tricky, and requires too many words, and is too tedious to explain why these obscure steps would be needed in the first place. Note that there seems to exist an inconsistency between the topo and multi functions, so I think this should be looked into. This being said, given your error stack it looks as if you run into this because you try to create a layout from the sensor description in the data. I would advice to use one of the standard layouts we have on file (in the fieldtrip/template/layout directory). The one you probably want to use is either cfg.layout = ‘4D248.lay’, or ‘4D248_helmet.mat’. (to be sure, just check the filenames in the directory, because I don’t know them from the top of my head). With an existing layout-filename in the cfg you should not run into this. Best, Jan-Mathijs On 29 Apr 2016, at 14:01, Reid, A.T. (Andrew) > wrote: Hi all, I am trying to do a simple topo plot of some time-locked HCP data. Running ft_multiplotTFR on the TFR output structure works fine. When I run ft_topoplotTFR on the same structure, I get the following error: creating layout from data.grad undoing the invcomp balancing for the gradiometer definition Error using ft_scalingfactor (line 181) cannot convert T to unknown Error in ft_scalingfactor (line 94) factor = cellfun(@ft_scalingfactor, old(:), new(:)); Error in ft_apply_montage (line 309) scale = ft_scalingfactor(input.chanunit, montage.chanunitorg); Error in undobalancing (line 37) sens = ft_apply_montage(sens, sens.balance.(sens.balance.current), 'inverse', 'yes', 'keepunused', 'yes', 'warning', 'no'); Error in ft_prepare_layout>sens2lay (line 957) sens = undobalancing(sens); Error in ft_prepare_layout (line 430) layout = sens2lay(data.grad, cfg.rotate, cfg.projection, cfg.style, cfg.overlap); Error in ft_topoplotTFR (line 192) cfg.layout = ft_prepare_layout(cfg, varargin{:}); The data.grad.balance.invcomp.chanunitnew cell array appears to be the culprit, as it contains “unknown” while the main data.chanunit has unit “T”. Not sure how to proceed here.. Thanks! Andrew ____________________________________________________ Andrew Reid Postdoctoral Fellow Department of Cognitive Artificial Intelligence Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen Web: http://andrew.modelgui.org/ Tel: +31 (0)24 36 55931 _______________________________________________ fieldtrip 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 Sun May 1 18:16:45 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:16:45 +0000 Subject: [FieldTrip] Electrode position effects on leadfield values In-Reply-To: References: Message-ID: Hi Maris, It is common knowledge that due to noise/measurement error, it is hard, if not impossible to match Polhemus digitized electrode locations with the MR head shape precisely. Indeed this is well known. Even after manual and iterative alignment some electrodes remain "hanging" in the air above the head surface, while some others get buried below the head surface. Here is an illustration of what I mean: https://goo.gl/aSm7YU Looks quite good to me! I am wondering what effect this type of electrode misplacement has on the values in the leadfield matrix as calculated by ft_prepare_leadfield? How does fieldtrip deal with electrodes placed in such a way? It seems that there is some magic involved there, since in theory the lead field matrix values for the electrodes not touching the surface of the head should be zero (which is not the case in the lead field matrix produced by ft_prepare_leadfield). Fieldtrip pulls (or pushes) the electrodes to the head surface, to ensure that the computations make sense. If you want to know the details, grep for project_elec (which is the function that does this). Best, Jan-Mathijs I am currently testing how moving a "floating" and a "buried" electrode to its nearest point on the scalp affects the leadfield matrix values. I do not have any definite answers yet, but I did want to check in with some more experienced users out there before spending too much time on this (and possibly reinventing the wheel, so to speak). Thanks! Maris _______________________________________________ fieldtrip 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 Sun May 1 18:44:16 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:44:16 +0000 Subject: [FieldTrip] MNE-sample data set on Fieldtrip. In-Reply-To: <96d4943980d708a2b7d8b6ffbc439792@cam.ac.uk> References: <96d4943980d708a2b7d8b6ffbc439792@cam.ac.uk> Message-ID: <13E4D5AA-9D4D-40C8-B886-5867726F256B@donders.ru.nl> Dear Parham, > I was hoping to perform a complete source analysis using FieldTrip on the MNE-sample data set. > The link to the MNE data set link is given below: > http://martinos.org/mne/dev/manual/sample_dataset.html#babdhifj That sounds like a great exercise! I am not aware of anybody having done this already. > I am terribly confused on how to align the MRI coordinates to MEG. Yes, coordinate systems are confusing and annoying. > The MEG system is a neuromag306. The function hdr=ft_read_header(raw_data_set_filename) reads fiducial marks > HPI. It is contained in hdr.orig.dig. > Also shape = ft_read_headshape(raw_data_set_filename) gives a structure > shape = > > pos: [143x3 double] > fid: [1x1 struct] > label: {143x1 cell} > coordsys: 'neuromag' > unit: 'cm' > pnt: [143x3 double] > > where the shape.fid has the nasion, lpa and rpa. I have the following questions: > 1. It appears to me that the MRI coordinate system is already spm. > Axis X :Left to right. > Axis Y: Posterior to Anterior. > Axis Z: bottom to top. >From the direction of the axes one cannot strictly conclude the coordinate system. Both the Elekta-based coordinates, and the SPM-based coordinates have their X/Y/Z axes pointing into R(ight)/A(nterior)/S(uperior). They differ in their origin. If however the shape.fid.pnt/pos (I am not sure whether the positions are represented in the pnt or pos field nowadays) for the ‘nas’ fiducial is [0 somevalue 0] (or at least the x and z coordinates are close to 0), you can be sure that this is defined in ‘MEG’ coordinates. > 2. How can I realign the MRI to MEG? > a) Interactively: ft_volumerealign > or > b) Should I use the information in shape to have it done automatically? > I think, it would be unwise to define my own lpa, rpa and nasion. Indeed, it adds error when trying to ‘click’ the lpa/rpa/nasion once more, because they are bound to end up at a slightly different location. Since you seem to have a digitized headshape, you could try and align this headshape to the surface reconstruction of the anatomical MRI (which I assume you have), using ft_volumerealign and the ‘headshape’ method. I would typically do the alignment manually (rather than relying on the automatic icp-based algorithm), particularly if you have only few points in the headshape. > 3. What is the relationship between HPI coil coordinates and the lpa, rpa and nasion coordinates? Are there scripts that relate the two. I don’t know. Sometimes there’s a one-to-one match between specific coils and the three fiducial locations, sometimes there isn’t :o(. Depends on the specifics of the data. > 4. Has anyone ever created a script to use Fieldtrip to analyze this specific data set? I am not aware of this, but I think it would be valuable to have this documented somewhere (and available to the wider community). > 5. The MEG sensors are in a different coordinate frame "1" as opposed to head coordinates (Electrodes). Do I have to make sure that these coordinates are transformed to head coordinates prior to ft_prepare_leadfield calculations? or is this done automatically by fieldtrip? I am not so familiar with the meaning of the different coordinate frames employed by the neuromag software (at least not with respect to how the numbers map onto specific conventions). Yet, in the end of the day you need to ensure that all the data-objects that represent geometrical information (sensors, volume conduction model, source model) are expressed in the same coordinate system. Fieldtrip will not automagically convert anything for you. > I just have the feeling that it would be unwise to do this interactively because of the existence of the fiducial markers. Yes, but if there’s no alternative, there’s no way around this. Yet, it could be that the different coordinate transformations are already represented in the data (and that the low-level reading routines know how to deal with this: perhaps you can specify a certain input argument that returns the coordinates in a specified coordinate system) So, in sum, perhaps not too helpful, but it may provide some clues to the solution. Also, perhaps some elekta people may want to chime in here. It would be great if you could get this going, and perhaps we could ask you to collaborate on providing some documentation about your endeavours on the fieldtrip wiki in due time. Best wishes, Jan-Mathijs > Many thanks if you are able to help me. > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sun May 1 18:52:19 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:52:19 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? In-Reply-To: References: Message-ID: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon May 2 12:06:20 2016 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 2 May 2016 12:06:20 +0200 Subject: [FieldTrip] FT clusterplot Message-ID: Dear all, I hope this email finds you well. I had a statistics results that I would like to use ft_clusterplot to plot the significant clusters. However, I'm experiencing some difficulties to specific the configuration. >From the ft_clusterplot.m, I noticed that the function is able to squeeze the 3D matrix into a 2D matrix for plotting purposes. My current statistics results is in "chan-freq-time" dimension, and I was wondering how I could specific the configuration to select a specific frequency to plot. Can someone please help? Or do I have to adjust the statistics results variable manually such that it has a "chan-time" dimension for plotting? Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.brehm at uu.nl Mon May 2 15:08:18 2016 From: j.brehm at uu.nl (Brehm, J. (Julia)) Date: Mon, 2 May 2016 13:08:18 +0000 Subject: [FieldTrip] What exactly does filterpadding do? Message-ID: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> Dear list, I am having problems applying filterpadding when using ft_artifact_zvalue. Could someone please explain what exactly the effect of filterpadding is, and in which cases I can apply it and in which not? I intended to use it to avoid edge effects in the artifact detection. However, I get the following warning (only when applying fltpadding, my data does not actually contain NaNs): Warning: data contains NaNs, no filtering or preprocessing applied > In ft_warning (line 181) In preproc (line 282) In ft_artifact_zvalue (line 292) These are my settings: cfg = []; cfg.trl = temptrl; % all trials cfg.artfctdef.zvalue.channel = channel{ch}; % single channel cfg.artfctdef.zvalue.cutoff = 3; cfg.artfctdef.zvalue.fltpadding = 0.1; cfg.artfctdef.zvalue.bpfilter = 'yes'; cfg.artfctdef.zvalue.bpfilttype = 'but'; cfg.artfctdef.zvalue.bpfreq = [1 3]; cfg.artfctdef.zvalue.bpfiltord = 2; cfg.artfctdef.zvalue.hilbert = 'yes'; Thanks! Best, Julia -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Mon May 2 15:14:09 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Mon, 2 May 2016 15:14:09 +0200 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? Message-ID: Hello, could you please explain the purpose of ft_sourcedescriptives() in EEG source analysis? The documentation is very brief (“computes descriptive parameters of the source analysis results”) and I haven't found a single tutorial with proper explanation. I found it used here but without any explanation whatsoever. Thank you! Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Mon May 2 15:24:40 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Mon, 2 May 2016 15:24:40 +0200 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> Message-ID: Dear Julia, >From the FAQ section: http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts I hope that helps, Diego On 2 May 2016 at 15:08, Brehm, J. (Julia) wrote: > Dear list, > > I am having problems applying filterpadding when using ft_artifact_zvalue. > > Could someone please explain what exactly the effect of filterpadding is, > and in which cases I can apply it and in which not? > > I intended to use it to avoid edge effects in the artifact detection. > However, I get the following warning (only when applying fltpadding, my > data does not actually contain NaNs): > > Warning: data contains NaNs, no filtering or preprocessing applied > > In ft_warning (line 181) > In preproc (line 282) > In ft_artifact_zvalue (line 292) > > These are my settings: > cfg = []; > cfg.trl = temptrl; % all trials > > cfg.artfctdef.zvalue.channel = channel{ch}; % single channel > cfg.artfctdef.zvalue.cutoff = 3; > cfg.artfctdef.zvalue.fltpadding = 0.1; > > cfg.artfctdef.zvalue.bpfilter = 'yes'; > cfg.artfctdef.zvalue.bpfilttype = 'but'; > cfg.artfctdef.zvalue.bpfreq = [1 3]; > cfg.artfctdef.zvalue.bpfiltord = 2; > cfg.artfctdef.zvalue.hilbert = 'yes'; > > Thanks! > > Best, > Julia > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Mon May 2 15:27:23 2016 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Mon, 2 May 2016 15:27:23 +0200 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? In-Reply-To: References: Message-ID: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > Dear Andreas, > > Have you tried it with a more recent version? Also, I would recommend not > to use ft_sourcegrandaverage, but to use the syntax > ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the > single subject data represented in a cell-array of structures, with source1 > for condition 1 and source2 for condition 2. > > Best, > Jan-Mathijs > > > > > On 24 Apr 2016, at 18:36, Andreas Sauer wrote: > > Dear all, > > unfortunately, I am having problems to run source statistics on ERF > mismatch negativity data (recorded with a 4D system). > > With the following data structure as input (output from > ft_sourcegrandaverage), fieldtrip gives a warning that it „could not > determine dimord of „pow“ in the following data“ > > pow: [16x37696 double] > dim: [31 38 32] > inside: [37696x1 logical] > pos: [37696x3 double] > time: [1x900 double] > cfg: [1x1 struct] > > and later throws an error that „field „pow“ (is) not present in data“. I > checked the ft_sourcestatistic script step by step and found out that > ft_selectdata removes it after being called by ft_sourcestatistics. > > I am using the fieldtrip version from 15/05/2015. I also tried with older > versions, one from late 2014 and late 2013, but nothing worked. > > Unfortunately, since ft_selectdata removes the field "pow" from the data > during the call to ft_sourcestatistic, I can’t put it back in to the > structure. > > Any help with this (esp. why „pow“ is being removed) is highly appreciated! > > Thanks and best wishes, > > Andreas > > > > -- > Dipl.-Psych. Andreas Sauer > Max Planck Institute for Brain Research > Deutschordenstraße 46 > 60528 Frankfurt am Main > Germany > > T: +49 69 96769 278 > F: +49 69 96769 327 > Email: sauer.mpih at gmail.com > www.brain.mpg.de > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.brehm at uu.nl Mon May 2 16:31:43 2016 From: j.brehm at uu.nl (Brehm, J. (Julia)) Date: Mon, 2 May 2016 14:31:43 +0000 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl>, Message-ID: <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> Dear Diego, yes, thank you, I've seen that already. Unfortunately this does not really help me. Apparently filtering is not even applied in my case (as the warning says). It seems that the NaNs are introduced in ft_fetch_data, shouldn't these be replaced by zeros where it's not filled by actual data when applying filterpadding? I assume it does that at some other point I couldn't find!? Furthermore, in the interactive mode one can see that the z-values mimic the data in the first and last trial of the dataset. This leads to the detection of artifacts which are none and missing real artifacts (due to very large effects in those two trials). I have attached a screenshot to illustrate what I mean. As far as I understand filterpadding uses zero-padding, meaning I can use it on segmented (not continuous) data, correct? So why does this have such a large effect on my whole data instead of simply getting rid of edge effects? Sorry if I am missing something obvious. Best, Julia ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Diego Lozano-Soldevilla [dlozanosoldevilla at gmail.com] Sent: Monday, May 02, 2016 3:24 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] What exactly does filterpadding do? Dear Julia, >From the FAQ section: http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts I hope that helps, Diego On 2 May 2016 at 15:08, Brehm, J. (Julia) > wrote: Dear list, I am having problems applying filterpadding when using ft_artifact_zvalue. Could someone please explain what exactly the effect of filterpadding is, and in which cases I can apply it and in which not? I intended to use it to avoid edge effects in the artifact detection. However, I get the following warning (only when applying fltpadding, my data does not actually contain NaNs): Warning: data contains NaNs, no filtering or preprocessing applied > In ft_warning (line 181) In preproc (line 282) In ft_artifact_zvalue (line 292) These are my settings: cfg = []; cfg.trl = temptrl; % all trials cfg.artfctdef.zvalue.channel = channel{ch}; % single channel cfg.artfctdef.zvalue.cutoff = 3; cfg.artfctdef.zvalue.fltpadding = 0.1; cfg.artfctdef.zvalue.bpfilter = 'yes'; cfg.artfctdef.zvalue.bpfilttype = 'but'; cfg.artfctdef.zvalue.bpfreq = [1 3]; cfg.artfctdef.zvalue.bpfiltord = 2; cfg.artfctdef.zvalue.hilbert = 'yes'; Thanks! Best, Julia _______________________________________________ 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: fltpadding_demo.jpg Type: image/jpeg Size: 52120 bytes Desc: fltpadding_demo.jpg URL: From kaitlynlitcofsky at gmail.com Mon May 2 22:06:17 2016 From: kaitlynlitcofsky at gmail.com (Kaitlyn Litcofsky) Date: Mon, 2 May 2016 16:06:17 -0400 Subject: [FieldTrip] Behavior-power correlations Message-ID: Hello, I'm trying to conduct behavior-power correlations. This topic has been discussed a few times before ( http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2015-October/009720.html), but I'm still having issues getting it to work. I'm working with a grand averaged structure of 25 individuals' frequency data, and trying to correlate it with a proficiency measurement (one value per person). If I follow the instructions on the tutorial ( http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables), I get an error that "uvar must be specified for dependent samples statistics". I tried various permutations of the design including a uvar got the error "Invalid specification of the design array." When I tried a suggestion in the previous email threads to ​create a dummy variable that is a copy of my frequency data, and replace the power spectrum with the behavioral measure, and create a design with their code: cfg.design = []; cfg.design(1,:) = [ones(1,length(BehVar)) 2*ones(1,length(BehVar))]; cfg.design(2,:) = [1:length(BehVar) 1:length(BehVar)]; I get the error "the length of the design matrix (2) does not match the number of observations in the data (25)". My question is this: what is the appropriate design array for computing a correlation with ft_statfun_correlationT? Is the behavioral variable supposed to be part of the design or must it be part of a dummy structure designed to be similar in size and structure to the frequency data? Alternatively, is there a way to get, for every individual in the grand average, one value representing the average power for, e.g., 300-600ms in the 4-7Hz range? Thank you very much for your help, Kaitlyn Litcofsky -- Kaitlyn Litcofsky Graduate Student, Cognitive Psychology 006 Moore Building Pennsylvania State University University Park, PA 16802 Email: kal378 at psu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon May 2 22:41:34 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 2 May 2016 13:41:34 -0700 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: References: Message-ID: Hi Kaitlyn, My question is this: what is the appropriate design array for computing a > correlation with ft_statfun_correlationT? Is the behavioral variable > supposed to be part of the design or must it be part of a dummy structure > designed to be similar in size and structure to the frequency data? > It's really as described on the page you referred to ( http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables ) n1 = 3; % n1 is the number of subjects design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. cfg.design = design; cfg.ivar = 1; stat = ft_freqstatistics(cfg, data_brain{:}); where data_brain is a multiple subjects structure in case you're doing this at the second/group level (i.e. correlate a behavioral variable to a neural variable across subjects). Thus, a dummy variable is no longer needed. Alternatively, is there a way to get, for every individual in the grand > average, one value representing the average power for, e.g., 300-600ms in > the 4-7Hz range? > You may want to use ft_freqdescriptives for that, per subject. Best, Arjen > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Mon May 2 23:54:48 2016 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 02 May 2016 17:54:48 -0400 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: References: Message-ID: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> Hi Kaitlyn, Which version of Fiedtrip you are using? I got similar error message when I used old version, but no error when I updated to latest version. Hope this will help. Xiaoming >>> Arjen Stolk 5/2/2016 4:41 PM >>> Hi Kaitlyn, My question is this: what is the appropriate design array for computing a correlation with ft_statfun_correlationT? Is the behavioral variable supposed to be part of the design or must it be part of a dummy structure designed to be similar in size and structure to the frequency data? It's really as described on the page you referred to (http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables) n1 = 3; % n1 is the number of subjects design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. cfg.design = design; cfg.ivar = 1; stat = ft_freqstatistics(cfg, data_brain{:}); where data_brain is a multiple subjects structure in case you're doing this at the second/group level (i.e. correlate a behavioral variable to a neural variable across subjects). Thus, a dummy variable is no longer needed. Alternatively, is there a way to get, for every individual in the grand average, one value representing the average power for, e.g., 300-600ms in the 4-7Hz range? You may want to use ft_freqdescriptives for that, per subject. Best, Arjen -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaitlynlitcofsky at gmail.com Tue May 3 02:48:02 2016 From: kaitlynlitcofsky at gmail.com (Kaitlyn Litcofsky) Date: Mon, 2 May 2016 20:48:02 -0400 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> References: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming and Arjen, After updating to the latest Fieldtrip, the code from the tutorial worked. Thank you so much! Kaitlyn On Mon, May 2, 2016 at 5:54 PM, Xiaoming Du wrote: > Hi Kaitlyn, > > Which version of Fiedtrip you are using? > > I got similar error message when I used old version, but no error when I > updated to latest version. > > Hope this will help. > > Xiaoming > > > >>> Arjen Stolk 5/2/2016 4:41 PM >>> > Hi Kaitlyn, > > My question is this: what is the appropriate design array for computing a >> correlation with ft_statfun_correlationT? Is the behavioral variable >> supposed to be part of the design or must it be part of a dummy structure >> designed to be similar in size and structure to the frequency data? >> > > It's really as described on the page you referred to ( > http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables > ) > > n1 = 3; % n1 is the number of subjects > design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. > > cfg.design = design; > cfg.ivar = 1; > > stat = ft_freqstatistics(cfg, data_brain{:}); > > where data_brain is a multiple subjects structure in case you're doing > this at the second/group level (i.e. correlate a behavioral variable to a > neural variable across subjects). Thus, a dummy variable is no longer > needed. > > Alternatively, is there a way to get, for every individual in the grand >> average, one value representing the average power for, e.g., 300-600ms in >> the 4-7Hz range? >> > > You may want to use ft_freqdescriptives for that, per subject. > > Best, Arjen > >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Kaitlyn Litcofsky Graduate Student, Cognitive Psychology 006 Moore Building Pennsylvania State University University Park, PA 16802 Email: kal378 at psu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Tue May 3 10:23:48 2016 From: mkshiri at gmail.com (shiri makov) Date: Tue, 3 May 2016 11:23:48 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' Message-ID: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that *sometimes *when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Tue May 3 11:29:27 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Tue, 3 May 2016 11:29:27 +0200 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> Message-ID: Dear Julia, The filtering not being applied might be related to the data samples you're providing the bandpass filtering. Several things: Keep in mind: You're creating a bandpass butterworth filter [1-3hz] with filter order 2. This means you'll need enough data to filter so low frequencies. Briefly, the butterworth filter is an infinite impulse response filter (IIR) that filters the data recursively (not by convolution) and the filter order means the amount of samples from input and output the filter will use (please go http://www.dspguide.com/CH14.PDF if this is not clear). The higher the filter order, the sharper the frequency response, the stronger the "ringing". The finite impulse response (FIR) filters, by the contrary, are implemented by convolution and the filter order means the length of the filter-kernel. The higher the filter order, the higher the frequency resolution, the lower the temporal resolution, the longer the filter kernel. Then you'll have to make sure your filter order is appropriate given the length of your data, which is not intuitive for IIR filters. I'm not an expert on filtering and I find the Widmann, Schröger & Maess recent paper an excellent guide: http://www.ncbi.nlm.nih.gov/pubmed/25128257 To dig into this issue, you can apply the very same filter settings with ft_preprocessing separately and check what's happening before and after. Then you can discard if the filtering is what is creating the problem. Check: - Make sure the epoching you're using in cfg.trl = temptrl; is not too short for your filtering. My hunch is that the NaNs might be related to this - I don't know what kind of artifacts are you chasing filtering so low (drifts?) but the artifact padding you're using might be too short (artpadding = 0.1;) Regarding the very large effects in those two trials, I'd be pragmatic and I would delete them or I'd cut the edges that are problematic for you... I hope that helps! Diego On 2 May 2016 at 16:31, Brehm, J. (Julia) wrote: > Dear Diego, > > yes, thank you, I've seen that already. Unfortunately this does not really > help me. > > Apparently filtering is not even applied in my case (as the warning says). > It seems that the NaNs are introduced in ft_fetch_data, shouldn't these be > replaced by zeros where it's not filled by actual data when applying > filterpadding? I assume it does that at some other point I couldn't find!? > > Furthermore, in the interactive mode one can see that the z-values mimic > the data in the first and last trial of the dataset. This leads to the > detection of artifacts which are none and missing real artifacts (due to > very large effects in those two trials). I have attached a screenshot to > illustrate what I mean. > > As far as I understand filterpadding uses zero-padding, meaning I can use > it on segmented (not continuous) data, correct? So why does this have such > a large effect on my whole data instead of simply getting rid of edge > effects? > > Sorry if I am missing something obvious. > > Best, > Julia > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Diego Lozano-Soldevilla [dlozanosoldevilla at gmail.com] > *Sent:* Monday, May 02, 2016 3:24 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] What exactly does filterpadding do? > > Dear Julia, > > From the FAQ section: > > > http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work > > > http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts > > > I hope that helps, > > Diego > > > > On 2 May 2016 at 15:08, Brehm, J. (Julia) > > wrote: > >> Dear list, >> >> I am having problems applying filterpadding when >> using ft_artifact_zvalue. >> >> Could someone please explain what exactly the effect of filterpadding is, >> and in which cases I can apply it and in which not? >> >> I intended to use it to avoid edge effects in the artifact detection. >> However, I get the following warning (only when applying fltpadding, my >> data does not actually contain NaNs): >> >> Warning: data contains NaNs, no filtering or preprocessing applied >> > In ft_warning (line 181) >> In preproc (line 282) >> In ft_artifact_zvalue (line 292) >> >> These are my settings: >> cfg = []; >> cfg.trl = temptrl; % all trials >> >> cfg.artfctdef.zvalue.channel = channel{ch}; % single channel >> cfg.artfctdef.zvalue.cutoff = 3; >> cfg.artfctdef.zvalue.fltpadding = 0.1; >> >> cfg.artfctdef.zvalue.bpfilter = 'yes'; >> cfg.artfctdef.zvalue.bpfilttype = 'but'; >> cfg.artfctdef.zvalue.bpfreq = [1 3]; >> cfg.artfctdef.zvalue.bpfiltord = 2; >> cfg.artfctdef.zvalue.hilbert = 'yes'; >> >> Thanks! >> >> Best, >> Julia >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> 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 Christoph.Kayser at glasgow.ac.uk Tue May 3 12:16:19 2016 From: Christoph.Kayser at glasgow.ac.uk (Christoph Kayser) Date: Tue, 3 May 2016 10:16:19 +0000 Subject: [FieldTrip] Post-Doc position in multisensory neuroimaging (MEG/EEG) studies at the Centre for Cognitive Neuroimaging, Glasgow, UK Message-ID: <330A4F21C29C8549A927275C10C1ADFB1FE87F73@CMS08-01.campus.gla.ac.uk> We are recruiting for 3 year post-doc position in the context of the EU-funded ERC project "Understanding the neural mechanisms of multisensory perception based on computational principles". The integrative neuroscience laboratory is dedicated to understanding the integration of multisensory information in the brain. The planned studies use state of the art imaging methodology (MEG, and possibly fMRI or EEG) combined with quantitative data analysis to better understand when and how the brain combines different sensory channels to inform perception. Further details about our research can be found on our website (http://inl.ccni.gla.ac.uk/). More details about the position and the link to the recruitment page can be found here http://www.jobs.ac.uk/job/ANO030/research-assistant-associate/ Job Ref: 013172 Closing data: 29th May 2016 The job requires all aspects of study design, implementation, data collection, data analysis as well as assisting in the supervision of junior lab members, presenting at conferences and participating in the writing up of the results. Applicants should have (or expect to receive in the near future) a PhD in neuroscience, cognitive science, psychology, mathematics, or a relevant discipline. We are especially interested in devotion to advanced quantitative data analysis including the capabilities to program or modify analysis code and the ideal applicant will have a strong analytical background and direct experience using MATLAB software. Experience with neuroimaging is required. Any applicant should have enthusiasm, and a clear, demonstrable capacity for acquiring expertise in these techniques. This position is funded for up to 3 years from November 2016, at UK RA Salary Grade 6 or 7 depending on experience. Questions may be directed to the PI: Christoph.Kayser at glasgow.ac.uk I'm sorry for multiple postings! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Tue May 3 13:07:18 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Tue, 3 May 2016 13:07:18 +0200 Subject: [FieldTrip] Cluster Permutation Message-ID: An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Tue May 3 15:34:14 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Tue, 3 May 2016 13:34:14 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <626588319.5432301.1462282454935.JavaMail.yahoo@mail.yahoo.com> Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Wednesday, February 10, 2016 11:20 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila (and Arjen): I just tried this out with a sample file, it looks like you can get this information if you use ft_read_header() rather than ft_preprocessing. The cfg structure I got from ft_preprocessing didn't contain the time-of-day information, but the structure returned from ft_read_header did: >> hdr = ft_read_header( cfg.dataset ); hdr.orig.T0 ans =         2005           9          15          10          18          42 I assume that's showing year, month, day, hour, minute (presumably based on the clock of the computer that made the recording). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/  Message: 3 Date: Tue, 9 Feb 2016 15:40:35 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1722640118.1244946.1455032435939.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Thanks.I need to retrieve the time when the recordings occure and I don't see it. I get the Fs but no more.I am using this code : cfg = [];cfg.trl = [1 1000000 0];%cfg.trl = [100001 2000000 0];%cfg.trialdef.triallength = 5;cfg.dataset =fileName; %'For leila.edf';cfg= ft_definetrial( cfg );cfg.continuous = 'yes'; datastr = ft_preprocessing(cfg);data=datastr.trial{1,1};chanls=datastr.label;Fs=datastr.fsample; and getting this?datastr =? ? ? ? ? ? ?hdr: [1x1 struct]? ? ? ? ?label: {65x1 cell}? ? ? ? ? time: {[1x1000000 double]}? ? ? ? ?trial: {[65x1000000 double]}? ? ? ?fsample: 1024? ? sampleinfo: [1 1000000]? ? ? ? ? ?cfg: [1x1 struct] cfg =? ? ? ? ? ? ? ? ? ? trl: [1 1000000 0]? ? ? ? ? ? ? dataset: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? trackconfig: 'off'? ? ? ? ? checkconfig: 'loose'? ? ? ? ? ? checksize: 100000? ? ? ? ?showcallinfo: 'yes'? ? ? ? ? ? ? ? debug: 'no'? ? outputfilepresent: 'overwrite'? ? ? ? trackcallinfo: 'yes'? ? ? ? trackdatainfo: 'no'? ? ? ? ? ? ?callinfo: [1x1 struct]? ? ? ? ? ? ? version: [1x1 struct]? ? ? ? ? ? ?datafile: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? ?headerfile: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? ?dataformat: 'edf'? ? ? ? ?headerformat: 'edf'? ? ? ? ? ? ? ? event: []? ? ? ? ? ?continuous: 'yes' ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Arjen Stolk  To: FieldTrip discussion list  Sent: Tuesday, February 9, 2016 3:32 PM  Subject: Re: [FieldTrip] importing large edf data Hi both,There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head.Arjen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 4 10:05:19 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 10:05:19 +0200 Subject: [FieldTrip] Fwd: Open PhD position in MEG studies of autism spectrum disorders... References: <61AE7C6258345149ADC0BA3AD9DA6E6201DD364CB0@exchccr1.neuro.gu.se> Message-ID: FYI Begin forwarded message: > From: Justin Schneiderman > Subject: Open PhD position in MEG studies of autism spectrum disorders... > Date: 4 May 2016 08:44:30 GMT+2 > To: Justin Schneiderman > > Hej! > My apologies if you receive this more than once. Please forward this to students interested in PhD studies in neuroscience, magnetoencephalography (MEG), neuroimaging, and autism spectrum disorders! > > We have an open PhD position at the Institute of Neuroscience and Physiology and the Gillberg Neuropsychiatry Centre here at the University of Gothenburg. The position is salaried and will be attached to our ongoing MEG neuroimaging study of autism spectrum disorders in connection to the Karolinska Institute's NatMEG center. For more information, please follow this link: > http://www.gu.se/english/about_the_university/announcements-in-the-job-application-portal/?languageId=100001&disableRedirect=true&returnUrl=http%3A%2F%2Fwww.gu.se%2Fomuniversitetet%2Faktuellt%2Fledigaanstallningar%2F%3Fid%3D19144%26Dnr%3D755868%26Type%3DS&Dnr=755868&Type=S > > If the link above doesn't work, then go to http://www.gu.se/english -> "About the university" -> "Job opportunities" -> "Doctoral student/ assistant/ teaching assistant" -> "PhD student position in medical science - Neurophysiological markers for autism (UR 2016/238)" > > Note: The deadline for applications is next Tuesday the 10th of May. > > Thanks! > -Justin > MedTech West > http://www.medtechwest.se > Institute of Neuroscience and Physiology > Sahlgrenska Academy & University of Gothenburg -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed May 4 10:51:24 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 08:51:24 +0000 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? In-Reply-To: References: Message-ID: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> Dear Harold, What extra documentation are you looking for? I think that a good start would be to read the description in the documentation part of the m-file itself (i.e. the stuff you get when typing ‘help ft_sourcedescriptives’). Note: if you don’t think you need the function, it’s alright not to use it :o). Best, Jan-Mathijs On 02 May 2016, at 15:14, Harold Cavendish > wrote: Hello, could you please explain the purpose of ft_sourcedescriptives() in EEG source analysis? The documentation is very brief (“computes descriptive parameters of the source analysis results”) and I haven't found a single tutorial with proper explanation. I found it used here but without any explanation whatsoever. Thank you! Harold _______________________________________________ fieldtrip 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 Wed May 4 11:08:05 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:08:05 +0000 Subject: [FieldTrip] FT clusterplot In-Reply-To: References: Message-ID: <2FCC2C77-A068-4B4B-8799-04491D7B2ACC@donders.ru.nl> Dear Hweeling, I am not a big fan of this function, and I would strongly recommend not to talk about ‘significant clusters’: using cluster-based permutation tests allows for inference about the difference across conditions/groups, based on a heuristic involving the estimation of clusters from the thresholded observed (and permuted) data, yet the clusters themselves are just a byproduct of this inferential procedure. >From what I can read in the code (which you also had a look at), indeed at some point a squeeze operation is performed in case the input data contains both a time and freq axis. Yet, note that the squeeze operation only has an effect if the freq dimension (the second dimension in the matrix) is singleton, i.e. if there’s only a single frequency bin in the data. In other words, even if the function does not crash when inputting time-frequency data, it will most likely produce ‘incorrect’ visualizations, or at least you think you are looking at something that will be different from the thing that you are actually looking at. The only way around this would be to do a pre-selection of a certain frequency range prior to calling ft_clusterplot. This preselection can be achieved with ft_selectdata in general (use cfg.frequency, and cfg.avgoverfreq), but will not likely produce the required output for the ‘posclusterslabelmat’ and ‘negclusterslabelmat’ fields, that are required for ft_clusterplot. At least, not if you select multiple frequency bins. Thus, in summary, you can pull this off, if you first use ft_selectdata, but in that case ensure that you select a single frequency bin. Best, Jan-Mathijs > On 02 May 2016, at 12:06, Hwee Ling Lee wrote: > > Dear all, > > I hope this email finds you well. > > I had a statistics results that I would like to use ft_clusterplot to plot the significant clusters. However, I'm experiencing some difficulties to specific the configuration. > > From the ft_clusterplot.m, I noticed that the function is able to squeeze the 3D matrix into a 2D matrix for plotting purposes. My current statistics results is in "chan-freq-time" dimension, and I was wondering how I could specific the configuration to select a specific frequency to plot. > > Can someone please help? > > Or do I have to adjust the statistics results variable manually such that it has a "chan-time" dimension for plotting? > > Thanks! > > Cheers, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 4 11:17:53 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:17:53 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? References: Message-ID: Hi Andreas, I think that the reason why ft_selectdata removes the ‘pow’-field is due to its overzealous bookkeeping. The data-structure you mentioned in a previous e-mail is not fully internally consistent (probably not your fault, by the way). Although it lacks a proper ‘dimord’ field, which specifies how the primary numeric data should be interpreted (in your case you probably want it to be: ‘subj_pos’), it also contains a ‘time’ field. In the absence of the dimord, FT is trying to create one from the data structure, and I suspect that the presence of the time-field will lead to something like ‘subj_pos_time’ or so. Subsequently, ft_seletdata only passes on those numeric data fields that are consistent with this dimord, which does not include pow. Anyway, my hunch is that if you do a rmfield(data,’time’), prior to calling ft_sourcestatistics the old-fashioned way (i.e. with the data being passed through ft_sourcegrandaverage), it may work as well. Best, Jan-Mathijs On 02 May 2016, at 15:27, Andreas Sauer > wrote: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) >: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip 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 Wed May 4 11:18:09 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:18:09 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? References: Message-ID: Hi Andreas, I think that the reason why ft_selectdata removes the ‘pow’-field is due to its overzealous bookkeeping. The data-structure you mentioned in a previous e-mail is not fully internally consistent (probably not your fault, by the way). Although it lacks a proper ‘dimord’ field, which specifies how the primary numeric data should be interpreted (in your case you probably want it to be: ‘subj_pos’), it also contains a ‘time’ field. In the absence of the dimord, FT is trying to create one from the data structure, and I suspect that the presence of the time-field will lead to something like ‘subj_pos_time’ or so. Subsequently, ft_seletdata only passes on those numeric data fields that are consistent with this dimord, which does not include pow. Anyway, my hunch is that if you do a rmfield(data,’time’), prior to calling ft_sourcestatistics the old-fashioned way (i.e. with the data being passed through ft_sourcegrandaverage), it may work as well. Best, Jan-Mathijs On 02 May 2016, at 15:27, Andreas Sauer > wrote: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) >: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lingwang at m.scnu.edu.cn Wed May 4 11:32:32 2016 From: lingwang at m.scnu.edu.cn (=?utf-8?B?TGluZyBXYW5n?=) Date: Wed, 4 May 2016 17:32:32 +0800 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Message-ID: Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Wed May 4 12:50:21 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Wed, 4 May 2016 10:50:21 +0000 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system In-Reply-To: References: Message-ID: <1462359023151.15592@cfin.au.dk> Dear Ling, Does your system consist of 148 magnetometors or gradiometers? In my previous lab at the University of Konstanz, we also had the Magnes 2500WH with 148 magnetometers. In our experience, the weights were not necessary for analyses at either the sensor or source level. If your system consists of gradiometers, however, maybe these weights would be necessary? If you really need those weights, I believe you can find them in the header structure, somewhere in data.hdr.orig. You will then need some knowledge on how to apply those weights. Cheers, Sarang ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Ling Wang Sent: Wednesday, May 4, 2016 11:32 AM To: fieldtrip Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 4 13:06:07 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 13:06:07 +0200 Subject: [FieldTrip] some issues with the sebserver hosting the wiki Message-ID: <79D7BF5F-97B6-436B-AA7C-1801AF32F7A1@donders.ru.nl> Dear community, The server that is also hosting the FieldTrip wiki (and some other Donders web sites) seems to have been under attack by hackers, trying to use it for sending email spam. We have not nailed down the issue yet. As a preventive measure we have blocked a whole list of suspicious IP addresses from accessing the FieldTrip wiki. If you cannot access the wiki any more, please let me know and I’ll unblock your IP address. Also if you notice anything unusual on the wiki (e.g. pages that youy think should not be there), please drop me a personal email. best regards, Robert From r.oostenveld at donders.ru.nl Wed May 4 15:38:37 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 15:38:37 +0200 Subject: [FieldTrip] Donders Institute Toolkit on Non-invasive Brain Stimulation (TMS, tDCS, tACS) References: <6711FBFF69C42F41B4FCD956BE3BE6663DC974DE@exprd01.hosting.ru.nl> Message-ID: <579BF03C-3E14-48C9-9AA2-D5A6DDE7486D@donders.ru.nl> Dear all, On June 14-17, 2016, the annual Donders Institute Toolkit on Non-invasive Brain Stimulation (TMS, tDCS, tACS) will take place in Nijmegen, the Netherlands. This intensive 4-day methods-focused course will feature hands-on sessions, demos, and lectures from Donders Institute affiliates and external Keynote Speakers, regarding fundamentals of TMS, tDCS, tACS and neuroimaging applications (EEG, MEG and fMRI), with a particular focus on TMS-EEG. See preliminary schedule in attachment and http://www.ru.nl/donders/agenda-news/tool-kits-cognitive/transcranial-brain/. _________________________ Ian Cameron, PhD Senior Researcher Donders Centre for Cognitive Neuroimaging visiting address: Kapittelweg 29, 6525 EN mailing address: P.O. Box 9101, NL-6500 HB Nijmegen, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Toolkit of Cognitive Neuroscience2016_BrainStim_preliminary.compressed.pdf Type: application/pdf Size: 167190 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From lingwang at m.scnu.edu.cn Wed May 4 16:27:43 2016 From: lingwang at m.scnu.edu.cn (=?utf-8?B?TGluZyBXYW5n?=) Date: Wed, 4 May 2016 22:27:43 +0800 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system In-Reply-To: <1462359023151.15592@cfin.au.dk> References: <1462359023151.15592@cfin.au.dk> Message-ID: Dear Sarang, Thanks for your reply. Our MEG system consists of 148 magnetometers. I searched the MEG papers published by researchers in your previous department at the University of Konstanz, and found two papers by Staudigl, Hanslmayr and colleagues (2013, 2015), in which the MEG data were collected with Magnes 2500WH 148-channel system and analyzed by FieldTrip. I'm happy about the papers. It seems that we can also use our MEG system to perform experiments. I'm new to the MEG field and am learning. Actually, I'm not sure about what the balancing weights are for. I read some scripts/functions of the FieldTrip toolbox, such as ft_read_header, bti2grad and read_4d_hdr. It says in the bti2grad function, "BTI2GRAD converts a 4D header to a gradiometer structure that can be understood by FieldTrip and Robert Oostenveld's low-level forward and inverse routines." So my understanding is that the balancing weights stored in hdr.grad is important for carrying out analyses at the source level? Or, the balancing weights are only necessary for gradieometers system but not for magnetometers system? Thanks again for the information. Best wishes, Ling ------------------ Original ------------------ From: "Sarang S. Dalal"; Date: Wed, May 4, 2016 06:50 PM To: "FieldTrip discussion list"; Subject: Re: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear Ling, Does your system consist of 148 magnetometors or gradiometers? In my previous lab at the University of Konstanz, we also had the Magnes 2500WH with 148 magnetometers. In our experience, the weights were not necessary for analyses at either the sensor or source level. If your system consists of gradiometers, however, maybe these weights would be necessary? If you really need those weights, I believe you can find them in the header structure, somewhere in data.hdr.orig. You will then need some knowledge on how to apply those weights. Cheers, Sarang From: fieldtrip-bounces at science.ru.nl on behalf of Ling Wang Sent: Wednesday, May 4, 2016 11:32 AM To: fieldtrip Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseluisblues at gmail.com Wed May 4 19:30:53 2016 From: joseluisblues at gmail.com (Jose) Date: Wed, 4 May 2016 19:30:53 +0200 Subject: [FieldTrip] integer frequencies in TFR Message-ID: dear list, I'm analysing CTF MEG data (sampling rate 1250 Hz). I'm epoching my data from -0.5 sec to 2.8 sec relative my marker of interest. % define the trial matrix trlFile = zeros(length(markers3), 3); for i_trial = 1:length(markers3) trlFile(i_trial,1) = markers3(i_trial,2) -625; % 0.5*1250 % SR = 1250, trlFile(i_trial,2) = markers3(i_trial,2) +3500; % 2.8*1250 % SR = 1250, trlFile(i_trial,3) = -625; trlFile(i_trial,4) = markers3(i_trial,1); end Once I pre-process the data, I run TF analyses with the wavelet method cfg = [ ]; cfg.trials = find(data2.trialinfo(:,1) == i_condition); cfg.channel = 'MEG'; cfg.method = 'wavelet'; cfg.width = 5; cfg.output = 'pow'; cfg.foi = 1:1:30; cfg.toi = -0.5:0.05:2.8; TFdata = ft_freqanalysis(cfg, data1); In the .freq field I realize that my frequency are not exact integers 0.907801418439716 2.11820330969267 3.02600472813239 3.93380614657210 5.14420803782506 6.05200945626478 6.95981087470449 7.86761229314421 9.07801418439716 9.98581560283688 ... I checked: http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies So, I decide to reduce one sample in my trial definition (so trlFile(i_trial,2) = markers3(i_trial,2) +3500-1; % 2.8*1250 % SR = 1250,) But, still I'm not having integers, 0.909090909090909 2.12121212121212 3.03030303030303 3.93939393939394 5.15151515151515 6.06060606060606 6.96969696969697 7.87878787878788 9.09090909090909 10 ... I suspect I can't obtain integer frequencies in my TFR due to my frequency sampling, Is there any recommendation regarding the frequencies used to compute the TFRs? Would that pose some issues for subsequent processing steps? thanks Jose -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Thu May 5 16:34:40 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Thu, 5 May 2016 14:34:40 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> References: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> Message-ID: <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com>  Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Arjen Stolk To: FieldTrip discussion list Sent: Tuesday, February 9, 2016 3:32 PM Subject: Re: [FieldTrip] importing large edf data Hi both,There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head.Arjen On Feb 9, 2016, at 3:19 AM, Stephen Politzer-Ahles wrote: Hi Leila, I'm sorry but I'm afraid I have not quite understood your issue. Can you give some more detail about what the problem is? In general, the fieldtrip structure output by ft_preprocessing() should have a .time field (indicating what timepoint during the epoch each sample corresponds to) and an .fsample field indicating the sampling rate (which you would also be able to use to figure out the time of each sample). 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: Mon, 8 Feb 2016 11:51:05 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1195829915.655104.1454932265573.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Stephen:I just happen to realize that when I load the data as you mentioned below, I can not get hold of the real time of the EEG file. (e.g.18:32:43 ).Could you please point out as how I could retrieve the real time of the EEG file after loading. Thanks a lot.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: 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 _______________________________________________ fieldtrip 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 Thu May 5 16:35:07 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Thu, 5 May 2016 14:35:07 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <261952317.6531678.1462458907903.JavaMail.yahoo@mail.yahoo.com>  Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ 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 gina.joue at univr.it Thu May 5 17:40:35 2016 From: gina.joue at univr.it (gj) Date: Thu, 5 May 2016 17:40:35 +0200 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572B6719.20906@univr.it> References: <572B6711.1050906@univr.it> <572B6719.20906@univr.it> Message-ID: <572B6973.4050104@univr.it> Hi again, I'm really stymied over this problem and can't move on with my analyses...help? Pretty please? Thank you in advance! Gina From jan.schoffelen at donders.ru.nl Thu May 5 19:11:32 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 17:11:32 +0000 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572B6973.4050104@univr.it> References: <572B6711.1050906@univr.it> <572B6719.20906@univr.it> <572B6973.4050104@univr.it> Message-ID: Hi Gina, In general I think that you really should provide a bit more information. I at least don’t remember what your problem is all about, and if you would like people to think along (who by the way all do this on a voluntary basis), you should really give us something to work on, and present things on a silver platter, rather than expecting us to dig through our (no doubt extensive) e-mail archives, which moreover relies on the assumption that we still have your earlier e-mails handy. This being said, I dug through my archive, and saw that I already replied to an e-mail of yours that has the same subject header. Here’s my earlier reply: ++++++++++++++++++++++++++++++++++++ Begin forwarded message: From: Jan Mathijs Schoffelen > Subject: Re: [FieldTrip] ft_source2sparse usage for EEG data Date: 11 April 2016 at 15:05:21 GMT+2 To: FieldTrip discussion list > Hi Gina, A dimensionality of 92232 ( ^ 2) suggests that you have 28 times the number of inside dipoles. I suspect a interaction between FieldTrip’s internal data bookkeeping and perhaps your specification of the input data/cfg. Where does this factor of 28 come from? Best, Jan-Mathijs ++++++++++++++++++++++++++++++++++++++++++ As you can see, this reply contained a question, which as far as I am concerned has not been answered. In other words, the ball is in your court. Best, Jan-Mathijs On 05 May 2016, at 17:40, gj > wrote: Hi again, I'm really stymied over this problem and can't move on with my analyses...help? Pretty please? Thank you in advance! Gina _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From brungio at gmail.com Thu May 5 20:37:51 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Thu, 5 May 2016 19:37:51 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign Message-ID: <572B92FF.9090502@gmail.com> Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From brungio at gmail.com Thu May 5 20:43:30 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Thu, 5 May 2016 19:43:30 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <572B92FF.9090502@gmail.com> References: <572B92FF.9090502@gmail.com> Message-ID: <572B9452.3060004@gmail.com> Please ignore this. I just tried with the current FT version, and the problem disappeared. Bruno On 05/05/2016 19:37, Bruno L. Giordano wrote: > Hello, > > I am trying to run these commands on different matlab versions(2013 vs. > 2015) and using different FT versions (20141209 vs. 20160317; let's call > them 2014 vs. 2016). > > The code I run is as follows: > > mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); > > cfg=[]; > cfg.method='fiducial'; > cfg.coordsys='4d'; > cfg.fiducial.nas=[59 168 104]; > cfg.fiducial.lpa=[138 133 28]; > cfg.fiducial.rpa=[147 138 169]; > mri=ft_volumerealign(cfg,mri); > > hs=ft_read_headshape(headshapefilename); > % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an > error, see v > > cfg=[]; > cfg.method='headshape'; > cfg.headshape=hs; > > mrihs=ft_volumerealign(cfg,mri); > > Unless otherwise noted, the code fails when I quit the interactive > alignment window. > > It fails in the following cases (errors below): > Matlab: 2015; FT: 2016 > Matlab: 2015; FT: 2014 > Matlab: 2013; FT: 2016 > > and is successful only for > Matlab: 2013; FT: 2014 > > Did anyone experience similar problems? Is there a workaround? If not, > would it be complicated to estimate the transformation matrices myself > once I know the right scale/translation/rotation parameters? > > Thank you, > > Bruno > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2013; FT: 2016 > Matlab: 2013; FT: 2016 > Fails when quitting interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Error using cell/ismember>cellismemberR2012a (line 193) > Input A of class cell and input B of class cell must be cell arrays of > strings, unless one is a string. > > Error in cell/ismember (line 57) > [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); > > Error in ft_senstype (line 303) > if (mean(ismember(ft_senslabel('ant128'), sens.label)) > > 0.8) > > Error in ft_datatype_sens (line 138) > ismeg = ft_senstype(sens, 'meg'); > > Error in ft_checkconfig (line 250) > cfg.elec = ft_datatype_sens(cfg.elec); > > Error in ft_interactiverealign (line 71) > cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', > 'headmodel'}); > > Error in ft_volumerealign (line 691) > tmpcfg = ft_interactiverealign(tmpcfg); > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2015; FT: 2016 > Matlab: 2015; FT: 2016 > hs.pnt=hs.pos; %required or will give another error > Fails when quitting interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Error using * > Inner matrix dimensions must agree. > > Error in ft_sourceinterpolate (line 328) > av = interpmat*fv; > > Error in ft_volumerealign (line 752) > smoothdist = ft_sourceinterpolate(tmpcfg, functional, > target); > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2015; FT: 2014 > Matlab: 2015; FT: 2014 > hs.pnt=hs.pos; %required or will give another error > Fails when creating the interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > ield assignment to a non-structure array object. > > Error in ft_plot_mesh (line 61) > bnd.pnt = bnd; > > Error in ft_interactiverealign>cb_redraw (line 282) > ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', > 'vertexsize',10); > > Error in ft_interactiverealign (line 126) > cb_redraw(gca); > > Error in ft_volumerealign (line 584) > tmpcfg = ft_interactiverealign(tmpcfg); > > > > > > > > > > > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Thu May 5 21:00:03 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 19:00:03 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> Message-ID: <700BDF87-ABB0-457C-BDA8-3BA3801DA4CB@donders.ru.nl> Hi Bruno, I think we have just been looking into it. And with just, I mean really just. I just merged a pull request from Roemer van der Meij into github.com/fieldtrip/fieldtrip (#141). This merge is related to a graphics issue that needs to be resolved differently for different matlab versions (in particular for matlab>=2014 it requires a different solution than matlab<2014). I wonder whether this is related to the problem you report. We did not do an comparable extensive sweep of the possible combinations (i.e. matlab versions and fieldtrip versions), so could you pull a copy from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that explains one way of getting yourself a local copy of the code. Thanks, Jan-Mathijs On 05 May 2016, at 20:37, Bruno L. Giordano > wrote: Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ _______________________________________________ fieldtrip 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 Thu May 5 21:05:48 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 19:05:48 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> Message-ID: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Hi Bruno, I think we have just been looking into it. And with just, I mean really just. I just merged a pull request from Roemer van der Meij into github.com/fieldtrip/fieldtrip (#141). This merge is related to a graphics issue that needs to be resolved differently for different matlab versions (in particular for matlab>=2014 it requires a different solution than matlab<2014). I wonder whether this is related to the problem you report. We did not do an comparable extensive sweep of the possible combinations (i.e. matlab versions and fieldtrip versions), so could you pull a copy from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that explains one way of getting yourself a local copy of the code. Thanks, Jan-Mathijs On 05 May 2016, at 20:37, Bruno L. Giordano > wrote: Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From brungio at gmail.com Fri May 6 10:22:58 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 09:22:58 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Message-ID: <572C5462.5070809@gmail.com> Hi, thanks, I will look into it! One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: hs.pnt=hs.pos; Cheers, Bruno On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Bruno, > > I think we have just been looking into it. And with just, I mean really > just. I just merged a pull request from Roemer van der Meij into > github.com/fieldtrip/fieldtrip > (#141). This merge is related to > a graphics issue that needs to be resolved differently for different > matlab versions (in particular for matlab>=2014 it requires a different > solution than matlab<2014). I wonder whether this is related to the > problem you report. > We did not do an comparable extensive sweep of the possible combinations > (i.e. matlab versions and fieldtrip versions), so could you pull a copy > from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that > explains one way of getting yourself a local copy of the code. > > Thanks, > > Jan-Mathijs > > > > > >> On 05 May 2016, at 20:37, Bruno L. Giordano > > wrote: >> >> Hello, >> >> I am trying to run these commands on different matlab versions(2013 >> vs. 2015) and using different FT versions (20141209 vs. 20160317; >> let's call them 2014 vs. 2016). >> >> The code I run is as follows: >> >> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >> >> cfg=[]; >> cfg.method='fiducial'; >> cfg.coordsys='4d'; >> cfg.fiducial.nas=[59 168 104]; >> cfg.fiducial.lpa=[138 133 28]; >> cfg.fiducial.rpa=[147 138 169]; >> mri=ft_volumerealign(cfg,mri); >> >> hs=ft_read_headshape(headshapefilename); >> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >> error, see v >> >> cfg=[]; >> cfg.method='headshape'; >> cfg.headshape=hs; >> >> mrihs=ft_volumerealign(cfg,mri); >> >> Unless otherwise noted, the code fails when I quit the interactive >> alignment window. >> >> It fails in the following cases (errors below): >> Matlab: 2015; FT: 2016 >> Matlab: 2015; FT: 2014 >> Matlab: 2013; FT: 2016 >> >> and is successful only for >> Matlab: 2013; FT: 2014 >> >> Did anyone experience similar problems? Is there a workaround? If not, >> would it be complicated to estimate the transformation matrices myself >> once I know the right scale/translation/rotation parameters? >> >> Thank you, >> >> Bruno >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2013; FT: 2016 >> Matlab: 2013; FT: 2016 >> Fails when quitting interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Error using cell/ismember>cellismemberR2012a (line 193) >> Input A of class cell and input B of class cell must be cell arrays of >> strings, unless one is a string. >> >> Error in cell/ismember (line 57) >> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >> >> Error in ft_senstype (line 303) >> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >> > 0.8) >> >> Error in ft_datatype_sens (line 138) >> ismeg = ft_senstype(sens, 'meg'); >> >> Error in ft_checkconfig (line 250) >> cfg.elec = ft_datatype_sens(cfg.elec); >> >> Error in ft_interactiverealign (line 71) >> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >> 'headmodel'}); >> >> Error in ft_volumerealign (line 691) >> tmpcfg = ft_interactiverealign(tmpcfg); >> >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2015; FT: 2016 >> Matlab: 2015; FT: 2016 >> hs.pnt=hs.pos; %required or will give another error >> Fails when quitting interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in ft_sourceinterpolate (line 328) >> av = interpmat*fv; >> >> Error in ft_volumerealign (line 752) >> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >> target); >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2015; FT: 2014 >> Matlab: 2015; FT: 2014 >> hs.pnt=hs.pos; %required or will give another error >> Fails when creating the interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> >> ield assignment to a non-structure array object. >> >> Error in ft_plot_mesh (line 61) >> bnd.pnt = bnd; >> >> Error in ft_interactiverealign>cb_redraw (line 282) >> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >> 'vertexsize',10); >> >> Error in ft_interactiverealign (line 126) >> cb_redraw(gca); >> >> Error in ft_volumerealign (line 584) >> tmpcfg = ft_interactiverealign(tmpcfg); >> >> >> >> >> >> >> >> >> >> >> >> -- >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Bruno L. Giordano, PhD >> Institute of Neuroscience and Psychology >> 58 Hillhead Street, University of Glasgow >> Glasgow, G12 8QB, Scotland >> T +44 (0) 141 330 5484 >> Www: http://www.brunolgiordano.net >> Email charter: http://www.emailcharter.org/ >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Fri May 6 10:25:00 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 6 May 2016 08:25:00 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <572C5462.5070809@gmail.com> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <572C5462.5070809@gmail.com> Message-ID: <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> Hi Bruno, Is this ‘hack’ done inside a function, or do you need to do it outside a function call? We recently tried and streamline the code to replace all occurrences of ‘pnt’ with ‘pos’. The fact that you need the hack suggests that we need to do some more code cleaning. It would be great if you could give us a pointer. JM > On 06 May 2016, at 10:22, Bruno L. Giordano wrote: > > Hi, > > thanks, I will look into it! > > One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: > > hs.pnt=hs.pos; > > Cheers, > > Bruno > > On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Bruno, >> >> I think we have just been looking into it. And with just, I mean really >> just. I just merged a pull request from Roemer van der Meij into >> github.com/fieldtrip/fieldtrip >> (#141). This merge is related to >> a graphics issue that needs to be resolved differently for different >> matlab versions (in particular for matlab>=2014 it requires a different >> solution than matlab<2014). I wonder whether this is related to the >> problem you report. >> We did not do an comparable extensive sweep of the possible combinations >> (i.e. matlab versions and fieldtrip versions), so could you pull a copy >> from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that >> explains one way of getting yourself a local copy of the code. >> >> Thanks, >> >> Jan-Mathijs >> >> >> >> >> >>> On 05 May 2016, at 20:37, Bruno L. Giordano >> > wrote: >>> >>> Hello, >>> >>> I am trying to run these commands on different matlab versions(2013 >>> vs. 2015) and using different FT versions (20141209 vs. 20160317; >>> let's call them 2014 vs. 2016). >>> >>> The code I run is as follows: >>> >>> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >>> >>> cfg=[]; >>> cfg.method='fiducial'; >>> cfg.coordsys='4d'; >>> cfg.fiducial.nas=[59 168 104]; >>> cfg.fiducial.lpa=[138 133 28]; >>> cfg.fiducial.rpa=[147 138 169]; >>> mri=ft_volumerealign(cfg,mri); >>> >>> hs=ft_read_headshape(headshapefilename); >>> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >>> error, see v >>> >>> cfg=[]; >>> cfg.method='headshape'; >>> cfg.headshape=hs; >>> >>> mrihs=ft_volumerealign(cfg,mri); >>> >>> Unless otherwise noted, the code fails when I quit the interactive >>> alignment window. >>> >>> It fails in the following cases (errors below): >>> Matlab: 2015; FT: 2016 >>> Matlab: 2015; FT: 2014 >>> Matlab: 2013; FT: 2016 >>> >>> and is successful only for >>> Matlab: 2013; FT: 2014 >>> >>> Did anyone experience similar problems? Is there a workaround? If not, >>> would it be complicated to estimate the transformation matrices myself >>> once I know the right scale/translation/rotation parameters? >>> >>> Thank you, >>> >>> Bruno >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2013; FT: 2016 >>> Matlab: 2013; FT: 2016 >>> Fails when quitting interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> Error using cell/ismember>cellismemberR2012a (line 193) >>> Input A of class cell and input B of class cell must be cell arrays of >>> strings, unless one is a string. >>> >>> Error in cell/ismember (line 57) >>> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >>> >>> Error in ft_senstype (line 303) >>> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >>> > 0.8) >>> >>> Error in ft_datatype_sens (line 138) >>> ismeg = ft_senstype(sens, 'meg'); >>> >>> Error in ft_checkconfig (line 250) >>> cfg.elec = ft_datatype_sens(cfg.elec); >>> >>> Error in ft_interactiverealign (line 71) >>> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >>> 'headmodel'}); >>> >>> Error in ft_volumerealign (line 691) >>> tmpcfg = ft_interactiverealign(tmpcfg); >>> >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2015; FT: 2016 >>> Matlab: 2015; FT: 2016 >>> hs.pnt=hs.pos; %required or will give another error >>> Fails when quitting interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> Error using * >>> Inner matrix dimensions must agree. >>> >>> Error in ft_sourceinterpolate (line 328) >>> av = interpmat*fv; >>> >>> Error in ft_volumerealign (line 752) >>> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >>> target); >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2015; FT: 2014 >>> Matlab: 2015; FT: 2014 >>> hs.pnt=hs.pos; %required or will give another error >>> Fails when creating the interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> >>> ield assignment to a non-structure array object. >>> >>> Error in ft_plot_mesh (line 61) >>> bnd.pnt = bnd; >>> >>> Error in ft_interactiverealign>cb_redraw (line 282) >>> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >>> 'vertexsize',10); >>> >>> Error in ft_interactiverealign (line 126) >>> cb_redraw(gca); >>> >>> Error in ft_volumerealign (line 584) >>> tmpcfg = ft_interactiverealign(tmpcfg); >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> -- >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Bruno L. Giordano, PhD >>> Institute of Neuroscience and Psychology >>> 58 Hillhead Street, University of Glasgow >>> Glasgow, G12 8QB, Scotland >>> T +44 (0) 141 330 5484 >>> Www: http://www.brunolgiordano.net >>> Email charter: http://www.emailcharter.org/ >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Bruno L. Giordano, PhD > Institute of Neuroscience and Psychology > 58 Hillhead Street, University of Glasgow > Glasgow, G12 8QB, Scotland > T +44 (0) 141 330 5484 > Www: http://www.brunolgiordano.net > Email charter: http://www.emailcharter.org/ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From brungio at gmail.com Fri May 6 10:59:35 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 09:59:35 +0100 Subject: [FieldTrip] Dartel-based MNI group grid Message-ID: <572C5CF7.3020407@gmail.com> Hi, I usually prepare the native-space beamforming grid by warping non-linearly to the native space a MNI group-level grid: cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = groupgrid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_headshape; %native-space anatomical grid = ft_prepare_sourcemodel(cfg); I am wondering whether someone ever tried to do this warping through DARTEL (http://www.ncbi.nlm.nih.gov/pubmed/17761438 implemented in SPM). The approach would still be to define an MNI-space grid, but to back-project to native space through the DARTEL template. When compared to the SPM non-linear warping, this approach would ensure a much better correspondence between structures for the different participant, and promises to boost to a certain extent group statistics (that is, not considering source blurring). It would also be quite a good idea for multimodal MEG/fMRI studies, where fMRI group-level is strongly recommended to rely on DARTEL (if you use SPM). Thank you for sharing your experiences/code snippets, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From brungio at gmail.com Fri May 6 11:29:45 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 10:29:45 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <572C5462.5070809@gmail.com> <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> Message-ID: <572C6409.5080504@gmail.com> Hi, we do this after getting the headshape with ft_readhsadshape, and before using the hs structure as cfg.headshape for mri-to-headshape realignment with ft_volumerealign. The switch to matlab2015 must have been a major headache for you guys ;-) Thanks for your hard work! Bruno On 06/05/2016 09:25, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Bruno, > > Is this ‘hack’ done inside a function, or do you need to do it outside a function call? > We recently tried and streamline the code to replace all occurrences of ‘pnt’ with ‘pos’. The fact that you need the hack suggests that we need to do some more code cleaning. It would be great if you could give us a pointer. > > JM > > >> On 06 May 2016, at 10:22, Bruno L. Giordano wrote: >> >> Hi, >> >> thanks, I will look into it! >> >> One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: >> >> hs.pnt=hs.pos; >> >> Cheers, >> >> Bruno >> >> On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: >>> Hi Bruno, >>> >>> I think we have just been looking into it. And with just, I mean really >>> just. I just merged a pull request from Roemer van der Meij into >>> github.com/fieldtrip/fieldtrip >>> (#141). This merge is related to >>> a graphics issue that needs to be resolved differently for different >>> matlab versions (in particular for matlab>=2014 it requires a different >>> solution than matlab<2014). I wonder whether this is related to the >>> problem you report. >>> We did not do an comparable extensive sweep of the possible combinations >>> (i.e. matlab versions and fieldtrip versions), so could you pull a copy >>> from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that >>> explains one way of getting yourself a local copy of the code. >>> >>> Thanks, >>> >>> Jan-Mathijs >>> >>> >>> >>> >>> >>>> On 05 May 2016, at 20:37, Bruno L. Giordano >>> > wrote: >>>> >>>> Hello, >>>> >>>> I am trying to run these commands on different matlab versions(2013 >>>> vs. 2015) and using different FT versions (20141209 vs. 20160317; >>>> let's call them 2014 vs. 2016). >>>> >>>> The code I run is as follows: >>>> >>>> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >>>> >>>> cfg=[]; >>>> cfg.method='fiducial'; >>>> cfg.coordsys='4d'; >>>> cfg.fiducial.nas=[59 168 104]; >>>> cfg.fiducial.lpa=[138 133 28]; >>>> cfg.fiducial.rpa=[147 138 169]; >>>> mri=ft_volumerealign(cfg,mri); >>>> >>>> hs=ft_read_headshape(headshapefilename); >>>> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >>>> error, see v >>>> >>>> cfg=[]; >>>> cfg.method='headshape'; >>>> cfg.headshape=hs; >>>> >>>> mrihs=ft_volumerealign(cfg,mri); >>>> >>>> Unless otherwise noted, the code fails when I quit the interactive >>>> alignment window. >>>> >>>> It fails in the following cases (errors below): >>>> Matlab: 2015; FT: 2016 >>>> Matlab: 2015; FT: 2014 >>>> Matlab: 2013; FT: 2016 >>>> >>>> and is successful only for >>>> Matlab: 2013; FT: 2014 >>>> >>>> Did anyone experience similar problems? Is there a workaround? If not, >>>> would it be complicated to estimate the transformation matrices myself >>>> once I know the right scale/translation/rotation parameters? >>>> >>>> Thank you, >>>> >>>> Bruno >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2013; FT: 2016 >>>> Matlab: 2013; FT: 2016 >>>> Fails when quitting interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> Error using cell/ismember>cellismemberR2012a (line 193) >>>> Input A of class cell and input B of class cell must be cell arrays of >>>> strings, unless one is a string. >>>> >>>> Error in cell/ismember (line 57) >>>> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >>>> >>>> Error in ft_senstype (line 303) >>>> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >>>>> 0.8) >>>> >>>> Error in ft_datatype_sens (line 138) >>>> ismeg = ft_senstype(sens, 'meg'); >>>> >>>> Error in ft_checkconfig (line 250) >>>> cfg.elec = ft_datatype_sens(cfg.elec); >>>> >>>> Error in ft_interactiverealign (line 71) >>>> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >>>> 'headmodel'}); >>>> >>>> Error in ft_volumerealign (line 691) >>>> tmpcfg = ft_interactiverealign(tmpcfg); >>>> >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2015; FT: 2016 >>>> Matlab: 2015; FT: 2016 >>>> hs.pnt=hs.pos; %required or will give another error >>>> Fails when quitting interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in ft_sourceinterpolate (line 328) >>>> av = interpmat*fv; >>>> >>>> Error in ft_volumerealign (line 752) >>>> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >>>> target); >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2015; FT: 2014 >>>> Matlab: 2015; FT: 2014 >>>> hs.pnt=hs.pos; %required or will give another error >>>> Fails when creating the interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> >>>> ield assignment to a non-structure array object. >>>> >>>> Error in ft_plot_mesh (line 61) >>>> bnd.pnt = bnd; >>>> >>>> Error in ft_interactiverealign>cb_redraw (line 282) >>>> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >>>> 'vertexsize',10); >>>> >>>> Error in ft_interactiverealign (line 126) >>>> cb_redraw(gca); >>>> >>>> Error in ft_volumerealign (line 584) >>>> tmpcfg = ft_interactiverealign(tmpcfg); >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Bruno L. Giordano, PhD >>>> Institute of Neuroscience and Psychology >>>> 58 Hillhead Street, University of Glasgow >>>> Glasgow, G12 8QB, Scotland >>>> T +44 (0) 141 330 5484 >>>> Www: http://www.brunolgiordano.net >>>> Email charter: http://www.emailcharter.org/ >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> -- >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Bruno L. Giordano, PhD >> Institute of Neuroscience and Psychology >> 58 Hillhead Street, University of Glasgow >> Glasgow, G12 8QB, Scotland >> T +44 (0) 141 330 5484 >> Www: http://www.brunolgiordano.net >> Email charter: http://www.emailcharter.org/ >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Fri May 6 20:50:52 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 6 May 2016 18:50:52 +0000 Subject: [FieldTrip] integer frequencies in TFR In-Reply-To: References: Message-ID: <19D4FAE7-1E95-4549-AE5F-7F597952F5FF@donders.ru.nl> Hi José, The frequencies that are returned are constrained by the intrinsic frequency resolution of your epochs. Since your epochs are 3.3 seconds long, FT will round to the nearest attainable frequencies, quantized at 1./3.3. You can use cfg.pad for spectral interpolation. This parameter is the length (in s) until which the data are padded with 0’s, prior to the FFT. In this case, I suggest to use cfg.pad = 4. Best, Jan-Mathijs On 04 May 2016, at 19:30, Jose > wrote: dear list, I'm analysing CTF MEG data (sampling rate 1250 Hz). I'm epoching my data from -0.5 sec to 2.8 sec relative my marker of interest. % define the trial matrix trlFile = zeros(length(markers3), 3); for i_trial = 1:length(markers3) trlFile(i_trial,1) = markers3(i_trial,2) -625; % 0.5*1250 % SR = 1250, trlFile(i_trial,2) = markers3(i_trial,2) +3500; % 2.8*1250 % SR = 1250, trlFile(i_trial,3) = -625; trlFile(i_trial,4) = markers3(i_trial,1); end Once I pre-process the data, I run TF analyses with the wavelet method cfg = [ ]; cfg.trials = find(data2.trialinfo(:,1) == i_condition); cfg.channel = 'MEG'; cfg.method = 'wavelet'; cfg.width = 5; cfg.output = 'pow'; cfg.foi = 1:1:30; cfg.toi = -0.5:0.05:2.8; TFdata = ft_freqanalysis(cfg, data1); In the .freq field I realize that my frequency are not exact integers 0.907801418439716 2.11820330969267 3.02600472813239 3.93380614657210 5.14420803782506 6.05200945626478 6.95981087470449 7.86761229314421 9.07801418439716 9.98581560283688 ... I checked: http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies So, I decide to reduce one sample in my trial definition (so trlFile(i_trial,2) = markers3(i_trial,2) +3500-1; % 2.8*1250 % SR = 1250,) But, still I'm not having integers, 0.909090909090909 2.12121212121212 3.03030303030303 3.93939393939394 5.15151515151515 6.06060606060606 6.96969696969697 7.87878787878788 9.09090909090909 10 ... I suspect I can't obtain integer frequencies in my TFR due to my frequency sampling, Is there any recommendation regarding the frequencies used to compute the TFRs? Would that pose some issues for subsequent processing steps? thanks Jose _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Fri May 6 23:02:24 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Fri, 6 May 2016 17:02:24 -0400 Subject: [FieldTrip] Washington DC/NIH Fieldtrip Users Message-ID: Hi, I am a graduate student at georgetown trying to use FT for EEG source localization, I have a working pipeline but I am not getting meaningful/correct results. Would be really helpful to sit down with other Fieldtrip users in the washington DC area to work out some bugs. Please let me know and I can commute to your location. Thank you, Hassanm -------------- next part -------------- An HTML attachment was scrubbed... URL: From munsif.jatoi at gmail.com Sat May 7 06:28:31 2016 From: munsif.jatoi at gmail.com (Munsif Jatoi) Date: Sat, 7 May 2016 12:28:31 +0800 Subject: [FieldTrip] Washington DC/NIH Fieldtrip Users In-Reply-To: References: Message-ID: Dear Hassan Aleem, I have been working in EEG source localization for my PH.D. Try to read the latest literature first. I would like to suggest you for different softwares such as SPM which has field trip integration in it. Try BEM head modeling with MSP Loreta as inversion methods. You can contact me for any help. Best, Munsif Sent from my iPhone > On 7 May 2016, at 05:02, Hassan Aleem wrote: > > Hi, > > I am a graduate student at georgetown trying to use FT for EEG source localization, I have a working pipeline but I am not getting meaningful/correct results. Would be really helpful to sit down with other Fieldtrip users in the washington DC area to work out some bugs. Please let me know and I can commute to your location. > > Thank you, > > Hassanm > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sat May 7 08:21:21 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sat, 7 May 2016 06:21:21 +0000 Subject: [FieldTrip] importing large edf data In-Reply-To: <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com> References: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com> Message-ID: Leila, I don’t know much about the EDF format, but perhaps you should consider that the ‘hdr’ should probably stay consistent with the data. That is, some data formats have a header that specifies the number of data samples. If you create ‘new’ data with an extra number of samples, it could be that the header needs to be updated as well. Best, Jan-Mathijs On 05 May 2016, at 16:34, Leila Ayoubian > wrote: Hi, I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece) Here is my code. It does create the 'a' file but it does not open as EDF. Any suggestion? clc; clear all; close all; %% [fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file'); file1 = fullfile(pathName1, fileName1); cfg1 = []; %cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms cfg1.trialdef.triallength = 5; cfg1.dataset =file1; %'For leila.edf'; cfg1= ft_definetrial( cfg1 ); cfg1.continuous = 'yes'; datastr1 = ft_preprocessing(cfg1); data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr; %% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file'); file2 = fullfile(pathName2, fileName2); cfg2 = []; %cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms cfg2.trialdef.triallength = 5; cfg2.dataset =file2; %'For leila.edf'; cfg2= ft_definetrial( cfg2 ); cfg2.continuous = 'yes'; datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2) % EEG=EEG'; % HDR=hdr1 % out=EDFCreator(EEG); dat = cat(2,data1,data2); %% % write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London ________________________________ From: Arjen Stolk > To: FieldTrip discussion list > Sent: Tuesday, February 9, 2016 3:32 PM Subject: Re: [FieldTrip] importing large edf data Hi both, There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head. Arjen On Feb 9, 2016, at 3:19 AM, Stephen Politzer-Ahles > wrote: Hi Leila, I'm sorry but I'm afraid I have not quite understood your issue. Can you give some more detail about what the problem is? In general, the fieldtrip structure output by ft_preprocessing() should have a .time field (indicating what timepoint during the epoch each sample corresponds to) and an .fsample field indicating the sampling rate (which you would also be able to use to figure out the time of each sample). 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: Mon, 8 Feb 2016 11:51:05 +0000 (UTC) From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data Message-ID: <1195829915.655104.1454932265573.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Stephen:I just happen to realize that when I load the data as you mentioned below, I can not get hold of the real time of the EEG file. (e.g.18:32:43 ).Could you please point out as how I could retrieve the real time of the EEG file after loading. Thanks a lot.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: 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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 gina.joue at univr.it Sat May 7 19:34:33 2016 From: gina.joue at univr.it (gj) Date: Sat, 7 May 2016 19:34:33 +0200 Subject: [FieldTrip] ft_source2sparse usage for EEG data Message-ID: <572E2729.8060701@univr.it> Hi, Sorry about that!! Good to know...I follow the forum threaded, so I made the false assumption that others do the same and that given the volume of emails/info overload and overworked forum-answering Samaritans these days that it was better to be concise rather than reiterate previous info...I do fully appreciate that people are kindly answering forum questions completely out of their good will -- without which I would be (more) lost and tearing more of my hair out -- so I FULLY appreciate you guys and, contrary to the end effect, I really do make an effort to try and package my questions.... To summarize, I am trying to use FieldTrip ver.20160309 to run a whole-brain network analysis on source level on a 2-sec continuous recording of EEG (preprocessed and averaged across all trials per condition per subject in another software -- I manually put the data in Fieldtrip format). Note that in trying to hack a way around the problem I've since reworked the data multiple times -- hence the numbers below are now not the same as what I previously posted, but the error is the same. Following the tutorials (for MEG: http://www.fieldtriptoolbox.org/tutorial/networkanalysis), I first run ft_source2sparse to reduce the matrix to only voxels inside the skull: >> source_sparse = ft_source2sparse(source_proj); total number of dipoles : 6804 number of dipoles inside brain: 3294 number of dipoles outside brain: 3510 When I then try to run the connectivity analysis (ft_connectivityanalysis), regardless of which connectivity method (I've tried the various options), e.g. cfg=[]; cfg.method ='coh'; cfg.complex = 'absimag'; source_conn = ft_connectivityanalysis(cfg, source_sparse); I get the error: ------------ error ----------- Requested 23058x23058 (7.9GB) 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 univariate2bivariate (line 314) data.crsspctrm = (transpose(mom)*conj(mom))./nrpt; Error in ft_connectivityanalysis (line 434) [data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm', dtype, 'cmb', cfg.refindx, 'keeprpt', 0); ------------ end error ----------- In univariate2bivariate(), it goes into "source moments are multivariate" with size(data.mom,1) = 3294 sizmom = [3, 7] Does this mean there were 3 dominant orientations of the source reconstructed data? I had done the projection with the following call: cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); At a loss -- not sure whether I set up something incorrectly? Thanks a mil in advance for any help or tips on where to troubleshoot!!! Gina From jan.schoffelen at donders.ru.nl Sun May 8 08:27:51 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 06:27:51 +0000 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572E2729.8060701@univr.it> References: <572E2729.8060701@univr.it> Message-ID: Hi Gina, First of all: it is not possible to compute connectivity from data that contains just a single trial. Second, it is not clear to me what kind of source reconstruction you have done, so it is difficult to comment here. In general, although I haven’t tried this recently myself, the best chances of being successful with your approach would be in the following ‘pipeline’ (I only flash out the functions to be used + some small details regarding the settings): 0. start with your data in a fieldtrip structure containing multiple trials. 1. call ft_freqanalysis to get the spectral representation of the data. Use cfg.method = ‘mtmfft’, cfg.output = ‘fourier’ 2. call ft_sourceanalysis, using a frequency domain beamformer to get the voxel-wise spectral representation of the data. Staying entirely within fieldtrip (i.e. without using some small hacks), you probably need the following: cfg.method = ‘pcc’ (this will give you the ‘mom’ in the appropriate shape, such that ft_connectivityanalysis may swallow it), cfg.pcc.fixedori = ‘yes’ (this gives a single orientation per voxel, i.e. a mom that is 1xobservations) 3. call ft_connectivityanalysis. It could be that you have been doing all this already (since you mention the networkanalysis tutorial, where at first glance this procedure is followed), and in that case I would first address points 0 and 1 above. Good luck, Jan-Mathijs > On 07 May 2016, at 19:34, gj wrote: > > Hi, > > Sorry about that!! Good to know...I follow the forum threaded, so I made the false assumption that others do the same and that given the volume of emails/info overload and overworked forum-answering Samaritans these days that it was better to be concise rather than reiterate previous info...I do fully appreciate that people are kindly answering forum questions completely out of their good will -- without which I would be (more) lost and tearing more of my hair out -- so I FULLY appreciate you guys and, contrary to the end effect, I really do make an effort to try and package my questions.... > > > To summarize, I am trying to use FieldTrip ver.20160309 to run a whole-brain network analysis on source level on a 2-sec continuous recording of EEG (preprocessed and averaged across all trials per condition per subject in another software -- I manually put the data in Fieldtrip format). Note that in trying to hack a way around the problem I've since reworked the data multiple times -- hence the numbers below are now not the same as what I previously posted, but the error is the same. > > Following the tutorials (for MEG: http://www.fieldtriptoolbox.org/tutorial/networkanalysis), I first run ft_source2sparse to reduce the matrix to only voxels inside the skull: > > >>> source_sparse = ft_source2sparse(source_proj); > total number of dipoles : 6804 > number of dipoles inside brain: 3294 > number of dipoles outside brain: 3510 > > When I then try to run the connectivity analysis (ft_connectivityanalysis), regardless of which connectivity method (I've tried the various options), e.g. > > > cfg=[]; > cfg.method ='coh'; > cfg.complex = 'absimag'; > source_conn = ft_connectivityanalysis(cfg, source_sparse); > > > I get the error: > > ------------ error ----------- > Requested 23058x23058 (7.9GB) 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 univariate2bivariate (line 314) > data.crsspctrm = (transpose(mom)*conj(mom))./nrpt; > > Error in ft_connectivityanalysis (line 434) > [data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm', > dtype, 'cmb', cfg.refindx, 'keeprpt', 0); > ------------ end error ----------- > > > In univariate2bivariate(), it goes into "source moments are multivariate" with > > size(data.mom,1) = 3294 > sizmom = [3, 7] > > Does this mean there were 3 dominant orientations of the source reconstructed data? I had done the projection with the following call: > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > > At a loss -- not sure whether I set up something incorrectly? Thanks a mil in advance for any help or tips on where to troubleshoot!!! > Gina > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From christine.blume at sbg.ac.at Sun May 8 09:26:08 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Sun, 8 May 2016 07:26:08 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Message-ID: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sun May 8 09:46:24 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 07:46:24 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: Message-ID: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Sun May 8 14:10:49 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Sun, 8 May 2016 12:10:49 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> References: , <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generating tmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows in data_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Sun May 8 19:07:51 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 18:07:51 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Message-ID: <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Dear all I was going through the tutorial: http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate My question involves the first realignment and reslicing followed by second realignment and reslicing. I do not understand the step below: -> T = transform_vox2ctf/transform_vox2spm= transform_vox2ctf*inv(transform_vox2spm) and this matrix is applied to sourcespace. What confuses me, is that a) we realign the anatomical voxel to spm (MNI) coordinates. b) we reslice and save it as shown in step "3. Preprocessing of the anatomical MRI: reslicing" && 4. Preprocessing of the anatomical MRI: save to disk At this stage we get the transformation matrix anatomical voxel to spm i.e transform_vox2spm Moreover, we reside in the SPM coordinates now. c) We then realign to CTF coordinates, no reslicing is done. we Should GET transform_spm2ctf. However, the obtained transform is called transform_vox2ct. Why??? We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); c) During the source creation, we are already in the MNI coordinates, because we are using Subject01.mgz. So, why in "STEP 4. Source model: Co-registration of the source space to the sensor-based head coordinate system we do we need to " T = transform_vox2ctf/transform_vox2spm; Should it not be transform_vox2ctf changed to transform_spm2ctf and T=transform_spm2ctf ??? best regards parham From jan.schoffelen at donders.ru.nl Sun May 8 21:35:38 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:35:38 +0000 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: Hi Parham, > On 08 May 2016, at 19:07, parham hashemzadeh wrote: > > Dear all > I was going through the tutorial: http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > My question involves the first realignment and reslicing followed by second realignment and reslicing. I do not understand the step below: > > -> T = transform_vox2ctf/transform_vox2spm= transform_vox2ctf*inv(transform_vox2spm) > and this matrix is applied to sourcespace. > > What confuses me, is that > a) we realign the anatomical voxel to spm (MNI) coordinates. > b) we reslice and save it as shown in step "3. Preprocessing of the anatomical MRI: reslicing" > && 4. Preprocessing of the anatomical MRI: save to disk > At this stage we get the transformation matrix anatomical voxel to spm i.e transform_vox2spm > Moreover, we reside in the SPM coordinates now. > c) We then realign to CTF coordinates, no reslicing is done. we Should > GET transform_spm2ctf. However, the obtained transform is called transform_vox2ct. Why??? Because the transformation matrix that is attached to the mri structure is always going from voxel space to a human interpretable coordinate system. > We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); > c) During the source creation, we are already in the MNI coordinates, because we are using Subject01.mgz. The fact that the file has the extension *.mgz does not mean that it is in MNI coordinates. The Subject01.mgz is created in the tutorial to have a transformation attached to it, that goes from (resliced) voxels to MNI. > So, why in "STEP 4. Source model: Co-registration of the source space to the sensor-based head coordinate system we do we need to " > T = transform_vox2ctf/transform_vox2spm; > Should it not be transform_vox2ctf changed to transform_spm2ctf > and T=transform_spm2ctf ??? No, it shouldn’t. Best, Jan-Mathijs > best regards parham > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sun May 8 21:43:34 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:43:34 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: <484A7AF5-98E5-435B-94E1-5493DE82C575@donders.ru.nl> Hi Christine, Checking for the number of unique rows in the sampleinfo field does not ensure that the data are not overlapping. e.g. data.sampleinfo = [1 200; 100 300]; is a valid specification, and unique(data.sampleinfo, ‘rows’) gives 2, yet the samples are overlapping. I don’t think the loss of chronology is causing the problem. Best, Jan-Mathijs On 08 May 2016, at 14:10, Blume Christine > wrote: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generatingtmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows indata_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 jan.schoffelen at donders.ru.nl Sun May 8 21:43:44 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:43:44 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: <32600EDE-3BCA-4EC9-BC25-911FF5B83B2F@donders.ru.nl> Hi Christine, Checking for the number of unique rows in the sampleinfo field does not ensure that the data are not overlapping. e.g. data.sampleinfo = [1 200; 100 300]; is a valid specification, and unique(data.sampleinfo, ‘rows’) gives 2, yet the samples are overlapping. I don’t think the loss of chronology is causing the problem. Best, Jan-Mathijs On 08 May 2016, at 14:10, Blume Christine > wrote: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generatingtmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows indata_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ph442 at cam.ac.uk Sun May 8 23:26:48 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 22:26:48 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: <7e6574fd0963df6d9993020635800764@cam.ac.uk> Hi Jan Thank you. best regards parham On 2016-05-08 20:35, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > >> On 08 May 2016, at 19:07, parham hashemzadeh wrote: >> >> Dear all >> I was going through the tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> My question involves the first realignment and reslicing followed by >> second realignment and reslicing. I do not understand the step below: >> >> -> T = transform_vox2ctf/transform_vox2spm= >> transform_vox2ctf*inv(transform_vox2spm) >> and this matrix is applied to sourcespace. >> >> What confuses me, is that >> a) we realign the anatomical voxel to spm (MNI) coordinates. >> b) we reslice and save it as shown in step "3. Preprocessing of the >> anatomical MRI: reslicing" >> && 4. Preprocessing of the >> anatomical MRI: save to disk >> At this stage we get the transformation matrix anatomical voxel to spm >> i.e transform_vox2spm >> Moreover, we reside in the SPM coordinates now. >> c) We then realign to CTF coordinates, no reslicing is done. we Should >> GET transform_spm2ctf. However, the obtained transform is called >> transform_vox2ct. Why??? > > Because the transformation matrix that is attached to the mri > structure is always going from voxel space to a human interpretable > coordinate system. > >> We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); >> c) During the source creation, we are already in the MNI coordinates, >> because we are using Subject01.mgz. > > The fact that the file has the extension *.mgz does not mean that it > is in MNI coordinates. The Subject01.mgz is created in the tutorial to > have a transformation attached to it, that goes from (resliced) voxels > to MNI. > >> So, why in "STEP 4. Source model: Co-registration of the source space >> to the sensor-based head coordinate system we do we need to " >> T = transform_vox2ctf/transform_vox2spm; >> Should it not be transform_vox2ctf changed to transform_spm2ctf >> and T=transform_spm2ctf ??? > > No, it shouldn’t. > > Best, > Jan-Mathijs > > >> best regards parham >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From cecile.issard at etu.parisdescartes.fr Sun May 8 23:30:13 2016 From: cecile.issard at etu.parisdescartes.fr (Cecile Issard) Date: Sun, 8 May 2016 21:30:13 +0000 Subject: [FieldTrip] two events per trial ? Message-ID: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, Cécile — Cécile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Université Paris Descartes 45 rue des Saints-Pères 75006 Paris From ph442 at cam.ac.uk Sun May 8 23:54:52 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 22:54:52 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: <234e99e29effe199b4124764558bcf68@cam.ac.uk> Hi Jan Thank you for your previous response. I guess, what confuses me http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate is the text in the section "1. Source model: Volumetric processing in FreeSurfer" "To create a skullstripped anatomical image, you can do the following. We assume that you have executed all steps that are described in the section about preprocessing of the anatomical MRI, and that you have a file that contains the resliced anatomical image, expressed in the MNI-RAS coordinate system. " It explicitly states that resliced anatomical image is expressed in MNI-RAS coordinates. I guess, the source must be in the MNI coordinates. such that T=transform_vox2ctf * inv(transform_vox2spm) can be applied to source as in the tutorial % go to the Subject01/bem directory sourcespace = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); sourcespace = ft_convert_units(sourcespace, 'mm'); sourcespace = ft_transform_geometry(T, sourcespace); save sourcespace sourcespace the transformation matrix above multiplies the source points from the left. If we denote the source points by S, then T*S is that right??? Many thanks best regards parham hashemzadeh On 2016-05-08 20:35, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > >> On 08 May 2016, at 19:07, parham hashemzadeh wrote: >> >> Dear all >> I was going through the tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> My question involves the first realignment and reslicing followed by >> second realignment and reslicing. I do not understand the step below: >> >> -> T = transform_vox2ctf/transform_vox2spm= >> transform_vox2ctf*inv(transform_vox2spm) >> and this matrix is applied to sourcespace. >> >> What confuses me, is that >> a) we realign the anatomical voxel to spm (MNI) coordinates. >> b) we reslice and save it as shown in step "3. Preprocessing of the >> anatomical MRI: reslicing" >> && 4. Preprocessing of the >> anatomical MRI: save to disk >> At this stage we get the transformation matrix anatomical voxel to spm >> i.e transform_vox2spm >> Moreover, we reside in the SPM coordinates now. >> c) We then realign to CTF coordinates, no reslicing is done. we Should >> GET transform_spm2ctf. However, the obtained transform is called >> transform_vox2ct. Why??? > > Because the transformation matrix that is attached to the mri > structure is always going from voxel space to a human interpretable > coordinate system. > >> We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); >> c) During the source creation, we are already in the MNI coordinates, >> because we are using Subject01.mgz. > > The fact that the file has the extension *.mgz does not mean that it > is in MNI coordinates. The Subject01.mgz is created in the tutorial to > have a transformation attached to it, that goes from (resliced) voxels > to MNI. > >> So, why in "STEP 4. Source model: Co-registration of the source space >> to the sensor-based head coordinate system we do we need to " >> T = transform_vox2ctf/transform_vox2spm; >> Should it not be transform_vox2ctf changed to transform_spm2ctf >> and T=transform_spm2ctf ??? > > No, it shouldn’t. > > Best, > Jan-Mathijs > > >> best regards parham >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From cogsci.tuna at gmail.com Mon May 9 17:26:01 2016 From: cogsci.tuna at gmail.com (Tuna Cakar) Date: Mon, 9 May 2016 18:26:01 +0300 Subject: [FieldTrip] About calculation of total power in TFr analysis Message-ID: Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Tue May 10 01:06:33 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Mon, 9 May 2016 19:06:33 -0400 Subject: [FieldTrip] Beam form source time discrepancy In-Reply-To: References: Message-ID: Hi, Doing source analysis on a visual training task and am seeing source power showing up at 0-20ms. Can anyine with latency based localization please advise? let me know if you need more information Best, Hassan -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.borbaruah at student.utwente.nl Tue May 10 10:00:19 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 08:00:19 +0000 Subject: [FieldTrip] Function is asking for raw data as input Message-ID: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Tue May 10 10:12:04 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Tue, 10 May 2016 08:12:04 +0000 Subject: [FieldTrip] About calculation of total power in TFr analysis In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C3F90F5D6@exprd03.hosting.ru.nl> Dear Tuna, As far as I understand, the morlet-TFR example as used in the tutorial (http://www.fieldtriptoolbox.org/tutorial/timefrequencyanalysis) computes total (evoked and induced) power, per trial and time bin, and then averages over trials. To compute total power in the 1000ms epoch, I would suggest using cfg.method=’mtmfft’. E.g., something like the following, assuming that your data is organized in trials in a variable called ‘data’. BTW, note that because of your 1000ms data epoch, the intrinsic frequency resolution of your data is 1 Hz (1/1), thus spectral power below 1 Hz will be poorly estimated. cfg=[]; cfg.toilim=[0.0 1.0]; %1000ms time window data_ep=ft_redefinetrial(cfg,data); cfg=[]; cfg.pad=10; cfg.method=’mtmfft’; cfg.outpu=’pow’; cfg.foilim= [0.1 40]; cfg.channel = ‘all’; data_ep_pow=ft_freqanalysis(cfg,data_ep); 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 Tuna Cakar Sent: maandag 9 mei 2016 17:26 To: fieldtrip at science.ru.nl Subject: [FieldTrip] About calculation of total power in TFr analysis Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 663 bytes Desc: image001.gif URL: From tineke.snijders at donders.ru.nl Tue May 10 10:34:19 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 08:34:19 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Tue May 10 10:55:39 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 08:55:39 +0000 Subject: [FieldTrip] two events per trial ? In-Reply-To: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> References: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F@exprd04.hosting.ru.nl> Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, Cécile — Cécile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Université Paris Descartes 45 rue des Saints-Pères 75006 Paris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From s.borbaruah at student.utwente.nl Tue May 10 11:27:58 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 11:27:58 +0200 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) < tineke.snijders at donders.ru.nl> wrote: > Dear Soujata, > > Have you checked what data is in Dat(i,j,k)? The data input of > ft_timelockanalysis should be organised in a structure as obtained from > ft_preprocessing, with trial-based data. > > Best, > Tineke > > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] > *Sent:* Tuesday, May 10, 2016 10:00 AM > *To:* fieldtrip, donders > *Subject:* [FieldTrip] Function is asking for raw data as input > > Hello, I am working on statistical analysis of EEG data from subjects. I > am trying to perform time lock analysis on the data available but while > executing the script these are the following errors I get: > > Error using ft_checkdata (line 464) > This function requires raw+comp or raw data as input. > > Error in ft_timelockanalysis (line 106) > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', > 'yes', 'hassampleinfo', 'yes'); > > Error in Actual_Timelockanalysis_MTT_EP (line 20) > EP{i,j,k}.All = > ft_timelockanalysis(cfg,Dat(i,j,k)); > > Error in Noise_MTT_EP (line 8) > [ep] = Actual_Timelockanalysis_MTT_EP(Data) > > Please let me know if you require any more information. > > > > Sent with MailTrack > > > _______________________________________________ > fieldtrip 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 Tue May 10 14:36:04 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Tue, 10 May 2016 12:36:04 +0000 Subject: [FieldTrip] About calculation of total power in TFr analysis In-Reply-To: References: <7CCA2706D7A4DA45931A892DF3C2894C3F90F5D6@exprd03.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C3F91068D@exprd03.hosting.ru.nl> Dear Tuna, In your code power is calculated relative to a baseline. So what you end up with is power change, not absolute power per se. Please check for yourself whether you want to have the data baselined or not. Secondly, assuming that you want to compute total power in the entire 1s epoch, a time-resolved FFT as you have now is not necessary. I would suggest using a regular FFT on the entire epoch (see my previous reply), without any baselining. Finally, the power now is only computed within the 1-40Hz range, which is less than ‘total’ of course. I would also advice you to go through some of the FT-tutorials on Fourier analyses, and search through the (extensive) mailing list-archive, see e.g. this thread: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-January/006114.html Best, Stan PS. Replying to the mailinglist is more useful than to specific persons individually, since the discussion might help others, too, and other people might want to add to the discussion. From: Tuna Cakar [mailto:cogsci.tuna at gmail.com] Sent: dinsdag 10 mei 2016 13:44 To: Pelt, S. van (Stan) Subject: Re: [FieldTrip] About calculation of total power in TFr analysis Dear Dr. van Pelt, I would like to thank you a lot for your response that also includes the necessary codes. The code I have performed is as below: cfg = []; cfg.baseline = [-0.4 -0.2]; cfg.baselinetype = 'relative'; %'absolute'; cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 1:1:40; cfg.toi = -0.4:0.01:0.99; cfg.keeptrials = 'yes'; TFR_MW_Px = ft_freqanalysis(cfg, data_out); Does it also calculate the total power then? I am supposed to perform wavelet analysis via Morlet and then calculate the total power. I may also look for trial-based analyses. It is also of my further interest to do the induced and evoked power calculations in the next steps. I would really appreciate your further support. Best, Tuna 2016-05-10 14:26 GMT+03:00 Tuna Cakar >: Dear Dr. van Pelt, I would like to thank you a lot for your response that also includes the necessary codes. The code I have performed is as below: cfg = [];cfg.baseline = [-0.4 -0.2]; cfg.baselinetype = 'relative'; %'absolute';cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 1:1:40; cfg.toi = -0.4:0.01:0.99;cfg.keeptrials = 'yes';TFR_MW_Px = ft_freqanalysis(cfg, data_out); Does it also calculate the total power then? I am supposed to perform wavelet analysis via Morlet and then calculate the total power. I may also look for trial-based analyses. It is also of my further interest to do the induced and evoked power calculations in the next steps. I would really appreciate your further support. Best, Tuna Dear Tuna, As far as I understand, the morlet-TFR example as used in the tutorial (http://www.fieldtriptoolbox.org/tutorial/timefrequencyanalysis) computes total (evoked and induced) power, per trial and time bin, and then averages over trials. To compute total power in the 1000ms epoch, I would suggest using cfg.method=’mtmfft’. E.g., something like the following, assuming that your data is organized in trials in a variable called ‘data’. BTW, note that because of your 1000ms data epoch, the intrinsic frequency resolution of your data is 1 Hz (1/1), thus spectral power below 1 Hz will be poorly estimated. cfg=[]; cfg.toilim=[0.0 1.0]; %1000ms time window data_ep=ft_redefinetrial(cfg,data); cfg=[]; cfg.pad=10; cfg.method=’mtmfft’; cfg.outpu=’pow’; cfg.foilim= [0.1 40]; cfg.channel = ‘all’; data_ep_pow=ft_freqanalysis(cfg,data_ep); 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 Tuna Cakar Sent: maandag 9 mei 2016 17:26 To: fieldtrip at science.ru.nl Subject: [FieldTrip] About calculation of total power in TFr analysis Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Tue May 10 17:15:17 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Tue, 10 May 2016 18:15:17 +0300 Subject: [FieldTrip] SVD did not converge. Message-ID: Dear fieldtrippers, I was doing the source reconstruction from MEG data based on individual headmodel (vol) and on individualized template grid (gridT). The following script cfg = []; cfg.method = 'lcmv'; %cfg.hdmfile = 'SubjectCMC.hdm'; cfg.headmodel = vol;%_nii_neuromag; %or project grad to common headmodel? cfg.grid = gridT; cfg.keepfilter = 'yes'; cfg.lcmv.fixedori='yes'; %use optimal orientation source = ft_sourceanalysis(cfg, timelock); worked fine for most subjects and even for this subject but in different condition. By some unknown reasons it shows error here. " *Error using svd SVD did not converge."* Could someone comment on this? below is a full copy from matlab output: > In ft_checkconfig at 475 In ft_sourceanalysis at 213 the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 0 MB using gradiometers specified in the data converting units from 'm' to 'cm' computing surface normals creating dipole grid based on user specified dipole positions using gradiometers specified in the configuration 3294 dipoles inside, 3510 dipoles outside brain the call to "ft_prepare_sourcemodel" took 1 seconds and required the additional allocation of an estimated 0 MB scanning repetition 1 *Error using svdSVD did not converge.Error in beamformer_lcmv>pinv (line 387) [U,S,V] = svd(A,0);Error in beamformer_lcmv (line 175)invCy = pinv(Cy + lambda * eye(size(Cy)));Error in ft_sourceanalysis (line 900) dip(i) = beamformer_lcmv(grid, sens, headmodel, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:});* Best Regards, Olga S. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Tue May 10 17:38:06 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 15:38:06 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl>, Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF318@exprd04.hosting.ru.nl> Hi Soujata, This probably happens because matlab is case-sensitive. So use .label instead of .Label; .trial instead of .Trial; .time instead of .Time. Then fieldtrip will recognize the correct fields. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 11:27 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Function is asking for raw data as input Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) > wrote: Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From cecile.issard at etu.parisdescartes.fr Tue May 10 18:16:48 2016 From: cecile.issard at etu.parisdescartes.fr (Cecile Issard) Date: Tue, 10 May 2016 16:16:48 +0000 Subject: [FieldTrip] two events per trial Message-ID: Hi Tineke, My problem is that the triggers for the onset and the offset of the stimulus are the same… — Message: 6 Date: Tue, 10 May 2016 08:55:39 +0000 From: "Snijders, T.M. (Tineke)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] two events per trial ? Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F at exprd04.hosting.ru.nl> Content-Type: text/plain; charset="Windows-1252" Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, C?cile ? C?cile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Universit? Paris Descartes 45 rue des Saints-P?res 75006 Paris Cécile Issard Doctorante 01.42.86.43.20 Laboratoire Psychologie de la Perception - UMR8242 45 rue des Sts Pères 75270 Paris cedex 06 http://lpp.psycho.univ-paris5.fr/index.php Labo bébé : http://recherche.parisdescartes.fr/LBB -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.borbaruah at student.utwente.nl Tue May 10 18:20:28 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 18:20:28 +0200 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, Many many thanks for the suggestion. It works now, however, instead of averaging trials in the three channels that is listed in cfg.channel, the script is performing the averaging in all 64 channels. Is it possible to correct it? After the script is executed, cfg contains a cell called channels with 6x1 cell and another cell called channel with 64x1 cell. I think the script is taking the data from channel. Regards, Soujata Sent with MailTrack On Tue, May 10, 2016 at 11:27 AM, Soujata Borbaruah < s.borbaruah at student.utwente.nl> wrote: > Dear Tineke, > > I have created a function that performs timelock analysis on trials > present in Dat which is obtained from Data of a subject. > > Script Average calls the function: > > Sub = 'Subject1'; % Need to perform for all the > subjects > load(['MTT_EP_data_',Sub,'.mat']); > > [ep] = Actual_Timelockanalysis_MTT_EP(Data) > > > function [EP] = Actual_Timelockanalysis_MTT_EP(Data) > > cfg = []; > cfg.channels = {'Cz';'M1';'M2'}; > > for i = 1; % Only for NOP=1 > S = unique(Data(i).Stimuli); % To find the unique stimuli > for j = 1:length(S) > Indices = find(Data(i).Stimuli == S(j)); % comparison > Idx{1} = 1:length(Indices); % Trials per amplitude, both > perceived and not perceived > for k = 1; > Dat(i,j,k).Stimuli = S(j); % Corresponding unique > stimuli > Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % > Extract the trials from Data(1).Trials and place in the new Dat structure > Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 > length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much > of time) > Dat(i,j,k).fsample = Data(i).fsample; > Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all > the 64 channels and the selection of the channels can be done using > cfg.channels > > if ~isempty(Idx{1}) > EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); > else > EP{i,j} = []; > > end > end > end > end > > Dat is supposed to be a 1x10 (because there are 10 unique stimuli) > structure with 5 fields which are: > 1. Type of stimuli > 2. Number of trials for the respective stimuli (64x4000 double for each > trial) > 3. Time of the trials (1x4000 double which is the same for every trial) > 4. fsample (1000) > 5. Labels of the EEG (64 channels). > > The Dat structure is created, however when the data in it is called for > timelockanalysis, it fails and the warning says it is not raw data. > > Sent with MailTrack > > > On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) < > tineke.snijders at donders.ru.nl> wrote: > >> Dear Soujata, >> >> Have you checked what data is in Dat(i,j,k)? The data input of >> ft_timelockanalysis should be organised in a structure as obtained from >> ft_preprocessing, with trial-based data. >> >> Best, >> Tineke >> >> >> >> ------------------------------ >> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] >> on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] >> *Sent:* Tuesday, May 10, 2016 10:00 AM >> *To:* fieldtrip, donders >> *Subject:* [FieldTrip] Function is asking for raw data as input >> >> Hello, I am working on statistical analysis of EEG data from subjects. I >> am trying to perform time lock analysis on the data available but while >> executing the script these are the following errors I get: >> >> Error using ft_checkdata (line 464) >> This function requires raw+comp or raw data as input. >> >> Error in ft_timelockanalysis (line 106) >> data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', >> 'yes', 'hassampleinfo', 'yes'); >> >> Error in Actual_Timelockanalysis_MTT_EP (line 20) >> EP{i,j,k}.All = >> ft_timelockanalysis(cfg,Dat(i,j,k)); >> >> Error in Noise_MTT_EP (line 8) >> [ep] = Actual_Timelockanalysis_MTT_EP(Data) >> >> Please let me know if you require any more information. >> >> >> >> Sent with MailTrack >> >> >> _______________________________________________ >> fieldtrip 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 Tue May 10 20:43:41 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 10 May 2016 18:43:41 +0000 Subject: [FieldTrip] two events per trial In-Reply-To: References: Message-ID: <12382FFA-DF60-4EDD-823D-439722B81DEB@donders.ru.nl> Hi Cecile, This sounds like a quasi serious flaw in your experimental setup. In general I would advice against the definition of the same event code for different events. In case one (or more) triggers are lost upon collection, it will be not trivial to correctly reconstruct the events post-hoc (in which case you always need to rely on an extra source of data , e.g. a logfile written out by your stimulus presentation software, where you then have to assume that all went well). Anyway, after this pedagogical note, the only thing I could come up with, is to write a custom ‘trialfun’ for your purposes, which selects every second equally valued event to be the ‘begin-of-trial’ trigger. Best, Jan-Mathijs On 10 May 2016, at 18:16, Cecile Issard > wrote: Hi Tineke, My problem is that the triggers for the onset and the offset of the stimulus are the same… — Message: 6 Date: Tue, 10 May 2016 08:55:39 +0000 From: "Snijders, T.M. (Tineke)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] two events per trial ? Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F at exprd04.hosting.ru.nl> Content-Type: text/plain; charset="Windows-1252" Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, C?cile ? C?cile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Universit? Paris Descartes 45 rue des Saints-P?res 75006 Paris Cécile Issard Doctorante 01.42.86.43.20 Laboratoire Psychologie de la Perception - UMR8242 45 rue des Sts Pères 75270 Paris cedex 06 http://lpp.psycho.univ-paris5.fr/index.php Labo bébé : http://recherche.parisdescartes.fr/LBB _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lindseyrtate at ou.edu Wed May 11 07:11:24 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Wed, 11 May 2016 05:11:24 +0000 Subject: [FieldTrip] Beamformer Tutorial, ft_prepare_headmodel Error Message-ID: Hello FieldTrip community, I'm working through the Beamformer tutorial on this page (http://www.fieldtriptoolbox.org/tutorial/beamformer) using MEG data from a saccade task. This code for constructing the head model, copied from the page, is giving me an error: % forward model mri segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat'); cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, segmentedmri); This is the complete text of the error: Error using ft_convert_units (line 150) cannot determine geometrical units Error in ft_checkdata (line 543) data = ft_convert_units(data); Error in ft_prepare_headmodel (line 203) data = ft_checkdata(data, 'hasunit', 'yes'); Error in LindseysBF (line 48) headmodel = ft_prepare_headmodel(cfg, segmentedmri); When I check the struct segmentedmri, it has a field called unit with a value of 'mm.' Because this code is using a file downloaded from the tutorial (i.e., segmentedmri, which can be downloaded from the link above) and is copy/pasted from the tutorial page, I can't figure out what's wrong or what to investigate. Can someone tell me if I'm making an error in the code, if there's something I could change about the code to make it work, or if this is a bug? Any help would be greatly appreciated. Thank you, Lindsey Tate Graduate Research Assistant Brian and Biomarker Lab University of Oklahoma -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed May 11 09:17:00 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 11 May 2016 09:17:00 +0200 Subject: [FieldTrip] Beamformer Tutorial, ft_prepare_headmodel Error In-Reply-To: References: Message-ID: <335A47C0-BC52-49D4-8C65-8582274B5338@donders.ru.nl> Dear Lindsey, The error lies in the way the data is loaded. > segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat’); produces this: segmentedmri = segmentedmri: [1x1 struct] The solution is quite easy, just replace the line by this: > load('C:\Users\EEG1\Documents\Data\segmentedmri.mat’); and it should look like this: segmentedmri = dim: [256 256 256] transform: [4x4 double] coordsys: 'ctf' unit: 'mm' gray: [256x256x256 double] white: [256x256x256 double] csf: [256x256x256 double] cfg: [1x1 struct] Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 11 May 2016, at 07:11, Tate, Lindsey R. wrote: > > Hello FieldTrip community, > > > I'm working through the Beamformer tutorial on this page (http://www.fieldtriptoolbox.org/tutorial/beamformer ) using MEG data from a saccade task. > > > > This code for constructing the head model, copied from the page, is giving me an error: > % forward model mri > segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat'); > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, segmentedmri); > > > This is the complete text of the error: > Error using ft_convert_units (line 150) > cannot determine geometrical units > > Error in ft_checkdata (line 543) > data = ft_convert_units(data); > > Error in ft_prepare_headmodel (line 203) > data = ft_checkdata(data, 'hasunit', 'yes'); > > Error in LindseysBF (line 48) > headmodel = ft_prepare_headmodel(cfg, segmentedmri); > > > When I check the struct segmentedmri, it has a field called unit with a value of 'mm.' Because this code is using a file downloaded from the tutorial (i.e., segmentedmri, which can be downloaded from the link above) and is copy/pasted from the tutorial page, I can't figure out what's wrong or what to investigate. Can someone tell me if I'm making an error in the code, if there's something I could change about the code to make it work, or if this is a bug? Any help would be greatly appreciated. > > > Thank you, > > Lindsey Tate > Graduate Research Assistant > Brian and Biomarker Lab > University of Oklahoma > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Wed May 11 09:23:47 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Wed, 11 May 2016 07:23:47 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> , Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF381@exprd04.hosting.ru.nl> Hi Soujata, So then you have to correct your script, so that you specify cfg.channel= {'Cz';'M1';'M2'}; instead of cfg.channels. I guess you could have worked that one out yourself... If you type 'help ft_timelockanalysis' you see it takes cfg.channel and not cfg.channels. Cheers, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 6:20 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Function is asking for raw data as input Dear Tineke, Many many thanks for the suggestion. It works now, however, instead of averaging trials in the three channels that is listed in cfg.channel, the script is performing the averaging in all 64 channels. Is it possible to correct it? After the script is executed, cfg contains a cell called channels with 6x1 cell and another cell called channel with 64x1 cell. I think the script is taking the data from channel. Regards, Soujata Sent with MailTrack On Tue, May 10, 2016 at 11:27 AM, Soujata Borbaruah > wrote: Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) > wrote: Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Wed May 11 20:04:38 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Wed, 11 May 2016 20:04:38 +0200 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? In-Reply-To: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> References: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> Message-ID: Dear Jan-Mathijs, thank you for your answer and please accept my apologies for the delay. I read that documentation but like I said, “computes descriptive parameters of the source analysis results” doesn't provide a meaningful explanation. What are those descriptive parameters? When should one use it? As for not using the function as an option, I'm trying to understand how to use FieldTrip and whether that function is important or not is beyond the scope of my current knowledge, hence why I'm trying to find the answer here. If I were to take your suggested approach every time, I don't think I'd ever succeed. ;-) Thank you and have a nice day! Harold On 4 May 2016 at 10:51, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Dear Harold, > > What extra documentation are you looking for? I think that a good start > would be to read the description in the documentation part of the m-file > itself (i.e. the stuff you get when typing ‘help ft_sourcedescriptives’). > Note: if you don’t think you need the function, it’s alright not to use it > :o). > > > Best, > Jan-Mathijs > > > On 02 May 2016, at 15:14, Harold Cavendish wrote: > > Hello, could you please explain the purpose of ft_sourcedescriptives() in > EEG source analysis? > > The documentation is very brief (“computes descriptive parameters of the > source analysis results”) and I haven't found a single tutorial with proper > explanation. I found it used here > but > without any explanation whatsoever. > > Thank you! > > Harold > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 elam4hcp at gmail.com Wed May 11 23:19:43 2016 From: elam4hcp at gmail.com (Jennifer Elam) Date: Wed, 11 May 2016 16:19:43 -0500 Subject: [FieldTrip] Announcing the the HCP Course 2016 in Boston Aug 28-Sept 1 Message-ID: The Human Connectome Project (HCP) is pleased to announce the 2016 HCP Course: “Exploring the Human Connectome” , to be held August 28-September 1 (Sunday-Thursday) at the Joseph B. Martin Conference Center at Harvard Medical School, in Boston, Massachusetts, USA. This 5-day intensive course will provide training in the acquisition, analysis and visualization of whole-brain imaging and behavioral data from the Human Connectome Project (HCP) using methods and informatics tools developed by the WU-Minn HCP consortium plus data made freely available to the neuroscience community. The course is designed for investigators who are interested in: *using data being collected and distributed by HCP *acquiring and analyzing HCP-style imaging and behavioral data at your own institution *processing your own non-HCP imaging data using HCP pipelines and methods *learning to use Connectome Workbench tools and the CIFTI connectivity data format *learning HCP multi-modal neuroimaging analysis methods, including those that combine MEG and MRI data *positioning yourself to capitalize on HCP-style data from forthcoming large-scale projects (e.g., Lifespan HCP and Connectomes Related to Human Disease) Participants will learn how to acquire, analyze, visualize, and interpret data from four major MR modalities (structural MR, resting-state fMRI, diffusion imaging, task-evoked fMRI) plus magnetoencephalography (MEG) and extensive behavioral data. Lectures and labs will provide grounding in neurobiological as well as methodological issues involved in interpreting multimodal data, and will span the range from single-voxel/vertex to brain network analysis approaches. The course is open to graduate students, postdocs, faculty, and industry participants. The course is aimed at both new and existing users of HCP data, methods, and tools, and will cover both basic and advanced topics. Prior experience in human neuroimaging or in computational analysis of brain networks is desirable, preferably including familiarity with FSL and Freesurfer software. For more info and to register visit the HCP Course website . We hope to see you in Bah-ston! Best, 2016 HCP Course Organizers -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 11:17:35 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 12:17:35 +0300 Subject: [FieldTrip] Allow overlap - ft_fetch_data Message-ID: Hello, How can I allow overlap between trials when using ft_fetch_data ? Many thanks, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 11:02:28 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 12:02:28 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' Message-ID: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that *sometimes *when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu May 12 11:46:12 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 12 May 2016 09:46:12 +0000 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' In-Reply-To: References: Message-ID: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> If your purpose is just to detrend, I would use ft_preprocessing: cfg = []; cfg.detrend = ‘yes’; data = ft_preprocessing(cfg, data); ft_resampledata is for resampling (what’s in a name), and allows for optional detrending prior to the downsampling (because a large trend may lead to edge artifacts upon the downsampling). best, Jan-Mathijs PS: I would also recommend to review your path settings, since you get some warnings about octave functions On 12 May 2016, at 11:02, shiri makov > wrote: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that sometimes when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 12:13:03 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 13:13:03 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' In-Reply-To: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> References: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> Message-ID: Thank you for your quick reply :) Actually I also need ft_resampledata for resampling... I get the same problem when trying to sownsample. I refreshed the path settings, do you think it should fix it? Best, S. 2016-05-12 12:46 GMT+03:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > If your purpose is just to detrend, I would use ft_preprocessing: > > cfg = []; > cfg.detrend = ‘yes’; > data = ft_preprocessing(cfg, data); > > ft_resampledata is for resampling (what’s in a name), and allows for > optional detrending prior to the downsampling (because a large trend may > lead to edge artifacts upon the downsampling). > > best, > Jan-Mathijs > > PS: I would also recommend to review your path settings, since you get > some warnings about octave functions > > > > On 12 May 2016, at 11:02, shiri makov wrote: > > > > Dear community, > > My name is Shiri and I am a student at Tel-Aviv Univesrity. I study > perception during sleep using EEG. Currently I am analysing EEG data > collected with EGI system. > > I tried using ft_resampledata to detrend the data. The weird thing is that * > sometimes *when I call ft_resampledata, I get an error message: > > the input is raw data with 8 channels and 60 trials > resampling data > Octave functions should not run on Matlab > Removing path ... > Error using .* > Matrix dimensions must agree. > Error in resample (line 71) > h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; > Error in ft_resampledata (line 208) > data.trial{itr} = > transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); > > > As noted, this error appears only sometimes. If I run ft_resampledata > again immidiately after receiving the error, it works well (same cfg, same > data). > The error always happens when I call the function within a parfor loop. It > almost never happens when I run the function line individually, without > preceeding script lines. > > > The cfg I use is very basic: > > >> display(cfg); > > cfg = > > detrend: 'yes' > > It happened to me on many data structs, so I share a link with just one of > them (http://www.filedropper.com/dataexample). Here too, I got the error > and right after that I ran the function line again and worked well. > > I don't think it's ok to live in peace with this function erroring from > time to time, can someone tell me what this error means? Did I not use the > function correctly? > > Best, > > Shiri > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 randomguy3167 at yahoo.com Thu May 12 20:54:00 2016 From: randomguy3167 at yahoo.com (Anon ymous) Date: Thu, 12 May 2016 18:54:00 +0000 (UTC) Subject: [FieldTrip] Help with Spike/LFP Tutorial Issue References: <660323151.1356054.1463079240955.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <660323151.1356054.1463079240955.JavaMail.yahoo@mail.yahoo.com> Hello Fieldtrip Community, I do realize this is probably really basic, but I was following the tutorial on analyzing spike and LFP data: http://www.fieldtriptoolbox.org/tutorial/spikefield. I've followed the tutorial almost exactly (with inconsequential changes) using the sample data provided in the tutorial.  It all works except for the STA plot for pre-stimulus. I get the correct plot as shown in the tutorial for my post-stimulus plot but then for some reason get the same thing for my pre-stimulus plot, which doesn't make sense. I have no idea what is causing this. The only differences I see between the two are the cfg.latency settings and all else is the same.      pre: cfg.latency = [-2.75 0];     post: cfg.latency = [0.3 10]; I've attached my script (as it is small) for reference. The plots and sample data are in the tutorial. Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Preprocessing.m Type: application/octet-stream Size: 2575 bytes Desc: not available URL: From christine.blume at sbg.ac.at Fri May 13 08:22:51 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Fri, 13 May 2016 06:22:51 +0000 Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation In-Reply-To: References: Message-ID: Dear community, I would like to do the following steps, however fieldtrip does not seem to like this in my case: 1. Artefact rejection on continuous data using ft_databrowser as I do not like ft_rejectvisual’s visualization (needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser). Calling ft_rejectartifact following that procedure to exclude major artefacts before ICA. 2. ICA on cleaned continuous data, mainly to remove EOG artefacts 3. Another round of manual/visual artefact rejection on cleaned/eog-rejected continuous data using ft_databrowser visualization (again, needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser) 4. Segmentation of cleaned data I am experiencing problems with the artefact rejection (1) and the following segmentation (4), though. It works fine if I segment my data using ft_redefinetrial and then call ft_rejectartifact with the cfg returned from the (first) call to ft_databrowser. However, if I reject artefacts first and then try to apply ft_redefinetrial to the cleaned data, “bad” trials are not excluded. Any ideas how to solve this are highly appreciated. Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Fri May 13 11:05:57 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Fri, 13 May 2016 14:35:57 +0530 Subject: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout Message-ID: Dear Fieldtrip team, I need 64 channels and 32 channels layout and labelings/nomenclature of those respective channels in compatible with fieldtrip.I have biosemi32.lay and biosemi64.lay.Please acknowledge me. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Fri May 13 12:20:10 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Fri, 13 May 2016 10:20:10 +0000 Subject: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout In-Reply-To: References: Message-ID: Hi Laxmi, Am I assuming correctly that you would like to prepare a layout file? The following should work: cfg = []; cfg.layout = ‘yourpath_to_the_biosemi32.lay’; biosemi32_layout = ft_prepare_layout(cfg); Following this, you can specify the layout every time you need one as: cfg = []; cfg.layout = biosemi32_layout; Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Laxmi Shaw Gesendet: Freitag, 13. Mai 2016 11:06 An: fieldtrip at science.ru.nl Betreff: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout Dear Fieldtrip team, I need 64 channels and 32 channels layout and labelings/nomenclature of those respective channels in compatible with fieldtrip.I have biosemi32.lay and biosemi64.lay.Please acknowledge me. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Fri May 13 20:21:59 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Fri, 13 May 2016 19:21:59 +0100 Subject: [FieldTrip] Neuromag coordinate transformation In-Reply-To: References: Message-ID: Dear All I have read in some data (MNE-sample data set). I have this command in the script hdr = ft_read_header(raw_data_filename); %your fif-filename hdr.grad gives the below structure ans = balance: [1x1 struct] chanori: [306x3 double] chanpos: [306x3 double] chantype: {306x1 cell} chanunit: {306x1 cell} coilori: [510x3 double] coilpos: [510x3 double] coordsys: 'neuromag' label: {306x1 cell} tra: [306x510 double] type: 'neuromag306' unit: 'cm' It says that I am in "neuromag coordinate" system. The corresponding number for this coordinate system is device=1.0. I have a transformation matrix T14.trans (coord system=1 to coord system=4) that takes me to head coordinate system i.e T14 = from: 1 to: 4 trans: [4x4 double] When I apply the transformation, to the coil position, the sensor array looks tilted to one side. But, without the transformation, it looks more reasonable (visually). Maybe he was tilting !!! My question is: Is it anyway possible that the transformation T14 has already been applied by the function hdr = ft_read_header(raw_data_filename); I have attached a picture of what I am describing. many thanks best regards parham hashemzadeh -------------- next part -------------- A non-text attachment was scrubbed... Name: coilpos.jpg Type: image/jpeg Size: 72267 bytes Desc: not available URL: From rabbani.6 at buckeyemail.osu.edu Fri May 13 22:19:11 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Fri, 13 May 2016 20:19:11 +0000 Subject: [FieldTrip] File Format Issue Message-ID: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Sat May 14 19:17:26 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Sat, 14 May 2016 22:47:26 +0530 Subject: [FieldTrip] Queries_related to structures Message-ID: Dear Fieldtrip list, I am having an issue with the data GA_FC. There is a structure inside the data named GA_FC.cfg and GA_FC.grad. So these two fields are showing dimension of 184*356. I have attached the structure with this mail.Could you please help me in what those structure signifies and how those can be define for any datasets. [image: Inline image 1] -- Thanks in advance Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 31543 bytes Desc: not available URL: From laxmi.shaw22 at gmail.com Mon May 16 18:27:31 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Mon, 16 May 2016 21:57:31 +0530 Subject: [FieldTrip] Queries using GRAD Message-ID: Dear Fieldtrip maillist, I am facing problem regarding the online available data of GA_FC, TFRhann and avg_FC. These files contain the structure field named grad. I am unable to understand the construction of this grad. I am getting the following errors while using our data set with that grad files. The errors are mentioned below: Error using fixdimord (line 85) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 80) timelock = fixdimord(timelock); Error in ft_checkdata (line 221) data = ft_datatype_timelock(data); Error in topoplot_common (line 74) data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}); Error in ft_topoplotER (line 195) cfg = topoplot_common(cfg, varargin{:}); Error in trial_3 (line 14) ft_topoplotER(cfg,STR_eEPDC); colorbar; Your help is always appreciated. Thanks and regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon May 16 19:42:44 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 16 May 2016 17:42:44 +0000 Subject: [FieldTrip] Queries using GRAD In-Reply-To: References: Message-ID: <52F8D9D2-B6F8-4D35-9B55-1CADA82A4E15@donders.ru.nl> Hi Laxmi, Why do you think that your current problem is caused by the ‘grad’ field in GA_FC? The error message you get suggests otherwise (it actually suggests that the data you use as an input to ft_topoplotER is not recognized as a properly formatted fieldtrip data structure), and indicates that the variable STR_eEPDC is internally inconsistent. The most likely cause of this is that the fields that describe the physical interpretation of the numeric data fields is not in line with the size of the data. Here’s a link that describes the type of data that (I think) you try to use as an input to the plotting routine: http://www.fieldtriptoolbox.org/reference/ft_datatype_timelock , but perhaps you also would like to look into http://www.fieldtriptoolbox.org/reference/ft_datatype_freq Here’s a link that describes the grad-structure (although I don’t think that you need this): http://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs > On 16 May 2016, at 18:27, Laxmi Shaw wrote: > > Dear Fieldtrip maillist, > I am facing problem regarding the online available data of GA_FC, TFRhann and avg_FC. > These files contain the structure field named grad. > I am unable to understand the construction of this grad. > I am getting the following errors while using our data set with that grad files. > The errors are mentioned below: > > > Error using fixdimord (line 85) > the data does not contain a dimord, but it also does not resemble raw or component data > > Error in ft_datatype_timelock (line 80) > timelock = fixdimord(timelock); > > Error in ft_checkdata (line 221) > data = ft_datatype_timelock(data); > > Error in topoplot_common (line 74) > data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}); > > Error in ft_topoplotER (line 195) > cfg = topoplot_common(cfg, varargin{:}); > > Error in trial_3 (line 14) > ft_topoplotER(cfg,STR_eEPDC); colorbar; > > Your help is always appreciated. > Thanks and regards > > -- > Laxmi Shaw > Research Scholar(PhD) > IIT Kharagpur > West Bengal > Ph no-08388837821 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From alex.sel at psy.ox.ac.uk Mon May 16 20:55:01 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Mon, 16 May 2016 18:55:01 +0000 Subject: [FieldTrip] depsamplesF Message-ID: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Dear list, I would like to run a non-parametric cluster-based permutation analysis. My experiment has a 2X2 within-subject design, i.e. I would like to compare more than two experimental conditions. I am using the cfg.statistics = 'depsamplesFmultivariate'. I wonder if this would be the correct option considering that I only have ONE dependent variable (i.e. ANOVA) and not multiple dependent variables (i.e. MANOVA). If this is not the correct statistic, would you be able to tell me what is the correct statistic that should be apply to tests differences between more than 2 experimental conditions in a within subject design? Any insight on this would be much appreciated. Best wishes, Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From bknakker at gmail.com Mon May 16 22:22:37 2016 From: bknakker at gmail.com (=?UTF-8?Q?Bal=C3=A1zs_Knakker?=) Date: Mon, 16 May 2016 22:22:37 +0200 Subject: [FieldTrip] depsamplesF In-Reply-To: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> References: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Message-ID: Dear Alex, As far as I know, depsamplesFmultivariate corresponds to what used to be the default option to perform a dependent samples F-test (it was called depsamplesF), which tolerates nonsphericity when there are more than 2 levels by dealing with the question from a multivariate standpoint. But in your case, you can also test main effects and interactions in your 2×2 design, and in that case I think these will yield identical results, and you could as well be using T-tests (comparing averages over the other factor for the main effects, and comparing the differences along one factor at both levels of the other factor for the interaction, see also this http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests ). If you would decide to disregard the factor structure of your data and would do something like a one-way ANOVA with 4 levels, I would stick with the MANOVA approach. I would be curious to know whether the univarate version is recommended, apart from the case when one wants results comparable to a conventional ANOVA F-test. Greetings, Balázs Knakker On Mon, May 16, 2016 at 8:55 PM, Alex Sel wrote: > Dear list, > > > > I would like to run a non-parametric cluster-based permutation analysis. > My experiment has a 2X2 within-subject design, i.e. I would like to compare > more than two experimental conditions. I am using the cfg.statistics = > ‘depsamplesFmultivariate’. I wonder if this would be the correct option > considering that I only have ONE dependent variable (i.e. ANOVA) and not > multiple dependent variables (i.e. MANOVA). If this is not the correct > statistic, would you be able to tell me what is the correct statistic that > should be apply to tests differences between more than 2 experimental > conditions in a within subject design? > > > > Any insight on this would be much appreciated. > > > > Best wishes, > > Alex Sel, PhD > > Postdoctoral Researcher > > Department of Experimental Psychology, > > University of Oxford, > > 9 South Parks Road, > > OX1 3UD > > Tel: 01865 271 340 > > Email: Alex.sel at psy.ox.ac.uk > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Mon May 16 22:26:57 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Mon, 16 May 2016 20:26:57 +0000 Subject: [FieldTrip] depsamplesF In-Reply-To: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> References: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378E0380@exprd04.hosting.ru.nl> Dear Alex, In your case the easiest is to just use depsamplesT. For testing the main effects you can then use the average of the 2 conditions, and for testing the interaction you can use the two difference scores. Good luck, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alex Sel [alex.sel at psy.ox.ac.uk] Sent: Monday, May 16, 2016 8:55 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] depsamplesF Dear list, I would like to run a non-parametric cluster-based permutation analysis. My experiment has a 2X2 within-subject design, i.e. I would like to compare more than two experimental conditions. I am using the cfg.statistics = ‘depsamplesFmultivariate’. I wonder if this would be the correct option considering that I only have ONE dependent variable (i.e. ANOVA) and not multiple dependent variables (i.e. MANOVA). If this is not the correct statistic, would you be able to tell me what is the correct statistic that should be apply to tests differences between more than 2 experimental conditions in a within subject design? Any insight on this would be much appreciated. Best wishes, Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabbani.6 at buckeyemail.osu.edu Mon May 16 22:38:10 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Mon, 16 May 2016 20:38:10 +0000 Subject: [FieldTrip] File Format Issue In-Reply-To: References: Message-ID: <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> Dear Fieldtrip Community, I don't seem to have gotten a response back for my issue. Forgive me if this is too soon. Please direct me to the right resource if you know of one. It's just a simple issue of formatting, but all the data is there. I would like to add that the specific error I get is with the initial step reading in the spike data with ft_read_spike. The error simply says "unsupported file format." I'm still new to all this and would really appreciate the help so I can move forward with the actual analysis. Thank you all for your time, Qinwan Rabbani On May 13, 2016, at 4:19 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabbani.6 at buckeyemail.osu.edu Mon May 16 22:40:11 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Mon, 16 May 2016 20:40:11 +0000 Subject: [FieldTrip] File Format Issue In-Reply-To: <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> References: , <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> Message-ID: My apologies for the double email. It says unsupported data format not file format. On May 16, 2016, at 4:38 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip Community, I don't seem to have gotten a response back for my issue. Forgive me if this is too soon. Please direct me to the right resource if you know of one. It's just a simple issue of formatting, but all the data is there. I would like to add that the specific error I get is with the initial step reading in the spike data with ft_read_spike. The error simply says "unsupported file format." I'm still new to all this and would really appreciate the help so I can move forward with the actual analysis. Thank you all for your time, Qinwan Rabbani On May 13, 2016, at 4:19 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From SXM1085 at student.bham.ac.uk Tue May 17 18:37:16 2016 From: SXM1085 at student.bham.ac.uk (Sebastian Michelmann) Date: Tue, 17 May 2016 16:37:16 +0000 Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation In-Reply-To: References: Message-ID: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EEF309E@EX13.adf.bham.ac.uk> Hi Christine, I'm sure that there is a "clean" fieldtrip way to solve your problem which should be the preferred solution. However here is an idea for debugging and a potential workaround that might help. So ft_databrowser marks the artefacts you selected by storing the sampleinfo of the beginning and the end of you selection (these are two sampling points, counted from the beginning of your recording). They are stored in two column vectors (look it up in cfg.artfctdef.visual). I think something might have gone wrong when you cut your data because fieldtrip eventually removes and/or reconstructs sampleinfo if it is inconsistent or missing (don't ask me how and when this does and does not happen). So my guess for debugging would be: check at every step, what happens to your data.sampleinfo. It's also worth to read through the command line output because you should get a warning if something funny is going on. If you know your sampleinfo to be correct, here a workaround you might want to try: % 1st Manually read out the trials that contain artifacts (right after you marked them: cfg_art= ft_databrowser(cfg, data)); a_trials =[]; % trials with artifacts artifacts=cfg_art.artfctdef.visual; % info about the artifacts for n=1:size(artifacts.artifact,1) a_trials = [a_trials;find(data.sampleinfo(:,1) <= artifacts.artifact(n,1) ... & data.sampleinfo(:,2) >= artifacts.artifact(n,1))]; %concatenate the trials that contain artifacts end % find out which trials are artefact free trials=1:numel(data.trial); % all the trials trialsel=find(~ismember(trials,a_trials)); % the selected trials are trials that are not member of the artifact trials % Call ft_preprocessing (or ft_selectdata...) to select only the artefact free trials. cfg=[]; cfg.trials=trialsel; data_clean = ft_selectdata(cfg, data); I hope that helps. Best, Sebastian From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Blume Christine Sent: 13 May 2016 07:23 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation Dear community, I would like to do the following steps, however fieldtrip does not seem to like this in my case: 1. Artefact rejection on continuous data using ft_databrowser as I do not like ft_rejectvisual's visualization (needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser). Calling ft_rejectartifact following that procedure to exclude major artefacts before ICA. 2. ICA on cleaned continuous data, mainly to remove EOG artefacts 3. Another round of manual/visual artefact rejection on cleaned/eog-rejected continuous data using ft_databrowser visualization (again, needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser) 4. Segmentation of cleaned data I am experiencing problems with the artefact rejection (1) and the following segmentation (4), though. It works fine if I segment my data using ft_redefinetrial and then call ft_rejectartifact with the cfg returned from the (first) call to ft_databrowser. However, if I reject artefacts first and then try to apply ft_redefinetrial to the cleaned data, "bad" trials are not excluded. Any ideas how to solve this are highly appreciated. Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From darinkat87 at gmail.com Wed May 18 12:12:58 2016 From: darinkat87 at gmail.com (=?UTF-8?Q?Darinka_Tr=C3=BCbutschek?=) Date: Wed, 18 May 2016 12:12:58 +0200 Subject: [FieldTrip] Baseline correction during ICA & then again before timelock? Message-ID: Dear all, I am using fieldtrip to preprocess (epoching, trial rejection, ICA to remove eye blinks, etc., filtering) my MEG data and have a question regarding baseline correction.I have noticed that, in the default settings for ft_componentanalysis, cfg.demean is set to 'yes', so I assume that the mean of the entire trial is subrated. What does this setting imply for future analyses of this data (at the sensor-level), for example timelock analyses of different conditions. Should one still implement another baseline-correction? Why/why not? In advance, many thanks for your help. I very much appreciate all of the knowledge of this community! Best, Darinka -- Darinka Trübutschek (PhD Candidate) Inserm-CEA Cognitive Neuroimaging Unit CEA/SAC/DSV/DRM/Neurospin Bât 145, Point Courier 156 F-91191 Gif-sur-Yvette website: https://sites.google.com/site/dtruebutschek/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From behzadiravani at gmail.com Wed May 18 13:05:15 2016 From: behzadiravani at gmail.com (Behzad Iravani) Date: Wed, 18 May 2016 13:05:15 +0200 Subject: [FieldTrip] Micro State Analysis Message-ID: Dear fieldtrip experts, I'm wondering if there is an implemented function to do the micro state analysis. If it's not then I managed to find some dominant states (let's say 8, so basically now I have data matrix 8*number of channels) and I want to determine the sources associate with these brain states but I'm not sure what the best way is to do it. Best Behzad Iravani Research Assistant, Karolinska Institutet -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmq1990 at gmail.com Wed May 18 18:33:41 2016 From: xmq1990 at gmail.com (Mengqi Xing) Date: Wed, 18 May 2016 16:33:41 +0000 Subject: [FieldTrip] EEG connectivity without averaging over the trials. Message-ID: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Dear all, I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a few questions about trial averaging in ft_connectivityanalysis. I realized regardless which method I'm using, the ft_connectivityanalysis tends to averaging over trials (dimension rpt), which sacrifices the dynamic of the data. Is it possible not let the function averaging over trials while still getting a meaningful result? ( I tried to duplicate trial and let it average itself and it reported some errors.) Or is there a connectivity method that allows non-trial-averaging to run? Thank you very much! Maggie Xing -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed May 18 18:59:05 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 18 May 2016 18:59:05 +0200 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: Dear Maggie, As connectivity in principle relies on the correlation between trials (very very very simplified), it's not possible to compute single trial connectivity. However, what has been done is taking the single-trial deviance from the average phase as a measure of connectivity. See Keil et al 2014, Cerebral Cortex or Hanslmayr et al 2007, NeuroImage for a description. Good Luck, Julian Am Mittwoch, 18. Mai 2016 schrieb Mengqi Xing : > Dear all, > > I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a > few questions about trial averaging in ft_connectivityanalysis. I realized > regardless which method I'm using, the ft_connectivityanalysis tends to > averaging over trials (dimension rpt), which sacrifices the dynamic of the > data. Is it possible not let the function averaging over trials while still > getting a meaningful result? ( I tried to duplicate trial and let it > average itself and it reported some errors.) Or is there a connectivity > method that allows non-trial-averaging to run? Thank you very much! > > Maggie Xing > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gcosta18 at gmail.com Wed May 18 19:50:56 2016 From: gcosta18 at gmail.com (Gabriel Costa) Date: Wed, 18 May 2016 17:50:56 +0000 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: <6afd5d9ac3664154ba3027791bc11548@EXPRD02.hosting.ru.nl> Dear Maggie, If I'm not mistaken, connectivity estimates can be obtained at single trial if one estimates phase correlation over time (see Cohen, 2014 Analyzing Neural Time Series). If you are not interested in the time dimension you could just obtain a single value of coherence for each trial, estimating phase coherence over time, which you can then average over trials. If you still want to maintain time dimension and get a time(x)-frequency(y) plot of coherence, than you should use a sliding window. I believe this method (coherence over time) is not integrated in either Fieldtrip or EEGLAB, but it's not that difficult to implement this from the matrix with the complex fourier spectra (ft_freqanalysis with cfg.output = 'fourier'). Good luck, Gabriel Costa . On Wed, May 18, 2016 at 5:33 PM, Mengqi Xing > wrote: Dear all, I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a few questions about trial averaging in ft_connectivityanalysis. I realized regardless which method I'm using, the ft_connectivityanalysis tends to averaging over trials (dimension rpt), which sacrifices the dynamic of the data. Is it possible not let the function averaging over trials while still getting a meaningful result? ( I tried to duplicate trial and let it average itself and it reported some errors.) Or is there a connectivity method that allows non-trial-averaging to run? Thank you very much! Maggie Xing _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From gcosta18 at gmail.com Wed May 18 19:50:56 2016 From: gcosta18 at gmail.com (Gabriel Costa) Date: Wed, 18 May 2016 18:50:56 +0100 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: Dear Maggie, If I'm not mistaken, connectivity estimates can be obtained at single trial if one estimates phase correlation over time (see Cohen, 2014 Analyzing Neural Time Series). If you are not interested in the time dimension you could just obtain a single value of coherence for each trial, estimating phase coherence over time, which you can then average over trials. If you still want to maintain time dimension and get a time(x)-frequency(y) plot of coherence, than you should use a sliding window. I believe this method (coherence over time) is not integrated in either Fieldtrip or EEGLAB, but it's not that difficult to implement this from the matrix with the complex fourier spectra (ft_freqanalysis with cfg.output = 'fourier'). Good luck, Gabriel Costa . On Wed, May 18, 2016 at 5:33 PM, Mengqi Xing wrote: > Dear all, > > I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a > few questions about trial averaging in ft_connectivityanalysis. I realized > regardless which method I'm using, the ft_connectivityanalysis tends to > averaging over trials (dimension rpt), which sacrifices the dynamic of the > data. Is it possible not let the function averaging over trials while still > getting a meaningful result? ( I tried to duplicate trial and let it > average itself and it reported some errors.) Or is there a connectivity > method that allows non-trial-averaging to run? Thank you very much! > > Maggie Xing > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Thu May 19 18:28:01 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Thu, 19 May 2016 21:58:01 +0530 Subject: [FieldTrip] Queries_3 Message-ID: Dear Fieldtrip list, I am having doubt in the cfg structure, how the cfg.xlim and cfg.zlim has been set for GA_FC data. How can we define for our datasets. What is the .lay files signifies. I mean biosemi64.lay and EEG1020.lay defines what. Your help and advice is always appreciated. Regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gina.joue at univr.it Thu May 19 18:36:38 2016 From: gina.joue at univr.it (gj) Date: Thu, 19 May 2016 18:36:38 +0200 Subject: [FieldTrip] head model mat contains only NaN values Message-ID: <573DEB96.4050100@univr.it> Hi FieldTrippers, While trying to calculate a head model (FT ver.20160309), the head model contains only NaNs, and I get the following errors: ------------- beg error ------------ Warning: NaN detected, trying once more with slightly different vertex positions > In ft_prepare_headmodel (line 280) Warning: No conductivity is declared, assuming standard values > In ft_headmodel_bemcp (line 79) In ft_prepare_headmodel (line 281) Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In ft_headmodel_bemcp (line 185) In ft_prepare_headmodel (line 281) ------------- end error ------------ This was what I ran: ----------- smri = ft_read_mri(smrifn); % subject's own structural MRI cfg = []; mri.coordsys = 'MNI'; cfg.brainthreshold = 0.5; cfg.output = {'brain','skull','scalp'}; smri_seg = ft_volumesegment(cfg, smri); cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.method = 'projectmesh'; cfg.numvertices = [2400 1600 800]; mesh_hd=ft_prepare_mesh(cfg,smri_seg); cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg, mesh_hd); ----------- Not sure if this might be related, but we have head+neck MRIs and when I plot the meshes, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I've tried different ft_prepare_mesh methods, different number of vertices.... Thanks in advance for any advice! Gina -------------- next part -------------- A non-text attachment was scrubbed... Name: FTmesh-lat.png Type: image/png Size: 48876 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FTmesh-sup.png Type: image/png Size: 43865 bytes Desc: not available URL: From S.Homolle at donders.ru.nl Thu May 19 19:42:50 2016 From: S.Homolle at donders.ru.nl (=?iso-8859-1?Q?Hom=F6lle=2C_S=2E_=28Simon=29?=) Date: Thu, 19 May 2016 17:42:50 +0000 Subject: [FieldTrip] head model mat contains only NaN values In-Reply-To: <573DEB96.4050100@univr.it> References: <573DEB96.4050100@univr.it> Message-ID: <2247A6E8AF3DB04AAB11BDDD86B72F8315878CC5@exprd02.hosting.ru.nl> Dear Gina, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I guess this is the reason why you get the NaN values. BEM needs nested and sufficiently distant surfaces. As I don't know the quality and sequence (T1, T2?) of your MRI I suggest you to look at the segmentation to be sure that this is well done. With a good segmentation preparing the mesh is not a problem. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of gj [gina.joue at univr.it] Sent: Thursday, May 19, 2016 6:36 PM To: FieldTrip discussion list Subject: [FieldTrip] head model mat contains only NaN values Hi FieldTrippers, While trying to calculate a head model (FT ver.20160309), the head model contains only NaNs, and I get the following errors: ------------- beg error ------------ Warning: NaN detected, trying once more with slightly different vertex positions > In ft_prepare_headmodel (line 280) Warning: No conductivity is declared, assuming standard values > In ft_headmodel_bemcp (line 79) In ft_prepare_headmodel (line 281) Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In ft_headmodel_bemcp (line 185) In ft_prepare_headmodel (line 281) ------------- end error ------------ This was what I ran: ----------- smri = ft_read_mri(smrifn); % subject's own structural MRI cfg = []; mri.coordsys = 'MNI'; cfg.brainthreshold = 0.5; cfg.output = {'brain','skull','scalp'}; smri_seg = ft_volumesegment(cfg, smri); cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.method = 'projectmesh'; cfg.numvertices = [2400 1600 800]; mesh_hd=ft_prepare_mesh(cfg,smri_seg); cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg, mesh_hd); ----------- Not sure if this might be related, but we have head+neck MRIs and when I plot the meshes, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I've tried different ft_prepare_mesh methods, different number of vertices.... Thanks in advance for any advice! Gina From gina.joue at univr.it Fri May 20 11:26:35 2016 From: gina.joue at univr.it (gj) Date: Fri, 20 May 2016 11:26:35 +0200 Subject: [FieldTrip] head model mat contains only NaN values In-Reply-To: <573ED025.40808@univr.it> References: <573DEB96.4050100@univr.it> <573ED025.40808@univr.it> Message-ID: <573ED84B.5030609@univr.it> Thanks for your reply, Simon. I had plotted the segmentation and it seems to look fine (see attached), which makes me think that it's the meshing, but I tried a slew of methods and number of vertices but I can't get rid of the scalp planes internal to the brain. Any advice on what to try greatly appreciated! Gina > Dear Gina, > > I see that the "scalp" has vertices that connect planes > internal to the brain (see images attached). > > I guess this is the reason why you get the NaN values. BEM needs > nested and sufficiently distant surfaces. > As I don't know the quality and sequence (T1, T2?) of your MRI I > suggest you to look at the segmentation to be sure that this is well done. With a good segmentation preparing the mesh is not a problem. > Bests, > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 20/05/2016 10:51, gj wrote: > > > On 19/05/2016 18:36, gj wrote: >> Hi FieldTrippers, >> >> While trying to calculate a head model (FT ver.20160309), the head model >> contains only NaNs, and I get the following errors: >> >> ------------- beg error ------------ >> Warning: NaN detected, trying once more with slightly different vertex >> positions >> > In ft_prepare_headmodel (line 280) >> Warning: No conductivity is declared, assuming standard values >> > In ft_headmodel_bemcp (line 79) >> In ft_prepare_headmodel (line 281) >> >> Warning: Matrix is singular, close to singular or badly scaled. Results >> may be inaccurate. RCOND = NaN. >> > In ft_headmodel_bemcp (line 185) >> In ft_prepare_headmodel (line 281) >> ------------- end error ------------ >> >> >> >> This was what I ran: >> >> ----------- >> smri = ft_read_mri(smrifn); % subject's own structural MRI >> >> cfg = []; >> mri.coordsys = 'MNI'; >> cfg.brainthreshold = 0.5; >> cfg.output = {'brain','skull','scalp'}; >> smri_seg = ft_volumesegment(cfg, smri); >> >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.method = 'projectmesh'; >> cfg.numvertices = [2400 1600 800]; >> mesh_hd=ft_prepare_mesh(cfg,smri_seg); >> >> cfg = []; >> cfg.method = 'bemcp'; >> headmodel = ft_prepare_headmodel(cfg, mesh_hd); >> ----------- >> >> Not sure if this might be related, but we have head+neck MRIs and when I >> plot the meshes, I see that the "scalp" has vertices that connect planes >> internal to the brain (see images attached). I've tried different >> ft_prepare_mesh methods, different number of vertices.... >> >> Thanks in advance for any advice! >> Gina -------------- next part -------------- A non-text attachment was scrubbed... Name: FTseg.png Type: image/png Size: 20730 bytes Desc: not available URL: From figueiredo.aeon at gmail.com Fri May 20 16:32:33 2016 From: figueiredo.aeon at gmail.com (Thiago Figueiredo) Date: Fri, 20 May 2016 16:32:33 +0200 Subject: [FieldTrip] Partial Directed Coherence threshold with few trials Message-ID: Hello Fieldtrip Community, I was analyzing corticocortical (EEG-EEG) and corticomuscular (EEG-sEMG) partial directed coherence with the ft_connectivityanalysis() function and later calculating a frequency dependent threshold for the coherence values in a session using my own implementation of the statistics described in Schelter, Björn, et al. "*Testing for directed influences among neural signals using partial directed coherence*." *Journal of neuroscience methods* (2006). I then considered in my analysis only the significant values higher than this threshold. The problem is that now we are applying a more strict preprocessing method that rejects many more trials, leaving us with a ​small number of trials ​(sometimes 20 or sometimes even less than 10 trials per session, instead of the 50 or 60 that we had before). This leads us to the problem of the validity of the coherence estimates with few trials and to the problem of the thresholding method, which is based on a theoretical asymptotic limit and gives incorrect results for such a small number of trials. So my question is twofold: 1- What is the minimum number of trials that we are allowed to use, in order to obtain a reasonable estimate for the PDC with ft_connectivityanalysis() 2- Do you know of any method for calculating the significance of the coherence values to a given significance level, considering that we have a small number of trials? (permutation tests? something else?) Thank you -- Thiago da Cruz Figueiredo Neuroprosthetics Laboratory, Institute for Medical Psychology and Behavioural Neurobiology - University of Tübingen, Germany Núcleo de Inovação Tecnológica em Reabilitação (NITRE) - Universidade Federal da Bahia, Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.sel at psy.ox.ac.uk Fri May 20 17:30:17 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Fri, 20 May 2016 15:30:17 +0000 Subject: [FieldTrip] 2x2 within subject design with covariate Message-ID: <3123912FD054FE44A023073D2EFD213C8C4209@MBX02.ad.oak.ox.ac.uk> Dear List, I am trying to perform a cluster-based permutation test. I have an experimental design with 2 within variables (2x2 design) and a covariate. I wonder how I can define the statistics in the script to include both the within-subject variables and the covariate. I am using the cfg.statistics = 'depsamplesFmultivariate' but I am unsure how to define the covariate in the model. Any insight on this would be much appreciated. Best wishes Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Sun May 22 17:28:39 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Sun, 22 May 2016 20:58:39 +0530 Subject: [FieldTrip] Queries:4 Message-ID: Dear Fieldtrip user, I am getting an that , i am using the layout of biosemi 64 and out of 64 ...8 selected electrodes.But the code is working fine,while investing i found that the out of 8, 4 electrodes are outsides the topoplot. I have doubt regarding the EEG 10-20 system, all the standards electrodes positions have to be same then how come X,Y ,z and theta values are differed in other layouts. How can i fix this problem of such 10-20 channels location.In biosemi 64 and EEG10-20.lay what are the 4 columns signifies and how can i define for my own 64 channels. Your help and suggestions are always appreciable. Thanks and regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.sel at psy.ox.ac.uk Tue May 24 10:57:46 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Tue, 24 May 2016 08:57:46 +0000 Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA Message-ID: <3123912FD054FE44A023073D2EFD213C8CA53F@MBX02.ad.oak.ox.ac.uk> Dear List, Apologies for the reposting... I am trying to perform a cluster-based permutation test. I have an experimental design with 2 within variables (2x2 design) and a covariate. I wonder how I can define the statistics in the script to include both the within-subject variables and the covariate. I am using the cfg.statistics = 'depsamplesFmultivariate' but I am unsure how to define the covariate in the model. Any insight on this would be much appreciated. Best wishes Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Tue May 24 11:56:55 2016 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 24 May 2016 02:56:55 -0700 Subject: [FieldTrip] Can I rename the CTF HLC0011 etc... to {'nasX'; 'nasY'; 'nasZ'; 'lpaX'; 'lpaY'; 'lpaZ'; 'rpaX'; 'rpaY'; 'rpaZ'}? Message-ID: Dear FieldTrippers, I'm using ft_megrealign after timelocking my data for each participant and recording, and before appending these different recording sessions (and subsequently taking grand averages over subjects). Since the experiment consisted of different sessions a few weeks apart, I'd like to minimise noise due to differences in head position (we used online head localisation, but this did not work very well for all participants when coming back a few weeks later. After making the headmodel (and ensuring it's aligned with the gradiometers), this works quite well: % realign to template sensor positions cfg = []; cfg.template = {'ctf275.mat'}; cfg.headmodel = headmodel; % For a realistic single-shell volume conduction model based on the brain surface, you % should probably use an inward shift of about 1 cm. cfg.inwardshift = 1; cfg.feedback = 'no'; data2 = ft_megrealign(cfg, data); However, when looking into the ft_megrealign function I found that there is the option of doing this per trial based on the CTF coil positions (rather than once based on the gradiometer definition at the beginning of the run). This seems sensible for participants who moved quite a bit during a recording. However, CTF does not originally output the {'nasX';'nasY';'nasZ';'lpaX';'lpaY';'lpaZ';'rpaX';'rpaY';'rpaZ'} that the function looks for. In ft_headmovement (and also buried somewhere in the CTF documentation), I could find % HLC0011 HLC0012 HLC0013 x, y, z coordinates of nasion-coil in m. % HLC0021 HLC0022 HLC0023 x, y, z coordinates of lpa-coil in m. % HLC0031 HLC0032 HLC0033 x, y, z coordinates of rpa-coil in m. So it seems reasonable to simply rename these to the channel names that ft_megrealign is looking for. When doing this, realignment indeed happens at the single trial level. However, I wanted to check if there is a reason for using the nasX nasY... channel names rather than the original HLC0011.. ones? Can I rename them while keeping the rest of the HLC channels (of which there are 24) the same? I can't think of a reason why this would cause any issues, but since I could not find the 'per-trial' option documented I thought I'd check what the rationale behind using per-trial or per-run is. Thanks! Cheers, — Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie Universitätsklinikum Hamburg-Eppendorf | Martinistrasse 52, 20246 | Hamburg, Germany www.anneurai.net / @AnneEUrai -------------- next part -------------- An HTML attachment was scrubbed... URL: From koreykam at gmail.com Tue May 24 17:15:51 2016 From: koreykam at gmail.com (Korey Kam) Date: Tue, 24 May 2016 15:15:51 +0000 Subject: [FieldTrip] coefficient of variation on raw data Message-ID: Hi all, I'm interested in computing the coefficient of variation on raw data for single trials (as opposed to averaging them). In order to maintain cfg bookkeeping, I've been trying ft_math for this purpose. However, I've been unable to call ft_math in a single trial manner to effectively compute this: coeff(i) = std(trial(i))/mean(trial(i)); Does anyone have a recommendation on doing this in FT? Alternatively, I've used nested loops over trials and channels, but would much rather maintain cfg history. Thanks, Korey -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.caballero at bcbl.eu Wed May 25 12:35:48 2016 From: c.caballero at bcbl.eu (Cesar Caballero) Date: Wed, 25 May 2016 12:35:48 +0200 (CEST) Subject: [FieldTrip] postdoctoral position on MEG correlates of statistical learning and language processing: BCBL, San Sebastian, Spain In-Reply-To: References: <6DDD80C5-EECF-467C-BABF-385AE1B6CB78@gmail.com> Message-ID: <2011274752.1506286.1464172548396.JavaMail.zimbra@bcbl.eu> Dear all, The Basque Center on Cognition Brain and Language – BCBL- (San Sebastián, Basque Country, Spain) is offering a postdoctoral position focused on the MEG correlates of statistical learning and language processing , as part of ERC-funded research project (PI: Ram Frost). The successful candidate will have a rigorous background in MEG data acquisition and analysis, have a high level of independence, and a strong publication record. The candidate should also be able to contribute to the broader research goals of the project which include computational, behavioural, and fMRI investigations of the neural basis of statistical learning and language learning conducted in collaboration with research groups at the Hebrew University and the University of Toronto. Individuals interested in undertaking research in the fields described in www.bcbl.eu (research) should apply through the BCBL web page http://www.bcbl.eu/jobs ( MEG Postdoc 2016) Deadline: July 15 th , 2016. For more information about the specifics of the position, please contact Ram Frost ( ram.frost at mail.huji.ac.il ) and for broader information about the BCBL please contact Manuel Carreiras ( info at bcbl.eu ). ---------------------------------------------------------------------- Cesar Caballero www.bcbl.eu Twitter: @caballerogaudes www.researchgate.net/profile/Cesar_Caballero2 Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Wed May 25 13:16:17 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Wed, 25 May 2016 16:46:17 +0530 Subject: [FieldTrip] Queries Message-ID: Dear fieldtrippers, I am trying to make a topoplot of my data, which has 8 channels. As there was no layout for 8 channels, I made my own layout for 8 channels with the same channel coordinates which were for 64 channel (biosemi64). And while plotting 4 of the electrodes are lying outside the head layout. Can you kindly suggest me a way how I can bring the layout points inside the head layout. Find the attached image file of the snap of the topoplot. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eEPDC_13.jpg Type: image/jpeg Size: 25679 bytes Desc: not available URL: From gina.joue at univr.it Wed May 25 13:39:00 2016 From: gina.joue at univr.it (gj) Date: Wed, 25 May 2016 13:39:00 +0200 Subject: [FieldTrip] "Out of memory" during ft_sourceplot Message-ID: <57458ED4.3060101@univr.it> Hi FieldTrippers, I am trying to do source analysis (eventually source-level connectivity analysis) and while plotting the source analysis results with ft_sourceplot, I get the following error: -------------------- error --------------------------------- Error using ' Out of memory. Type HELP MEMORY for your options. Error in pos2transform (line 33) transform = pos(:,sel)/ind(:,sel); Error in ft_sourceplot (line 291) functional.transform = pos2transform(functional.pos, functional.dim); -------------------------------------------------------------- Could someone guide me in what I should doublecheck along the way for possible errors and how? Below are the commands I executed leading to the plot command. Thanks in advance! Gina --------------------------------------- cfg = []; cfg.frequency = fft.freq; cfg.elec = elecR; % realigned electrodes cfg.method = 'dics'; % only dics seems to give noise proj? cfg.grid = lf; % lf.pos is a 6804x3 double arr lf.dim=18,21,18] cfg.headmodel = headmodel; % bemcp in mm, mat is 330x4330 double arr cfg.keeptrials = 'yes'; cfg.pcc.fixedori = 'yes'; cfg.dics.projectnoise = 'yes'; % to norm power in ctr of brain cfg.dics.lambda = 0; source_avg = ft_sourceanalysis(cfg, fft); % fft = output from ft_freqanalysis with meth 'mtmfft' and output 'fourier' % calc to reduce center of head bias sourceNAI = source_avg; sourceNAI.avg.pow = source_avg.avg.pow ./ source_avg.avg.noise; % reduce the source reconstructed data to the dominant orientation cfg = []; cfg.projectmom = 'yes'; % project to the direction that explains most of the source variance; The three rows of the moment are the strength of the source in the x-, y- and z-direction -- how do you limit to one direction?? source_proj = ft_sourcedescriptives(cfg,sourceNAI); % src_proj.inside = 6804x1 logical matrix (like template grid) % after source recon still in indiv space -- put into std space source_proj.dim = std_grid.sourcemodel.dim; source_proj.pos = std_grid.sourcemodel.pos; % interpolate onto the MNI template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'all'; cfg.interpmethod = 'linear'; source_interp = ft_sourceinterpolate(cfg, source_proj, smri); % source_interp.inside/nai/noise/pow is a 41943040x1 double arr!! % MESSAGES: % the input is volume data with dimensions [512 512 160] % the input is source data with 6804 brainordinates on a [18 21 18] grid cfg = []; cfg.method = 'slice'; cfg.funparameter = 'pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; ft_sourceplot(cfg,source_interp); % MESSAGES: % the input is source data with 41943040 brainordinates on a % [512 512 160] grid From gina.joue at univr.it Wed May 25 13:58:58 2016 From: gina.joue at univr.it (gj) Date: Wed, 25 May 2016 13:58:58 +0200 Subject: [FieldTrip] head model mat contains only NaN values Message-ID: <57459382.90209@univr.it> Hi, Just to keep questions-answers in the same thread, the problem I had with only NaNs in the head model appears indeed to be because of the internal intersecting mesh plans in the "scalp" (at least the problem disappeared once I got the scalp mesh not to intersect). After much digging, I found these previous posts http://mailman.science.ru.nl/pipermail/fieldtrip/2014-January/007433.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006365.html from Gregor who noticed that the finer the mesh, the more likely self intersections occur. He also suggested using om_check_vol() on the prepare mesh output to check for intersections, but I couldn't get it to work (om_check_vol expects a "skin" structure?) so relied on visual inspection with ft_plot_mesh. After much persistence with playing with different cfg.numvertices values for ft_prepare_mesh (for those wondering I ended up specifying 330 vertices for the "scalp" of an MRI with head+neck), I was able to get a mesh with no self-intersections and was able to calculate a head model with more meaningful values. g From conrado.bosman at gmail.com Wed May 25 14:28:09 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 14:28:09 +0200 Subject: [FieldTrip] Error in ft_hastoolbox Message-ID: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); of a Neuralynx -------------- next part -------------- An HTML attachment was scrubbed... URL: From conrado.bosman at gmail.com Wed May 25 14:33:57 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 12:33:57 +0000 Subject: [FieldTrip] Error in ft_hastoolbox References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at gmail.com Wed May 25 15:23:35 2016 From: michelic72 at gmail.com (Cristiano Micheli) Date: Wed, 25 May 2016 15:23:35 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: Dear Conrado, I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). Which version of MatLab are you running? try to apply this change: if exist(varname) -> if exist(varname,'var') That should do it I hope this helped! Cris On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman wrote: > Dear fieldtrippers, > > I’m trying to read the header of a Neuralynx dataset, using the last > FieldTrip version available at Github, running on a Linux machine. I > encounter the following error (see below). > > Originally, I thought that the problem could be related to a FieldTrip > dependency on a .mex file, that should be downloaded from the Neuralynx > website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS > X’), so I downloaded, compiled and placed the toolbox on a recognizable > MATLAB path. > Then, when I run ft_hastoolbox, I noticed that the value of the variable > dependency is “3”, which is the expected outcome from the MATLAB function > “exist" (which is used in the helper function has_mex from ft_hastoolbox > (l539)), when you have a recognizable mex file. However, the value 3 > provides you the cryptic error message in “is_present” at line 576 > > Do you have any clue if I’m doing something wrong? > > Thanks in advance! > Conrado > > K>> Error using ft_hastoolbox>is_present (line 576) > this should not happen > > Error in ft_hastoolbox (line 378) > status = is_present(dependency); > > Error in read_neuralynx_ncs (line 57) > isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for > debug > > Error in read_neuralynx_ds (line 84) > orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); > > Error in ft_read_header (line 1576) > hdr = read_neuralynx_ds(filename); > of a Neuralynx > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed May 25 15:26:25 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 13:26:25 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans Message-ID: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Hi FieldTrippers, I hope someone can help me with the following. My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. Best wishes, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at donders.ru.nl Wed May 25 15:34:59 2016 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 25 May 2016 13:34:59 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From j.herring at donders.ru.nl Wed May 25 15:34:59 2016 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 25 May 2016 13:34:59 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 25 15:40:06 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 25 May 2016 13:40:06 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: <0DAE8198-1597-4A3C-B22C-6CBED9ED6D6A@donders.ru.nl> Hi Stephen, > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > Perhaps you have to :o). This is the only (relatively straightforward) way I can think of at least. If you ensure your trialinfo field to have trial counter prior to doing the partial rejection, you will have the necessary bookkeeping info to glue things together again. > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. I am afraid that this is impossible. Reason: algorithmically ft_specest_mtmconvol is exploiting the fact that convolution in the time domain is equivalent to multiplication in the frequency domain (which is what makes the function fast). The bottom line is that an FFT is done on the whole epoch (followed by a multiplication with the FFT of tapered sine/cosine waves), which, if the data epoch contains NaNs, returns NaNs all over the place. Best, JM > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 25 15:48:18 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 25 May 2016 13:48:18 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, This is how you could ‘glue’ together the fragments of your trials: freq.powspctrm(~isfinite(freq.powspctrm)) = 0; % converting the nans to 0 allows for summation nrpt = numel(unique(freq.trialinfo(:,1))); % assume that the first column of trialinfo is the counter of the original trials siz = size(freq.powspctrm); newpowspctrm = zeros([nrpt siz(2:end)]); for k = 1:nrpt for m = find(freq.trialinfo(:,1)==k)’ newpowspctrm(k,:,:,:) = newpowspctrm(k,:,:,:)+freq.powspctrm(m,:,:,:); end end newpowspctrm(newpowspctrm==0) = nan; % now you can create your new freq structure with the additional metadata (possibly corrected for the new number of ‘rpt’s. Best, JM > On 25 May 2016, at 15:26, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From conrado.bosman at gmail.com Wed May 25 15:50:20 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 15:50:20 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> Hey Cristiano, Thanks for the advice! The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code best Conrado > On 25 May 2016, at 15:23, Cristiano Micheli wrote: > > Dear Conrado, > I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). > Which version of MatLab are you running? > > try to apply this change: > if exist(varname) -> if exist(varname,'var') > > That should do it > I hope this helped! > > > Cris > > On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: > Dear fieldtrippers, > > I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). > > Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. > Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 > > Do you have any clue if I’m doing something wrong? > > Thanks in advance! > Conrado > > K>> Error using ft_hastoolbox>is_present (line 576) > this should not happen > > Error in ft_hastoolbox (line 378) > status = is_present(dependency); > > Error in read_neuralynx_ncs (line 57) > isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug > > Error in read_neuralynx_ds (line 84) > orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); > > Error in ft_read_header (line 1576) > hdr = read_neuralynx_ds(filename); > of a Neuralynx > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 15:58:35 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 13:58:35 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: <7ca8318372b946b98295e516ce8554bf@EXPRD02.hosting.ru.nl> Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 16:08:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 14:08:34 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: As a follow-up: I guess the best solution in the case would then be to make my TFR, and replace those values with nans based on the sample number from the time-series artifact detection. Cheers, Stephen On 25 May 2016 at 15:58, Stephen Whitmarsh > wrote: Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 16:08:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 16:08:34 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: As a follow-up: I guess the best solution in the case would then be to make my TFR, and replace those values with nans based on the sample number from the time-series artifact detection. Cheers, Stephen On 25 May 2016 at 15:58, Stephen Whitmarsh wrote: > Hi Jim! > > Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and > method = 'tfr' give the same problem. I'm afraid I'll end up writing my own > code, cutting up data and using an FFT :-/ > > Thank again, > > Stephen > > On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: > >> Hi Stephen, >> >> As far as I know this is expected as mtmconvol is actually multiplying >> the fft of the entire trial with the fft of your tapered windows. Perhaps >> it will work of you use one of the methods that actually uses convolution >> in the time domain rather than multiplication in the frequency domain. >> >> Best, >> >> Jim >> >> >> >> > On 25 May 2016, at 15:29, Stephen Whitmarsh < >> stephen.whitmarsh at gmail.com> wrote: >> > >> > Hi FieldTrippers, >> > >> > I hope someone can help me with the following. >> > >> > My problem is that I like to maintain my original rpt/chan/time/freq >> size after artefact rejection based on the time series data, i.e. to have >> the same dimensions of the TFR as if I did not reject data. This is for >> reasons of bookkeeping between different types of channels that are >> processed differently throughout my analysis. >> > >> > What works well is to detect artifacts in the data and replace those >> intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So >> far this is perfect for the approach I had in mind. >> > >> > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as >> nans whenever a (small) period has nans. What I would need - and in fact >> expect - is that only those time/frequency windows that have (one or more) >> nan values will output nan, while the rest should merrily go round giving >> power values. After all, the data is there. >> > >> > It is unclear to me whether this is expected behaviour or not. I might >> be making a mistake but some simple tests replicated this behaviour. >> > >> > Is there a solution that still allows me to end up with a >> rpt/chan/time/freq representation of the same size as when i would not have >> rejected artifacts? >> > >> > The only other FieldTrip-like option I can think of is to use >> ft_rejectartifact with method = 'partial', do the freqanalysis on trial >> parts, and somehow glue the separate trial parts together again afterwards. >> But I really don't want to go in that direction. >> > >> > In the end I'm afraid I don't understand the core of >> ft_specest_mtmconvol enough to see where I could hack it. I hope some of >> you might be able to help. >> > >> > Best wishes, >> > Stephen >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > 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 stephen.whitmarsh at gmail.com Wed May 25 15:58:35 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 15:58:35 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) wrote: > Hi Stephen, > > As far as I know this is expected as mtmconvol is actually multiplying the > fft of the entire trial with the fft of your tapered windows. Perhaps it > will work of you use one of the methods that actually uses convolution in > the time domain rather than multiplication in the frequency domain. > > Best, > > Jim > > > > > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > > > Hi FieldTrippers, > > > > I hope someone can help me with the following. > > > > My problem is that I like to maintain my original rpt/chan/time/freq > size after artefact rejection based on the time series data, i.e. to have > the same dimensions of the TFR as if I did not reject data. This is for > reasons of bookkeeping between different types of channels that are > processed differently throughout my analysis. > > > > What works well is to detect artifacts in the data and replace those > intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So > far this is perfect for the approach I had in mind. > > > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as > nans whenever a (small) period has nans. What I would need - and in fact > expect - is that only those time/frequency windows that have (one or more) > nan values will output nan, while the rest should merrily go round giving > power values. After all, the data is there. > > > > It is unclear to me whether this is expected behaviour or not. I might > be making a mistake but some simple tests replicated this behaviour. > > > > Is there a solution that still allows me to end up with a > rpt/chan/time/freq representation of the same size as when i would not have > rejected artifacts? > > > > The only other FieldTrip-like option I can think of is to use > ft_rejectartifact with method = 'partial', do the freqanalysis on trial > parts, and somehow glue the separate trial parts together again afterwards. > But I really don't want to go in that direction. > > > > In the end I'm afraid I don't understand the core of > ft_specest_mtmconvol enough to see where I could hack it. I hope some of > you might be able to help. > > > > Best wishes, > > Stephen > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 25 23:14:00 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 25 May 2016 23:14:00 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> Message-ID: <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> Hi Conrado, that should not hapen, as the code also tells you ;-) Could you try replacing line 539 in ft_hastoolbox from status = exist(full_name, 'file'); into status = (exist(full_name, 'file')==3); After that you should make sure that the ft_hastoolbox copy (which is present in multipe private directories) is updated by (on your Mac) running in a terminal fieldtrip/bin/synchronize-private.sh the synchronize-private script runs autmatically upon each git commit, but with a manual change you sometimes have to do it by hand. The recent change in this section of FieldTrip code was (as Cristiano mentioned) triggered by recent matlab incompatibilities in file detection, and in making it more octave compatible. But apparently we did not test all possible cases. Please let me know whether it works, I’ll then integrate it in the release version. Best regards Robert > On 25 May 2016, at 15:50, Conrado Bosman wrote: > > Hey Cristiano, > Thanks for the advice! > The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct > The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code > > best > Conrado >> On 25 May 2016, at 15:23, Cristiano Micheli > wrote: >> >> Dear Conrado, >> I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). >> Which version of MatLab are you running? >> >> try to apply this change: >> if exist(varname) -> if exist(varname,'var') >> >> That should do it >> I hope this helped! >> >> >> Cris >> >> On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: >> Dear fieldtrippers, >> >> I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). >> >> Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. >> Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 >> >> Do you have any clue if I’m doing something wrong? >> >> Thanks in advance! >> Conrado >> >> K>> Error using ft_hastoolbox>is_present (line 576) >> this should not happen >> >> Error in ft_hastoolbox (line 378) >> status = is_present(dependency); >> >> Error in read_neuralynx_ncs (line 57) >> isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug >> >> Error in read_neuralynx_ds (line 84) >> orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); >> >> Error in ft_read_header (line 1576) >> hdr = read_neuralynx_ds(filename); >> of a Neuralynx >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan at ustc.edu.cn Thu May 26 08:02:07 2016 From: tzvetan at ustc.edu.cn (Tzvetomir) Date: Thu, 26 May 2016 14:02:07 +0800 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Dear Stephen, you could also apply the nanconv() function of B.Kraus, available on Matlab's fileexchange. (http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv) I'm doing my own wavelet processing for the reason that part of my epochs are filled with nan's due to experimental design. But fieldtrip website remains a huge source of infos, tips and solutions where to look for :) all the best, Tzvetomir On 2016-05-25 10:08 PM, Stephen Whitmarsh wrote: > As a follow-up: I guess the best solution in the case would then be to > make my TFR, and replace those values with nans based on the sample > number from the time-series artifact detection. > > Cheers, > Stephen > > On 25 May 2016 at 15:58, Stephen Whitmarsh > > wrote: > > Hi Jim! > > Thanks. Ofcourse, that's the problem. However, method = 'wavelet', > and method = 'tfr' give the same problem. I'm afraid I'll end up > writing my own code, cutting up data and using an FFT :-/ > > Thank again, > > Stephen > > On 25 May 2016 at 15:34, Herring, J.D. (Jim) > > wrote: > > Hi Stephen, > > As far as I know this is expected as mtmconvol is actually > multiplying the fft of the entire trial with the fft of your > tapered windows. Perhaps it will work of you use one of the > methods that actually uses convolution in the time domain > rather than multiplication in the frequency domain. > > Best, > > Jim > > > > > On 25 May 2016, at 15:29, Stephen Whitmarsh > > wrote: > > > > Hi FieldTrippers, > > > > I hope someone can help me with the following. > > > > My problem is that I like to maintain my original > rpt/chan/time/freq size after artefact rejection based on the > time series data, i.e. to have the same dimensions of the TFR > as if I did not reject data. This is for reasons of > bookkeeping between different types of channels that are > processed differently throughout my analysis. > > > > What works well is to detect artifacts in the data and > replace those intervals with nans using ft_rejectartifact, > with cfg.reject = 'nan'. So far this is perfect for the > approach I had in mind. > > > > However, ft_freqanalysis (method = 'mtmconvol') outputs > whole trials as nans whenever a (small) period has nans. What > I would need - and in fact expect - is that only those > time/frequency windows that have (one or more) nan values will > output nan, while the rest should merrily go round giving > power values. After all, the data is there. > > > > It is unclear to me whether this is expected behaviour or > not. I might be making a mistake but some simple tests > replicated this behaviour. > > > > Is there a solution that still allows me to end up with a > rpt/chan/time/freq representation of the same size as when i > would not have rejected artifacts? > > > > The only other FieldTrip-like option I can think of is to > use ft_rejectartifact with method = 'partial', do the > freqanalysis on trial parts, and somehow glue the separate > trial parts together again afterwards. But I really don't want > to go in that direction. > > > > In the end I'm afraid I don't understand the core of > ft_specest_mtmconvol enough to see where I could hack it. I > hope some of you might be able to help. > > > > Best wishes, > > Stephen > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- __________________________________________________ Tzvetomir Tzvetanov, PhD (赐为) Associate Professor Vision Research Laboratory, School of Life Sciences, CAS Key Laboratory of Brain Function and Disease, University of Science & Technology of China Hefei, Anhui 230027, P.R.China http://vision.ustc.edu.cn/ Email: tzvetan at ustc.edu.cn -------------- next part -------------- An HTML attachment was scrubbed... URL: From conrado.bosman at gmail.com Thu May 26 10:24:22 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Thu, 26 May 2016 08:24:22 +0000 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> Message-ID: <840de86e5f884294b4a5855b3cd9de6b@EXPRD02.hosting.ru.nl> Hi Robert, Thanks! this little change solved the bug. Best, Conrado On 25 May 2016, at 23:14, Robert Oostenveld > wrote: Hi Conrado, that should not hapen, as the code also tells you ;-) Could you try replacing line 539 in ft_hastoolbox from status = exist(full_name, 'file'); into status = (exist(full_name, 'file')==3); After that you should make sure that the ft_hastoolbox copy (which is present in multipe private directories) is updated by (on your Mac) running in a terminal fieldtrip/bin/synchronize-private.sh the synchronize-private script runs autmatically upon each git commit, but with a manual change you sometimes have to do it by hand. The recent change in this section of FieldTrip code was (as Cristiano mentioned) triggered by recent matlab incompatibilities in file detection, and in making it more octave compatible. But apparently we did not test all possible cases. Please let me know whether it works, I’ll then integrate it in the release version. Best regards Robert On 25 May 2016, at 15:50, Conrado Bosman > wrote: Hey Cristiano, Thanks for the advice! The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code best Conrado On 25 May 2016, at 15:23, Cristiano Micheli > wrote: Dear Conrado, I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). Which version of MatLab are you running? try to apply this change: if exist(varname) -> if exist(varname,'var') That should do it I hope this helped! Cris On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); of a Neuralynx _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Thu May 26 10:58:16 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 26 May 2016 10:58:16 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Dear Tzvetomir, Thank you so much! That is very helpful. And I concur fully with the praise of FT, and the mailinglist :-) Best wishes, Stephen On 26 May 2016 at 08:02, Tzvetomir wrote: > Dear Stephen, > > you could also apply the nanconv() function of B.Kraus, available on > Matlab's fileexchange. > > (http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv) > > I'm doing my own wavelet processing for the reason that part of my epochs > are filled with nan's due to experimental design. > > But fieldtrip website remains a huge source of infos, tips and solutions > where to look for :) > > all the best, > > Tzvetomir > On 2016-05-25 10:08 PM, Stephen Whitmarsh wrote: > > As a follow-up: I guess the best solution in the case would then be to > make my TFR, and replace those values with nans based on the sample number > from the time-series artifact detection. > > Cheers, > Stephen > > On 25 May 2016 at 15:58, Stephen Whitmarsh > wrote: > >> Hi Jim! >> >> Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and >> method = 'tfr' give the same problem. I'm afraid I'll end up writing my own >> code, cutting up data and using an FFT :-/ >> >> Thank again, >> >> Stephen >> >> On 25 May 2016 at 15:34, Herring, J.D. (Jim) < >> j.herring at donders.ru.nl> wrote: >> >>> Hi Stephen, >>> >>> As far as I know this is expected as mtmconvol is actually multiplying >>> the fft of the entire trial with the fft of your tapered windows. Perhaps >>> it will work of you use one of the methods that actually uses convolution >>> in the time domain rather than multiplication in the frequency domain. >>> >>> Best, >>> >>> Jim >>> >>> >>> >>> > On 25 May 2016, at 15:29, Stephen Whitmarsh < >>> stephen.whitmarsh at gmail.com> wrote: >>> > >>> > Hi FieldTrippers, >>> > >>> > I hope someone can help me with the following. >>> > >>> > My problem is that I like to maintain my original rpt/chan/time/freq >>> size after artefact rejection based on the time series data, i.e. to have >>> the same dimensions of the TFR as if I did not reject data. This is for >>> reasons of bookkeeping between different types of channels that are >>> processed differently throughout my analysis. >>> > >>> > What works well is to detect artifacts in the data and replace those >>> intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So >>> far this is perfect for the approach I had in mind. >>> > >>> > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials >>> as nans whenever a (small) period has nans. What I would need - and in fact >>> expect - is that only those time/frequency windows that have (one or more) >>> nan values will output nan, while the rest should merrily go round giving >>> power values. After all, the data is there. >>> > >>> > It is unclear to me whether this is expected behaviour or not. I might >>> be making a mistake but some simple tests replicated this behaviour. >>> > >>> > Is there a solution that still allows me to end up with a >>> rpt/chan/time/freq representation of the same size as when i would not have >>> rejected artifacts? >>> > >>> > The only other FieldTrip-like option I can think of is to use >>> ft_rejectartifact with method = 'partial', do the freqanalysis on trial >>> parts, and somehow glue the separate trial parts together again afterwards. >>> But I really don't want to go in that direction. >>> > >>> > In the end I'm afraid I don't understand the core of >>> ft_specest_mtmconvol enough to see where I could hack it. I hope some of >>> you might be able to help. >>> > >>> > Best wishes, >>> > Stephen >>> > >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > __________________________________________________ > > Tzvetomir Tzvetanov, PhD > (赐为) > > Associate Professor > Vision Research Laboratory, School of Life Sciences, > CAS Key Laboratory of Brain Function and Disease, > University of Science & Technology of China > Hefei, Anhui 230027, P.R.Chinahttp://vision.ustc.edu.cn/ > Email: tzvetan at ustc.edu.cn > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From icelandhouse at gmail.com Thu May 26 20:12:47 2016 From: icelandhouse at gmail.com (Maris Skujevskis) Date: Thu, 26 May 2016 20:12:47 +0200 Subject: [FieldTrip] Average referencing and demeaning prior to beamformer Message-ID: Hi fieldtrip users, I have a question of clarification regarding common average referencing during beamformer source reconstruction. The yellow warning box in the tutorial http://www.fieldtriptoolbox.org/tutorial/beamformer stresses the importance of common average referencing but leaves me confused as to when exactly it needs to be done. Suppose I have an set of EEG trials (i.e., a set of multichannel time series). The entire data set has already been demeaned and common average referenced. I then cut out two time windows of interest on which I wish to apply a beamformer filter. Question 1: after I combine the the two cut-out time windows to calculate the common filter, do I need to average reference the combined data set prior to calculating the beamformer filter? Question 2: Do I need to separately average reference each of the two cut-out windows prior to applying the beamformer on each of the cut-out data segments? Question 3 on demeaning: do the cut-out combined/separate time windows should also be demeaned or demeaning doesn't make any difference for beamformer source reconstruction? Thanks! Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From SXM1170 at student.bham.ac.uk Thu May 26 20:46:43 2016 From: SXM1170 at student.bham.ac.uk (Stefan Maslanka) Date: Thu, 26 May 2016 18:46:43 +0000 Subject: [FieldTrip] Reading BCI2000 files with stimulus codes Message-ID: Dear FieldTrip users, I have recently been using the Emotiv Epoc with BCI2000 to develop a BCI. I was using BCILAB to create a model to use online but recently came across FieldTrip and its buffer. Unfortunately I am having issues reading my BCI2000 files and processing based on stimulation time points. The BCI2000 '.dat' files are saved with an event field called 'StimulusCode' with values relating to a left or right arrow (1 or 2) and a fixation cross (5). This is clearly seen when loading the header, each samples code is stored in 'hdr.orig.states.StimulusCode'. However when loading the events FieldTrip does not detect these stimulus codes, only listing the 5's for the rest condition, the values of 1 and 2 are not picked up. Is this a known .dat or BCI2000 issue? I was hoping to create a simple model and train a classifier to use in an online environment. Thank you for your time, Stefan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri May 27 09:31:45 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 27 May 2016 08:31:45 +0100 Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA Message-ID: Hi list, Eventually we managed to figure this out off-list, but I just wanted to post a response here to show that it's been resolved (and in case someone in the future has a similar issue and finds this thread). We ended up handling this by making a difference-of-differences wave to quantify the 2x2 within-subjects interaction (per http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests) and then using ft_statfun_indepsamplesregrT to correlate that interaction effect with the subject-wise covariate (as opposed to comparing it to 0 with a regular t-test). For the cfg.design matrix we just used the list of the subjects' values on the covariate. The results we got seemed to make sense (i.e., they were consistent with what had been observed in the same dataset with a time-window analysis before this), but of course if we've done anything wrong or if anyone has suggestions for a better way to do this then we'd be happy to hear. 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: Tue, 24 May 2016 08:57:46 +0000 > From: Alex Sel > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA > Message-ID: > <3123912FD054FE44A023073D2EFD213C8CA53F at MBX02.ad.oak.ox.ac.uk> > Content-Type: text/plain; charset="us-ascii" > > Dear List, > > > > Apologies for the reposting... > > > > I am trying to perform a cluster-based permutation test. I have an > experimental design with 2 within variables (2x2 design) and a covariate. I > wonder how I can define the statistics in the script to include both the > within-subject variables and the covariate. I am using the cfg.statistics > = 'depsamplesFmultivariate' but I am unsure how to define the covariate in > the model. > > > > Any insight on this would be much appreciated. > > > > Best wishes > > > > Alex Sel, PhD > Postdoctoral Researcher > Department of Experimental Psychology, > University of Oxford, > 9 South Parks Road, > OX1 3UD > Tel: 01865 271 340 > Email: Alex.sel at psy.ox.ac.uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seymourr at aston.ac.uk Fri May 27 15:39:58 2016 From: seymourr at aston.ac.uk (Seymour, Robert (Research Student)) Date: Fri, 27 May 2016 13:39:58 +0000 Subject: [FieldTrip] Combining GRADS+MAGS Message-ID: Dear Fieldtrip Users, I am using an Elekta Neuromag 306 scaner which obviously has both magnetometers and gradiometers. When performing source localisation using an LCMV beamformer I would like to use both MAGS and GRADS (i.e. use cfg.channel = 'MEG' '-badchans'). I know that there is a scaling issue between MAGS and GRADS.. so I was wondering if Fieldtrip compensates for this during leadfield creation and/or ft_sourceanalysis, and if so how? Many thanks, Robert Seymour (PhD Student, Aston Brain Centre) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon May 30 05:38:53 2016 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 30 May 2016 13:38:53 +1000 Subject: [FieldTrip] Problem with EGI file Message-ID: Dear fieldtrip community, I am trying to analyse eeg recorded from EGI. I want to highpass filter the data before epoching and I managed to create the following script from the fieldtrip documentation. However I am getting an error (please see below). Could someone suggest a fix. Thank you, Arti datadir = 'D:\EGITest'; dataset = fullfile(datadir, 's01_CH.mff'); headerformat = 'egi_mff_v2'; dataformat = 'egi_mff_v2'; eventformat = 'egi_mff_v2'; hdr = ft_read_header(dataset, 'headerformat', headerformat); dat = ft_read_data(dataset, 'headerformat', headerformat, 'dataformat', dataformat); event = ft_read_event(dataset, 'headerformat', headerformat, 'eventformat', eventformat); fg = []; cfg.data = dat; cfg.headerfile=hdr; cfg.trialdef.triallength = Inf; cfg.trialdef.ntrials = 1; cfg = ft_definetrial(cfg); cfg.hpfilter = 'yes'; cfg.hpfreq = .1; cfg.hpfilttype = 'firws'; cfg.hpfiltdir = 'onepass-zerophase'; alldata = ft_preprocessing(cfg); I am getting the following error Undefined function 'exist' for input arguments of type 'struct'. Error in isdir (line 10) result = exist(dirpath,'dir') == 7; Error in ft_filetype (line 150) if isdir(filename) Error in ft_checkconfig (line 559) cfg.dataformat = ft_filetype(cfg.datafile); Error in ft_definetrial (line 128) cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Mon May 30 09:48:12 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Mon, 30 May 2016 07:48:12 +0000 Subject: [FieldTrip] Problem with EGI file In-Reply-To: References: Message-ID: Dear Arti, You could try to adapt the following code: % -------------------------------- % Load & preprocess continuous files % --------------------------------- cfg = []; cfg.dataset = tmpfilename; cfg.continuous='yes'; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; cfg.hpfreq = 0.5; % Hz cfg.channel = elecs_183_selec; data_cont = ft_preprocessing(cfg); % ----------------------------------------- % define trials %----------------------------------------- cfg = []; cfg.dataset = tmpfilename; % datafile to read events from cfg.eventformat = 'egi_mff_v2'; cfg.trialdef.prestim = 2; % in seconds cfg.trialdef.poststim = 2; % in seconds cfg.trialdef.eventtype = {'DIN12'}; cfgDIN12 = ft_definetrial(cfg); tmp_data_segm12 = ft_redefinetrial(cfgDIN12, data_cont); %Segmentation The problem is that for me, it does not import the trialinfo. Therefore, I do the segmentation (here for DIN12) separately for all triggers, then append all tmp_data_segm and write the following code for adding the trialinfo: data_segm.trialinfo=[ones(1, length(tmp_data_segm12.trial))*12] Hope that helps! Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arti Abhishek [mailtome.2113 at gmail.com] Gesendet: Montag, 30. Mai 2016 05:38 An: FieldTrip discussion list Betreff: [FieldTrip] Problem with EGI file Dear fieldtrip community, I am trying to analyse eeg recorded from EGI. I want to highpass filter the data before epoching and I managed to create the following script from the fieldtrip documentation. However I am getting an error (please see below). Could someone suggest a fix. Thank you, Arti datadir = 'D:\EGITest'; dataset = fullfile(datadir, 's01_CH.mff'); headerformat = 'egi_mff_v2'; dataformat = 'egi_mff_v2'; eventformat = 'egi_mff_v2'; hdr = ft_read_header(dataset, 'headerformat', headerformat); dat = ft_read_data(dataset, 'headerformat', headerformat, 'dataformat', dataformat); event = ft_read_event(dataset, 'headerformat', headerformat, 'eventformat', eventformat); fg = []; cfg.data = dat; cfg.headerfile=hdr; cfg.trialdef.triallength = Inf; cfg.trialdef.ntrials = 1; cfg = ft_definetrial(cfg); cfg.hpfilter = 'yes'; cfg.hpfreq = .1; cfg.hpfilttype = 'firws'; cfg.hpfiltdir = 'onepass-zerophase'; alldata = ft_preprocessing(cfg); I am getting the following error Undefined function 'exist' for input arguments of type 'struct'. Error in isdir (line 10) result = exist(dirpath,'dir') == 7; Error in ft_filetype (line 150) if isdir(filename) Error in ft_checkconfig (line 559) cfg.dataformat = ft_filetype(cfg.datafile); Error in ft_definetrial (line 128) cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); -------------- next part -------------- An HTML attachment was scrubbed... URL: From Claudio.Georgii at stud.sbg.ac.at Mon May 30 10:53:22 2016 From: Claudio.Georgii at stud.sbg.ac.at (Claudio Georgii) Date: Mon, 30 May 2016 10:53:22 +0200 Subject: [FieldTrip] Problem with EGI file In-Reply-To: References: Message-ID: Hey, i guess a more convenient & less error prone way to import the trialinfo would be to specify your own trialfun. Within you trialfun, just search for the stimulus value (trigger value) and add it to a 4th column of your trl structure: % Search for trials: stimulus_value = {event(find(strcmp('Stimulus', {event.type}))).value}'; % add to 4th colum of trl trl(:,4) = str2double(stimulus_value); After using ft_preprocessing, the 4th colum will be automatically added to the trialinfo. Best, Claudio 2016-05-30 9:48 GMT+02:00 Blume Christine : > Dear Arti, > > You could try to adapt the following code: > > % -------------------------------- > % Load & preprocess continuous files > % --------------------------------- > cfg = []; > cfg.dataset = tmpfilename; > cfg.continuous='yes'; > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > cfg.hpfreq = 0.5; % Hz > cfg.channel = elecs_183_selec; > data_cont = ft_preprocessing(cfg); > > % ----------------------------------------- > % define trials > %----------------------------------------- > cfg = []; > cfg.dataset = tmpfilename; % datafile to read events from > cfg.eventformat = 'egi_mff_v2'; > cfg.trialdef.prestim = 2; % in seconds > cfg.trialdef.poststim = 2; % in seconds > > cfg.trialdef.eventtype = {'DIN12'}; > cfgDIN12 = ft_definetrial(cfg); > > tmp_data_segm12 = ft_redefinetrial(cfgDIN12, data_cont); %Segmentation > > The problem is that for me, it does not import the trialinfo. Therefore, I > do the segmentation (here for DIN12) separately for all triggers, then > append all tmp_data_segm and write the following code for adding the > trialinfo: > > data_segm.trialinfo=[ones(1, length(tmp_data_segm12.trial))*12] > > Hope that helps! > > Best, > Christine > > > ------------------------------ > *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" > im Auftrag von "Arti Abhishek [mailtome.2113 at gmail.com] > *Gesendet:* Montag, 30. Mai 2016 05:38 > *An:* FieldTrip discussion list > *Betreff:* [FieldTrip] Problem with EGI file > > Dear fieldtrip community, > > I am trying to analyse eeg recorded from EGI. I want to highpass filter > the data before epoching and I managed to create the following script from > the fieldtrip documentation. However I am getting an error (please see > below). Could someone suggest a fix. > > Thank you, > Arti > > > datadir = 'D:\EGITest'; > dataset = fullfile(datadir, 's01_CH.mff'); > headerformat = 'egi_mff_v2'; > dataformat = 'egi_mff_v2'; > eventformat = 'egi_mff_v2'; > hdr = ft_read_header(dataset, 'headerformat', headerformat); > dat = ft_read_data(dataset, 'headerformat', headerformat, > 'dataformat', dataformat); > event = ft_read_event(dataset, 'headerformat', headerformat, > 'eventformat', eventformat); > fg = []; > cfg.data = dat; > cfg.headerfile=hdr; > cfg.trialdef.triallength = Inf; > cfg.trialdef.ntrials = 1; > cfg = ft_definetrial(cfg); > cfg.hpfilter = 'yes'; > cfg.hpfreq = .1; > cfg.hpfilttype = 'firws'; > cfg.hpfiltdir = 'onepass-zerophase'; > alldata = ft_preprocessing(cfg); > > I am getting the following error > > Undefined function 'exist' for input arguments of type > 'struct'. > > Error in isdir (line 10) > result = exist(dirpath,'dir') == 7; > > Error in ft_filetype (line 150) > if isdir(filename) > > Error in ft_checkconfig (line 559) > cfg.dataformat = ft_filetype(cfg.datafile); > > Error in ft_definetrial (line 128) > cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Claudio Georgii, MSc. Phd student University of Salzburg - Department of Psychology Eating Behavior Laboratory Hellbrunnerstraße 34 5020 Salzburg - Austria Phone: 0043- (0)662 8044 5164 E-Mail: claudio.georgii at sbg.ac.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sun May 1 18:14:59 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:14:59 +0000 Subject: [FieldTrip] Unit error using ft_topoplotTFR.m References: Message-ID: <6647E974-EBA7-4730-9828-FB272C2C3DBD@donders.ru.nl> Hi Andrew, It seems that FT chokes on some bookkeeping operation (the ‘unbalancing’ stuff), which is known to be tricky, and requires too many words, and is too tedious to explain why these obscure steps would be needed in the first place. Note that there seems to exist an inconsistency between the topo and multi functions, so I think this should be looked into. This being said, given your error stack it looks as if you run into this because you try to create a layout from the sensor description in the data. I would advice to use one of the standard layouts we have on file (in the fieldtrip/template/layout directory). The one you probably want to use is either cfg.layout = ‘4D248.lay’, or ‘4D248_helmet.mat’. (to be sure, just check the filenames in the directory, because I don’t know them from the top of my head). With an existing layout-filename in the cfg you should not run into this. Best, Jan-Mathijs On 29 Apr 2016, at 14:01, Reid, A.T. (Andrew) > wrote: Hi all, I am trying to do a simple topo plot of some time-locked HCP data. Running ft_multiplotTFR on the TFR output structure works fine. When I run ft_topoplotTFR on the same structure, I get the following error: creating layout from data.grad undoing the invcomp balancing for the gradiometer definition Error using ft_scalingfactor (line 181) cannot convert T to unknown Error in ft_scalingfactor (line 94) factor = cellfun(@ft_scalingfactor, old(:), new(:)); Error in ft_apply_montage (line 309) scale = ft_scalingfactor(input.chanunit, montage.chanunitorg); Error in undobalancing (line 37) sens = ft_apply_montage(sens, sens.balance.(sens.balance.current), 'inverse', 'yes', 'keepunused', 'yes', 'warning', 'no'); Error in ft_prepare_layout>sens2lay (line 957) sens = undobalancing(sens); Error in ft_prepare_layout (line 430) layout = sens2lay(data.grad, cfg.rotate, cfg.projection, cfg.style, cfg.overlap); Error in ft_topoplotTFR (line 192) cfg.layout = ft_prepare_layout(cfg, varargin{:}); The data.grad.balance.invcomp.chanunitnew cell array appears to be the culprit, as it contains “unknown” while the main data.chanunit has unit “T”. Not sure how to proceed here.. Thanks! Andrew ____________________________________________________ Andrew Reid Postdoctoral Fellow Department of Cognitive Artificial Intelligence Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen Web: http://andrew.modelgui.org/ Tel: +31 (0)24 36 55931 _______________________________________________ fieldtrip 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 Sun May 1 18:16:45 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:16:45 +0000 Subject: [FieldTrip] Electrode position effects on leadfield values In-Reply-To: References: Message-ID: Hi Maris, It is common knowledge that due to noise/measurement error, it is hard, if not impossible to match Polhemus digitized electrode locations with the MR head shape precisely. Indeed this is well known. Even after manual and iterative alignment some electrodes remain "hanging" in the air above the head surface, while some others get buried below the head surface. Here is an illustration of what I mean: https://goo.gl/aSm7YU Looks quite good to me! I am wondering what effect this type of electrode misplacement has on the values in the leadfield matrix as calculated by ft_prepare_leadfield? How does fieldtrip deal with electrodes placed in such a way? It seems that there is some magic involved there, since in theory the lead field matrix values for the electrodes not touching the surface of the head should be zero (which is not the case in the lead field matrix produced by ft_prepare_leadfield). Fieldtrip pulls (or pushes) the electrodes to the head surface, to ensure that the computations make sense. If you want to know the details, grep for project_elec (which is the function that does this). Best, Jan-Mathijs I am currently testing how moving a "floating" and a "buried" electrode to its nearest point on the scalp affects the leadfield matrix values. I do not have any definite answers yet, but I did want to check in with some more experienced users out there before spending too much time on this (and possibly reinventing the wheel, so to speak). Thanks! Maris _______________________________________________ fieldtrip 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 Sun May 1 18:44:16 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:44:16 +0000 Subject: [FieldTrip] MNE-sample data set on Fieldtrip. In-Reply-To: <96d4943980d708a2b7d8b6ffbc439792@cam.ac.uk> References: <96d4943980d708a2b7d8b6ffbc439792@cam.ac.uk> Message-ID: <13E4D5AA-9D4D-40C8-B886-5867726F256B@donders.ru.nl> Dear Parham, > I was hoping to perform a complete source analysis using FieldTrip on the MNE-sample data set. > The link to the MNE data set link is given below: > http://martinos.org/mne/dev/manual/sample_dataset.html#babdhifj That sounds like a great exercise! I am not aware of anybody having done this already. > I am terribly confused on how to align the MRI coordinates to MEG. Yes, coordinate systems are confusing and annoying. > The MEG system is a neuromag306. The function hdr=ft_read_header(raw_data_set_filename) reads fiducial marks > HPI. It is contained in hdr.orig.dig. > Also shape = ft_read_headshape(raw_data_set_filename) gives a structure > shape = > > pos: [143x3 double] > fid: [1x1 struct] > label: {143x1 cell} > coordsys: 'neuromag' > unit: 'cm' > pnt: [143x3 double] > > where the shape.fid has the nasion, lpa and rpa. I have the following questions: > 1. It appears to me that the MRI coordinate system is already spm. > Axis X :Left to right. > Axis Y: Posterior to Anterior. > Axis Z: bottom to top. >From the direction of the axes one cannot strictly conclude the coordinate system. Both the Elekta-based coordinates, and the SPM-based coordinates have their X/Y/Z axes pointing into R(ight)/A(nterior)/S(uperior). They differ in their origin. If however the shape.fid.pnt/pos (I am not sure whether the positions are represented in the pnt or pos field nowadays) for the ‘nas’ fiducial is [0 somevalue 0] (or at least the x and z coordinates are close to 0), you can be sure that this is defined in ‘MEG’ coordinates. > 2. How can I realign the MRI to MEG? > a) Interactively: ft_volumerealign > or > b) Should I use the information in shape to have it done automatically? > I think, it would be unwise to define my own lpa, rpa and nasion. Indeed, it adds error when trying to ‘click’ the lpa/rpa/nasion once more, because they are bound to end up at a slightly different location. Since you seem to have a digitized headshape, you could try and align this headshape to the surface reconstruction of the anatomical MRI (which I assume you have), using ft_volumerealign and the ‘headshape’ method. I would typically do the alignment manually (rather than relying on the automatic icp-based algorithm), particularly if you have only few points in the headshape. > 3. What is the relationship between HPI coil coordinates and the lpa, rpa and nasion coordinates? Are there scripts that relate the two. I don’t know. Sometimes there’s a one-to-one match between specific coils and the three fiducial locations, sometimes there isn’t :o(. Depends on the specifics of the data. > 4. Has anyone ever created a script to use Fieldtrip to analyze this specific data set? I am not aware of this, but I think it would be valuable to have this documented somewhere (and available to the wider community). > 5. The MEG sensors are in a different coordinate frame "1" as opposed to head coordinates (Electrodes). Do I have to make sure that these coordinates are transformed to head coordinates prior to ft_prepare_leadfield calculations? or is this done automatically by fieldtrip? I am not so familiar with the meaning of the different coordinate frames employed by the neuromag software (at least not with respect to how the numbers map onto specific conventions). Yet, in the end of the day you need to ensure that all the data-objects that represent geometrical information (sensors, volume conduction model, source model) are expressed in the same coordinate system. Fieldtrip will not automagically convert anything for you. > I just have the feeling that it would be unwise to do this interactively because of the existence of the fiducial markers. Yes, but if there’s no alternative, there’s no way around this. Yet, it could be that the different coordinate transformations are already represented in the data (and that the low-level reading routines know how to deal with this: perhaps you can specify a certain input argument that returns the coordinates in a specified coordinate system) So, in sum, perhaps not too helpful, but it may provide some clues to the solution. Also, perhaps some elekta people may want to chime in here. It would be great if you could get this going, and perhaps we could ask you to collaborate on providing some documentation about your endeavours on the fieldtrip wiki in due time. Best wishes, Jan-Mathijs > Many thanks if you are able to help me. > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sun May 1 18:52:19 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:52:19 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? In-Reply-To: References: Message-ID: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon May 2 12:06:20 2016 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 2 May 2016 12:06:20 +0200 Subject: [FieldTrip] FT clusterplot Message-ID: Dear all, I hope this email finds you well. I had a statistics results that I would like to use ft_clusterplot to plot the significant clusters. However, I'm experiencing some difficulties to specific the configuration. >From the ft_clusterplot.m, I noticed that the function is able to squeeze the 3D matrix into a 2D matrix for plotting purposes. My current statistics results is in "chan-freq-time" dimension, and I was wondering how I could specific the configuration to select a specific frequency to plot. Can someone please help? Or do I have to adjust the statistics results variable manually such that it has a "chan-time" dimension for plotting? Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.brehm at uu.nl Mon May 2 15:08:18 2016 From: j.brehm at uu.nl (Brehm, J. (Julia)) Date: Mon, 2 May 2016 13:08:18 +0000 Subject: [FieldTrip] What exactly does filterpadding do? Message-ID: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> Dear list, I am having problems applying filterpadding when using ft_artifact_zvalue. Could someone please explain what exactly the effect of filterpadding is, and in which cases I can apply it and in which not? I intended to use it to avoid edge effects in the artifact detection. However, I get the following warning (only when applying fltpadding, my data does not actually contain NaNs): Warning: data contains NaNs, no filtering or preprocessing applied > In ft_warning (line 181) In preproc (line 282) In ft_artifact_zvalue (line 292) These are my settings: cfg = []; cfg.trl = temptrl; % all trials cfg.artfctdef.zvalue.channel = channel{ch}; % single channel cfg.artfctdef.zvalue.cutoff = 3; cfg.artfctdef.zvalue.fltpadding = 0.1; cfg.artfctdef.zvalue.bpfilter = 'yes'; cfg.artfctdef.zvalue.bpfilttype = 'but'; cfg.artfctdef.zvalue.bpfreq = [1 3]; cfg.artfctdef.zvalue.bpfiltord = 2; cfg.artfctdef.zvalue.hilbert = 'yes'; Thanks! Best, Julia -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Mon May 2 15:14:09 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Mon, 2 May 2016 15:14:09 +0200 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? Message-ID: Hello, could you please explain the purpose of ft_sourcedescriptives() in EEG source analysis? The documentation is very brief (“computes descriptive parameters of the source analysis results”) and I haven't found a single tutorial with proper explanation. I found it used here but without any explanation whatsoever. Thank you! Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Mon May 2 15:24:40 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Mon, 2 May 2016 15:24:40 +0200 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> Message-ID: Dear Julia, >From the FAQ section: http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts I hope that helps, Diego On 2 May 2016 at 15:08, Brehm, J. (Julia) wrote: > Dear list, > > I am having problems applying filterpadding when using ft_artifact_zvalue. > > Could someone please explain what exactly the effect of filterpadding is, > and in which cases I can apply it and in which not? > > I intended to use it to avoid edge effects in the artifact detection. > However, I get the following warning (only when applying fltpadding, my > data does not actually contain NaNs): > > Warning: data contains NaNs, no filtering or preprocessing applied > > In ft_warning (line 181) > In preproc (line 282) > In ft_artifact_zvalue (line 292) > > These are my settings: > cfg = []; > cfg.trl = temptrl; % all trials > > cfg.artfctdef.zvalue.channel = channel{ch}; % single channel > cfg.artfctdef.zvalue.cutoff = 3; > cfg.artfctdef.zvalue.fltpadding = 0.1; > > cfg.artfctdef.zvalue.bpfilter = 'yes'; > cfg.artfctdef.zvalue.bpfilttype = 'but'; > cfg.artfctdef.zvalue.bpfreq = [1 3]; > cfg.artfctdef.zvalue.bpfiltord = 2; > cfg.artfctdef.zvalue.hilbert = 'yes'; > > Thanks! > > Best, > Julia > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Mon May 2 15:27:23 2016 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Mon, 2 May 2016 15:27:23 +0200 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? In-Reply-To: References: Message-ID: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > Dear Andreas, > > Have you tried it with a more recent version? Also, I would recommend not > to use ft_sourcegrandaverage, but to use the syntax > ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the > single subject data represented in a cell-array of structures, with source1 > for condition 1 and source2 for condition 2. > > Best, > Jan-Mathijs > > > > > On 24 Apr 2016, at 18:36, Andreas Sauer wrote: > > Dear all, > > unfortunately, I am having problems to run source statistics on ERF > mismatch negativity data (recorded with a 4D system). > > With the following data structure as input (output from > ft_sourcegrandaverage), fieldtrip gives a warning that it „could not > determine dimord of „pow“ in the following data“ > > pow: [16x37696 double] > dim: [31 38 32] > inside: [37696x1 logical] > pos: [37696x3 double] > time: [1x900 double] > cfg: [1x1 struct] > > and later throws an error that „field „pow“ (is) not present in data“. I > checked the ft_sourcestatistic script step by step and found out that > ft_selectdata removes it after being called by ft_sourcestatistics. > > I am using the fieldtrip version from 15/05/2015. I also tried with older > versions, one from late 2014 and late 2013, but nothing worked. > > Unfortunately, since ft_selectdata removes the field "pow" from the data > during the call to ft_sourcestatistic, I can’t put it back in to the > structure. > > Any help with this (esp. why „pow“ is being removed) is highly appreciated! > > Thanks and best wishes, > > Andreas > > > > -- > Dipl.-Psych. Andreas Sauer > Max Planck Institute for Brain Research > Deutschordenstraße 46 > 60528 Frankfurt am Main > Germany > > T: +49 69 96769 278 > F: +49 69 96769 327 > Email: sauer.mpih at gmail.com > www.brain.mpg.de > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.brehm at uu.nl Mon May 2 16:31:43 2016 From: j.brehm at uu.nl (Brehm, J. (Julia)) Date: Mon, 2 May 2016 14:31:43 +0000 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl>, Message-ID: <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> Dear Diego, yes, thank you, I've seen that already. Unfortunately this does not really help me. Apparently filtering is not even applied in my case (as the warning says). It seems that the NaNs are introduced in ft_fetch_data, shouldn't these be replaced by zeros where it's not filled by actual data when applying filterpadding? I assume it does that at some other point I couldn't find!? Furthermore, in the interactive mode one can see that the z-values mimic the data in the first and last trial of the dataset. This leads to the detection of artifacts which are none and missing real artifacts (due to very large effects in those two trials). I have attached a screenshot to illustrate what I mean. As far as I understand filterpadding uses zero-padding, meaning I can use it on segmented (not continuous) data, correct? So why does this have such a large effect on my whole data instead of simply getting rid of edge effects? Sorry if I am missing something obvious. Best, Julia ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Diego Lozano-Soldevilla [dlozanosoldevilla at gmail.com] Sent: Monday, May 02, 2016 3:24 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] What exactly does filterpadding do? Dear Julia, >From the FAQ section: http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts I hope that helps, Diego On 2 May 2016 at 15:08, Brehm, J. (Julia) > wrote: Dear list, I am having problems applying filterpadding when using ft_artifact_zvalue. Could someone please explain what exactly the effect of filterpadding is, and in which cases I can apply it and in which not? I intended to use it to avoid edge effects in the artifact detection. However, I get the following warning (only when applying fltpadding, my data does not actually contain NaNs): Warning: data contains NaNs, no filtering or preprocessing applied > In ft_warning (line 181) In preproc (line 282) In ft_artifact_zvalue (line 292) These are my settings: cfg = []; cfg.trl = temptrl; % all trials cfg.artfctdef.zvalue.channel = channel{ch}; % single channel cfg.artfctdef.zvalue.cutoff = 3; cfg.artfctdef.zvalue.fltpadding = 0.1; cfg.artfctdef.zvalue.bpfilter = 'yes'; cfg.artfctdef.zvalue.bpfilttype = 'but'; cfg.artfctdef.zvalue.bpfreq = [1 3]; cfg.artfctdef.zvalue.bpfiltord = 2; cfg.artfctdef.zvalue.hilbert = 'yes'; Thanks! Best, Julia _______________________________________________ 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: fltpadding_demo.jpg Type: image/jpeg Size: 52120 bytes Desc: fltpadding_demo.jpg URL: From kaitlynlitcofsky at gmail.com Mon May 2 22:06:17 2016 From: kaitlynlitcofsky at gmail.com (Kaitlyn Litcofsky) Date: Mon, 2 May 2016 16:06:17 -0400 Subject: [FieldTrip] Behavior-power correlations Message-ID: Hello, I'm trying to conduct behavior-power correlations. This topic has been discussed a few times before ( http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2015-October/009720.html), but I'm still having issues getting it to work. I'm working with a grand averaged structure of 25 individuals' frequency data, and trying to correlate it with a proficiency measurement (one value per person). If I follow the instructions on the tutorial ( http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables), I get an error that "uvar must be specified for dependent samples statistics". I tried various permutations of the design including a uvar got the error "Invalid specification of the design array." When I tried a suggestion in the previous email threads to ​create a dummy variable that is a copy of my frequency data, and replace the power spectrum with the behavioral measure, and create a design with their code: cfg.design = []; cfg.design(1,:) = [ones(1,length(BehVar)) 2*ones(1,length(BehVar))]; cfg.design(2,:) = [1:length(BehVar) 1:length(BehVar)]; I get the error "the length of the design matrix (2) does not match the number of observations in the data (25)". My question is this: what is the appropriate design array for computing a correlation with ft_statfun_correlationT? Is the behavioral variable supposed to be part of the design or must it be part of a dummy structure designed to be similar in size and structure to the frequency data? Alternatively, is there a way to get, for every individual in the grand average, one value representing the average power for, e.g., 300-600ms in the 4-7Hz range? Thank you very much for your help, Kaitlyn Litcofsky -- Kaitlyn Litcofsky Graduate Student, Cognitive Psychology 006 Moore Building Pennsylvania State University University Park, PA 16802 Email: kal378 at psu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon May 2 22:41:34 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 2 May 2016 13:41:34 -0700 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: References: Message-ID: Hi Kaitlyn, My question is this: what is the appropriate design array for computing a > correlation with ft_statfun_correlationT? Is the behavioral variable > supposed to be part of the design or must it be part of a dummy structure > designed to be similar in size and structure to the frequency data? > It's really as described on the page you referred to ( http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables ) n1 = 3; % n1 is the number of subjects design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. cfg.design = design; cfg.ivar = 1; stat = ft_freqstatistics(cfg, data_brain{:}); where data_brain is a multiple subjects structure in case you're doing this at the second/group level (i.e. correlate a behavioral variable to a neural variable across subjects). Thus, a dummy variable is no longer needed. Alternatively, is there a way to get, for every individual in the grand > average, one value representing the average power for, e.g., 300-600ms in > the 4-7Hz range? > You may want to use ft_freqdescriptives for that, per subject. Best, Arjen > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Mon May 2 23:54:48 2016 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 02 May 2016 17:54:48 -0400 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: References: Message-ID: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> Hi Kaitlyn, Which version of Fiedtrip you are using? I got similar error message when I used old version, but no error when I updated to latest version. Hope this will help. Xiaoming >>> Arjen Stolk 5/2/2016 4:41 PM >>> Hi Kaitlyn, My question is this: what is the appropriate design array for computing a correlation with ft_statfun_correlationT? Is the behavioral variable supposed to be part of the design or must it be part of a dummy structure designed to be similar in size and structure to the frequency data? It's really as described on the page you referred to (http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables) n1 = 3; % n1 is the number of subjects design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. cfg.design = design; cfg.ivar = 1; stat = ft_freqstatistics(cfg, data_brain{:}); where data_brain is a multiple subjects structure in case you're doing this at the second/group level (i.e. correlate a behavioral variable to a neural variable across subjects). Thus, a dummy variable is no longer needed. Alternatively, is there a way to get, for every individual in the grand average, one value representing the average power for, e.g., 300-600ms in the 4-7Hz range? You may want to use ft_freqdescriptives for that, per subject. Best, Arjen -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaitlynlitcofsky at gmail.com Tue May 3 02:48:02 2016 From: kaitlynlitcofsky at gmail.com (Kaitlyn Litcofsky) Date: Mon, 2 May 2016 20:48:02 -0400 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> References: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming and Arjen, After updating to the latest Fieldtrip, the code from the tutorial worked. Thank you so much! Kaitlyn On Mon, May 2, 2016 at 5:54 PM, Xiaoming Du wrote: > Hi Kaitlyn, > > Which version of Fiedtrip you are using? > > I got similar error message when I used old version, but no error when I > updated to latest version. > > Hope this will help. > > Xiaoming > > > >>> Arjen Stolk 5/2/2016 4:41 PM >>> > Hi Kaitlyn, > > My question is this: what is the appropriate design array for computing a >> correlation with ft_statfun_correlationT? Is the behavioral variable >> supposed to be part of the design or must it be part of a dummy structure >> designed to be similar in size and structure to the frequency data? >> > > It's really as described on the page you referred to ( > http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables > ) > > n1 = 3; % n1 is the number of subjects > design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. > > cfg.design = design; > cfg.ivar = 1; > > stat = ft_freqstatistics(cfg, data_brain{:}); > > where data_brain is a multiple subjects structure in case you're doing > this at the second/group level (i.e. correlate a behavioral variable to a > neural variable across subjects). Thus, a dummy variable is no longer > needed. > > Alternatively, is there a way to get, for every individual in the grand >> average, one value representing the average power for, e.g., 300-600ms in >> the 4-7Hz range? >> > > You may want to use ft_freqdescriptives for that, per subject. > > Best, Arjen > >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Kaitlyn Litcofsky Graduate Student, Cognitive Psychology 006 Moore Building Pennsylvania State University University Park, PA 16802 Email: kal378 at psu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Tue May 3 10:23:48 2016 From: mkshiri at gmail.com (shiri makov) Date: Tue, 3 May 2016 11:23:48 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' Message-ID: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that *sometimes *when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Tue May 3 11:29:27 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Tue, 3 May 2016 11:29:27 +0200 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> Message-ID: Dear Julia, The filtering not being applied might be related to the data samples you're providing the bandpass filtering. Several things: Keep in mind: You're creating a bandpass butterworth filter [1-3hz] with filter order 2. This means you'll need enough data to filter so low frequencies. Briefly, the butterworth filter is an infinite impulse response filter (IIR) that filters the data recursively (not by convolution) and the filter order means the amount of samples from input and output the filter will use (please go http://www.dspguide.com/CH14.PDF if this is not clear). The higher the filter order, the sharper the frequency response, the stronger the "ringing". The finite impulse response (FIR) filters, by the contrary, are implemented by convolution and the filter order means the length of the filter-kernel. The higher the filter order, the higher the frequency resolution, the lower the temporal resolution, the longer the filter kernel. Then you'll have to make sure your filter order is appropriate given the length of your data, which is not intuitive for IIR filters. I'm not an expert on filtering and I find the Widmann, Schröger & Maess recent paper an excellent guide: http://www.ncbi.nlm.nih.gov/pubmed/25128257 To dig into this issue, you can apply the very same filter settings with ft_preprocessing separately and check what's happening before and after. Then you can discard if the filtering is what is creating the problem. Check: - Make sure the epoching you're using in cfg.trl = temptrl; is not too short for your filtering. My hunch is that the NaNs might be related to this - I don't know what kind of artifacts are you chasing filtering so low (drifts?) but the artifact padding you're using might be too short (artpadding = 0.1;) Regarding the very large effects in those two trials, I'd be pragmatic and I would delete them or I'd cut the edges that are problematic for you... I hope that helps! Diego On 2 May 2016 at 16:31, Brehm, J. (Julia) wrote: > Dear Diego, > > yes, thank you, I've seen that already. Unfortunately this does not really > help me. > > Apparently filtering is not even applied in my case (as the warning says). > It seems that the NaNs are introduced in ft_fetch_data, shouldn't these be > replaced by zeros where it's not filled by actual data when applying > filterpadding? I assume it does that at some other point I couldn't find!? > > Furthermore, in the interactive mode one can see that the z-values mimic > the data in the first and last trial of the dataset. This leads to the > detection of artifacts which are none and missing real artifacts (due to > very large effects in those two trials). I have attached a screenshot to > illustrate what I mean. > > As far as I understand filterpadding uses zero-padding, meaning I can use > it on segmented (not continuous) data, correct? So why does this have such > a large effect on my whole data instead of simply getting rid of edge > effects? > > Sorry if I am missing something obvious. > > Best, > Julia > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Diego Lozano-Soldevilla [dlozanosoldevilla at gmail.com] > *Sent:* Monday, May 02, 2016 3:24 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] What exactly does filterpadding do? > > Dear Julia, > > From the FAQ section: > > > http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work > > > http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts > > > I hope that helps, > > Diego > > > > On 2 May 2016 at 15:08, Brehm, J. (Julia) > > wrote: > >> Dear list, >> >> I am having problems applying filterpadding when >> using ft_artifact_zvalue. >> >> Could someone please explain what exactly the effect of filterpadding is, >> and in which cases I can apply it and in which not? >> >> I intended to use it to avoid edge effects in the artifact detection. >> However, I get the following warning (only when applying fltpadding, my >> data does not actually contain NaNs): >> >> Warning: data contains NaNs, no filtering or preprocessing applied >> > In ft_warning (line 181) >> In preproc (line 282) >> In ft_artifact_zvalue (line 292) >> >> These are my settings: >> cfg = []; >> cfg.trl = temptrl; % all trials >> >> cfg.artfctdef.zvalue.channel = channel{ch}; % single channel >> cfg.artfctdef.zvalue.cutoff = 3; >> cfg.artfctdef.zvalue.fltpadding = 0.1; >> >> cfg.artfctdef.zvalue.bpfilter = 'yes'; >> cfg.artfctdef.zvalue.bpfilttype = 'but'; >> cfg.artfctdef.zvalue.bpfreq = [1 3]; >> cfg.artfctdef.zvalue.bpfiltord = 2; >> cfg.artfctdef.zvalue.hilbert = 'yes'; >> >> Thanks! >> >> Best, >> Julia >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> 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 Christoph.Kayser at glasgow.ac.uk Tue May 3 12:16:19 2016 From: Christoph.Kayser at glasgow.ac.uk (Christoph Kayser) Date: Tue, 3 May 2016 10:16:19 +0000 Subject: [FieldTrip] Post-Doc position in multisensory neuroimaging (MEG/EEG) studies at the Centre for Cognitive Neuroimaging, Glasgow, UK Message-ID: <330A4F21C29C8549A927275C10C1ADFB1FE87F73@CMS08-01.campus.gla.ac.uk> We are recruiting for 3 year post-doc position in the context of the EU-funded ERC project "Understanding the neural mechanisms of multisensory perception based on computational principles". The integrative neuroscience laboratory is dedicated to understanding the integration of multisensory information in the brain. The planned studies use state of the art imaging methodology (MEG, and possibly fMRI or EEG) combined with quantitative data analysis to better understand when and how the brain combines different sensory channels to inform perception. Further details about our research can be found on our website (http://inl.ccni.gla.ac.uk/). More details about the position and the link to the recruitment page can be found here http://www.jobs.ac.uk/job/ANO030/research-assistant-associate/ Job Ref: 013172 Closing data: 29th May 2016 The job requires all aspects of study design, implementation, data collection, data analysis as well as assisting in the supervision of junior lab members, presenting at conferences and participating in the writing up of the results. Applicants should have (or expect to receive in the near future) a PhD in neuroscience, cognitive science, psychology, mathematics, or a relevant discipline. We are especially interested in devotion to advanced quantitative data analysis including the capabilities to program or modify analysis code and the ideal applicant will have a strong analytical background and direct experience using MATLAB software. Experience with neuroimaging is required. Any applicant should have enthusiasm, and a clear, demonstrable capacity for acquiring expertise in these techniques. This position is funded for up to 3 years from November 2016, at UK RA Salary Grade 6 or 7 depending on experience. Questions may be directed to the PI: Christoph.Kayser at glasgow.ac.uk I'm sorry for multiple postings! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Tue May 3 13:07:18 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Tue, 3 May 2016 13:07:18 +0200 Subject: [FieldTrip] Cluster Permutation Message-ID: An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Tue May 3 15:34:14 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Tue, 3 May 2016 13:34:14 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <626588319.5432301.1462282454935.JavaMail.yahoo@mail.yahoo.com> Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Wednesday, February 10, 2016 11:20 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila (and Arjen): I just tried this out with a sample file, it looks like you can get this information if you use ft_read_header() rather than ft_preprocessing. The cfg structure I got from ft_preprocessing didn't contain the time-of-day information, but the structure returned from ft_read_header did: >> hdr = ft_read_header( cfg.dataset ); hdr.orig.T0 ans =         2005           9          15          10          18          42 I assume that's showing year, month, day, hour, minute (presumably based on the clock of the computer that made the recording). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/  Message: 3 Date: Tue, 9 Feb 2016 15:40:35 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1722640118.1244946.1455032435939.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Thanks.I need to retrieve the time when the recordings occure and I don't see it. I get the Fs but no more.I am using this code : cfg = [];cfg.trl = [1 1000000 0];%cfg.trl = [100001 2000000 0];%cfg.trialdef.triallength = 5;cfg.dataset =fileName; %'For leila.edf';cfg= ft_definetrial( cfg );cfg.continuous = 'yes'; datastr = ft_preprocessing(cfg);data=datastr.trial{1,1};chanls=datastr.label;Fs=datastr.fsample; and getting this?datastr =? ? ? ? ? ? ?hdr: [1x1 struct]? ? ? ? ?label: {65x1 cell}? ? ? ? ? time: {[1x1000000 double]}? ? ? ? ?trial: {[65x1000000 double]}? ? ? ?fsample: 1024? ? sampleinfo: [1 1000000]? ? ? ? ? ?cfg: [1x1 struct] cfg =? ? ? ? ? ? ? ? ? ? trl: [1 1000000 0]? ? ? ? ? ? ? dataset: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? trackconfig: 'off'? ? ? ? ? checkconfig: 'loose'? ? ? ? ? ? checksize: 100000? ? ? ? ?showcallinfo: 'yes'? ? ? ? ? ? ? ? debug: 'no'? ? outputfilepresent: 'overwrite'? ? ? ? trackcallinfo: 'yes'? ? ? ? trackdatainfo: 'no'? ? ? ? ? ? ?callinfo: [1x1 struct]? ? ? ? ? ? ? version: [1x1 struct]? ? ? ? ? ? ?datafile: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? ?headerfile: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? ?dataformat: 'edf'? ? ? ? ?headerformat: 'edf'? ? ? ? ? ? ? ? event: []? ? ? ? ? ?continuous: 'yes' ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Arjen Stolk  To: FieldTrip discussion list  Sent: Tuesday, February 9, 2016 3:32 PM  Subject: Re: [FieldTrip] importing large edf data Hi both,There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head.Arjen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 4 10:05:19 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 10:05:19 +0200 Subject: [FieldTrip] Fwd: Open PhD position in MEG studies of autism spectrum disorders... References: <61AE7C6258345149ADC0BA3AD9DA6E6201DD364CB0@exchccr1.neuro.gu.se> Message-ID: FYI Begin forwarded message: > From: Justin Schneiderman > Subject: Open PhD position in MEG studies of autism spectrum disorders... > Date: 4 May 2016 08:44:30 GMT+2 > To: Justin Schneiderman > > Hej! > My apologies if you receive this more than once. Please forward this to students interested in PhD studies in neuroscience, magnetoencephalography (MEG), neuroimaging, and autism spectrum disorders! > > We have an open PhD position at the Institute of Neuroscience and Physiology and the Gillberg Neuropsychiatry Centre here at the University of Gothenburg. The position is salaried and will be attached to our ongoing MEG neuroimaging study of autism spectrum disorders in connection to the Karolinska Institute's NatMEG center. For more information, please follow this link: > http://www.gu.se/english/about_the_university/announcements-in-the-job-application-portal/?languageId=100001&disableRedirect=true&returnUrl=http%3A%2F%2Fwww.gu.se%2Fomuniversitetet%2Faktuellt%2Fledigaanstallningar%2F%3Fid%3D19144%26Dnr%3D755868%26Type%3DS&Dnr=755868&Type=S > > If the link above doesn't work, then go to http://www.gu.se/english -> "About the university" -> "Job opportunities" -> "Doctoral student/ assistant/ teaching assistant" -> "PhD student position in medical science - Neurophysiological markers for autism (UR 2016/238)" > > Note: The deadline for applications is next Tuesday the 10th of May. > > Thanks! > -Justin > MedTech West > http://www.medtechwest.se > Institute of Neuroscience and Physiology > Sahlgrenska Academy & University of Gothenburg -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed May 4 10:51:24 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 08:51:24 +0000 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? In-Reply-To: References: Message-ID: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> Dear Harold, What extra documentation are you looking for? I think that a good start would be to read the description in the documentation part of the m-file itself (i.e. the stuff you get when typing ‘help ft_sourcedescriptives’). Note: if you don’t think you need the function, it’s alright not to use it :o). Best, Jan-Mathijs On 02 May 2016, at 15:14, Harold Cavendish > wrote: Hello, could you please explain the purpose of ft_sourcedescriptives() in EEG source analysis? The documentation is very brief (“computes descriptive parameters of the source analysis results”) and I haven't found a single tutorial with proper explanation. I found it used here but without any explanation whatsoever. Thank you! Harold _______________________________________________ fieldtrip 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 Wed May 4 11:08:05 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:08:05 +0000 Subject: [FieldTrip] FT clusterplot In-Reply-To: References: Message-ID: <2FCC2C77-A068-4B4B-8799-04491D7B2ACC@donders.ru.nl> Dear Hweeling, I am not a big fan of this function, and I would strongly recommend not to talk about ‘significant clusters’: using cluster-based permutation tests allows for inference about the difference across conditions/groups, based on a heuristic involving the estimation of clusters from the thresholded observed (and permuted) data, yet the clusters themselves are just a byproduct of this inferential procedure. >From what I can read in the code (which you also had a look at), indeed at some point a squeeze operation is performed in case the input data contains both a time and freq axis. Yet, note that the squeeze operation only has an effect if the freq dimension (the second dimension in the matrix) is singleton, i.e. if there’s only a single frequency bin in the data. In other words, even if the function does not crash when inputting time-frequency data, it will most likely produce ‘incorrect’ visualizations, or at least you think you are looking at something that will be different from the thing that you are actually looking at. The only way around this would be to do a pre-selection of a certain frequency range prior to calling ft_clusterplot. This preselection can be achieved with ft_selectdata in general (use cfg.frequency, and cfg.avgoverfreq), but will not likely produce the required output for the ‘posclusterslabelmat’ and ‘negclusterslabelmat’ fields, that are required for ft_clusterplot. At least, not if you select multiple frequency bins. Thus, in summary, you can pull this off, if you first use ft_selectdata, but in that case ensure that you select a single frequency bin. Best, Jan-Mathijs > On 02 May 2016, at 12:06, Hwee Ling Lee wrote: > > Dear all, > > I hope this email finds you well. > > I had a statistics results that I would like to use ft_clusterplot to plot the significant clusters. However, I'm experiencing some difficulties to specific the configuration. > > From the ft_clusterplot.m, I noticed that the function is able to squeeze the 3D matrix into a 2D matrix for plotting purposes. My current statistics results is in "chan-freq-time" dimension, and I was wondering how I could specific the configuration to select a specific frequency to plot. > > Can someone please help? > > Or do I have to adjust the statistics results variable manually such that it has a "chan-time" dimension for plotting? > > Thanks! > > Cheers, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 4 11:17:53 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:17:53 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? References: Message-ID: Hi Andreas, I think that the reason why ft_selectdata removes the ‘pow’-field is due to its overzealous bookkeeping. The data-structure you mentioned in a previous e-mail is not fully internally consistent (probably not your fault, by the way). Although it lacks a proper ‘dimord’ field, which specifies how the primary numeric data should be interpreted (in your case you probably want it to be: ‘subj_pos’), it also contains a ‘time’ field. In the absence of the dimord, FT is trying to create one from the data structure, and I suspect that the presence of the time-field will lead to something like ‘subj_pos_time’ or so. Subsequently, ft_seletdata only passes on those numeric data fields that are consistent with this dimord, which does not include pow. Anyway, my hunch is that if you do a rmfield(data,’time’), prior to calling ft_sourcestatistics the old-fashioned way (i.e. with the data being passed through ft_sourcegrandaverage), it may work as well. Best, Jan-Mathijs On 02 May 2016, at 15:27, Andreas Sauer > wrote: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) >: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip 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 Wed May 4 11:18:09 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:18:09 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? References: Message-ID: Hi Andreas, I think that the reason why ft_selectdata removes the ‘pow’-field is due to its overzealous bookkeeping. The data-structure you mentioned in a previous e-mail is not fully internally consistent (probably not your fault, by the way). Although it lacks a proper ‘dimord’ field, which specifies how the primary numeric data should be interpreted (in your case you probably want it to be: ‘subj_pos’), it also contains a ‘time’ field. In the absence of the dimord, FT is trying to create one from the data structure, and I suspect that the presence of the time-field will lead to something like ‘subj_pos_time’ or so. Subsequently, ft_seletdata only passes on those numeric data fields that are consistent with this dimord, which does not include pow. Anyway, my hunch is that if you do a rmfield(data,’time’), prior to calling ft_sourcestatistics the old-fashioned way (i.e. with the data being passed through ft_sourcegrandaverage), it may work as well. Best, Jan-Mathijs On 02 May 2016, at 15:27, Andreas Sauer > wrote: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) >: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lingwang at m.scnu.edu.cn Wed May 4 11:32:32 2016 From: lingwang at m.scnu.edu.cn (=?utf-8?B?TGluZyBXYW5n?=) Date: Wed, 4 May 2016 17:32:32 +0800 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Message-ID: Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Wed May 4 12:50:21 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Wed, 4 May 2016 10:50:21 +0000 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system In-Reply-To: References: Message-ID: <1462359023151.15592@cfin.au.dk> Dear Ling, Does your system consist of 148 magnetometors or gradiometers? In my previous lab at the University of Konstanz, we also had the Magnes 2500WH with 148 magnetometers. In our experience, the weights were not necessary for analyses at either the sensor or source level. If your system consists of gradiometers, however, maybe these weights would be necessary? If you really need those weights, I believe you can find them in the header structure, somewhere in data.hdr.orig. You will then need some knowledge on how to apply those weights. Cheers, Sarang ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Ling Wang Sent: Wednesday, May 4, 2016 11:32 AM To: fieldtrip Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 4 13:06:07 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 13:06:07 +0200 Subject: [FieldTrip] some issues with the sebserver hosting the wiki Message-ID: <79D7BF5F-97B6-436B-AA7C-1801AF32F7A1@donders.ru.nl> Dear community, The server that is also hosting the FieldTrip wiki (and some other Donders web sites) seems to have been under attack by hackers, trying to use it for sending email spam. We have not nailed down the issue yet. As a preventive measure we have blocked a whole list of suspicious IP addresses from accessing the FieldTrip wiki. If you cannot access the wiki any more, please let me know and I’ll unblock your IP address. Also if you notice anything unusual on the wiki (e.g. pages that youy think should not be there), please drop me a personal email. best regards, Robert From r.oostenveld at donders.ru.nl Wed May 4 15:38:37 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 15:38:37 +0200 Subject: [FieldTrip] Donders Institute Toolkit on Non-invasive Brain Stimulation (TMS, tDCS, tACS) References: <6711FBFF69C42F41B4FCD956BE3BE6663DC974DE@exprd01.hosting.ru.nl> Message-ID: <579BF03C-3E14-48C9-9AA2-D5A6DDE7486D@donders.ru.nl> Dear all, On June 14-17, 2016, the annual Donders Institute Toolkit on Non-invasive Brain Stimulation (TMS, tDCS, tACS) will take place in Nijmegen, the Netherlands. This intensive 4-day methods-focused course will feature hands-on sessions, demos, and lectures from Donders Institute affiliates and external Keynote Speakers, regarding fundamentals of TMS, tDCS, tACS and neuroimaging applications (EEG, MEG and fMRI), with a particular focus on TMS-EEG. See preliminary schedule in attachment and http://www.ru.nl/donders/agenda-news/tool-kits-cognitive/transcranial-brain/. _________________________ Ian Cameron, PhD Senior Researcher Donders Centre for Cognitive Neuroimaging visiting address: Kapittelweg 29, 6525 EN mailing address: P.O. Box 9101, NL-6500 HB Nijmegen, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Toolkit of Cognitive Neuroscience2016_BrainStim_preliminary.compressed.pdf Type: application/pdf Size: 167190 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From lingwang at m.scnu.edu.cn Wed May 4 16:27:43 2016 From: lingwang at m.scnu.edu.cn (=?utf-8?B?TGluZyBXYW5n?=) Date: Wed, 4 May 2016 22:27:43 +0800 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system In-Reply-To: <1462359023151.15592@cfin.au.dk> References: <1462359023151.15592@cfin.au.dk> Message-ID: Dear Sarang, Thanks for your reply. Our MEG system consists of 148 magnetometers. I searched the MEG papers published by researchers in your previous department at the University of Konstanz, and found two papers by Staudigl, Hanslmayr and colleagues (2013, 2015), in which the MEG data were collected with Magnes 2500WH 148-channel system and analyzed by FieldTrip. I'm happy about the papers. It seems that we can also use our MEG system to perform experiments. I'm new to the MEG field and am learning. Actually, I'm not sure about what the balancing weights are for. I read some scripts/functions of the FieldTrip toolbox, such as ft_read_header, bti2grad and read_4d_hdr. It says in the bti2grad function, "BTI2GRAD converts a 4D header to a gradiometer structure that can be understood by FieldTrip and Robert Oostenveld's low-level forward and inverse routines." So my understanding is that the balancing weights stored in hdr.grad is important for carrying out analyses at the source level? Or, the balancing weights are only necessary for gradieometers system but not for magnetometers system? Thanks again for the information. Best wishes, Ling ------------------ Original ------------------ From: "Sarang S. Dalal"; Date: Wed, May 4, 2016 06:50 PM To: "FieldTrip discussion list"; Subject: Re: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear Ling, Does your system consist of 148 magnetometors or gradiometers? In my previous lab at the University of Konstanz, we also had the Magnes 2500WH with 148 magnetometers. In our experience, the weights were not necessary for analyses at either the sensor or source level. If your system consists of gradiometers, however, maybe these weights would be necessary? If you really need those weights, I believe you can find them in the header structure, somewhere in data.hdr.orig. You will then need some knowledge on how to apply those weights. Cheers, Sarang From: fieldtrip-bounces at science.ru.nl on behalf of Ling Wang Sent: Wednesday, May 4, 2016 11:32 AM To: fieldtrip Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseluisblues at gmail.com Wed May 4 19:30:53 2016 From: joseluisblues at gmail.com (Jose) Date: Wed, 4 May 2016 19:30:53 +0200 Subject: [FieldTrip] integer frequencies in TFR Message-ID: dear list, I'm analysing CTF MEG data (sampling rate 1250 Hz). I'm epoching my data from -0.5 sec to 2.8 sec relative my marker of interest. % define the trial matrix trlFile = zeros(length(markers3), 3); for i_trial = 1:length(markers3) trlFile(i_trial,1) = markers3(i_trial,2) -625; % 0.5*1250 % SR = 1250, trlFile(i_trial,2) = markers3(i_trial,2) +3500; % 2.8*1250 % SR = 1250, trlFile(i_trial,3) = -625; trlFile(i_trial,4) = markers3(i_trial,1); end Once I pre-process the data, I run TF analyses with the wavelet method cfg = [ ]; cfg.trials = find(data2.trialinfo(:,1) == i_condition); cfg.channel = 'MEG'; cfg.method = 'wavelet'; cfg.width = 5; cfg.output = 'pow'; cfg.foi = 1:1:30; cfg.toi = -0.5:0.05:2.8; TFdata = ft_freqanalysis(cfg, data1); In the .freq field I realize that my frequency are not exact integers 0.907801418439716 2.11820330969267 3.02600472813239 3.93380614657210 5.14420803782506 6.05200945626478 6.95981087470449 7.86761229314421 9.07801418439716 9.98581560283688 ... I checked: http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies So, I decide to reduce one sample in my trial definition (so trlFile(i_trial,2) = markers3(i_trial,2) +3500-1; % 2.8*1250 % SR = 1250,) But, still I'm not having integers, 0.909090909090909 2.12121212121212 3.03030303030303 3.93939393939394 5.15151515151515 6.06060606060606 6.96969696969697 7.87878787878788 9.09090909090909 10 ... I suspect I can't obtain integer frequencies in my TFR due to my frequency sampling, Is there any recommendation regarding the frequencies used to compute the TFRs? Would that pose some issues for subsequent processing steps? thanks Jose -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Thu May 5 16:34:40 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Thu, 5 May 2016 14:34:40 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> References: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> Message-ID: <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com>  Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Arjen Stolk To: FieldTrip discussion list Sent: Tuesday, February 9, 2016 3:32 PM Subject: Re: [FieldTrip] importing large edf data Hi both,There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head.Arjen On Feb 9, 2016, at 3:19 AM, Stephen Politzer-Ahles wrote: Hi Leila, I'm sorry but I'm afraid I have not quite understood your issue. Can you give some more detail about what the problem is? In general, the fieldtrip structure output by ft_preprocessing() should have a .time field (indicating what timepoint during the epoch each sample corresponds to) and an .fsample field indicating the sampling rate (which you would also be able to use to figure out the time of each sample). 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: Mon, 8 Feb 2016 11:51:05 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1195829915.655104.1454932265573.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Stephen:I just happen to realize that when I load the data as you mentioned below, I can not get hold of the real time of the EEG file. (e.g.18:32:43 ).Could you please point out as how I could retrieve the real time of the EEG file after loading. Thanks a lot.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: 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 _______________________________________________ fieldtrip 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 Thu May 5 16:35:07 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Thu, 5 May 2016 14:35:07 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <261952317.6531678.1462458907903.JavaMail.yahoo@mail.yahoo.com>  Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ 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 gina.joue at univr.it Thu May 5 17:40:35 2016 From: gina.joue at univr.it (gj) Date: Thu, 5 May 2016 17:40:35 +0200 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572B6719.20906@univr.it> References: <572B6711.1050906@univr.it> <572B6719.20906@univr.it> Message-ID: <572B6973.4050104@univr.it> Hi again, I'm really stymied over this problem and can't move on with my analyses...help? Pretty please? Thank you in advance! Gina From jan.schoffelen at donders.ru.nl Thu May 5 19:11:32 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 17:11:32 +0000 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572B6973.4050104@univr.it> References: <572B6711.1050906@univr.it> <572B6719.20906@univr.it> <572B6973.4050104@univr.it> Message-ID: Hi Gina, In general I think that you really should provide a bit more information. I at least don’t remember what your problem is all about, and if you would like people to think along (who by the way all do this on a voluntary basis), you should really give us something to work on, and present things on a silver platter, rather than expecting us to dig through our (no doubt extensive) e-mail archives, which moreover relies on the assumption that we still have your earlier e-mails handy. This being said, I dug through my archive, and saw that I already replied to an e-mail of yours that has the same subject header. Here’s my earlier reply: ++++++++++++++++++++++++++++++++++++ Begin forwarded message: From: Jan Mathijs Schoffelen > Subject: Re: [FieldTrip] ft_source2sparse usage for EEG data Date: 11 April 2016 at 15:05:21 GMT+2 To: FieldTrip discussion list > Hi Gina, A dimensionality of 92232 ( ^ 2) suggests that you have 28 times the number of inside dipoles. I suspect a interaction between FieldTrip’s internal data bookkeeping and perhaps your specification of the input data/cfg. Where does this factor of 28 come from? Best, Jan-Mathijs ++++++++++++++++++++++++++++++++++++++++++ As you can see, this reply contained a question, which as far as I am concerned has not been answered. In other words, the ball is in your court. Best, Jan-Mathijs On 05 May 2016, at 17:40, gj > wrote: Hi again, I'm really stymied over this problem and can't move on with my analyses...help? Pretty please? Thank you in advance! Gina _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From brungio at gmail.com Thu May 5 20:37:51 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Thu, 5 May 2016 19:37:51 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign Message-ID: <572B92FF.9090502@gmail.com> Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From brungio at gmail.com Thu May 5 20:43:30 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Thu, 5 May 2016 19:43:30 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <572B92FF.9090502@gmail.com> References: <572B92FF.9090502@gmail.com> Message-ID: <572B9452.3060004@gmail.com> Please ignore this. I just tried with the current FT version, and the problem disappeared. Bruno On 05/05/2016 19:37, Bruno L. Giordano wrote: > Hello, > > I am trying to run these commands on different matlab versions(2013 vs. > 2015) and using different FT versions (20141209 vs. 20160317; let's call > them 2014 vs. 2016). > > The code I run is as follows: > > mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); > > cfg=[]; > cfg.method='fiducial'; > cfg.coordsys='4d'; > cfg.fiducial.nas=[59 168 104]; > cfg.fiducial.lpa=[138 133 28]; > cfg.fiducial.rpa=[147 138 169]; > mri=ft_volumerealign(cfg,mri); > > hs=ft_read_headshape(headshapefilename); > % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an > error, see v > > cfg=[]; > cfg.method='headshape'; > cfg.headshape=hs; > > mrihs=ft_volumerealign(cfg,mri); > > Unless otherwise noted, the code fails when I quit the interactive > alignment window. > > It fails in the following cases (errors below): > Matlab: 2015; FT: 2016 > Matlab: 2015; FT: 2014 > Matlab: 2013; FT: 2016 > > and is successful only for > Matlab: 2013; FT: 2014 > > Did anyone experience similar problems? Is there a workaround? If not, > would it be complicated to estimate the transformation matrices myself > once I know the right scale/translation/rotation parameters? > > Thank you, > > Bruno > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2013; FT: 2016 > Matlab: 2013; FT: 2016 > Fails when quitting interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Error using cell/ismember>cellismemberR2012a (line 193) > Input A of class cell and input B of class cell must be cell arrays of > strings, unless one is a string. > > Error in cell/ismember (line 57) > [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); > > Error in ft_senstype (line 303) > if (mean(ismember(ft_senslabel('ant128'), sens.label)) > > 0.8) > > Error in ft_datatype_sens (line 138) > ismeg = ft_senstype(sens, 'meg'); > > Error in ft_checkconfig (line 250) > cfg.elec = ft_datatype_sens(cfg.elec); > > Error in ft_interactiverealign (line 71) > cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', > 'headmodel'}); > > Error in ft_volumerealign (line 691) > tmpcfg = ft_interactiverealign(tmpcfg); > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2015; FT: 2016 > Matlab: 2015; FT: 2016 > hs.pnt=hs.pos; %required or will give another error > Fails when quitting interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Error using * > Inner matrix dimensions must agree. > > Error in ft_sourceinterpolate (line 328) > av = interpmat*fv; > > Error in ft_volumerealign (line 752) > smoothdist = ft_sourceinterpolate(tmpcfg, functional, > target); > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2015; FT: 2014 > Matlab: 2015; FT: 2014 > hs.pnt=hs.pos; %required or will give another error > Fails when creating the interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > ield assignment to a non-structure array object. > > Error in ft_plot_mesh (line 61) > bnd.pnt = bnd; > > Error in ft_interactiverealign>cb_redraw (line 282) > ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', > 'vertexsize',10); > > Error in ft_interactiverealign (line 126) > cb_redraw(gca); > > Error in ft_volumerealign (line 584) > tmpcfg = ft_interactiverealign(tmpcfg); > > > > > > > > > > > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Thu May 5 21:00:03 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 19:00:03 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> Message-ID: <700BDF87-ABB0-457C-BDA8-3BA3801DA4CB@donders.ru.nl> Hi Bruno, I think we have just been looking into it. And with just, I mean really just. I just merged a pull request from Roemer van der Meij into github.com/fieldtrip/fieldtrip (#141). This merge is related to a graphics issue that needs to be resolved differently for different matlab versions (in particular for matlab>=2014 it requires a different solution than matlab<2014). I wonder whether this is related to the problem you report. We did not do an comparable extensive sweep of the possible combinations (i.e. matlab versions and fieldtrip versions), so could you pull a copy from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that explains one way of getting yourself a local copy of the code. Thanks, Jan-Mathijs On 05 May 2016, at 20:37, Bruno L. Giordano > wrote: Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ _______________________________________________ fieldtrip 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 Thu May 5 21:05:48 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 19:05:48 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> Message-ID: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Hi Bruno, I think we have just been looking into it. And with just, I mean really just. I just merged a pull request from Roemer van der Meij into github.com/fieldtrip/fieldtrip (#141). This merge is related to a graphics issue that needs to be resolved differently for different matlab versions (in particular for matlab>=2014 it requires a different solution than matlab<2014). I wonder whether this is related to the problem you report. We did not do an comparable extensive sweep of the possible combinations (i.e. matlab versions and fieldtrip versions), so could you pull a copy from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that explains one way of getting yourself a local copy of the code. Thanks, Jan-Mathijs On 05 May 2016, at 20:37, Bruno L. Giordano > wrote: Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From brungio at gmail.com Fri May 6 10:22:58 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 09:22:58 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Message-ID: <572C5462.5070809@gmail.com> Hi, thanks, I will look into it! One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: hs.pnt=hs.pos; Cheers, Bruno On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Bruno, > > I think we have just been looking into it. And with just, I mean really > just. I just merged a pull request from Roemer van der Meij into > github.com/fieldtrip/fieldtrip > (#141). This merge is related to > a graphics issue that needs to be resolved differently for different > matlab versions (in particular for matlab>=2014 it requires a different > solution than matlab<2014). I wonder whether this is related to the > problem you report. > We did not do an comparable extensive sweep of the possible combinations > (i.e. matlab versions and fieldtrip versions), so could you pull a copy > from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that > explains one way of getting yourself a local copy of the code. > > Thanks, > > Jan-Mathijs > > > > > >> On 05 May 2016, at 20:37, Bruno L. Giordano > > wrote: >> >> Hello, >> >> I am trying to run these commands on different matlab versions(2013 >> vs. 2015) and using different FT versions (20141209 vs. 20160317; >> let's call them 2014 vs. 2016). >> >> The code I run is as follows: >> >> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >> >> cfg=[]; >> cfg.method='fiducial'; >> cfg.coordsys='4d'; >> cfg.fiducial.nas=[59 168 104]; >> cfg.fiducial.lpa=[138 133 28]; >> cfg.fiducial.rpa=[147 138 169]; >> mri=ft_volumerealign(cfg,mri); >> >> hs=ft_read_headshape(headshapefilename); >> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >> error, see v >> >> cfg=[]; >> cfg.method='headshape'; >> cfg.headshape=hs; >> >> mrihs=ft_volumerealign(cfg,mri); >> >> Unless otherwise noted, the code fails when I quit the interactive >> alignment window. >> >> It fails in the following cases (errors below): >> Matlab: 2015; FT: 2016 >> Matlab: 2015; FT: 2014 >> Matlab: 2013; FT: 2016 >> >> and is successful only for >> Matlab: 2013; FT: 2014 >> >> Did anyone experience similar problems? Is there a workaround? If not, >> would it be complicated to estimate the transformation matrices myself >> once I know the right scale/translation/rotation parameters? >> >> Thank you, >> >> Bruno >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2013; FT: 2016 >> Matlab: 2013; FT: 2016 >> Fails when quitting interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Error using cell/ismember>cellismemberR2012a (line 193) >> Input A of class cell and input B of class cell must be cell arrays of >> strings, unless one is a string. >> >> Error in cell/ismember (line 57) >> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >> >> Error in ft_senstype (line 303) >> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >> > 0.8) >> >> Error in ft_datatype_sens (line 138) >> ismeg = ft_senstype(sens, 'meg'); >> >> Error in ft_checkconfig (line 250) >> cfg.elec = ft_datatype_sens(cfg.elec); >> >> Error in ft_interactiverealign (line 71) >> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >> 'headmodel'}); >> >> Error in ft_volumerealign (line 691) >> tmpcfg = ft_interactiverealign(tmpcfg); >> >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2015; FT: 2016 >> Matlab: 2015; FT: 2016 >> hs.pnt=hs.pos; %required or will give another error >> Fails when quitting interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in ft_sourceinterpolate (line 328) >> av = interpmat*fv; >> >> Error in ft_volumerealign (line 752) >> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >> target); >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2015; FT: 2014 >> Matlab: 2015; FT: 2014 >> hs.pnt=hs.pos; %required or will give another error >> Fails when creating the interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> >> ield assignment to a non-structure array object. >> >> Error in ft_plot_mesh (line 61) >> bnd.pnt = bnd; >> >> Error in ft_interactiverealign>cb_redraw (line 282) >> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >> 'vertexsize',10); >> >> Error in ft_interactiverealign (line 126) >> cb_redraw(gca); >> >> Error in ft_volumerealign (line 584) >> tmpcfg = ft_interactiverealign(tmpcfg); >> >> >> >> >> >> >> >> >> >> >> >> -- >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Bruno L. Giordano, PhD >> Institute of Neuroscience and Psychology >> 58 Hillhead Street, University of Glasgow >> Glasgow, G12 8QB, Scotland >> T +44 (0) 141 330 5484 >> Www: http://www.brunolgiordano.net >> Email charter: http://www.emailcharter.org/ >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Fri May 6 10:25:00 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 6 May 2016 08:25:00 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <572C5462.5070809@gmail.com> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <572C5462.5070809@gmail.com> Message-ID: <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> Hi Bruno, Is this ‘hack’ done inside a function, or do you need to do it outside a function call? We recently tried and streamline the code to replace all occurrences of ‘pnt’ with ‘pos’. The fact that you need the hack suggests that we need to do some more code cleaning. It would be great if you could give us a pointer. JM > On 06 May 2016, at 10:22, Bruno L. Giordano wrote: > > Hi, > > thanks, I will look into it! > > One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: > > hs.pnt=hs.pos; > > Cheers, > > Bruno > > On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Bruno, >> >> I think we have just been looking into it. And with just, I mean really >> just. I just merged a pull request from Roemer van der Meij into >> github.com/fieldtrip/fieldtrip >> (#141). This merge is related to >> a graphics issue that needs to be resolved differently for different >> matlab versions (in particular for matlab>=2014 it requires a different >> solution than matlab<2014). I wonder whether this is related to the >> problem you report. >> We did not do an comparable extensive sweep of the possible combinations >> (i.e. matlab versions and fieldtrip versions), so could you pull a copy >> from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that >> explains one way of getting yourself a local copy of the code. >> >> Thanks, >> >> Jan-Mathijs >> >> >> >> >> >>> On 05 May 2016, at 20:37, Bruno L. Giordano >> > wrote: >>> >>> Hello, >>> >>> I am trying to run these commands on different matlab versions(2013 >>> vs. 2015) and using different FT versions (20141209 vs. 20160317; >>> let's call them 2014 vs. 2016). >>> >>> The code I run is as follows: >>> >>> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >>> >>> cfg=[]; >>> cfg.method='fiducial'; >>> cfg.coordsys='4d'; >>> cfg.fiducial.nas=[59 168 104]; >>> cfg.fiducial.lpa=[138 133 28]; >>> cfg.fiducial.rpa=[147 138 169]; >>> mri=ft_volumerealign(cfg,mri); >>> >>> hs=ft_read_headshape(headshapefilename); >>> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >>> error, see v >>> >>> cfg=[]; >>> cfg.method='headshape'; >>> cfg.headshape=hs; >>> >>> mrihs=ft_volumerealign(cfg,mri); >>> >>> Unless otherwise noted, the code fails when I quit the interactive >>> alignment window. >>> >>> It fails in the following cases (errors below): >>> Matlab: 2015; FT: 2016 >>> Matlab: 2015; FT: 2014 >>> Matlab: 2013; FT: 2016 >>> >>> and is successful only for >>> Matlab: 2013; FT: 2014 >>> >>> Did anyone experience similar problems? Is there a workaround? If not, >>> would it be complicated to estimate the transformation matrices myself >>> once I know the right scale/translation/rotation parameters? >>> >>> Thank you, >>> >>> Bruno >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2013; FT: 2016 >>> Matlab: 2013; FT: 2016 >>> Fails when quitting interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> Error using cell/ismember>cellismemberR2012a (line 193) >>> Input A of class cell and input B of class cell must be cell arrays of >>> strings, unless one is a string. >>> >>> Error in cell/ismember (line 57) >>> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >>> >>> Error in ft_senstype (line 303) >>> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >>> > 0.8) >>> >>> Error in ft_datatype_sens (line 138) >>> ismeg = ft_senstype(sens, 'meg'); >>> >>> Error in ft_checkconfig (line 250) >>> cfg.elec = ft_datatype_sens(cfg.elec); >>> >>> Error in ft_interactiverealign (line 71) >>> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >>> 'headmodel'}); >>> >>> Error in ft_volumerealign (line 691) >>> tmpcfg = ft_interactiverealign(tmpcfg); >>> >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2015; FT: 2016 >>> Matlab: 2015; FT: 2016 >>> hs.pnt=hs.pos; %required or will give another error >>> Fails when quitting interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> Error using * >>> Inner matrix dimensions must agree. >>> >>> Error in ft_sourceinterpolate (line 328) >>> av = interpmat*fv; >>> >>> Error in ft_volumerealign (line 752) >>> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >>> target); >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2015; FT: 2014 >>> Matlab: 2015; FT: 2014 >>> hs.pnt=hs.pos; %required or will give another error >>> Fails when creating the interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> >>> ield assignment to a non-structure array object. >>> >>> Error in ft_plot_mesh (line 61) >>> bnd.pnt = bnd; >>> >>> Error in ft_interactiverealign>cb_redraw (line 282) >>> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >>> 'vertexsize',10); >>> >>> Error in ft_interactiverealign (line 126) >>> cb_redraw(gca); >>> >>> Error in ft_volumerealign (line 584) >>> tmpcfg = ft_interactiverealign(tmpcfg); >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> -- >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Bruno L. Giordano, PhD >>> Institute of Neuroscience and Psychology >>> 58 Hillhead Street, University of Glasgow >>> Glasgow, G12 8QB, Scotland >>> T +44 (0) 141 330 5484 >>> Www: http://www.brunolgiordano.net >>> Email charter: http://www.emailcharter.org/ >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Bruno L. Giordano, PhD > Institute of Neuroscience and Psychology > 58 Hillhead Street, University of Glasgow > Glasgow, G12 8QB, Scotland > T +44 (0) 141 330 5484 > Www: http://www.brunolgiordano.net > Email charter: http://www.emailcharter.org/ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From brungio at gmail.com Fri May 6 10:59:35 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 09:59:35 +0100 Subject: [FieldTrip] Dartel-based MNI group grid Message-ID: <572C5CF7.3020407@gmail.com> Hi, I usually prepare the native-space beamforming grid by warping non-linearly to the native space a MNI group-level grid: cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = groupgrid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_headshape; %native-space anatomical grid = ft_prepare_sourcemodel(cfg); I am wondering whether someone ever tried to do this warping through DARTEL (http://www.ncbi.nlm.nih.gov/pubmed/17761438 implemented in SPM). The approach would still be to define an MNI-space grid, but to back-project to native space through the DARTEL template. When compared to the SPM non-linear warping, this approach would ensure a much better correspondence between structures for the different participant, and promises to boost to a certain extent group statistics (that is, not considering source blurring). It would also be quite a good idea for multimodal MEG/fMRI studies, where fMRI group-level is strongly recommended to rely on DARTEL (if you use SPM). Thank you for sharing your experiences/code snippets, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From brungio at gmail.com Fri May 6 11:29:45 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 10:29:45 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <572C5462.5070809@gmail.com> <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> Message-ID: <572C6409.5080504@gmail.com> Hi, we do this after getting the headshape with ft_readhsadshape, and before using the hs structure as cfg.headshape for mri-to-headshape realignment with ft_volumerealign. The switch to matlab2015 must have been a major headache for you guys ;-) Thanks for your hard work! Bruno On 06/05/2016 09:25, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Bruno, > > Is this ‘hack’ done inside a function, or do you need to do it outside a function call? > We recently tried and streamline the code to replace all occurrences of ‘pnt’ with ‘pos’. The fact that you need the hack suggests that we need to do some more code cleaning. It would be great if you could give us a pointer. > > JM > > >> On 06 May 2016, at 10:22, Bruno L. Giordano wrote: >> >> Hi, >> >> thanks, I will look into it! >> >> One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: >> >> hs.pnt=hs.pos; >> >> Cheers, >> >> Bruno >> >> On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: >>> Hi Bruno, >>> >>> I think we have just been looking into it. And with just, I mean really >>> just. I just merged a pull request from Roemer van der Meij into >>> github.com/fieldtrip/fieldtrip >>> (#141). This merge is related to >>> a graphics issue that needs to be resolved differently for different >>> matlab versions (in particular for matlab>=2014 it requires a different >>> solution than matlab<2014). I wonder whether this is related to the >>> problem you report. >>> We did not do an comparable extensive sweep of the possible combinations >>> (i.e. matlab versions and fieldtrip versions), so could you pull a copy >>> from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that >>> explains one way of getting yourself a local copy of the code. >>> >>> Thanks, >>> >>> Jan-Mathijs >>> >>> >>> >>> >>> >>>> On 05 May 2016, at 20:37, Bruno L. Giordano >>> > wrote: >>>> >>>> Hello, >>>> >>>> I am trying to run these commands on different matlab versions(2013 >>>> vs. 2015) and using different FT versions (20141209 vs. 20160317; >>>> let's call them 2014 vs. 2016). >>>> >>>> The code I run is as follows: >>>> >>>> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >>>> >>>> cfg=[]; >>>> cfg.method='fiducial'; >>>> cfg.coordsys='4d'; >>>> cfg.fiducial.nas=[59 168 104]; >>>> cfg.fiducial.lpa=[138 133 28]; >>>> cfg.fiducial.rpa=[147 138 169]; >>>> mri=ft_volumerealign(cfg,mri); >>>> >>>> hs=ft_read_headshape(headshapefilename); >>>> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >>>> error, see v >>>> >>>> cfg=[]; >>>> cfg.method='headshape'; >>>> cfg.headshape=hs; >>>> >>>> mrihs=ft_volumerealign(cfg,mri); >>>> >>>> Unless otherwise noted, the code fails when I quit the interactive >>>> alignment window. >>>> >>>> It fails in the following cases (errors below): >>>> Matlab: 2015; FT: 2016 >>>> Matlab: 2015; FT: 2014 >>>> Matlab: 2013; FT: 2016 >>>> >>>> and is successful only for >>>> Matlab: 2013; FT: 2014 >>>> >>>> Did anyone experience similar problems? Is there a workaround? If not, >>>> would it be complicated to estimate the transformation matrices myself >>>> once I know the right scale/translation/rotation parameters? >>>> >>>> Thank you, >>>> >>>> Bruno >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2013; FT: 2016 >>>> Matlab: 2013; FT: 2016 >>>> Fails when quitting interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> Error using cell/ismember>cellismemberR2012a (line 193) >>>> Input A of class cell and input B of class cell must be cell arrays of >>>> strings, unless one is a string. >>>> >>>> Error in cell/ismember (line 57) >>>> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >>>> >>>> Error in ft_senstype (line 303) >>>> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >>>>> 0.8) >>>> >>>> Error in ft_datatype_sens (line 138) >>>> ismeg = ft_senstype(sens, 'meg'); >>>> >>>> Error in ft_checkconfig (line 250) >>>> cfg.elec = ft_datatype_sens(cfg.elec); >>>> >>>> Error in ft_interactiverealign (line 71) >>>> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >>>> 'headmodel'}); >>>> >>>> Error in ft_volumerealign (line 691) >>>> tmpcfg = ft_interactiverealign(tmpcfg); >>>> >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2015; FT: 2016 >>>> Matlab: 2015; FT: 2016 >>>> hs.pnt=hs.pos; %required or will give another error >>>> Fails when quitting interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in ft_sourceinterpolate (line 328) >>>> av = interpmat*fv; >>>> >>>> Error in ft_volumerealign (line 752) >>>> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >>>> target); >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2015; FT: 2014 >>>> Matlab: 2015; FT: 2014 >>>> hs.pnt=hs.pos; %required or will give another error >>>> Fails when creating the interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> >>>> ield assignment to a non-structure array object. >>>> >>>> Error in ft_plot_mesh (line 61) >>>> bnd.pnt = bnd; >>>> >>>> Error in ft_interactiverealign>cb_redraw (line 282) >>>> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >>>> 'vertexsize',10); >>>> >>>> Error in ft_interactiverealign (line 126) >>>> cb_redraw(gca); >>>> >>>> Error in ft_volumerealign (line 584) >>>> tmpcfg = ft_interactiverealign(tmpcfg); >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Bruno L. Giordano, PhD >>>> Institute of Neuroscience and Psychology >>>> 58 Hillhead Street, University of Glasgow >>>> Glasgow, G12 8QB, Scotland >>>> T +44 (0) 141 330 5484 >>>> Www: http://www.brunolgiordano.net >>>> Email charter: http://www.emailcharter.org/ >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> -- >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Bruno L. Giordano, PhD >> Institute of Neuroscience and Psychology >> 58 Hillhead Street, University of Glasgow >> Glasgow, G12 8QB, Scotland >> T +44 (0) 141 330 5484 >> Www: http://www.brunolgiordano.net >> Email charter: http://www.emailcharter.org/ >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Fri May 6 20:50:52 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 6 May 2016 18:50:52 +0000 Subject: [FieldTrip] integer frequencies in TFR In-Reply-To: References: Message-ID: <19D4FAE7-1E95-4549-AE5F-7F597952F5FF@donders.ru.nl> Hi José, The frequencies that are returned are constrained by the intrinsic frequency resolution of your epochs. Since your epochs are 3.3 seconds long, FT will round to the nearest attainable frequencies, quantized at 1./3.3. You can use cfg.pad for spectral interpolation. This parameter is the length (in s) until which the data are padded with 0’s, prior to the FFT. In this case, I suggest to use cfg.pad = 4. Best, Jan-Mathijs On 04 May 2016, at 19:30, Jose > wrote: dear list, I'm analysing CTF MEG data (sampling rate 1250 Hz). I'm epoching my data from -0.5 sec to 2.8 sec relative my marker of interest. % define the trial matrix trlFile = zeros(length(markers3), 3); for i_trial = 1:length(markers3) trlFile(i_trial,1) = markers3(i_trial,2) -625; % 0.5*1250 % SR = 1250, trlFile(i_trial,2) = markers3(i_trial,2) +3500; % 2.8*1250 % SR = 1250, trlFile(i_trial,3) = -625; trlFile(i_trial,4) = markers3(i_trial,1); end Once I pre-process the data, I run TF analyses with the wavelet method cfg = [ ]; cfg.trials = find(data2.trialinfo(:,1) == i_condition); cfg.channel = 'MEG'; cfg.method = 'wavelet'; cfg.width = 5; cfg.output = 'pow'; cfg.foi = 1:1:30; cfg.toi = -0.5:0.05:2.8; TFdata = ft_freqanalysis(cfg, data1); In the .freq field I realize that my frequency are not exact integers 0.907801418439716 2.11820330969267 3.02600472813239 3.93380614657210 5.14420803782506 6.05200945626478 6.95981087470449 7.86761229314421 9.07801418439716 9.98581560283688 ... I checked: http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies So, I decide to reduce one sample in my trial definition (so trlFile(i_trial,2) = markers3(i_trial,2) +3500-1; % 2.8*1250 % SR = 1250,) But, still I'm not having integers, 0.909090909090909 2.12121212121212 3.03030303030303 3.93939393939394 5.15151515151515 6.06060606060606 6.96969696969697 7.87878787878788 9.09090909090909 10 ... I suspect I can't obtain integer frequencies in my TFR due to my frequency sampling, Is there any recommendation regarding the frequencies used to compute the TFRs? Would that pose some issues for subsequent processing steps? thanks Jose _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Fri May 6 23:02:24 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Fri, 6 May 2016 17:02:24 -0400 Subject: [FieldTrip] Washington DC/NIH Fieldtrip Users Message-ID: Hi, I am a graduate student at georgetown trying to use FT for EEG source localization, I have a working pipeline but I am not getting meaningful/correct results. Would be really helpful to sit down with other Fieldtrip users in the washington DC area to work out some bugs. Please let me know and I can commute to your location. Thank you, Hassanm -------------- next part -------------- An HTML attachment was scrubbed... URL: From munsif.jatoi at gmail.com Sat May 7 06:28:31 2016 From: munsif.jatoi at gmail.com (Munsif Jatoi) Date: Sat, 7 May 2016 12:28:31 +0800 Subject: [FieldTrip] Washington DC/NIH Fieldtrip Users In-Reply-To: References: Message-ID: Dear Hassan Aleem, I have been working in EEG source localization for my PH.D. Try to read the latest literature first. I would like to suggest you for different softwares such as SPM which has field trip integration in it. Try BEM head modeling with MSP Loreta as inversion methods. You can contact me for any help. Best, Munsif Sent from my iPhone > On 7 May 2016, at 05:02, Hassan Aleem wrote: > > Hi, > > I am a graduate student at georgetown trying to use FT for EEG source localization, I have a working pipeline but I am not getting meaningful/correct results. Would be really helpful to sit down with other Fieldtrip users in the washington DC area to work out some bugs. Please let me know and I can commute to your location. > > Thank you, > > Hassanm > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sat May 7 08:21:21 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sat, 7 May 2016 06:21:21 +0000 Subject: [FieldTrip] importing large edf data In-Reply-To: <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com> References: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com> Message-ID: Leila, I don’t know much about the EDF format, but perhaps you should consider that the ‘hdr’ should probably stay consistent with the data. That is, some data formats have a header that specifies the number of data samples. If you create ‘new’ data with an extra number of samples, it could be that the header needs to be updated as well. Best, Jan-Mathijs On 05 May 2016, at 16:34, Leila Ayoubian > wrote: Hi, I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece) Here is my code. It does create the 'a' file but it does not open as EDF. Any suggestion? clc; clear all; close all; %% [fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file'); file1 = fullfile(pathName1, fileName1); cfg1 = []; %cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms cfg1.trialdef.triallength = 5; cfg1.dataset =file1; %'For leila.edf'; cfg1= ft_definetrial( cfg1 ); cfg1.continuous = 'yes'; datastr1 = ft_preprocessing(cfg1); data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr; %% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file'); file2 = fullfile(pathName2, fileName2); cfg2 = []; %cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms cfg2.trialdef.triallength = 5; cfg2.dataset =file2; %'For leila.edf'; cfg2= ft_definetrial( cfg2 ); cfg2.continuous = 'yes'; datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2) % EEG=EEG'; % HDR=hdr1 % out=EDFCreator(EEG); dat = cat(2,data1,data2); %% % write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London ________________________________ From: Arjen Stolk > To: FieldTrip discussion list > Sent: Tuesday, February 9, 2016 3:32 PM Subject: Re: [FieldTrip] importing large edf data Hi both, There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head. Arjen On Feb 9, 2016, at 3:19 AM, Stephen Politzer-Ahles > wrote: Hi Leila, I'm sorry but I'm afraid I have not quite understood your issue. Can you give some more detail about what the problem is? In general, the fieldtrip structure output by ft_preprocessing() should have a .time field (indicating what timepoint during the epoch each sample corresponds to) and an .fsample field indicating the sampling rate (which you would also be able to use to figure out the time of each sample). 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: Mon, 8 Feb 2016 11:51:05 +0000 (UTC) From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data Message-ID: <1195829915.655104.1454932265573.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Stephen:I just happen to realize that when I load the data as you mentioned below, I can not get hold of the real time of the EEG file. (e.g.18:32:43 ).Could you please point out as how I could retrieve the real time of the EEG file after loading. Thanks a lot.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: 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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 gina.joue at univr.it Sat May 7 19:34:33 2016 From: gina.joue at univr.it (gj) Date: Sat, 7 May 2016 19:34:33 +0200 Subject: [FieldTrip] ft_source2sparse usage for EEG data Message-ID: <572E2729.8060701@univr.it> Hi, Sorry about that!! Good to know...I follow the forum threaded, so I made the false assumption that others do the same and that given the volume of emails/info overload and overworked forum-answering Samaritans these days that it was better to be concise rather than reiterate previous info...I do fully appreciate that people are kindly answering forum questions completely out of their good will -- without which I would be (more) lost and tearing more of my hair out -- so I FULLY appreciate you guys and, contrary to the end effect, I really do make an effort to try and package my questions.... To summarize, I am trying to use FieldTrip ver.20160309 to run a whole-brain network analysis on source level on a 2-sec continuous recording of EEG (preprocessed and averaged across all trials per condition per subject in another software -- I manually put the data in Fieldtrip format). Note that in trying to hack a way around the problem I've since reworked the data multiple times -- hence the numbers below are now not the same as what I previously posted, but the error is the same. Following the tutorials (for MEG: http://www.fieldtriptoolbox.org/tutorial/networkanalysis), I first run ft_source2sparse to reduce the matrix to only voxels inside the skull: >> source_sparse = ft_source2sparse(source_proj); total number of dipoles : 6804 number of dipoles inside brain: 3294 number of dipoles outside brain: 3510 When I then try to run the connectivity analysis (ft_connectivityanalysis), regardless of which connectivity method (I've tried the various options), e.g. cfg=[]; cfg.method ='coh'; cfg.complex = 'absimag'; source_conn = ft_connectivityanalysis(cfg, source_sparse); I get the error: ------------ error ----------- Requested 23058x23058 (7.9GB) 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 univariate2bivariate (line 314) data.crsspctrm = (transpose(mom)*conj(mom))./nrpt; Error in ft_connectivityanalysis (line 434) [data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm', dtype, 'cmb', cfg.refindx, 'keeprpt', 0); ------------ end error ----------- In univariate2bivariate(), it goes into "source moments are multivariate" with size(data.mom,1) = 3294 sizmom = [3, 7] Does this mean there were 3 dominant orientations of the source reconstructed data? I had done the projection with the following call: cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); At a loss -- not sure whether I set up something incorrectly? Thanks a mil in advance for any help or tips on where to troubleshoot!!! Gina From jan.schoffelen at donders.ru.nl Sun May 8 08:27:51 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 06:27:51 +0000 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572E2729.8060701@univr.it> References: <572E2729.8060701@univr.it> Message-ID: Hi Gina, First of all: it is not possible to compute connectivity from data that contains just a single trial. Second, it is not clear to me what kind of source reconstruction you have done, so it is difficult to comment here. In general, although I haven’t tried this recently myself, the best chances of being successful with your approach would be in the following ‘pipeline’ (I only flash out the functions to be used + some small details regarding the settings): 0. start with your data in a fieldtrip structure containing multiple trials. 1. call ft_freqanalysis to get the spectral representation of the data. Use cfg.method = ‘mtmfft’, cfg.output = ‘fourier’ 2. call ft_sourceanalysis, using a frequency domain beamformer to get the voxel-wise spectral representation of the data. Staying entirely within fieldtrip (i.e. without using some small hacks), you probably need the following: cfg.method = ‘pcc’ (this will give you the ‘mom’ in the appropriate shape, such that ft_connectivityanalysis may swallow it), cfg.pcc.fixedori = ‘yes’ (this gives a single orientation per voxel, i.e. a mom that is 1xobservations) 3. call ft_connectivityanalysis. It could be that you have been doing all this already (since you mention the networkanalysis tutorial, where at first glance this procedure is followed), and in that case I would first address points 0 and 1 above. Good luck, Jan-Mathijs > On 07 May 2016, at 19:34, gj wrote: > > Hi, > > Sorry about that!! Good to know...I follow the forum threaded, so I made the false assumption that others do the same and that given the volume of emails/info overload and overworked forum-answering Samaritans these days that it was better to be concise rather than reiterate previous info...I do fully appreciate that people are kindly answering forum questions completely out of their good will -- without which I would be (more) lost and tearing more of my hair out -- so I FULLY appreciate you guys and, contrary to the end effect, I really do make an effort to try and package my questions.... > > > To summarize, I am trying to use FieldTrip ver.20160309 to run a whole-brain network analysis on source level on a 2-sec continuous recording of EEG (preprocessed and averaged across all trials per condition per subject in another software -- I manually put the data in Fieldtrip format). Note that in trying to hack a way around the problem I've since reworked the data multiple times -- hence the numbers below are now not the same as what I previously posted, but the error is the same. > > Following the tutorials (for MEG: http://www.fieldtriptoolbox.org/tutorial/networkanalysis), I first run ft_source2sparse to reduce the matrix to only voxels inside the skull: > > >>> source_sparse = ft_source2sparse(source_proj); > total number of dipoles : 6804 > number of dipoles inside brain: 3294 > number of dipoles outside brain: 3510 > > When I then try to run the connectivity analysis (ft_connectivityanalysis), regardless of which connectivity method (I've tried the various options), e.g. > > > cfg=[]; > cfg.method ='coh'; > cfg.complex = 'absimag'; > source_conn = ft_connectivityanalysis(cfg, source_sparse); > > > I get the error: > > ------------ error ----------- > Requested 23058x23058 (7.9GB) 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 univariate2bivariate (line 314) > data.crsspctrm = (transpose(mom)*conj(mom))./nrpt; > > Error in ft_connectivityanalysis (line 434) > [data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm', > dtype, 'cmb', cfg.refindx, 'keeprpt', 0); > ------------ end error ----------- > > > In univariate2bivariate(), it goes into "source moments are multivariate" with > > size(data.mom,1) = 3294 > sizmom = [3, 7] > > Does this mean there were 3 dominant orientations of the source reconstructed data? I had done the projection with the following call: > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > > At a loss -- not sure whether I set up something incorrectly? Thanks a mil in advance for any help or tips on where to troubleshoot!!! > Gina > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From christine.blume at sbg.ac.at Sun May 8 09:26:08 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Sun, 8 May 2016 07:26:08 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Message-ID: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sun May 8 09:46:24 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 07:46:24 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: Message-ID: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Sun May 8 14:10:49 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Sun, 8 May 2016 12:10:49 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> References: , <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generating tmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows in data_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Sun May 8 19:07:51 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 18:07:51 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Message-ID: <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Dear all I was going through the tutorial: http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate My question involves the first realignment and reslicing followed by second realignment and reslicing. I do not understand the step below: -> T = transform_vox2ctf/transform_vox2spm= transform_vox2ctf*inv(transform_vox2spm) and this matrix is applied to sourcespace. What confuses me, is that a) we realign the anatomical voxel to spm (MNI) coordinates. b) we reslice and save it as shown in step "3. Preprocessing of the anatomical MRI: reslicing" && 4. Preprocessing of the anatomical MRI: save to disk At this stage we get the transformation matrix anatomical voxel to spm i.e transform_vox2spm Moreover, we reside in the SPM coordinates now. c) We then realign to CTF coordinates, no reslicing is done. we Should GET transform_spm2ctf. However, the obtained transform is called transform_vox2ct. Why??? We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); c) During the source creation, we are already in the MNI coordinates, because we are using Subject01.mgz. So, why in "STEP 4. Source model: Co-registration of the source space to the sensor-based head coordinate system we do we need to " T = transform_vox2ctf/transform_vox2spm; Should it not be transform_vox2ctf changed to transform_spm2ctf and T=transform_spm2ctf ??? best regards parham From jan.schoffelen at donders.ru.nl Sun May 8 21:35:38 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:35:38 +0000 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: Hi Parham, > On 08 May 2016, at 19:07, parham hashemzadeh wrote: > > Dear all > I was going through the tutorial: http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > My question involves the first realignment and reslicing followed by second realignment and reslicing. I do not understand the step below: > > -> T = transform_vox2ctf/transform_vox2spm= transform_vox2ctf*inv(transform_vox2spm) > and this matrix is applied to sourcespace. > > What confuses me, is that > a) we realign the anatomical voxel to spm (MNI) coordinates. > b) we reslice and save it as shown in step "3. Preprocessing of the anatomical MRI: reslicing" > && 4. Preprocessing of the anatomical MRI: save to disk > At this stage we get the transformation matrix anatomical voxel to spm i.e transform_vox2spm > Moreover, we reside in the SPM coordinates now. > c) We then realign to CTF coordinates, no reslicing is done. we Should > GET transform_spm2ctf. However, the obtained transform is called transform_vox2ct. Why??? Because the transformation matrix that is attached to the mri structure is always going from voxel space to a human interpretable coordinate system. > We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); > c) During the source creation, we are already in the MNI coordinates, because we are using Subject01.mgz. The fact that the file has the extension *.mgz does not mean that it is in MNI coordinates. The Subject01.mgz is created in the tutorial to have a transformation attached to it, that goes from (resliced) voxels to MNI. > So, why in "STEP 4. Source model: Co-registration of the source space to the sensor-based head coordinate system we do we need to " > T = transform_vox2ctf/transform_vox2spm; > Should it not be transform_vox2ctf changed to transform_spm2ctf > and T=transform_spm2ctf ??? No, it shouldn’t. Best, Jan-Mathijs > best regards parham > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sun May 8 21:43:34 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:43:34 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: <484A7AF5-98E5-435B-94E1-5493DE82C575@donders.ru.nl> Hi Christine, Checking for the number of unique rows in the sampleinfo field does not ensure that the data are not overlapping. e.g. data.sampleinfo = [1 200; 100 300]; is a valid specification, and unique(data.sampleinfo, ‘rows’) gives 2, yet the samples are overlapping. I don’t think the loss of chronology is causing the problem. Best, Jan-Mathijs On 08 May 2016, at 14:10, Blume Christine > wrote: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generatingtmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows indata_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 jan.schoffelen at donders.ru.nl Sun May 8 21:43:44 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:43:44 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: <32600EDE-3BCA-4EC9-BC25-911FF5B83B2F@donders.ru.nl> Hi Christine, Checking for the number of unique rows in the sampleinfo field does not ensure that the data are not overlapping. e.g. data.sampleinfo = [1 200; 100 300]; is a valid specification, and unique(data.sampleinfo, ‘rows’) gives 2, yet the samples are overlapping. I don’t think the loss of chronology is causing the problem. Best, Jan-Mathijs On 08 May 2016, at 14:10, Blume Christine > wrote: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generatingtmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows indata_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ph442 at cam.ac.uk Sun May 8 23:26:48 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 22:26:48 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: <7e6574fd0963df6d9993020635800764@cam.ac.uk> Hi Jan Thank you. best regards parham On 2016-05-08 20:35, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > >> On 08 May 2016, at 19:07, parham hashemzadeh wrote: >> >> Dear all >> I was going through the tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> My question involves the first realignment and reslicing followed by >> second realignment and reslicing. I do not understand the step below: >> >> -> T = transform_vox2ctf/transform_vox2spm= >> transform_vox2ctf*inv(transform_vox2spm) >> and this matrix is applied to sourcespace. >> >> What confuses me, is that >> a) we realign the anatomical voxel to spm (MNI) coordinates. >> b) we reslice and save it as shown in step "3. Preprocessing of the >> anatomical MRI: reslicing" >> && 4. Preprocessing of the >> anatomical MRI: save to disk >> At this stage we get the transformation matrix anatomical voxel to spm >> i.e transform_vox2spm >> Moreover, we reside in the SPM coordinates now. >> c) We then realign to CTF coordinates, no reslicing is done. we Should >> GET transform_spm2ctf. However, the obtained transform is called >> transform_vox2ct. Why??? > > Because the transformation matrix that is attached to the mri > structure is always going from voxel space to a human interpretable > coordinate system. > >> We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); >> c) During the source creation, we are already in the MNI coordinates, >> because we are using Subject01.mgz. > > The fact that the file has the extension *.mgz does not mean that it > is in MNI coordinates. The Subject01.mgz is created in the tutorial to > have a transformation attached to it, that goes from (resliced) voxels > to MNI. > >> So, why in "STEP 4. Source model: Co-registration of the source space >> to the sensor-based head coordinate system we do we need to " >> T = transform_vox2ctf/transform_vox2spm; >> Should it not be transform_vox2ctf changed to transform_spm2ctf >> and T=transform_spm2ctf ??? > > No, it shouldn’t. > > Best, > Jan-Mathijs > > >> best regards parham >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From cecile.issard at etu.parisdescartes.fr Sun May 8 23:30:13 2016 From: cecile.issard at etu.parisdescartes.fr (Cecile Issard) Date: Sun, 8 May 2016 21:30:13 +0000 Subject: [FieldTrip] two events per trial ? Message-ID: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, Cécile — Cécile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Université Paris Descartes 45 rue des Saints-Pères 75006 Paris From ph442 at cam.ac.uk Sun May 8 23:54:52 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 22:54:52 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: <234e99e29effe199b4124764558bcf68@cam.ac.uk> Hi Jan Thank you for your previous response. I guess, what confuses me http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate is the text in the section "1. Source model: Volumetric processing in FreeSurfer" "To create a skullstripped anatomical image, you can do the following. We assume that you have executed all steps that are described in the section about preprocessing of the anatomical MRI, and that you have a file that contains the resliced anatomical image, expressed in the MNI-RAS coordinate system. " It explicitly states that resliced anatomical image is expressed in MNI-RAS coordinates. I guess, the source must be in the MNI coordinates. such that T=transform_vox2ctf * inv(transform_vox2spm) can be applied to source as in the tutorial % go to the Subject01/bem directory sourcespace = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); sourcespace = ft_convert_units(sourcespace, 'mm'); sourcespace = ft_transform_geometry(T, sourcespace); save sourcespace sourcespace the transformation matrix above multiplies the source points from the left. If we denote the source points by S, then T*S is that right??? Many thanks best regards parham hashemzadeh On 2016-05-08 20:35, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > >> On 08 May 2016, at 19:07, parham hashemzadeh wrote: >> >> Dear all >> I was going through the tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> My question involves the first realignment and reslicing followed by >> second realignment and reslicing. I do not understand the step below: >> >> -> T = transform_vox2ctf/transform_vox2spm= >> transform_vox2ctf*inv(transform_vox2spm) >> and this matrix is applied to sourcespace. >> >> What confuses me, is that >> a) we realign the anatomical voxel to spm (MNI) coordinates. >> b) we reslice and save it as shown in step "3. Preprocessing of the >> anatomical MRI: reslicing" >> && 4. Preprocessing of the >> anatomical MRI: save to disk >> At this stage we get the transformation matrix anatomical voxel to spm >> i.e transform_vox2spm >> Moreover, we reside in the SPM coordinates now. >> c) We then realign to CTF coordinates, no reslicing is done. we Should >> GET transform_spm2ctf. However, the obtained transform is called >> transform_vox2ct. Why??? > > Because the transformation matrix that is attached to the mri > structure is always going from voxel space to a human interpretable > coordinate system. > >> We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); >> c) During the source creation, we are already in the MNI coordinates, >> because we are using Subject01.mgz. > > The fact that the file has the extension *.mgz does not mean that it > is in MNI coordinates. The Subject01.mgz is created in the tutorial to > have a transformation attached to it, that goes from (resliced) voxels > to MNI. > >> So, why in "STEP 4. Source model: Co-registration of the source space >> to the sensor-based head coordinate system we do we need to " >> T = transform_vox2ctf/transform_vox2spm; >> Should it not be transform_vox2ctf changed to transform_spm2ctf >> and T=transform_spm2ctf ??? > > No, it shouldn’t. > > Best, > Jan-Mathijs > > >> best regards parham >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From cogsci.tuna at gmail.com Mon May 9 17:26:01 2016 From: cogsci.tuna at gmail.com (Tuna Cakar) Date: Mon, 9 May 2016 18:26:01 +0300 Subject: [FieldTrip] About calculation of total power in TFr analysis Message-ID: Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Tue May 10 01:06:33 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Mon, 9 May 2016 19:06:33 -0400 Subject: [FieldTrip] Beam form source time discrepancy In-Reply-To: References: Message-ID: Hi, Doing source analysis on a visual training task and am seeing source power showing up at 0-20ms. Can anyine with latency based localization please advise? let me know if you need more information Best, Hassan -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.borbaruah at student.utwente.nl Tue May 10 10:00:19 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 08:00:19 +0000 Subject: [FieldTrip] Function is asking for raw data as input Message-ID: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Tue May 10 10:12:04 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Tue, 10 May 2016 08:12:04 +0000 Subject: [FieldTrip] About calculation of total power in TFr analysis In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C3F90F5D6@exprd03.hosting.ru.nl> Dear Tuna, As far as I understand, the morlet-TFR example as used in the tutorial (http://www.fieldtriptoolbox.org/tutorial/timefrequencyanalysis) computes total (evoked and induced) power, per trial and time bin, and then averages over trials. To compute total power in the 1000ms epoch, I would suggest using cfg.method=’mtmfft’. E.g., something like the following, assuming that your data is organized in trials in a variable called ‘data’. BTW, note that because of your 1000ms data epoch, the intrinsic frequency resolution of your data is 1 Hz (1/1), thus spectral power below 1 Hz will be poorly estimated. cfg=[]; cfg.toilim=[0.0 1.0]; %1000ms time window data_ep=ft_redefinetrial(cfg,data); cfg=[]; cfg.pad=10; cfg.method=’mtmfft’; cfg.outpu=’pow’; cfg.foilim= [0.1 40]; cfg.channel = ‘all’; data_ep_pow=ft_freqanalysis(cfg,data_ep); 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 Tuna Cakar Sent: maandag 9 mei 2016 17:26 To: fieldtrip at science.ru.nl Subject: [FieldTrip] About calculation of total power in TFr analysis Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 663 bytes Desc: image001.gif URL: From tineke.snijders at donders.ru.nl Tue May 10 10:34:19 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 08:34:19 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Tue May 10 10:55:39 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 08:55:39 +0000 Subject: [FieldTrip] two events per trial ? In-Reply-To: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> References: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F@exprd04.hosting.ru.nl> Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, Cécile — Cécile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Université Paris Descartes 45 rue des Saints-Pères 75006 Paris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From s.borbaruah at student.utwente.nl Tue May 10 11:27:58 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 11:27:58 +0200 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) < tineke.snijders at donders.ru.nl> wrote: > Dear Soujata, > > Have you checked what data is in Dat(i,j,k)? The data input of > ft_timelockanalysis should be organised in a structure as obtained from > ft_preprocessing, with trial-based data. > > Best, > Tineke > > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] > *Sent:* Tuesday, May 10, 2016 10:00 AM > *To:* fieldtrip, donders > *Subject:* [FieldTrip] Function is asking for raw data as input > > Hello, I am working on statistical analysis of EEG data from subjects. I > am trying to perform time lock analysis on the data available but while > executing the script these are the following errors I get: > > Error using ft_checkdata (line 464) > This function requires raw+comp or raw data as input. > > Error in ft_timelockanalysis (line 106) > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', > 'yes', 'hassampleinfo', 'yes'); > > Error in Actual_Timelockanalysis_MTT_EP (line 20) > EP{i,j,k}.All = > ft_timelockanalysis(cfg,Dat(i,j,k)); > > Error in Noise_MTT_EP (line 8) > [ep] = Actual_Timelockanalysis_MTT_EP(Data) > > Please let me know if you require any more information. > > > > Sent with MailTrack > > > _______________________________________________ > fieldtrip 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 Tue May 10 14:36:04 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Tue, 10 May 2016 12:36:04 +0000 Subject: [FieldTrip] About calculation of total power in TFr analysis In-Reply-To: References: <7CCA2706D7A4DA45931A892DF3C2894C3F90F5D6@exprd03.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C3F91068D@exprd03.hosting.ru.nl> Dear Tuna, In your code power is calculated relative to a baseline. So what you end up with is power change, not absolute power per se. Please check for yourself whether you want to have the data baselined or not. Secondly, assuming that you want to compute total power in the entire 1s epoch, a time-resolved FFT as you have now is not necessary. I would suggest using a regular FFT on the entire epoch (see my previous reply), without any baselining. Finally, the power now is only computed within the 1-40Hz range, which is less than ‘total’ of course. I would also advice you to go through some of the FT-tutorials on Fourier analyses, and search through the (extensive) mailing list-archive, see e.g. this thread: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-January/006114.html Best, Stan PS. Replying to the mailinglist is more useful than to specific persons individually, since the discussion might help others, too, and other people might want to add to the discussion. From: Tuna Cakar [mailto:cogsci.tuna at gmail.com] Sent: dinsdag 10 mei 2016 13:44 To: Pelt, S. van (Stan) Subject: Re: [FieldTrip] About calculation of total power in TFr analysis Dear Dr. van Pelt, I would like to thank you a lot for your response that also includes the necessary codes. The code I have performed is as below: cfg = []; cfg.baseline = [-0.4 -0.2]; cfg.baselinetype = 'relative'; %'absolute'; cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 1:1:40; cfg.toi = -0.4:0.01:0.99; cfg.keeptrials = 'yes'; TFR_MW_Px = ft_freqanalysis(cfg, data_out); Does it also calculate the total power then? I am supposed to perform wavelet analysis via Morlet and then calculate the total power. I may also look for trial-based analyses. It is also of my further interest to do the induced and evoked power calculations in the next steps. I would really appreciate your further support. Best, Tuna 2016-05-10 14:26 GMT+03:00 Tuna Cakar >: Dear Dr. van Pelt, I would like to thank you a lot for your response that also includes the necessary codes. The code I have performed is as below: cfg = [];cfg.baseline = [-0.4 -0.2]; cfg.baselinetype = 'relative'; %'absolute';cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 1:1:40; cfg.toi = -0.4:0.01:0.99;cfg.keeptrials = 'yes';TFR_MW_Px = ft_freqanalysis(cfg, data_out); Does it also calculate the total power then? I am supposed to perform wavelet analysis via Morlet and then calculate the total power. I may also look for trial-based analyses. It is also of my further interest to do the induced and evoked power calculations in the next steps. I would really appreciate your further support. Best, Tuna Dear Tuna, As far as I understand, the morlet-TFR example as used in the tutorial (http://www.fieldtriptoolbox.org/tutorial/timefrequencyanalysis) computes total (evoked and induced) power, per trial and time bin, and then averages over trials. To compute total power in the 1000ms epoch, I would suggest using cfg.method=’mtmfft’. E.g., something like the following, assuming that your data is organized in trials in a variable called ‘data’. BTW, note that because of your 1000ms data epoch, the intrinsic frequency resolution of your data is 1 Hz (1/1), thus spectral power below 1 Hz will be poorly estimated. cfg=[]; cfg.toilim=[0.0 1.0]; %1000ms time window data_ep=ft_redefinetrial(cfg,data); cfg=[]; cfg.pad=10; cfg.method=’mtmfft’; cfg.outpu=’pow’; cfg.foilim= [0.1 40]; cfg.channel = ‘all’; data_ep_pow=ft_freqanalysis(cfg,data_ep); 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 Tuna Cakar Sent: maandag 9 mei 2016 17:26 To: fieldtrip at science.ru.nl Subject: [FieldTrip] About calculation of total power in TFr analysis Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Tue May 10 17:15:17 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Tue, 10 May 2016 18:15:17 +0300 Subject: [FieldTrip] SVD did not converge. Message-ID: Dear fieldtrippers, I was doing the source reconstruction from MEG data based on individual headmodel (vol) and on individualized template grid (gridT). The following script cfg = []; cfg.method = 'lcmv'; %cfg.hdmfile = 'SubjectCMC.hdm'; cfg.headmodel = vol;%_nii_neuromag; %or project grad to common headmodel? cfg.grid = gridT; cfg.keepfilter = 'yes'; cfg.lcmv.fixedori='yes'; %use optimal orientation source = ft_sourceanalysis(cfg, timelock); worked fine for most subjects and even for this subject but in different condition. By some unknown reasons it shows error here. " *Error using svd SVD did not converge."* Could someone comment on this? below is a full copy from matlab output: > In ft_checkconfig at 475 In ft_sourceanalysis at 213 the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 0 MB using gradiometers specified in the data converting units from 'm' to 'cm' computing surface normals creating dipole grid based on user specified dipole positions using gradiometers specified in the configuration 3294 dipoles inside, 3510 dipoles outside brain the call to "ft_prepare_sourcemodel" took 1 seconds and required the additional allocation of an estimated 0 MB scanning repetition 1 *Error using svdSVD did not converge.Error in beamformer_lcmv>pinv (line 387) [U,S,V] = svd(A,0);Error in beamformer_lcmv (line 175)invCy = pinv(Cy + lambda * eye(size(Cy)));Error in ft_sourceanalysis (line 900) dip(i) = beamformer_lcmv(grid, sens, headmodel, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:});* Best Regards, Olga S. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Tue May 10 17:38:06 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 15:38:06 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl>, Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF318@exprd04.hosting.ru.nl> Hi Soujata, This probably happens because matlab is case-sensitive. So use .label instead of .Label; .trial instead of .Trial; .time instead of .Time. Then fieldtrip will recognize the correct fields. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 11:27 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Function is asking for raw data as input Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) > wrote: Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From cecile.issard at etu.parisdescartes.fr Tue May 10 18:16:48 2016 From: cecile.issard at etu.parisdescartes.fr (Cecile Issard) Date: Tue, 10 May 2016 16:16:48 +0000 Subject: [FieldTrip] two events per trial Message-ID: Hi Tineke, My problem is that the triggers for the onset and the offset of the stimulus are the same… — Message: 6 Date: Tue, 10 May 2016 08:55:39 +0000 From: "Snijders, T.M. (Tineke)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] two events per trial ? Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F at exprd04.hosting.ru.nl> Content-Type: text/plain; charset="Windows-1252" Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, C?cile ? C?cile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Universit? Paris Descartes 45 rue des Saints-P?res 75006 Paris Cécile Issard Doctorante 01.42.86.43.20 Laboratoire Psychologie de la Perception - UMR8242 45 rue des Sts Pères 75270 Paris cedex 06 http://lpp.psycho.univ-paris5.fr/index.php Labo bébé : http://recherche.parisdescartes.fr/LBB -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.borbaruah at student.utwente.nl Tue May 10 18:20:28 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 18:20:28 +0200 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, Many many thanks for the suggestion. It works now, however, instead of averaging trials in the three channels that is listed in cfg.channel, the script is performing the averaging in all 64 channels. Is it possible to correct it? After the script is executed, cfg contains a cell called channels with 6x1 cell and another cell called channel with 64x1 cell. I think the script is taking the data from channel. Regards, Soujata Sent with MailTrack On Tue, May 10, 2016 at 11:27 AM, Soujata Borbaruah < s.borbaruah at student.utwente.nl> wrote: > Dear Tineke, > > I have created a function that performs timelock analysis on trials > present in Dat which is obtained from Data of a subject. > > Script Average calls the function: > > Sub = 'Subject1'; % Need to perform for all the > subjects > load(['MTT_EP_data_',Sub,'.mat']); > > [ep] = Actual_Timelockanalysis_MTT_EP(Data) > > > function [EP] = Actual_Timelockanalysis_MTT_EP(Data) > > cfg = []; > cfg.channels = {'Cz';'M1';'M2'}; > > for i = 1; % Only for NOP=1 > S = unique(Data(i).Stimuli); % To find the unique stimuli > for j = 1:length(S) > Indices = find(Data(i).Stimuli == S(j)); % comparison > Idx{1} = 1:length(Indices); % Trials per amplitude, both > perceived and not perceived > for k = 1; > Dat(i,j,k).Stimuli = S(j); % Corresponding unique > stimuli > Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % > Extract the trials from Data(1).Trials and place in the new Dat structure > Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 > length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much > of time) > Dat(i,j,k).fsample = Data(i).fsample; > Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all > the 64 channels and the selection of the channels can be done using > cfg.channels > > if ~isempty(Idx{1}) > EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); > else > EP{i,j} = []; > > end > end > end > end > > Dat is supposed to be a 1x10 (because there are 10 unique stimuli) > structure with 5 fields which are: > 1. Type of stimuli > 2. Number of trials for the respective stimuli (64x4000 double for each > trial) > 3. Time of the trials (1x4000 double which is the same for every trial) > 4. fsample (1000) > 5. Labels of the EEG (64 channels). > > The Dat structure is created, however when the data in it is called for > timelockanalysis, it fails and the warning says it is not raw data. > > Sent with MailTrack > > > On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) < > tineke.snijders at donders.ru.nl> wrote: > >> Dear Soujata, >> >> Have you checked what data is in Dat(i,j,k)? The data input of >> ft_timelockanalysis should be organised in a structure as obtained from >> ft_preprocessing, with trial-based data. >> >> Best, >> Tineke >> >> >> >> ------------------------------ >> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] >> on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] >> *Sent:* Tuesday, May 10, 2016 10:00 AM >> *To:* fieldtrip, donders >> *Subject:* [FieldTrip] Function is asking for raw data as input >> >> Hello, I am working on statistical analysis of EEG data from subjects. I >> am trying to perform time lock analysis on the data available but while >> executing the script these are the following errors I get: >> >> Error using ft_checkdata (line 464) >> This function requires raw+comp or raw data as input. >> >> Error in ft_timelockanalysis (line 106) >> data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', >> 'yes', 'hassampleinfo', 'yes'); >> >> Error in Actual_Timelockanalysis_MTT_EP (line 20) >> EP{i,j,k}.All = >> ft_timelockanalysis(cfg,Dat(i,j,k)); >> >> Error in Noise_MTT_EP (line 8) >> [ep] = Actual_Timelockanalysis_MTT_EP(Data) >> >> Please let me know if you require any more information. >> >> >> >> Sent with MailTrack >> >> >> _______________________________________________ >> fieldtrip 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 Tue May 10 20:43:41 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 10 May 2016 18:43:41 +0000 Subject: [FieldTrip] two events per trial In-Reply-To: References: Message-ID: <12382FFA-DF60-4EDD-823D-439722B81DEB@donders.ru.nl> Hi Cecile, This sounds like a quasi serious flaw in your experimental setup. In general I would advice against the definition of the same event code for different events. In case one (or more) triggers are lost upon collection, it will be not trivial to correctly reconstruct the events post-hoc (in which case you always need to rely on an extra source of data , e.g. a logfile written out by your stimulus presentation software, where you then have to assume that all went well). Anyway, after this pedagogical note, the only thing I could come up with, is to write a custom ‘trialfun’ for your purposes, which selects every second equally valued event to be the ‘begin-of-trial’ trigger. Best, Jan-Mathijs On 10 May 2016, at 18:16, Cecile Issard > wrote: Hi Tineke, My problem is that the triggers for the onset and the offset of the stimulus are the same… — Message: 6 Date: Tue, 10 May 2016 08:55:39 +0000 From: "Snijders, T.M. (Tineke)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] two events per trial ? Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F at exprd04.hosting.ru.nl> Content-Type: text/plain; charset="Windows-1252" Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, C?cile ? C?cile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Universit? Paris Descartes 45 rue des Saints-P?res 75006 Paris Cécile Issard Doctorante 01.42.86.43.20 Laboratoire Psychologie de la Perception - UMR8242 45 rue des Sts Pères 75270 Paris cedex 06 http://lpp.psycho.univ-paris5.fr/index.php Labo bébé : http://recherche.parisdescartes.fr/LBB _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lindseyrtate at ou.edu Wed May 11 07:11:24 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Wed, 11 May 2016 05:11:24 +0000 Subject: [FieldTrip] Beamformer Tutorial, ft_prepare_headmodel Error Message-ID: Hello FieldTrip community, I'm working through the Beamformer tutorial on this page (http://www.fieldtriptoolbox.org/tutorial/beamformer) using MEG data from a saccade task. This code for constructing the head model, copied from the page, is giving me an error: % forward model mri segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat'); cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, segmentedmri); This is the complete text of the error: Error using ft_convert_units (line 150) cannot determine geometrical units Error in ft_checkdata (line 543) data = ft_convert_units(data); Error in ft_prepare_headmodel (line 203) data = ft_checkdata(data, 'hasunit', 'yes'); Error in LindseysBF (line 48) headmodel = ft_prepare_headmodel(cfg, segmentedmri); When I check the struct segmentedmri, it has a field called unit with a value of 'mm.' Because this code is using a file downloaded from the tutorial (i.e., segmentedmri, which can be downloaded from the link above) and is copy/pasted from the tutorial page, I can't figure out what's wrong or what to investigate. Can someone tell me if I'm making an error in the code, if there's something I could change about the code to make it work, or if this is a bug? Any help would be greatly appreciated. Thank you, Lindsey Tate Graduate Research Assistant Brian and Biomarker Lab University of Oklahoma -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed May 11 09:17:00 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 11 May 2016 09:17:00 +0200 Subject: [FieldTrip] Beamformer Tutorial, ft_prepare_headmodel Error In-Reply-To: References: Message-ID: <335A47C0-BC52-49D4-8C65-8582274B5338@donders.ru.nl> Dear Lindsey, The error lies in the way the data is loaded. > segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat’); produces this: segmentedmri = segmentedmri: [1x1 struct] The solution is quite easy, just replace the line by this: > load('C:\Users\EEG1\Documents\Data\segmentedmri.mat’); and it should look like this: segmentedmri = dim: [256 256 256] transform: [4x4 double] coordsys: 'ctf' unit: 'mm' gray: [256x256x256 double] white: [256x256x256 double] csf: [256x256x256 double] cfg: [1x1 struct] Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 11 May 2016, at 07:11, Tate, Lindsey R. wrote: > > Hello FieldTrip community, > > > I'm working through the Beamformer tutorial on this page (http://www.fieldtriptoolbox.org/tutorial/beamformer ) using MEG data from a saccade task. > > > > This code for constructing the head model, copied from the page, is giving me an error: > % forward model mri > segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat'); > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, segmentedmri); > > > This is the complete text of the error: > Error using ft_convert_units (line 150) > cannot determine geometrical units > > Error in ft_checkdata (line 543) > data = ft_convert_units(data); > > Error in ft_prepare_headmodel (line 203) > data = ft_checkdata(data, 'hasunit', 'yes'); > > Error in LindseysBF (line 48) > headmodel = ft_prepare_headmodel(cfg, segmentedmri); > > > When I check the struct segmentedmri, it has a field called unit with a value of 'mm.' Because this code is using a file downloaded from the tutorial (i.e., segmentedmri, which can be downloaded from the link above) and is copy/pasted from the tutorial page, I can't figure out what's wrong or what to investigate. Can someone tell me if I'm making an error in the code, if there's something I could change about the code to make it work, or if this is a bug? Any help would be greatly appreciated. > > > Thank you, > > Lindsey Tate > Graduate Research Assistant > Brian and Biomarker Lab > University of Oklahoma > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Wed May 11 09:23:47 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Wed, 11 May 2016 07:23:47 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> , Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF381@exprd04.hosting.ru.nl> Hi Soujata, So then you have to correct your script, so that you specify cfg.channel= {'Cz';'M1';'M2'}; instead of cfg.channels. I guess you could have worked that one out yourself... If you type 'help ft_timelockanalysis' you see it takes cfg.channel and not cfg.channels. Cheers, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 6:20 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Function is asking for raw data as input Dear Tineke, Many many thanks for the suggestion. It works now, however, instead of averaging trials in the three channels that is listed in cfg.channel, the script is performing the averaging in all 64 channels. Is it possible to correct it? After the script is executed, cfg contains a cell called channels with 6x1 cell and another cell called channel with 64x1 cell. I think the script is taking the data from channel. Regards, Soujata Sent with MailTrack On Tue, May 10, 2016 at 11:27 AM, Soujata Borbaruah > wrote: Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) > wrote: Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Wed May 11 20:04:38 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Wed, 11 May 2016 20:04:38 +0200 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? In-Reply-To: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> References: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> Message-ID: Dear Jan-Mathijs, thank you for your answer and please accept my apologies for the delay. I read that documentation but like I said, “computes descriptive parameters of the source analysis results” doesn't provide a meaningful explanation. What are those descriptive parameters? When should one use it? As for not using the function as an option, I'm trying to understand how to use FieldTrip and whether that function is important or not is beyond the scope of my current knowledge, hence why I'm trying to find the answer here. If I were to take your suggested approach every time, I don't think I'd ever succeed. ;-) Thank you and have a nice day! Harold On 4 May 2016 at 10:51, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Dear Harold, > > What extra documentation are you looking for? I think that a good start > would be to read the description in the documentation part of the m-file > itself (i.e. the stuff you get when typing ‘help ft_sourcedescriptives’). > Note: if you don’t think you need the function, it’s alright not to use it > :o). > > > Best, > Jan-Mathijs > > > On 02 May 2016, at 15:14, Harold Cavendish wrote: > > Hello, could you please explain the purpose of ft_sourcedescriptives() in > EEG source analysis? > > The documentation is very brief (“computes descriptive parameters of the > source analysis results”) and I haven't found a single tutorial with proper > explanation. I found it used here > but > without any explanation whatsoever. > > Thank you! > > Harold > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 elam4hcp at gmail.com Wed May 11 23:19:43 2016 From: elam4hcp at gmail.com (Jennifer Elam) Date: Wed, 11 May 2016 16:19:43 -0500 Subject: [FieldTrip] Announcing the the HCP Course 2016 in Boston Aug 28-Sept 1 Message-ID: The Human Connectome Project (HCP) is pleased to announce the 2016 HCP Course: “Exploring the Human Connectome” , to be held August 28-September 1 (Sunday-Thursday) at the Joseph B. Martin Conference Center at Harvard Medical School, in Boston, Massachusetts, USA. This 5-day intensive course will provide training in the acquisition, analysis and visualization of whole-brain imaging and behavioral data from the Human Connectome Project (HCP) using methods and informatics tools developed by the WU-Minn HCP consortium plus data made freely available to the neuroscience community. The course is designed for investigators who are interested in: *using data being collected and distributed by HCP *acquiring and analyzing HCP-style imaging and behavioral data at your own institution *processing your own non-HCP imaging data using HCP pipelines and methods *learning to use Connectome Workbench tools and the CIFTI connectivity data format *learning HCP multi-modal neuroimaging analysis methods, including those that combine MEG and MRI data *positioning yourself to capitalize on HCP-style data from forthcoming large-scale projects (e.g., Lifespan HCP and Connectomes Related to Human Disease) Participants will learn how to acquire, analyze, visualize, and interpret data from four major MR modalities (structural MR, resting-state fMRI, diffusion imaging, task-evoked fMRI) plus magnetoencephalography (MEG) and extensive behavioral data. Lectures and labs will provide grounding in neurobiological as well as methodological issues involved in interpreting multimodal data, and will span the range from single-voxel/vertex to brain network analysis approaches. The course is open to graduate students, postdocs, faculty, and industry participants. The course is aimed at both new and existing users of HCP data, methods, and tools, and will cover both basic and advanced topics. Prior experience in human neuroimaging or in computational analysis of brain networks is desirable, preferably including familiarity with FSL and Freesurfer software. For more info and to register visit the HCP Course website . We hope to see you in Bah-ston! Best, 2016 HCP Course Organizers -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 11:17:35 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 12:17:35 +0300 Subject: [FieldTrip] Allow overlap - ft_fetch_data Message-ID: Hello, How can I allow overlap between trials when using ft_fetch_data ? Many thanks, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 11:02:28 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 12:02:28 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' Message-ID: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that *sometimes *when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu May 12 11:46:12 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 12 May 2016 09:46:12 +0000 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' In-Reply-To: References: Message-ID: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> If your purpose is just to detrend, I would use ft_preprocessing: cfg = []; cfg.detrend = ‘yes’; data = ft_preprocessing(cfg, data); ft_resampledata is for resampling (what’s in a name), and allows for optional detrending prior to the downsampling (because a large trend may lead to edge artifacts upon the downsampling). best, Jan-Mathijs PS: I would also recommend to review your path settings, since you get some warnings about octave functions On 12 May 2016, at 11:02, shiri makov > wrote: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that sometimes when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 12:13:03 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 13:13:03 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' In-Reply-To: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> References: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> Message-ID: Thank you for your quick reply :) Actually I also need ft_resampledata for resampling... I get the same problem when trying to sownsample. I refreshed the path settings, do you think it should fix it? Best, S. 2016-05-12 12:46 GMT+03:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > If your purpose is just to detrend, I would use ft_preprocessing: > > cfg = []; > cfg.detrend = ‘yes’; > data = ft_preprocessing(cfg, data); > > ft_resampledata is for resampling (what’s in a name), and allows for > optional detrending prior to the downsampling (because a large trend may > lead to edge artifacts upon the downsampling). > > best, > Jan-Mathijs > > PS: I would also recommend to review your path settings, since you get > some warnings about octave functions > > > > On 12 May 2016, at 11:02, shiri makov wrote: > > > > Dear community, > > My name is Shiri and I am a student at Tel-Aviv Univesrity. I study > perception during sleep using EEG. Currently I am analysing EEG data > collected with EGI system. > > I tried using ft_resampledata to detrend the data. The weird thing is that * > sometimes *when I call ft_resampledata, I get an error message: > > the input is raw data with 8 channels and 60 trials > resampling data > Octave functions should not run on Matlab > Removing path ... > Error using .* > Matrix dimensions must agree. > Error in resample (line 71) > h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; > Error in ft_resampledata (line 208) > data.trial{itr} = > transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); > > > As noted, this error appears only sometimes. If I run ft_resampledata > again immidiately after receiving the error, it works well (same cfg, same > data). > The error always happens when I call the function within a parfor loop. It > almost never happens when I run the function line individually, without > preceeding script lines. > > > The cfg I use is very basic: > > >> display(cfg); > > cfg = > > detrend: 'yes' > > It happened to me on many data structs, so I share a link with just one of > them (http://www.filedropper.com/dataexample). Here too, I got the error > and right after that I ran the function line again and worked well. > > I don't think it's ok to live in peace with this function erroring from > time to time, can someone tell me what this error means? Did I not use the > function correctly? > > Best, > > Shiri > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 randomguy3167 at yahoo.com Thu May 12 20:54:00 2016 From: randomguy3167 at yahoo.com (Anon ymous) Date: Thu, 12 May 2016 18:54:00 +0000 (UTC) Subject: [FieldTrip] Help with Spike/LFP Tutorial Issue References: <660323151.1356054.1463079240955.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <660323151.1356054.1463079240955.JavaMail.yahoo@mail.yahoo.com> Hello Fieldtrip Community, I do realize this is probably really basic, but I was following the tutorial on analyzing spike and LFP data: http://www.fieldtriptoolbox.org/tutorial/spikefield. I've followed the tutorial almost exactly (with inconsequential changes) using the sample data provided in the tutorial.  It all works except for the STA plot for pre-stimulus. I get the correct plot as shown in the tutorial for my post-stimulus plot but then for some reason get the same thing for my pre-stimulus plot, which doesn't make sense. I have no idea what is causing this. The only differences I see between the two are the cfg.latency settings and all else is the same.      pre: cfg.latency = [-2.75 0];     post: cfg.latency = [0.3 10]; I've attached my script (as it is small) for reference. The plots and sample data are in the tutorial. Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Preprocessing.m Type: application/octet-stream Size: 2575 bytes Desc: not available URL: From christine.blume at sbg.ac.at Fri May 13 08:22:51 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Fri, 13 May 2016 06:22:51 +0000 Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation In-Reply-To: References: Message-ID: Dear community, I would like to do the following steps, however fieldtrip does not seem to like this in my case: 1. Artefact rejection on continuous data using ft_databrowser as I do not like ft_rejectvisual’s visualization (needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser). Calling ft_rejectartifact following that procedure to exclude major artefacts before ICA. 2. ICA on cleaned continuous data, mainly to remove EOG artefacts 3. Another round of manual/visual artefact rejection on cleaned/eog-rejected continuous data using ft_databrowser visualization (again, needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser) 4. Segmentation of cleaned data I am experiencing problems with the artefact rejection (1) and the following segmentation (4), though. It works fine if I segment my data using ft_redefinetrial and then call ft_rejectartifact with the cfg returned from the (first) call to ft_databrowser. However, if I reject artefacts first and then try to apply ft_redefinetrial to the cleaned data, “bad” trials are not excluded. Any ideas how to solve this are highly appreciated. Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Fri May 13 11:05:57 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Fri, 13 May 2016 14:35:57 +0530 Subject: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout Message-ID: Dear Fieldtrip team, I need 64 channels and 32 channels layout and labelings/nomenclature of those respective channels in compatible with fieldtrip.I have biosemi32.lay and biosemi64.lay.Please acknowledge me. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Fri May 13 12:20:10 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Fri, 13 May 2016 10:20:10 +0000 Subject: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout In-Reply-To: References: Message-ID: Hi Laxmi, Am I assuming correctly that you would like to prepare a layout file? The following should work: cfg = []; cfg.layout = ‘yourpath_to_the_biosemi32.lay’; biosemi32_layout = ft_prepare_layout(cfg); Following this, you can specify the layout every time you need one as: cfg = []; cfg.layout = biosemi32_layout; Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Laxmi Shaw Gesendet: Freitag, 13. Mai 2016 11:06 An: fieldtrip at science.ru.nl Betreff: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout Dear Fieldtrip team, I need 64 channels and 32 channels layout and labelings/nomenclature of those respective channels in compatible with fieldtrip.I have biosemi32.lay and biosemi64.lay.Please acknowledge me. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Fri May 13 20:21:59 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Fri, 13 May 2016 19:21:59 +0100 Subject: [FieldTrip] Neuromag coordinate transformation In-Reply-To: References: Message-ID: Dear All I have read in some data (MNE-sample data set). I have this command in the script hdr = ft_read_header(raw_data_filename); %your fif-filename hdr.grad gives the below structure ans = balance: [1x1 struct] chanori: [306x3 double] chanpos: [306x3 double] chantype: {306x1 cell} chanunit: {306x1 cell} coilori: [510x3 double] coilpos: [510x3 double] coordsys: 'neuromag' label: {306x1 cell} tra: [306x510 double] type: 'neuromag306' unit: 'cm' It says that I am in "neuromag coordinate" system. The corresponding number for this coordinate system is device=1.0. I have a transformation matrix T14.trans (coord system=1 to coord system=4) that takes me to head coordinate system i.e T14 = from: 1 to: 4 trans: [4x4 double] When I apply the transformation, to the coil position, the sensor array looks tilted to one side. But, without the transformation, it looks more reasonable (visually). Maybe he was tilting !!! My question is: Is it anyway possible that the transformation T14 has already been applied by the function hdr = ft_read_header(raw_data_filename); I have attached a picture of what I am describing. many thanks best regards parham hashemzadeh -------------- next part -------------- A non-text attachment was scrubbed... Name: coilpos.jpg Type: image/jpeg Size: 72267 bytes Desc: not available URL: From rabbani.6 at buckeyemail.osu.edu Fri May 13 22:19:11 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Fri, 13 May 2016 20:19:11 +0000 Subject: [FieldTrip] File Format Issue Message-ID: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Sat May 14 19:17:26 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Sat, 14 May 2016 22:47:26 +0530 Subject: [FieldTrip] Queries_related to structures Message-ID: Dear Fieldtrip list, I am having an issue with the data GA_FC. There is a structure inside the data named GA_FC.cfg and GA_FC.grad. So these two fields are showing dimension of 184*356. I have attached the structure with this mail.Could you please help me in what those structure signifies and how those can be define for any datasets. [image: Inline image 1] -- Thanks in advance Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 31543 bytes Desc: not available URL: From laxmi.shaw22 at gmail.com Mon May 16 18:27:31 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Mon, 16 May 2016 21:57:31 +0530 Subject: [FieldTrip] Queries using GRAD Message-ID: Dear Fieldtrip maillist, I am facing problem regarding the online available data of GA_FC, TFRhann and avg_FC. These files contain the structure field named grad. I am unable to understand the construction of this grad. I am getting the following errors while using our data set with that grad files. The errors are mentioned below: Error using fixdimord (line 85) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 80) timelock = fixdimord(timelock); Error in ft_checkdata (line 221) data = ft_datatype_timelock(data); Error in topoplot_common (line 74) data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}); Error in ft_topoplotER (line 195) cfg = topoplot_common(cfg, varargin{:}); Error in trial_3 (line 14) ft_topoplotER(cfg,STR_eEPDC); colorbar; Your help is always appreciated. Thanks and regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon May 16 19:42:44 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 16 May 2016 17:42:44 +0000 Subject: [FieldTrip] Queries using GRAD In-Reply-To: References: Message-ID: <52F8D9D2-B6F8-4D35-9B55-1CADA82A4E15@donders.ru.nl> Hi Laxmi, Why do you think that your current problem is caused by the ‘grad’ field in GA_FC? The error message you get suggests otherwise (it actually suggests that the data you use as an input to ft_topoplotER is not recognized as a properly formatted fieldtrip data structure), and indicates that the variable STR_eEPDC is internally inconsistent. The most likely cause of this is that the fields that describe the physical interpretation of the numeric data fields is not in line with the size of the data. Here’s a link that describes the type of data that (I think) you try to use as an input to the plotting routine: http://www.fieldtriptoolbox.org/reference/ft_datatype_timelock , but perhaps you also would like to look into http://www.fieldtriptoolbox.org/reference/ft_datatype_freq Here’s a link that describes the grad-structure (although I don’t think that you need this): http://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs > On 16 May 2016, at 18:27, Laxmi Shaw wrote: > > Dear Fieldtrip maillist, > I am facing problem regarding the online available data of GA_FC, TFRhann and avg_FC. > These files contain the structure field named grad. > I am unable to understand the construction of this grad. > I am getting the following errors while using our data set with that grad files. > The errors are mentioned below: > > > Error using fixdimord (line 85) > the data does not contain a dimord, but it also does not resemble raw or component data > > Error in ft_datatype_timelock (line 80) > timelock = fixdimord(timelock); > > Error in ft_checkdata (line 221) > data = ft_datatype_timelock(data); > > Error in topoplot_common (line 74) > data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}); > > Error in ft_topoplotER (line 195) > cfg = topoplot_common(cfg, varargin{:}); > > Error in trial_3 (line 14) > ft_topoplotER(cfg,STR_eEPDC); colorbar; > > Your help is always appreciated. > Thanks and regards > > -- > Laxmi Shaw > Research Scholar(PhD) > IIT Kharagpur > West Bengal > Ph no-08388837821 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From alex.sel at psy.ox.ac.uk Mon May 16 20:55:01 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Mon, 16 May 2016 18:55:01 +0000 Subject: [FieldTrip] depsamplesF Message-ID: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Dear list, I would like to run a non-parametric cluster-based permutation analysis. My experiment has a 2X2 within-subject design, i.e. I would like to compare more than two experimental conditions. I am using the cfg.statistics = 'depsamplesFmultivariate'. I wonder if this would be the correct option considering that I only have ONE dependent variable (i.e. ANOVA) and not multiple dependent variables (i.e. MANOVA). If this is not the correct statistic, would you be able to tell me what is the correct statistic that should be apply to tests differences between more than 2 experimental conditions in a within subject design? Any insight on this would be much appreciated. Best wishes, Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From bknakker at gmail.com Mon May 16 22:22:37 2016 From: bknakker at gmail.com (=?UTF-8?Q?Bal=C3=A1zs_Knakker?=) Date: Mon, 16 May 2016 22:22:37 +0200 Subject: [FieldTrip] depsamplesF In-Reply-To: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> References: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Message-ID: Dear Alex, As far as I know, depsamplesFmultivariate corresponds to what used to be the default option to perform a dependent samples F-test (it was called depsamplesF), which tolerates nonsphericity when there are more than 2 levels by dealing with the question from a multivariate standpoint. But in your case, you can also test main effects and interactions in your 2×2 design, and in that case I think these will yield identical results, and you could as well be using T-tests (comparing averages over the other factor for the main effects, and comparing the differences along one factor at both levels of the other factor for the interaction, see also this http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests ). If you would decide to disregard the factor structure of your data and would do something like a one-way ANOVA with 4 levels, I would stick with the MANOVA approach. I would be curious to know whether the univarate version is recommended, apart from the case when one wants results comparable to a conventional ANOVA F-test. Greetings, Balázs Knakker On Mon, May 16, 2016 at 8:55 PM, Alex Sel wrote: > Dear list, > > > > I would like to run a non-parametric cluster-based permutation analysis. > My experiment has a 2X2 within-subject design, i.e. I would like to compare > more than two experimental conditions. I am using the cfg.statistics = > ‘depsamplesFmultivariate’. I wonder if this would be the correct option > considering that I only have ONE dependent variable (i.e. ANOVA) and not > multiple dependent variables (i.e. MANOVA). If this is not the correct > statistic, would you be able to tell me what is the correct statistic that > should be apply to tests differences between more than 2 experimental > conditions in a within subject design? > > > > Any insight on this would be much appreciated. > > > > Best wishes, > > Alex Sel, PhD > > Postdoctoral Researcher > > Department of Experimental Psychology, > > University of Oxford, > > 9 South Parks Road, > > OX1 3UD > > Tel: 01865 271 340 > > Email: Alex.sel at psy.ox.ac.uk > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Mon May 16 22:26:57 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Mon, 16 May 2016 20:26:57 +0000 Subject: [FieldTrip] depsamplesF In-Reply-To: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> References: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378E0380@exprd04.hosting.ru.nl> Dear Alex, In your case the easiest is to just use depsamplesT. For testing the main effects you can then use the average of the 2 conditions, and for testing the interaction you can use the two difference scores. Good luck, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alex Sel [alex.sel at psy.ox.ac.uk] Sent: Monday, May 16, 2016 8:55 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] depsamplesF Dear list, I would like to run a non-parametric cluster-based permutation analysis. My experiment has a 2X2 within-subject design, i.e. I would like to compare more than two experimental conditions. I am using the cfg.statistics = ‘depsamplesFmultivariate’. I wonder if this would be the correct option considering that I only have ONE dependent variable (i.e. ANOVA) and not multiple dependent variables (i.e. MANOVA). If this is not the correct statistic, would you be able to tell me what is the correct statistic that should be apply to tests differences between more than 2 experimental conditions in a within subject design? Any insight on this would be much appreciated. Best wishes, Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabbani.6 at buckeyemail.osu.edu Mon May 16 22:38:10 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Mon, 16 May 2016 20:38:10 +0000 Subject: [FieldTrip] File Format Issue In-Reply-To: References: Message-ID: <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> Dear Fieldtrip Community, I don't seem to have gotten a response back for my issue. Forgive me if this is too soon. Please direct me to the right resource if you know of one. It's just a simple issue of formatting, but all the data is there. I would like to add that the specific error I get is with the initial step reading in the spike data with ft_read_spike. The error simply says "unsupported file format." I'm still new to all this and would really appreciate the help so I can move forward with the actual analysis. Thank you all for your time, Qinwan Rabbani On May 13, 2016, at 4:19 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabbani.6 at buckeyemail.osu.edu Mon May 16 22:40:11 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Mon, 16 May 2016 20:40:11 +0000 Subject: [FieldTrip] File Format Issue In-Reply-To: <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> References: , <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> Message-ID: My apologies for the double email. It says unsupported data format not file format. On May 16, 2016, at 4:38 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip Community, I don't seem to have gotten a response back for my issue. Forgive me if this is too soon. Please direct me to the right resource if you know of one. It's just a simple issue of formatting, but all the data is there. I would like to add that the specific error I get is with the initial step reading in the spike data with ft_read_spike. The error simply says "unsupported file format." I'm still new to all this and would really appreciate the help so I can move forward with the actual analysis. Thank you all for your time, Qinwan Rabbani On May 13, 2016, at 4:19 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From SXM1085 at student.bham.ac.uk Tue May 17 18:37:16 2016 From: SXM1085 at student.bham.ac.uk (Sebastian Michelmann) Date: Tue, 17 May 2016 16:37:16 +0000 Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation In-Reply-To: References: Message-ID: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EEF309E@EX13.adf.bham.ac.uk> Hi Christine, I'm sure that there is a "clean" fieldtrip way to solve your problem which should be the preferred solution. However here is an idea for debugging and a potential workaround that might help. So ft_databrowser marks the artefacts you selected by storing the sampleinfo of the beginning and the end of you selection (these are two sampling points, counted from the beginning of your recording). They are stored in two column vectors (look it up in cfg.artfctdef.visual). I think something might have gone wrong when you cut your data because fieldtrip eventually removes and/or reconstructs sampleinfo if it is inconsistent or missing (don't ask me how and when this does and does not happen). So my guess for debugging would be: check at every step, what happens to your data.sampleinfo. It's also worth to read through the command line output because you should get a warning if something funny is going on. If you know your sampleinfo to be correct, here a workaround you might want to try: % 1st Manually read out the trials that contain artifacts (right after you marked them: cfg_art= ft_databrowser(cfg, data)); a_trials =[]; % trials with artifacts artifacts=cfg_art.artfctdef.visual; % info about the artifacts for n=1:size(artifacts.artifact,1) a_trials = [a_trials;find(data.sampleinfo(:,1) <= artifacts.artifact(n,1) ... & data.sampleinfo(:,2) >= artifacts.artifact(n,1))]; %concatenate the trials that contain artifacts end % find out which trials are artefact free trials=1:numel(data.trial); % all the trials trialsel=find(~ismember(trials,a_trials)); % the selected trials are trials that are not member of the artifact trials % Call ft_preprocessing (or ft_selectdata...) to select only the artefact free trials. cfg=[]; cfg.trials=trialsel; data_clean = ft_selectdata(cfg, data); I hope that helps. Best, Sebastian From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Blume Christine Sent: 13 May 2016 07:23 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation Dear community, I would like to do the following steps, however fieldtrip does not seem to like this in my case: 1. Artefact rejection on continuous data using ft_databrowser as I do not like ft_rejectvisual's visualization (needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser). Calling ft_rejectartifact following that procedure to exclude major artefacts before ICA. 2. ICA on cleaned continuous data, mainly to remove EOG artefacts 3. Another round of manual/visual artefact rejection on cleaned/eog-rejected continuous data using ft_databrowser visualization (again, needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser) 4. Segmentation of cleaned data I am experiencing problems with the artefact rejection (1) and the following segmentation (4), though. It works fine if I segment my data using ft_redefinetrial and then call ft_rejectartifact with the cfg returned from the (first) call to ft_databrowser. However, if I reject artefacts first and then try to apply ft_redefinetrial to the cleaned data, "bad" trials are not excluded. Any ideas how to solve this are highly appreciated. Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From darinkat87 at gmail.com Wed May 18 12:12:58 2016 From: darinkat87 at gmail.com (=?UTF-8?Q?Darinka_Tr=C3=BCbutschek?=) Date: Wed, 18 May 2016 12:12:58 +0200 Subject: [FieldTrip] Baseline correction during ICA & then again before timelock? Message-ID: Dear all, I am using fieldtrip to preprocess (epoching, trial rejection, ICA to remove eye blinks, etc., filtering) my MEG data and have a question regarding baseline correction.I have noticed that, in the default settings for ft_componentanalysis, cfg.demean is set to 'yes', so I assume that the mean of the entire trial is subrated. What does this setting imply for future analyses of this data (at the sensor-level), for example timelock analyses of different conditions. Should one still implement another baseline-correction? Why/why not? In advance, many thanks for your help. I very much appreciate all of the knowledge of this community! Best, Darinka -- Darinka Trübutschek (PhD Candidate) Inserm-CEA Cognitive Neuroimaging Unit CEA/SAC/DSV/DRM/Neurospin Bât 145, Point Courier 156 F-91191 Gif-sur-Yvette website: https://sites.google.com/site/dtruebutschek/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From behzadiravani at gmail.com Wed May 18 13:05:15 2016 From: behzadiravani at gmail.com (Behzad Iravani) Date: Wed, 18 May 2016 13:05:15 +0200 Subject: [FieldTrip] Micro State Analysis Message-ID: Dear fieldtrip experts, I'm wondering if there is an implemented function to do the micro state analysis. If it's not then I managed to find some dominant states (let's say 8, so basically now I have data matrix 8*number of channels) and I want to determine the sources associate with these brain states but I'm not sure what the best way is to do it. Best Behzad Iravani Research Assistant, Karolinska Institutet -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmq1990 at gmail.com Wed May 18 18:33:41 2016 From: xmq1990 at gmail.com (Mengqi Xing) Date: Wed, 18 May 2016 16:33:41 +0000 Subject: [FieldTrip] EEG connectivity without averaging over the trials. Message-ID: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Dear all, I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a few questions about trial averaging in ft_connectivityanalysis. I realized regardless which method I'm using, the ft_connectivityanalysis tends to averaging over trials (dimension rpt), which sacrifices the dynamic of the data. Is it possible not let the function averaging over trials while still getting a meaningful result? ( I tried to duplicate trial and let it average itself and it reported some errors.) Or is there a connectivity method that allows non-trial-averaging to run? Thank you very much! Maggie Xing -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed May 18 18:59:05 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 18 May 2016 18:59:05 +0200 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: Dear Maggie, As connectivity in principle relies on the correlation between trials (very very very simplified), it's not possible to compute single trial connectivity. However, what has been done is taking the single-trial deviance from the average phase as a measure of connectivity. See Keil et al 2014, Cerebral Cortex or Hanslmayr et al 2007, NeuroImage for a description. Good Luck, Julian Am Mittwoch, 18. Mai 2016 schrieb Mengqi Xing : > Dear all, > > I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a > few questions about trial averaging in ft_connectivityanalysis. I realized > regardless which method I'm using, the ft_connectivityanalysis tends to > averaging over trials (dimension rpt), which sacrifices the dynamic of the > data. Is it possible not let the function averaging over trials while still > getting a meaningful result? ( I tried to duplicate trial and let it > average itself and it reported some errors.) Or is there a connectivity > method that allows non-trial-averaging to run? Thank you very much! > > Maggie Xing > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gcosta18 at gmail.com Wed May 18 19:50:56 2016 From: gcosta18 at gmail.com (Gabriel Costa) Date: Wed, 18 May 2016 17:50:56 +0000 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: <6afd5d9ac3664154ba3027791bc11548@EXPRD02.hosting.ru.nl> Dear Maggie, If I'm not mistaken, connectivity estimates can be obtained at single trial if one estimates phase correlation over time (see Cohen, 2014 Analyzing Neural Time Series). If you are not interested in the time dimension you could just obtain a single value of coherence for each trial, estimating phase coherence over time, which you can then average over trials. If you still want to maintain time dimension and get a time(x)-frequency(y) plot of coherence, than you should use a sliding window. I believe this method (coherence over time) is not integrated in either Fieldtrip or EEGLAB, but it's not that difficult to implement this from the matrix with the complex fourier spectra (ft_freqanalysis with cfg.output = 'fourier'). Good luck, Gabriel Costa . On Wed, May 18, 2016 at 5:33 PM, Mengqi Xing > wrote: Dear all, I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a few questions about trial averaging in ft_connectivityanalysis. I realized regardless which method I'm using, the ft_connectivityanalysis tends to averaging over trials (dimension rpt), which sacrifices the dynamic of the data. Is it possible not let the function averaging over trials while still getting a meaningful result? ( I tried to duplicate trial and let it average itself and it reported some errors.) Or is there a connectivity method that allows non-trial-averaging to run? Thank you very much! Maggie Xing _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From gcosta18 at gmail.com Wed May 18 19:50:56 2016 From: gcosta18 at gmail.com (Gabriel Costa) Date: Wed, 18 May 2016 18:50:56 +0100 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: Dear Maggie, If I'm not mistaken, connectivity estimates can be obtained at single trial if one estimates phase correlation over time (see Cohen, 2014 Analyzing Neural Time Series). If you are not interested in the time dimension you could just obtain a single value of coherence for each trial, estimating phase coherence over time, which you can then average over trials. If you still want to maintain time dimension and get a time(x)-frequency(y) plot of coherence, than you should use a sliding window. I believe this method (coherence over time) is not integrated in either Fieldtrip or EEGLAB, but it's not that difficult to implement this from the matrix with the complex fourier spectra (ft_freqanalysis with cfg.output = 'fourier'). Good luck, Gabriel Costa . On Wed, May 18, 2016 at 5:33 PM, Mengqi Xing wrote: > Dear all, > > I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a > few questions about trial averaging in ft_connectivityanalysis. I realized > regardless which method I'm using, the ft_connectivityanalysis tends to > averaging over trials (dimension rpt), which sacrifices the dynamic of the > data. Is it possible not let the function averaging over trials while still > getting a meaningful result? ( I tried to duplicate trial and let it > average itself and it reported some errors.) Or is there a connectivity > method that allows non-trial-averaging to run? Thank you very much! > > Maggie Xing > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Thu May 19 18:28:01 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Thu, 19 May 2016 21:58:01 +0530 Subject: [FieldTrip] Queries_3 Message-ID: Dear Fieldtrip list, I am having doubt in the cfg structure, how the cfg.xlim and cfg.zlim has been set for GA_FC data. How can we define for our datasets. What is the .lay files signifies. I mean biosemi64.lay and EEG1020.lay defines what. Your help and advice is always appreciated. Regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gina.joue at univr.it Thu May 19 18:36:38 2016 From: gina.joue at univr.it (gj) Date: Thu, 19 May 2016 18:36:38 +0200 Subject: [FieldTrip] head model mat contains only NaN values Message-ID: <573DEB96.4050100@univr.it> Hi FieldTrippers, While trying to calculate a head model (FT ver.20160309), the head model contains only NaNs, and I get the following errors: ------------- beg error ------------ Warning: NaN detected, trying once more with slightly different vertex positions > In ft_prepare_headmodel (line 280) Warning: No conductivity is declared, assuming standard values > In ft_headmodel_bemcp (line 79) In ft_prepare_headmodel (line 281) Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In ft_headmodel_bemcp (line 185) In ft_prepare_headmodel (line 281) ------------- end error ------------ This was what I ran: ----------- smri = ft_read_mri(smrifn); % subject's own structural MRI cfg = []; mri.coordsys = 'MNI'; cfg.brainthreshold = 0.5; cfg.output = {'brain','skull','scalp'}; smri_seg = ft_volumesegment(cfg, smri); cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.method = 'projectmesh'; cfg.numvertices = [2400 1600 800]; mesh_hd=ft_prepare_mesh(cfg,smri_seg); cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg, mesh_hd); ----------- Not sure if this might be related, but we have head+neck MRIs and when I plot the meshes, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I've tried different ft_prepare_mesh methods, different number of vertices.... Thanks in advance for any advice! Gina -------------- next part -------------- A non-text attachment was scrubbed... Name: FTmesh-lat.png Type: image/png Size: 48876 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FTmesh-sup.png Type: image/png Size: 43865 bytes Desc: not available URL: From S.Homolle at donders.ru.nl Thu May 19 19:42:50 2016 From: S.Homolle at donders.ru.nl (=?iso-8859-1?Q?Hom=F6lle=2C_S=2E_=28Simon=29?=) Date: Thu, 19 May 2016 17:42:50 +0000 Subject: [FieldTrip] head model mat contains only NaN values In-Reply-To: <573DEB96.4050100@univr.it> References: <573DEB96.4050100@univr.it> Message-ID: <2247A6E8AF3DB04AAB11BDDD86B72F8315878CC5@exprd02.hosting.ru.nl> Dear Gina, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I guess this is the reason why you get the NaN values. BEM needs nested and sufficiently distant surfaces. As I don't know the quality and sequence (T1, T2?) of your MRI I suggest you to look at the segmentation to be sure that this is well done. With a good segmentation preparing the mesh is not a problem. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of gj [gina.joue at univr.it] Sent: Thursday, May 19, 2016 6:36 PM To: FieldTrip discussion list Subject: [FieldTrip] head model mat contains only NaN values Hi FieldTrippers, While trying to calculate a head model (FT ver.20160309), the head model contains only NaNs, and I get the following errors: ------------- beg error ------------ Warning: NaN detected, trying once more with slightly different vertex positions > In ft_prepare_headmodel (line 280) Warning: No conductivity is declared, assuming standard values > In ft_headmodel_bemcp (line 79) In ft_prepare_headmodel (line 281) Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In ft_headmodel_bemcp (line 185) In ft_prepare_headmodel (line 281) ------------- end error ------------ This was what I ran: ----------- smri = ft_read_mri(smrifn); % subject's own structural MRI cfg = []; mri.coordsys = 'MNI'; cfg.brainthreshold = 0.5; cfg.output = {'brain','skull','scalp'}; smri_seg = ft_volumesegment(cfg, smri); cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.method = 'projectmesh'; cfg.numvertices = [2400 1600 800]; mesh_hd=ft_prepare_mesh(cfg,smri_seg); cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg, mesh_hd); ----------- Not sure if this might be related, but we have head+neck MRIs and when I plot the meshes, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I've tried different ft_prepare_mesh methods, different number of vertices.... Thanks in advance for any advice! Gina From gina.joue at univr.it Fri May 20 11:26:35 2016 From: gina.joue at univr.it (gj) Date: Fri, 20 May 2016 11:26:35 +0200 Subject: [FieldTrip] head model mat contains only NaN values In-Reply-To: <573ED025.40808@univr.it> References: <573DEB96.4050100@univr.it> <573ED025.40808@univr.it> Message-ID: <573ED84B.5030609@univr.it> Thanks for your reply, Simon. I had plotted the segmentation and it seems to look fine (see attached), which makes me think that it's the meshing, but I tried a slew of methods and number of vertices but I can't get rid of the scalp planes internal to the brain. Any advice on what to try greatly appreciated! Gina > Dear Gina, > > I see that the "scalp" has vertices that connect planes > internal to the brain (see images attached). > > I guess this is the reason why you get the NaN values. BEM needs > nested and sufficiently distant surfaces. > As I don't know the quality and sequence (T1, T2?) of your MRI I > suggest you to look at the segmentation to be sure that this is well done. With a good segmentation preparing the mesh is not a problem. > Bests, > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 20/05/2016 10:51, gj wrote: > > > On 19/05/2016 18:36, gj wrote: >> Hi FieldTrippers, >> >> While trying to calculate a head model (FT ver.20160309), the head model >> contains only NaNs, and I get the following errors: >> >> ------------- beg error ------------ >> Warning: NaN detected, trying once more with slightly different vertex >> positions >> > In ft_prepare_headmodel (line 280) >> Warning: No conductivity is declared, assuming standard values >> > In ft_headmodel_bemcp (line 79) >> In ft_prepare_headmodel (line 281) >> >> Warning: Matrix is singular, close to singular or badly scaled. Results >> may be inaccurate. RCOND = NaN. >> > In ft_headmodel_bemcp (line 185) >> In ft_prepare_headmodel (line 281) >> ------------- end error ------------ >> >> >> >> This was what I ran: >> >> ----------- >> smri = ft_read_mri(smrifn); % subject's own structural MRI >> >> cfg = []; >> mri.coordsys = 'MNI'; >> cfg.brainthreshold = 0.5; >> cfg.output = {'brain','skull','scalp'}; >> smri_seg = ft_volumesegment(cfg, smri); >> >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.method = 'projectmesh'; >> cfg.numvertices = [2400 1600 800]; >> mesh_hd=ft_prepare_mesh(cfg,smri_seg); >> >> cfg = []; >> cfg.method = 'bemcp'; >> headmodel = ft_prepare_headmodel(cfg, mesh_hd); >> ----------- >> >> Not sure if this might be related, but we have head+neck MRIs and when I >> plot the meshes, I see that the "scalp" has vertices that connect planes >> internal to the brain (see images attached). I've tried different >> ft_prepare_mesh methods, different number of vertices.... >> >> Thanks in advance for any advice! >> Gina -------------- next part -------------- A non-text attachment was scrubbed... Name: FTseg.png Type: image/png Size: 20730 bytes Desc: not available URL: From figueiredo.aeon at gmail.com Fri May 20 16:32:33 2016 From: figueiredo.aeon at gmail.com (Thiago Figueiredo) Date: Fri, 20 May 2016 16:32:33 +0200 Subject: [FieldTrip] Partial Directed Coherence threshold with few trials Message-ID: Hello Fieldtrip Community, I was analyzing corticocortical (EEG-EEG) and corticomuscular (EEG-sEMG) partial directed coherence with the ft_connectivityanalysis() function and later calculating a frequency dependent threshold for the coherence values in a session using my own implementation of the statistics described in Schelter, Björn, et al. "*Testing for directed influences among neural signals using partial directed coherence*." *Journal of neuroscience methods* (2006). I then considered in my analysis only the significant values higher than this threshold. The problem is that now we are applying a more strict preprocessing method that rejects many more trials, leaving us with a ​small number of trials ​(sometimes 20 or sometimes even less than 10 trials per session, instead of the 50 or 60 that we had before). This leads us to the problem of the validity of the coherence estimates with few trials and to the problem of the thresholding method, which is based on a theoretical asymptotic limit and gives incorrect results for such a small number of trials. So my question is twofold: 1- What is the minimum number of trials that we are allowed to use, in order to obtain a reasonable estimate for the PDC with ft_connectivityanalysis() 2- Do you know of any method for calculating the significance of the coherence values to a given significance level, considering that we have a small number of trials? (permutation tests? something else?) Thank you -- Thiago da Cruz Figueiredo Neuroprosthetics Laboratory, Institute for Medical Psychology and Behavioural Neurobiology - University of Tübingen, Germany Núcleo de Inovação Tecnológica em Reabilitação (NITRE) - Universidade Federal da Bahia, Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.sel at psy.ox.ac.uk Fri May 20 17:30:17 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Fri, 20 May 2016 15:30:17 +0000 Subject: [FieldTrip] 2x2 within subject design with covariate Message-ID: <3123912FD054FE44A023073D2EFD213C8C4209@MBX02.ad.oak.ox.ac.uk> Dear List, I am trying to perform a cluster-based permutation test. I have an experimental design with 2 within variables (2x2 design) and a covariate. I wonder how I can define the statistics in the script to include both the within-subject variables and the covariate. I am using the cfg.statistics = 'depsamplesFmultivariate' but I am unsure how to define the covariate in the model. Any insight on this would be much appreciated. Best wishes Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Sun May 22 17:28:39 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Sun, 22 May 2016 20:58:39 +0530 Subject: [FieldTrip] Queries:4 Message-ID: Dear Fieldtrip user, I am getting an that , i am using the layout of biosemi 64 and out of 64 ...8 selected electrodes.But the code is working fine,while investing i found that the out of 8, 4 electrodes are outsides the topoplot. I have doubt regarding the EEG 10-20 system, all the standards electrodes positions have to be same then how come X,Y ,z and theta values are differed in other layouts. How can i fix this problem of such 10-20 channels location.In biosemi 64 and EEG10-20.lay what are the 4 columns signifies and how can i define for my own 64 channels. Your help and suggestions are always appreciable. Thanks and regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.sel at psy.ox.ac.uk Tue May 24 10:57:46 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Tue, 24 May 2016 08:57:46 +0000 Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA Message-ID: <3123912FD054FE44A023073D2EFD213C8CA53F@MBX02.ad.oak.ox.ac.uk> Dear List, Apologies for the reposting... I am trying to perform a cluster-based permutation test. I have an experimental design with 2 within variables (2x2 design) and a covariate. I wonder how I can define the statistics in the script to include both the within-subject variables and the covariate. I am using the cfg.statistics = 'depsamplesFmultivariate' but I am unsure how to define the covariate in the model. Any insight on this would be much appreciated. Best wishes Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Tue May 24 11:56:55 2016 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 24 May 2016 02:56:55 -0700 Subject: [FieldTrip] Can I rename the CTF HLC0011 etc... to {'nasX'; 'nasY'; 'nasZ'; 'lpaX'; 'lpaY'; 'lpaZ'; 'rpaX'; 'rpaY'; 'rpaZ'}? Message-ID: Dear FieldTrippers, I'm using ft_megrealign after timelocking my data for each participant and recording, and before appending these different recording sessions (and subsequently taking grand averages over subjects). Since the experiment consisted of different sessions a few weeks apart, I'd like to minimise noise due to differences in head position (we used online head localisation, but this did not work very well for all participants when coming back a few weeks later. After making the headmodel (and ensuring it's aligned with the gradiometers), this works quite well: % realign to template sensor positions cfg = []; cfg.template = {'ctf275.mat'}; cfg.headmodel = headmodel; % For a realistic single-shell volume conduction model based on the brain surface, you % should probably use an inward shift of about 1 cm. cfg.inwardshift = 1; cfg.feedback = 'no'; data2 = ft_megrealign(cfg, data); However, when looking into the ft_megrealign function I found that there is the option of doing this per trial based on the CTF coil positions (rather than once based on the gradiometer definition at the beginning of the run). This seems sensible for participants who moved quite a bit during a recording. However, CTF does not originally output the {'nasX';'nasY';'nasZ';'lpaX';'lpaY';'lpaZ';'rpaX';'rpaY';'rpaZ'} that the function looks for. In ft_headmovement (and also buried somewhere in the CTF documentation), I could find % HLC0011 HLC0012 HLC0013 x, y, z coordinates of nasion-coil in m. % HLC0021 HLC0022 HLC0023 x, y, z coordinates of lpa-coil in m. % HLC0031 HLC0032 HLC0033 x, y, z coordinates of rpa-coil in m. So it seems reasonable to simply rename these to the channel names that ft_megrealign is looking for. When doing this, realignment indeed happens at the single trial level. However, I wanted to check if there is a reason for using the nasX nasY... channel names rather than the original HLC0011.. ones? Can I rename them while keeping the rest of the HLC channels (of which there are 24) the same? I can't think of a reason why this would cause any issues, but since I could not find the 'per-trial' option documented I thought I'd check what the rationale behind using per-trial or per-run is. Thanks! Cheers, — Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie Universitätsklinikum Hamburg-Eppendorf | Martinistrasse 52, 20246 | Hamburg, Germany www.anneurai.net / @AnneEUrai -------------- next part -------------- An HTML attachment was scrubbed... URL: From koreykam at gmail.com Tue May 24 17:15:51 2016 From: koreykam at gmail.com (Korey Kam) Date: Tue, 24 May 2016 15:15:51 +0000 Subject: [FieldTrip] coefficient of variation on raw data Message-ID: Hi all, I'm interested in computing the coefficient of variation on raw data for single trials (as opposed to averaging them). In order to maintain cfg bookkeeping, I've been trying ft_math for this purpose. However, I've been unable to call ft_math in a single trial manner to effectively compute this: coeff(i) = std(trial(i))/mean(trial(i)); Does anyone have a recommendation on doing this in FT? Alternatively, I've used nested loops over trials and channels, but would much rather maintain cfg history. Thanks, Korey -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.caballero at bcbl.eu Wed May 25 12:35:48 2016 From: c.caballero at bcbl.eu (Cesar Caballero) Date: Wed, 25 May 2016 12:35:48 +0200 (CEST) Subject: [FieldTrip] postdoctoral position on MEG correlates of statistical learning and language processing: BCBL, San Sebastian, Spain In-Reply-To: References: <6DDD80C5-EECF-467C-BABF-385AE1B6CB78@gmail.com> Message-ID: <2011274752.1506286.1464172548396.JavaMail.zimbra@bcbl.eu> Dear all, The Basque Center on Cognition Brain and Language – BCBL- (San Sebastián, Basque Country, Spain) is offering a postdoctoral position focused on the MEG correlates of statistical learning and language processing , as part of ERC-funded research project (PI: Ram Frost). The successful candidate will have a rigorous background in MEG data acquisition and analysis, have a high level of independence, and a strong publication record. The candidate should also be able to contribute to the broader research goals of the project which include computational, behavioural, and fMRI investigations of the neural basis of statistical learning and language learning conducted in collaboration with research groups at the Hebrew University and the University of Toronto. Individuals interested in undertaking research in the fields described in www.bcbl.eu (research) should apply through the BCBL web page http://www.bcbl.eu/jobs ( MEG Postdoc 2016) Deadline: July 15 th , 2016. For more information about the specifics of the position, please contact Ram Frost ( ram.frost at mail.huji.ac.il ) and for broader information about the BCBL please contact Manuel Carreiras ( info at bcbl.eu ). ---------------------------------------------------------------------- Cesar Caballero www.bcbl.eu Twitter: @caballerogaudes www.researchgate.net/profile/Cesar_Caballero2 Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Wed May 25 13:16:17 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Wed, 25 May 2016 16:46:17 +0530 Subject: [FieldTrip] Queries Message-ID: Dear fieldtrippers, I am trying to make a topoplot of my data, which has 8 channels. As there was no layout for 8 channels, I made my own layout for 8 channels with the same channel coordinates which were for 64 channel (biosemi64). And while plotting 4 of the electrodes are lying outside the head layout. Can you kindly suggest me a way how I can bring the layout points inside the head layout. Find the attached image file of the snap of the topoplot. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eEPDC_13.jpg Type: image/jpeg Size: 25679 bytes Desc: not available URL: From gina.joue at univr.it Wed May 25 13:39:00 2016 From: gina.joue at univr.it (gj) Date: Wed, 25 May 2016 13:39:00 +0200 Subject: [FieldTrip] "Out of memory" during ft_sourceplot Message-ID: <57458ED4.3060101@univr.it> Hi FieldTrippers, I am trying to do source analysis (eventually source-level connectivity analysis) and while plotting the source analysis results with ft_sourceplot, I get the following error: -------------------- error --------------------------------- Error using ' Out of memory. Type HELP MEMORY for your options. Error in pos2transform (line 33) transform = pos(:,sel)/ind(:,sel); Error in ft_sourceplot (line 291) functional.transform = pos2transform(functional.pos, functional.dim); -------------------------------------------------------------- Could someone guide me in what I should doublecheck along the way for possible errors and how? Below are the commands I executed leading to the plot command. Thanks in advance! Gina --------------------------------------- cfg = []; cfg.frequency = fft.freq; cfg.elec = elecR; % realigned electrodes cfg.method = 'dics'; % only dics seems to give noise proj? cfg.grid = lf; % lf.pos is a 6804x3 double arr lf.dim=18,21,18] cfg.headmodel = headmodel; % bemcp in mm, mat is 330x4330 double arr cfg.keeptrials = 'yes'; cfg.pcc.fixedori = 'yes'; cfg.dics.projectnoise = 'yes'; % to norm power in ctr of brain cfg.dics.lambda = 0; source_avg = ft_sourceanalysis(cfg, fft); % fft = output from ft_freqanalysis with meth 'mtmfft' and output 'fourier' % calc to reduce center of head bias sourceNAI = source_avg; sourceNAI.avg.pow = source_avg.avg.pow ./ source_avg.avg.noise; % reduce the source reconstructed data to the dominant orientation cfg = []; cfg.projectmom = 'yes'; % project to the direction that explains most of the source variance; The three rows of the moment are the strength of the source in the x-, y- and z-direction -- how do you limit to one direction?? source_proj = ft_sourcedescriptives(cfg,sourceNAI); % src_proj.inside = 6804x1 logical matrix (like template grid) % after source recon still in indiv space -- put into std space source_proj.dim = std_grid.sourcemodel.dim; source_proj.pos = std_grid.sourcemodel.pos; % interpolate onto the MNI template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'all'; cfg.interpmethod = 'linear'; source_interp = ft_sourceinterpolate(cfg, source_proj, smri); % source_interp.inside/nai/noise/pow is a 41943040x1 double arr!! % MESSAGES: % the input is volume data with dimensions [512 512 160] % the input is source data with 6804 brainordinates on a [18 21 18] grid cfg = []; cfg.method = 'slice'; cfg.funparameter = 'pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; ft_sourceplot(cfg,source_interp); % MESSAGES: % the input is source data with 41943040 brainordinates on a % [512 512 160] grid From gina.joue at univr.it Wed May 25 13:58:58 2016 From: gina.joue at univr.it (gj) Date: Wed, 25 May 2016 13:58:58 +0200 Subject: [FieldTrip] head model mat contains only NaN values Message-ID: <57459382.90209@univr.it> Hi, Just to keep questions-answers in the same thread, the problem I had with only NaNs in the head model appears indeed to be because of the internal intersecting mesh plans in the "scalp" (at least the problem disappeared once I got the scalp mesh not to intersect). After much digging, I found these previous posts http://mailman.science.ru.nl/pipermail/fieldtrip/2014-January/007433.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006365.html from Gregor who noticed that the finer the mesh, the more likely self intersections occur. He also suggested using om_check_vol() on the prepare mesh output to check for intersections, but I couldn't get it to work (om_check_vol expects a "skin" structure?) so relied on visual inspection with ft_plot_mesh. After much persistence with playing with different cfg.numvertices values for ft_prepare_mesh (for those wondering I ended up specifying 330 vertices for the "scalp" of an MRI with head+neck), I was able to get a mesh with no self-intersections and was able to calculate a head model with more meaningful values. g From conrado.bosman at gmail.com Wed May 25 14:28:09 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 14:28:09 +0200 Subject: [FieldTrip] Error in ft_hastoolbox Message-ID: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); of a Neuralynx -------------- next part -------------- An HTML attachment was scrubbed... URL: From conrado.bosman at gmail.com Wed May 25 14:33:57 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 12:33:57 +0000 Subject: [FieldTrip] Error in ft_hastoolbox References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at gmail.com Wed May 25 15:23:35 2016 From: michelic72 at gmail.com (Cristiano Micheli) Date: Wed, 25 May 2016 15:23:35 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: Dear Conrado, I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). Which version of MatLab are you running? try to apply this change: if exist(varname) -> if exist(varname,'var') That should do it I hope this helped! Cris On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman wrote: > Dear fieldtrippers, > > I’m trying to read the header of a Neuralynx dataset, using the last > FieldTrip version available at Github, running on a Linux machine. I > encounter the following error (see below). > > Originally, I thought that the problem could be related to a FieldTrip > dependency on a .mex file, that should be downloaded from the Neuralynx > website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS > X’), so I downloaded, compiled and placed the toolbox on a recognizable > MATLAB path. > Then, when I run ft_hastoolbox, I noticed that the value of the variable > dependency is “3”, which is the expected outcome from the MATLAB function > “exist" (which is used in the helper function has_mex from ft_hastoolbox > (l539)), when you have a recognizable mex file. However, the value 3 > provides you the cryptic error message in “is_present” at line 576 > > Do you have any clue if I’m doing something wrong? > > Thanks in advance! > Conrado > > K>> Error using ft_hastoolbox>is_present (line 576) > this should not happen > > Error in ft_hastoolbox (line 378) > status = is_present(dependency); > > Error in read_neuralynx_ncs (line 57) > isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for > debug > > Error in read_neuralynx_ds (line 84) > orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); > > Error in ft_read_header (line 1576) > hdr = read_neuralynx_ds(filename); > of a Neuralynx > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed May 25 15:26:25 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 13:26:25 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans Message-ID: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Hi FieldTrippers, I hope someone can help me with the following. My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. Best wishes, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at donders.ru.nl Wed May 25 15:34:59 2016 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 25 May 2016 13:34:59 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From j.herring at donders.ru.nl Wed May 25 15:34:59 2016 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 25 May 2016 13:34:59 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 25 15:40:06 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 25 May 2016 13:40:06 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: <0DAE8198-1597-4A3C-B22C-6CBED9ED6D6A@donders.ru.nl> Hi Stephen, > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > Perhaps you have to :o). This is the only (relatively straightforward) way I can think of at least. If you ensure your trialinfo field to have trial counter prior to doing the partial rejection, you will have the necessary bookkeeping info to glue things together again. > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. I am afraid that this is impossible. Reason: algorithmically ft_specest_mtmconvol is exploiting the fact that convolution in the time domain is equivalent to multiplication in the frequency domain (which is what makes the function fast). The bottom line is that an FFT is done on the whole epoch (followed by a multiplication with the FFT of tapered sine/cosine waves), which, if the data epoch contains NaNs, returns NaNs all over the place. Best, JM > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 25 15:48:18 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 25 May 2016 13:48:18 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, This is how you could ‘glue’ together the fragments of your trials: freq.powspctrm(~isfinite(freq.powspctrm)) = 0; % converting the nans to 0 allows for summation nrpt = numel(unique(freq.trialinfo(:,1))); % assume that the first column of trialinfo is the counter of the original trials siz = size(freq.powspctrm); newpowspctrm = zeros([nrpt siz(2:end)]); for k = 1:nrpt for m = find(freq.trialinfo(:,1)==k)’ newpowspctrm(k,:,:,:) = newpowspctrm(k,:,:,:)+freq.powspctrm(m,:,:,:); end end newpowspctrm(newpowspctrm==0) = nan; % now you can create your new freq structure with the additional metadata (possibly corrected for the new number of ‘rpt’s. Best, JM > On 25 May 2016, at 15:26, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From conrado.bosman at gmail.com Wed May 25 15:50:20 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 15:50:20 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> Hey Cristiano, Thanks for the advice! The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code best Conrado > On 25 May 2016, at 15:23, Cristiano Micheli wrote: > > Dear Conrado, > I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). > Which version of MatLab are you running? > > try to apply this change: > if exist(varname) -> if exist(varname,'var') > > That should do it > I hope this helped! > > > Cris > > On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: > Dear fieldtrippers, > > I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). > > Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. > Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 > > Do you have any clue if I’m doing something wrong? > > Thanks in advance! > Conrado > > K>> Error using ft_hastoolbox>is_present (line 576) > this should not happen > > Error in ft_hastoolbox (line 378) > status = is_present(dependency); > > Error in read_neuralynx_ncs (line 57) > isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug > > Error in read_neuralynx_ds (line 84) > orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); > > Error in ft_read_header (line 1576) > hdr = read_neuralynx_ds(filename); > of a Neuralynx > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 15:58:35 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 13:58:35 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: <7ca8318372b946b98295e516ce8554bf@EXPRD02.hosting.ru.nl> Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 16:08:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 14:08:34 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: As a follow-up: I guess the best solution in the case would then be to make my TFR, and replace those values with nans based on the sample number from the time-series artifact detection. Cheers, Stephen On 25 May 2016 at 15:58, Stephen Whitmarsh > wrote: Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 16:08:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 16:08:34 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: As a follow-up: I guess the best solution in the case would then be to make my TFR, and replace those values with nans based on the sample number from the time-series artifact detection. Cheers, Stephen On 25 May 2016 at 15:58, Stephen Whitmarsh wrote: > Hi Jim! > > Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and > method = 'tfr' give the same problem. I'm afraid I'll end up writing my own > code, cutting up data and using an FFT :-/ > > Thank again, > > Stephen > > On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: > >> Hi Stephen, >> >> As far as I know this is expected as mtmconvol is actually multiplying >> the fft of the entire trial with the fft of your tapered windows. Perhaps >> it will work of you use one of the methods that actually uses convolution >> in the time domain rather than multiplication in the frequency domain. >> >> Best, >> >> Jim >> >> >> >> > On 25 May 2016, at 15:29, Stephen Whitmarsh < >> stephen.whitmarsh at gmail.com> wrote: >> > >> > Hi FieldTrippers, >> > >> > I hope someone can help me with the following. >> > >> > My problem is that I like to maintain my original rpt/chan/time/freq >> size after artefact rejection based on the time series data, i.e. to have >> the same dimensions of the TFR as if I did not reject data. This is for >> reasons of bookkeeping between different types of channels that are >> processed differently throughout my analysis. >> > >> > What works well is to detect artifacts in the data and replace those >> intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So >> far this is perfect for the approach I had in mind. >> > >> > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as >> nans whenever a (small) period has nans. What I would need - and in fact >> expect - is that only those time/frequency windows that have (one or more) >> nan values will output nan, while the rest should merrily go round giving >> power values. After all, the data is there. >> > >> > It is unclear to me whether this is expected behaviour or not. I might >> be making a mistake but some simple tests replicated this behaviour. >> > >> > Is there a solution that still allows me to end up with a >> rpt/chan/time/freq representation of the same size as when i would not have >> rejected artifacts? >> > >> > The only other FieldTrip-like option I can think of is to use >> ft_rejectartifact with method = 'partial', do the freqanalysis on trial >> parts, and somehow glue the separate trial parts together again afterwards. >> But I really don't want to go in that direction. >> > >> > In the end I'm afraid I don't understand the core of >> ft_specest_mtmconvol enough to see where I could hack it. I hope some of >> you might be able to help. >> > >> > Best wishes, >> > Stephen >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > 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 stephen.whitmarsh at gmail.com Wed May 25 15:58:35 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 15:58:35 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) wrote: > Hi Stephen, > > As far as I know this is expected as mtmconvol is actually multiplying the > fft of the entire trial with the fft of your tapered windows. Perhaps it > will work of you use one of the methods that actually uses convolution in > the time domain rather than multiplication in the frequency domain. > > Best, > > Jim > > > > > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > > > Hi FieldTrippers, > > > > I hope someone can help me with the following. > > > > My problem is that I like to maintain my original rpt/chan/time/freq > size after artefact rejection based on the time series data, i.e. to have > the same dimensions of the TFR as if I did not reject data. This is for > reasons of bookkeeping between different types of channels that are > processed differently throughout my analysis. > > > > What works well is to detect artifacts in the data and replace those > intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So > far this is perfect for the approach I had in mind. > > > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as > nans whenever a (small) period has nans. What I would need - and in fact > expect - is that only those time/frequency windows that have (one or more) > nan values will output nan, while the rest should merrily go round giving > power values. After all, the data is there. > > > > It is unclear to me whether this is expected behaviour or not. I might > be making a mistake but some simple tests replicated this behaviour. > > > > Is there a solution that still allows me to end up with a > rpt/chan/time/freq representation of the same size as when i would not have > rejected artifacts? > > > > The only other FieldTrip-like option I can think of is to use > ft_rejectartifact with method = 'partial', do the freqanalysis on trial > parts, and somehow glue the separate trial parts together again afterwards. > But I really don't want to go in that direction. > > > > In the end I'm afraid I don't understand the core of > ft_specest_mtmconvol enough to see where I could hack it. I hope some of > you might be able to help. > > > > Best wishes, > > Stephen > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 25 23:14:00 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 25 May 2016 23:14:00 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> Message-ID: <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> Hi Conrado, that should not hapen, as the code also tells you ;-) Could you try replacing line 539 in ft_hastoolbox from status = exist(full_name, 'file'); into status = (exist(full_name, 'file')==3); After that you should make sure that the ft_hastoolbox copy (which is present in multipe private directories) is updated by (on your Mac) running in a terminal fieldtrip/bin/synchronize-private.sh the synchronize-private script runs autmatically upon each git commit, but with a manual change you sometimes have to do it by hand. The recent change in this section of FieldTrip code was (as Cristiano mentioned) triggered by recent matlab incompatibilities in file detection, and in making it more octave compatible. But apparently we did not test all possible cases. Please let me know whether it works, I’ll then integrate it in the release version. Best regards Robert > On 25 May 2016, at 15:50, Conrado Bosman wrote: > > Hey Cristiano, > Thanks for the advice! > The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct > The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code > > best > Conrado >> On 25 May 2016, at 15:23, Cristiano Micheli > wrote: >> >> Dear Conrado, >> I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). >> Which version of MatLab are you running? >> >> try to apply this change: >> if exist(varname) -> if exist(varname,'var') >> >> That should do it >> I hope this helped! >> >> >> Cris >> >> On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: >> Dear fieldtrippers, >> >> I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). >> >> Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. >> Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 >> >> Do you have any clue if I’m doing something wrong? >> >> Thanks in advance! >> Conrado >> >> K>> Error using ft_hastoolbox>is_present (line 576) >> this should not happen >> >> Error in ft_hastoolbox (line 378) >> status = is_present(dependency); >> >> Error in read_neuralynx_ncs (line 57) >> isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug >> >> Error in read_neuralynx_ds (line 84) >> orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); >> >> Error in ft_read_header (line 1576) >> hdr = read_neuralynx_ds(filename); >> of a Neuralynx >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan at ustc.edu.cn Thu May 26 08:02:07 2016 From: tzvetan at ustc.edu.cn (Tzvetomir) Date: Thu, 26 May 2016 14:02:07 +0800 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Dear Stephen, you could also apply the nanconv() function of B.Kraus, available on Matlab's fileexchange. (http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv) I'm doing my own wavelet processing for the reason that part of my epochs are filled with nan's due to experimental design. But fieldtrip website remains a huge source of infos, tips and solutions where to look for :) all the best, Tzvetomir On 2016-05-25 10:08 PM, Stephen Whitmarsh wrote: > As a follow-up: I guess the best solution in the case would then be to > make my TFR, and replace those values with nans based on the sample > number from the time-series artifact detection. > > Cheers, > Stephen > > On 25 May 2016 at 15:58, Stephen Whitmarsh > > wrote: > > Hi Jim! > > Thanks. Ofcourse, that's the problem. However, method = 'wavelet', > and method = 'tfr' give the same problem. I'm afraid I'll end up > writing my own code, cutting up data and using an FFT :-/ > > Thank again, > > Stephen > > On 25 May 2016 at 15:34, Herring, J.D. (Jim) > > wrote: > > Hi Stephen, > > As far as I know this is expected as mtmconvol is actually > multiplying the fft of the entire trial with the fft of your > tapered windows. Perhaps it will work of you use one of the > methods that actually uses convolution in the time domain > rather than multiplication in the frequency domain. > > Best, > > Jim > > > > > On 25 May 2016, at 15:29, Stephen Whitmarsh > > wrote: > > > > Hi FieldTrippers, > > > > I hope someone can help me with the following. > > > > My problem is that I like to maintain my original > rpt/chan/time/freq size after artefact rejection based on the > time series data, i.e. to have the same dimensions of the TFR > as if I did not reject data. This is for reasons of > bookkeeping between different types of channels that are > processed differently throughout my analysis. > > > > What works well is to detect artifacts in the data and > replace those intervals with nans using ft_rejectartifact, > with cfg.reject = 'nan'. So far this is perfect for the > approach I had in mind. > > > > However, ft_freqanalysis (method = 'mtmconvol') outputs > whole trials as nans whenever a (small) period has nans. What > I would need - and in fact expect - is that only those > time/frequency windows that have (one or more) nan values will > output nan, while the rest should merrily go round giving > power values. After all, the data is there. > > > > It is unclear to me whether this is expected behaviour or > not. I might be making a mistake but some simple tests > replicated this behaviour. > > > > Is there a solution that still allows me to end up with a > rpt/chan/time/freq representation of the same size as when i > would not have rejected artifacts? > > > > The only other FieldTrip-like option I can think of is to > use ft_rejectartifact with method = 'partial', do the > freqanalysis on trial parts, and somehow glue the separate > trial parts together again afterwards. But I really don't want > to go in that direction. > > > > In the end I'm afraid I don't understand the core of > ft_specest_mtmconvol enough to see where I could hack it. I > hope some of you might be able to help. > > > > Best wishes, > > Stephen > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- __________________________________________________ Tzvetomir Tzvetanov, PhD (赐为) Associate Professor Vision Research Laboratory, School of Life Sciences, CAS Key Laboratory of Brain Function and Disease, University of Science & Technology of China Hefei, Anhui 230027, P.R.China http://vision.ustc.edu.cn/ Email: tzvetan at ustc.edu.cn -------------- next part -------------- An HTML attachment was scrubbed... URL: From conrado.bosman at gmail.com Thu May 26 10:24:22 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Thu, 26 May 2016 08:24:22 +0000 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> Message-ID: <840de86e5f884294b4a5855b3cd9de6b@EXPRD02.hosting.ru.nl> Hi Robert, Thanks! this little change solved the bug. Best, Conrado On 25 May 2016, at 23:14, Robert Oostenveld > wrote: Hi Conrado, that should not hapen, as the code also tells you ;-) Could you try replacing line 539 in ft_hastoolbox from status = exist(full_name, 'file'); into status = (exist(full_name, 'file')==3); After that you should make sure that the ft_hastoolbox copy (which is present in multipe private directories) is updated by (on your Mac) running in a terminal fieldtrip/bin/synchronize-private.sh the synchronize-private script runs autmatically upon each git commit, but with a manual change you sometimes have to do it by hand. The recent change in this section of FieldTrip code was (as Cristiano mentioned) triggered by recent matlab incompatibilities in file detection, and in making it more octave compatible. But apparently we did not test all possible cases. Please let me know whether it works, I’ll then integrate it in the release version. Best regards Robert On 25 May 2016, at 15:50, Conrado Bosman > wrote: Hey Cristiano, Thanks for the advice! The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code best Conrado On 25 May 2016, at 15:23, Cristiano Micheli > wrote: Dear Conrado, I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). Which version of MatLab are you running? try to apply this change: if exist(varname) -> if exist(varname,'var') That should do it I hope this helped! Cris On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); of a Neuralynx _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Thu May 26 10:58:16 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 26 May 2016 10:58:16 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Dear Tzvetomir, Thank you so much! That is very helpful. And I concur fully with the praise of FT, and the mailinglist :-) Best wishes, Stephen On 26 May 2016 at 08:02, Tzvetomir wrote: > Dear Stephen, > > you could also apply the nanconv() function of B.Kraus, available on > Matlab's fileexchange. > > (http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv) > > I'm doing my own wavelet processing for the reason that part of my epochs > are filled with nan's due to experimental design. > > But fieldtrip website remains a huge source of infos, tips and solutions > where to look for :) > > all the best, > > Tzvetomir > On 2016-05-25 10:08 PM, Stephen Whitmarsh wrote: > > As a follow-up: I guess the best solution in the case would then be to > make my TFR, and replace those values with nans based on the sample number > from the time-series artifact detection. > > Cheers, > Stephen > > On 25 May 2016 at 15:58, Stephen Whitmarsh > wrote: > >> Hi Jim! >> >> Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and >> method = 'tfr' give the same problem. I'm afraid I'll end up writing my own >> code, cutting up data and using an FFT :-/ >> >> Thank again, >> >> Stephen >> >> On 25 May 2016 at 15:34, Herring, J.D. (Jim) < >> j.herring at donders.ru.nl> wrote: >> >>> Hi Stephen, >>> >>> As far as I know this is expected as mtmconvol is actually multiplying >>> the fft of the entire trial with the fft of your tapered windows. Perhaps >>> it will work of you use one of the methods that actually uses convolution >>> in the time domain rather than multiplication in the frequency domain. >>> >>> Best, >>> >>> Jim >>> >>> >>> >>> > On 25 May 2016, at 15:29, Stephen Whitmarsh < >>> stephen.whitmarsh at gmail.com> wrote: >>> > >>> > Hi FieldTrippers, >>> > >>> > I hope someone can help me with the following. >>> > >>> > My problem is that I like to maintain my original rpt/chan/time/freq >>> size after artefact rejection based on the time series data, i.e. to have >>> the same dimensions of the TFR as if I did not reject data. This is for >>> reasons of bookkeeping between different types of channels that are >>> processed differently throughout my analysis. >>> > >>> > What works well is to detect artifacts in the data and replace those >>> intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So >>> far this is perfect for the approach I had in mind. >>> > >>> > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials >>> as nans whenever a (small) period has nans. What I would need - and in fact >>> expect - is that only those time/frequency windows that have (one or more) >>> nan values will output nan, while the rest should merrily go round giving >>> power values. After all, the data is there. >>> > >>> > It is unclear to me whether this is expected behaviour or not. I might >>> be making a mistake but some simple tests replicated this behaviour. >>> > >>> > Is there a solution that still allows me to end up with a >>> rpt/chan/time/freq representation of the same size as when i would not have >>> rejected artifacts? >>> > >>> > The only other FieldTrip-like option I can think of is to use >>> ft_rejectartifact with method = 'partial', do the freqanalysis on trial >>> parts, and somehow glue the separate trial parts together again afterwards. >>> But I really don't want to go in that direction. >>> > >>> > In the end I'm afraid I don't understand the core of >>> ft_specest_mtmconvol enough to see where I could hack it. I hope some of >>> you might be able to help. >>> > >>> > Best wishes, >>> > Stephen >>> > >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > __________________________________________________ > > Tzvetomir Tzvetanov, PhD > (赐为) > > Associate Professor > Vision Research Laboratory, School of Life Sciences, > CAS Key Laboratory of Brain Function and Disease, > University of Science & Technology of China > Hefei, Anhui 230027, P.R.Chinahttp://vision.ustc.edu.cn/ > Email: tzvetan at ustc.edu.cn > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From icelandhouse at gmail.com Thu May 26 20:12:47 2016 From: icelandhouse at gmail.com (Maris Skujevskis) Date: Thu, 26 May 2016 20:12:47 +0200 Subject: [FieldTrip] Average referencing and demeaning prior to beamformer Message-ID: Hi fieldtrip users, I have a question of clarification regarding common average referencing during beamformer source reconstruction. The yellow warning box in the tutorial http://www.fieldtriptoolbox.org/tutorial/beamformer stresses the importance of common average referencing but leaves me confused as to when exactly it needs to be done. Suppose I have an set of EEG trials (i.e., a set of multichannel time series). The entire data set has already been demeaned and common average referenced. I then cut out two time windows of interest on which I wish to apply a beamformer filter. Question 1: after I combine the the two cut-out time windows to calculate the common filter, do I need to average reference the combined data set prior to calculating the beamformer filter? Question 2: Do I need to separately average reference each of the two cut-out windows prior to applying the beamformer on each of the cut-out data segments? Question 3 on demeaning: do the cut-out combined/separate time windows should also be demeaned or demeaning doesn't make any difference for beamformer source reconstruction? Thanks! Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From SXM1170 at student.bham.ac.uk Thu May 26 20:46:43 2016 From: SXM1170 at student.bham.ac.uk (Stefan Maslanka) Date: Thu, 26 May 2016 18:46:43 +0000 Subject: [FieldTrip] Reading BCI2000 files with stimulus codes Message-ID: Dear FieldTrip users, I have recently been using the Emotiv Epoc with BCI2000 to develop a BCI. I was using BCILAB to create a model to use online but recently came across FieldTrip and its buffer. Unfortunately I am having issues reading my BCI2000 files and processing based on stimulation time points. The BCI2000 '.dat' files are saved with an event field called 'StimulusCode' with values relating to a left or right arrow (1 or 2) and a fixation cross (5). This is clearly seen when loading the header, each samples code is stored in 'hdr.orig.states.StimulusCode'. However when loading the events FieldTrip does not detect these stimulus codes, only listing the 5's for the rest condition, the values of 1 and 2 are not picked up. Is this a known .dat or BCI2000 issue? I was hoping to create a simple model and train a classifier to use in an online environment. Thank you for your time, Stefan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri May 27 09:31:45 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 27 May 2016 08:31:45 +0100 Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA Message-ID: Hi list, Eventually we managed to figure this out off-list, but I just wanted to post a response here to show that it's been resolved (and in case someone in the future has a similar issue and finds this thread). We ended up handling this by making a difference-of-differences wave to quantify the 2x2 within-subjects interaction (per http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests) and then using ft_statfun_indepsamplesregrT to correlate that interaction effect with the subject-wise covariate (as opposed to comparing it to 0 with a regular t-test). For the cfg.design matrix we just used the list of the subjects' values on the covariate. The results we got seemed to make sense (i.e., they were consistent with what had been observed in the same dataset with a time-window analysis before this), but of course if we've done anything wrong or if anyone has suggestions for a better way to do this then we'd be happy to hear. 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: Tue, 24 May 2016 08:57:46 +0000 > From: Alex Sel > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA > Message-ID: > <3123912FD054FE44A023073D2EFD213C8CA53F at MBX02.ad.oak.ox.ac.uk> > Content-Type: text/plain; charset="us-ascii" > > Dear List, > > > > Apologies for the reposting... > > > > I am trying to perform a cluster-based permutation test. I have an > experimental design with 2 within variables (2x2 design) and a covariate. I > wonder how I can define the statistics in the script to include both the > within-subject variables and the covariate. I am using the cfg.statistics > = 'depsamplesFmultivariate' but I am unsure how to define the covariate in > the model. > > > > Any insight on this would be much appreciated. > > > > Best wishes > > > > Alex Sel, PhD > Postdoctoral Researcher > Department of Experimental Psychology, > University of Oxford, > 9 South Parks Road, > OX1 3UD > Tel: 01865 271 340 > Email: Alex.sel at psy.ox.ac.uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seymourr at aston.ac.uk Fri May 27 15:39:58 2016 From: seymourr at aston.ac.uk (Seymour, Robert (Research Student)) Date: Fri, 27 May 2016 13:39:58 +0000 Subject: [FieldTrip] Combining GRADS+MAGS Message-ID: Dear Fieldtrip Users, I am using an Elekta Neuromag 306 scaner which obviously has both magnetometers and gradiometers. When performing source localisation using an LCMV beamformer I would like to use both MAGS and GRADS (i.e. use cfg.channel = 'MEG' '-badchans'). I know that there is a scaling issue between MAGS and GRADS.. so I was wondering if Fieldtrip compensates for this during leadfield creation and/or ft_sourceanalysis, and if so how? Many thanks, Robert Seymour (PhD Student, Aston Brain Centre) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon May 30 05:38:53 2016 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 30 May 2016 13:38:53 +1000 Subject: [FieldTrip] Problem with EGI file Message-ID: Dear fieldtrip community, I am trying to analyse eeg recorded from EGI. I want to highpass filter the data before epoching and I managed to create the following script from the fieldtrip documentation. However I am getting an error (please see below). Could someone suggest a fix. Thank you, Arti datadir = 'D:\EGITest'; dataset = fullfile(datadir, 's01_CH.mff'); headerformat = 'egi_mff_v2'; dataformat = 'egi_mff_v2'; eventformat = 'egi_mff_v2'; hdr = ft_read_header(dataset, 'headerformat', headerformat); dat = ft_read_data(dataset, 'headerformat', headerformat, 'dataformat', dataformat); event = ft_read_event(dataset, 'headerformat', headerformat, 'eventformat', eventformat); fg = []; cfg.data = dat; cfg.headerfile=hdr; cfg.trialdef.triallength = Inf; cfg.trialdef.ntrials = 1; cfg = ft_definetrial(cfg); cfg.hpfilter = 'yes'; cfg.hpfreq = .1; cfg.hpfilttype = 'firws'; cfg.hpfiltdir = 'onepass-zerophase'; alldata = ft_preprocessing(cfg); I am getting the following error Undefined function 'exist' for input arguments of type 'struct'. Error in isdir (line 10) result = exist(dirpath,'dir') == 7; Error in ft_filetype (line 150) if isdir(filename) Error in ft_checkconfig (line 559) cfg.dataformat = ft_filetype(cfg.datafile); Error in ft_definetrial (line 128) cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Mon May 30 09:48:12 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Mon, 30 May 2016 07:48:12 +0000 Subject: [FieldTrip] Problem with EGI file In-Reply-To: References: Message-ID: Dear Arti, You could try to adapt the following code: % -------------------------------- % Load & preprocess continuous files % --------------------------------- cfg = []; cfg.dataset = tmpfilename; cfg.continuous='yes'; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; cfg.hpfreq = 0.5; % Hz cfg.channel = elecs_183_selec; data_cont = ft_preprocessing(cfg); % ----------------------------------------- % define trials %----------------------------------------- cfg = []; cfg.dataset = tmpfilename; % datafile to read events from cfg.eventformat = 'egi_mff_v2'; cfg.trialdef.prestim = 2; % in seconds cfg.trialdef.poststim = 2; % in seconds cfg.trialdef.eventtype = {'DIN12'}; cfgDIN12 = ft_definetrial(cfg); tmp_data_segm12 = ft_redefinetrial(cfgDIN12, data_cont); %Segmentation The problem is that for me, it does not import the trialinfo. Therefore, I do the segmentation (here for DIN12) separately for all triggers, then append all tmp_data_segm and write the following code for adding the trialinfo: data_segm.trialinfo=[ones(1, length(tmp_data_segm12.trial))*12] Hope that helps! Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arti Abhishek [mailtome.2113 at gmail.com] Gesendet: Montag, 30. Mai 2016 05:38 An: FieldTrip discussion list Betreff: [FieldTrip] Problem with EGI file Dear fieldtrip community, I am trying to analyse eeg recorded from EGI. I want to highpass filter the data before epoching and I managed to create the following script from the fieldtrip documentation. However I am getting an error (please see below). Could someone suggest a fix. Thank you, Arti datadir = 'D:\EGITest'; dataset = fullfile(datadir, 's01_CH.mff'); headerformat = 'egi_mff_v2'; dataformat = 'egi_mff_v2'; eventformat = 'egi_mff_v2'; hdr = ft_read_header(dataset, 'headerformat', headerformat); dat = ft_read_data(dataset, 'headerformat', headerformat, 'dataformat', dataformat); event = ft_read_event(dataset, 'headerformat', headerformat, 'eventformat', eventformat); fg = []; cfg.data = dat; cfg.headerfile=hdr; cfg.trialdef.triallength = Inf; cfg.trialdef.ntrials = 1; cfg = ft_definetrial(cfg); cfg.hpfilter = 'yes'; cfg.hpfreq = .1; cfg.hpfilttype = 'firws'; cfg.hpfiltdir = 'onepass-zerophase'; alldata = ft_preprocessing(cfg); I am getting the following error Undefined function 'exist' for input arguments of type 'struct'. Error in isdir (line 10) result = exist(dirpath,'dir') == 7; Error in ft_filetype (line 150) if isdir(filename) Error in ft_checkconfig (line 559) cfg.dataformat = ft_filetype(cfg.datafile); Error in ft_definetrial (line 128) cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); -------------- next part -------------- An HTML attachment was scrubbed... URL: From Claudio.Georgii at stud.sbg.ac.at Mon May 30 10:53:22 2016 From: Claudio.Georgii at stud.sbg.ac.at (Claudio Georgii) Date: Mon, 30 May 2016 10:53:22 +0200 Subject: [FieldTrip] Problem with EGI file In-Reply-To: References: Message-ID: Hey, i guess a more convenient & less error prone way to import the trialinfo would be to specify your own trialfun. Within you trialfun, just search for the stimulus value (trigger value) and add it to a 4th column of your trl structure: % Search for trials: stimulus_value = {event(find(strcmp('Stimulus', {event.type}))).value}'; % add to 4th colum of trl trl(:,4) = str2double(stimulus_value); After using ft_preprocessing, the 4th colum will be automatically added to the trialinfo. Best, Claudio 2016-05-30 9:48 GMT+02:00 Blume Christine : > Dear Arti, > > You could try to adapt the following code: > > % -------------------------------- > % Load & preprocess continuous files > % --------------------------------- > cfg = []; > cfg.dataset = tmpfilename; > cfg.continuous='yes'; > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > cfg.hpfreq = 0.5; % Hz > cfg.channel = elecs_183_selec; > data_cont = ft_preprocessing(cfg); > > % ----------------------------------------- > % define trials > %----------------------------------------- > cfg = []; > cfg.dataset = tmpfilename; % datafile to read events from > cfg.eventformat = 'egi_mff_v2'; > cfg.trialdef.prestim = 2; % in seconds > cfg.trialdef.poststim = 2; % in seconds > > cfg.trialdef.eventtype = {'DIN12'}; > cfgDIN12 = ft_definetrial(cfg); > > tmp_data_segm12 = ft_redefinetrial(cfgDIN12, data_cont); %Segmentation > > The problem is that for me, it does not import the trialinfo. Therefore, I > do the segmentation (here for DIN12) separately for all triggers, then > append all tmp_data_segm and write the following code for adding the > trialinfo: > > data_segm.trialinfo=[ones(1, length(tmp_data_segm12.trial))*12] > > Hope that helps! > > Best, > Christine > > > ------------------------------ > *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" > im Auftrag von "Arti Abhishek [mailtome.2113 at gmail.com] > *Gesendet:* Montag, 30. Mai 2016 05:38 > *An:* FieldTrip discussion list > *Betreff:* [FieldTrip] Problem with EGI file > > Dear fieldtrip community, > > I am trying to analyse eeg recorded from EGI. I want to highpass filter > the data before epoching and I managed to create the following script from > the fieldtrip documentation. However I am getting an error (please see > below). Could someone suggest a fix. > > Thank you, > Arti > > > datadir = 'D:\EGITest'; > dataset = fullfile(datadir, 's01_CH.mff'); > headerformat = 'egi_mff_v2'; > dataformat = 'egi_mff_v2'; > eventformat = 'egi_mff_v2'; > hdr = ft_read_header(dataset, 'headerformat', headerformat); > dat = ft_read_data(dataset, 'headerformat', headerformat, > 'dataformat', dataformat); > event = ft_read_event(dataset, 'headerformat', headerformat, > 'eventformat', eventformat); > fg = []; > cfg.data = dat; > cfg.headerfile=hdr; > cfg.trialdef.triallength = Inf; > cfg.trialdef.ntrials = 1; > cfg = ft_definetrial(cfg); > cfg.hpfilter = 'yes'; > cfg.hpfreq = .1; > cfg.hpfilttype = 'firws'; > cfg.hpfiltdir = 'onepass-zerophase'; > alldata = ft_preprocessing(cfg); > > I am getting the following error > > Undefined function 'exist' for input arguments of type > 'struct'. > > Error in isdir (line 10) > result = exist(dirpath,'dir') == 7; > > Error in ft_filetype (line 150) > if isdir(filename) > > Error in ft_checkconfig (line 559) > cfg.dataformat = ft_filetype(cfg.datafile); > > Error in ft_definetrial (line 128) > cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Claudio Georgii, MSc. Phd student University of Salzburg - Department of Psychology Eating Behavior Laboratory Hellbrunnerstraße 34 5020 Salzburg - Austria Phone: 0043- (0)662 8044 5164 E-Mail: claudio.georgii at sbg.ac.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sun May 1 18:14:59 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:14:59 +0000 Subject: [FieldTrip] Unit error using ft_topoplotTFR.m References: Message-ID: <6647E974-EBA7-4730-9828-FB272C2C3DBD@donders.ru.nl> Hi Andrew, It seems that FT chokes on some bookkeeping operation (the ‘unbalancing’ stuff), which is known to be tricky, and requires too many words, and is too tedious to explain why these obscure steps would be needed in the first place. Note that there seems to exist an inconsistency between the topo and multi functions, so I think this should be looked into. This being said, given your error stack it looks as if you run into this because you try to create a layout from the sensor description in the data. I would advice to use one of the standard layouts we have on file (in the fieldtrip/template/layout directory). The one you probably want to use is either cfg.layout = ‘4D248.lay’, or ‘4D248_helmet.mat’. (to be sure, just check the filenames in the directory, because I don’t know them from the top of my head). With an existing layout-filename in the cfg you should not run into this. Best, Jan-Mathijs On 29 Apr 2016, at 14:01, Reid, A.T. (Andrew) > wrote: Hi all, I am trying to do a simple topo plot of some time-locked HCP data. Running ft_multiplotTFR on the TFR output structure works fine. When I run ft_topoplotTFR on the same structure, I get the following error: creating layout from data.grad undoing the invcomp balancing for the gradiometer definition Error using ft_scalingfactor (line 181) cannot convert T to unknown Error in ft_scalingfactor (line 94) factor = cellfun(@ft_scalingfactor, old(:), new(:)); Error in ft_apply_montage (line 309) scale = ft_scalingfactor(input.chanunit, montage.chanunitorg); Error in undobalancing (line 37) sens = ft_apply_montage(sens, sens.balance.(sens.balance.current), 'inverse', 'yes', 'keepunused', 'yes', 'warning', 'no'); Error in ft_prepare_layout>sens2lay (line 957) sens = undobalancing(sens); Error in ft_prepare_layout (line 430) layout = sens2lay(data.grad, cfg.rotate, cfg.projection, cfg.style, cfg.overlap); Error in ft_topoplotTFR (line 192) cfg.layout = ft_prepare_layout(cfg, varargin{:}); The data.grad.balance.invcomp.chanunitnew cell array appears to be the culprit, as it contains “unknown” while the main data.chanunit has unit “T”. Not sure how to proceed here.. Thanks! Andrew ____________________________________________________ Andrew Reid Postdoctoral Fellow Department of Cognitive Artificial Intelligence Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen Web: http://andrew.modelgui.org/ Tel: +31 (0)24 36 55931 _______________________________________________ fieldtrip 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 Sun May 1 18:16:45 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:16:45 +0000 Subject: [FieldTrip] Electrode position effects on leadfield values In-Reply-To: References: Message-ID: Hi Maris, It is common knowledge that due to noise/measurement error, it is hard, if not impossible to match Polhemus digitized electrode locations with the MR head shape precisely. Indeed this is well known. Even after manual and iterative alignment some electrodes remain "hanging" in the air above the head surface, while some others get buried below the head surface. Here is an illustration of what I mean: https://goo.gl/aSm7YU Looks quite good to me! I am wondering what effect this type of electrode misplacement has on the values in the leadfield matrix as calculated by ft_prepare_leadfield? How does fieldtrip deal with electrodes placed in such a way? It seems that there is some magic involved there, since in theory the lead field matrix values for the electrodes not touching the surface of the head should be zero (which is not the case in the lead field matrix produced by ft_prepare_leadfield). Fieldtrip pulls (or pushes) the electrodes to the head surface, to ensure that the computations make sense. If you want to know the details, grep for project_elec (which is the function that does this). Best, Jan-Mathijs I am currently testing how moving a "floating" and a "buried" electrode to its nearest point on the scalp affects the leadfield matrix values. I do not have any definite answers yet, but I did want to check in with some more experienced users out there before spending too much time on this (and possibly reinventing the wheel, so to speak). Thanks! Maris _______________________________________________ fieldtrip 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 Sun May 1 18:44:16 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:44:16 +0000 Subject: [FieldTrip] MNE-sample data set on Fieldtrip. In-Reply-To: <96d4943980d708a2b7d8b6ffbc439792@cam.ac.uk> References: <96d4943980d708a2b7d8b6ffbc439792@cam.ac.uk> Message-ID: <13E4D5AA-9D4D-40C8-B886-5867726F256B@donders.ru.nl> Dear Parham, > I was hoping to perform a complete source analysis using FieldTrip on the MNE-sample data set. > The link to the MNE data set link is given below: > http://martinos.org/mne/dev/manual/sample_dataset.html#babdhifj That sounds like a great exercise! I am not aware of anybody having done this already. > I am terribly confused on how to align the MRI coordinates to MEG. Yes, coordinate systems are confusing and annoying. > The MEG system is a neuromag306. The function hdr=ft_read_header(raw_data_set_filename) reads fiducial marks > HPI. It is contained in hdr.orig.dig. > Also shape = ft_read_headshape(raw_data_set_filename) gives a structure > shape = > > pos: [143x3 double] > fid: [1x1 struct] > label: {143x1 cell} > coordsys: 'neuromag' > unit: 'cm' > pnt: [143x3 double] > > where the shape.fid has the nasion, lpa and rpa. I have the following questions: > 1. It appears to me that the MRI coordinate system is already spm. > Axis X :Left to right. > Axis Y: Posterior to Anterior. > Axis Z: bottom to top. >From the direction of the axes one cannot strictly conclude the coordinate system. Both the Elekta-based coordinates, and the SPM-based coordinates have their X/Y/Z axes pointing into R(ight)/A(nterior)/S(uperior). They differ in their origin. If however the shape.fid.pnt/pos (I am not sure whether the positions are represented in the pnt or pos field nowadays) for the ‘nas’ fiducial is [0 somevalue 0] (or at least the x and z coordinates are close to 0), you can be sure that this is defined in ‘MEG’ coordinates. > 2. How can I realign the MRI to MEG? > a) Interactively: ft_volumerealign > or > b) Should I use the information in shape to have it done automatically? > I think, it would be unwise to define my own lpa, rpa and nasion. Indeed, it adds error when trying to ‘click’ the lpa/rpa/nasion once more, because they are bound to end up at a slightly different location. Since you seem to have a digitized headshape, you could try and align this headshape to the surface reconstruction of the anatomical MRI (which I assume you have), using ft_volumerealign and the ‘headshape’ method. I would typically do the alignment manually (rather than relying on the automatic icp-based algorithm), particularly if you have only few points in the headshape. > 3. What is the relationship between HPI coil coordinates and the lpa, rpa and nasion coordinates? Are there scripts that relate the two. I don’t know. Sometimes there’s a one-to-one match between specific coils and the three fiducial locations, sometimes there isn’t :o(. Depends on the specifics of the data. > 4. Has anyone ever created a script to use Fieldtrip to analyze this specific data set? I am not aware of this, but I think it would be valuable to have this documented somewhere (and available to the wider community). > 5. The MEG sensors are in a different coordinate frame "1" as opposed to head coordinates (Electrodes). Do I have to make sure that these coordinates are transformed to head coordinates prior to ft_prepare_leadfield calculations? or is this done automatically by fieldtrip? I am not so familiar with the meaning of the different coordinate frames employed by the neuromag software (at least not with respect to how the numbers map onto specific conventions). Yet, in the end of the day you need to ensure that all the data-objects that represent geometrical information (sensors, volume conduction model, source model) are expressed in the same coordinate system. Fieldtrip will not automagically convert anything for you. > I just have the feeling that it would be unwise to do this interactively because of the existence of the fiducial markers. Yes, but if there’s no alternative, there’s no way around this. Yet, it could be that the different coordinate transformations are already represented in the data (and that the low-level reading routines know how to deal with this: perhaps you can specify a certain input argument that returns the coordinates in a specified coordinate system) So, in sum, perhaps not too helpful, but it may provide some clues to the solution. Also, perhaps some elekta people may want to chime in here. It would be great if you could get this going, and perhaps we could ask you to collaborate on providing some documentation about your endeavours on the fieldtrip wiki in due time. Best wishes, Jan-Mathijs > Many thanks if you are able to help me. > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sun May 1 18:52:19 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 1 May 2016 16:52:19 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? In-Reply-To: References: Message-ID: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon May 2 12:06:20 2016 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 2 May 2016 12:06:20 +0200 Subject: [FieldTrip] FT clusterplot Message-ID: Dear all, I hope this email finds you well. I had a statistics results that I would like to use ft_clusterplot to plot the significant clusters. However, I'm experiencing some difficulties to specific the configuration. >From the ft_clusterplot.m, I noticed that the function is able to squeeze the 3D matrix into a 2D matrix for plotting purposes. My current statistics results is in "chan-freq-time" dimension, and I was wondering how I could specific the configuration to select a specific frequency to plot. Can someone please help? Or do I have to adjust the statistics results variable manually such that it has a "chan-time" dimension for plotting? Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.brehm at uu.nl Mon May 2 15:08:18 2016 From: j.brehm at uu.nl (Brehm, J. (Julia)) Date: Mon, 2 May 2016 13:08:18 +0000 Subject: [FieldTrip] What exactly does filterpadding do? Message-ID: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> Dear list, I am having problems applying filterpadding when using ft_artifact_zvalue. Could someone please explain what exactly the effect of filterpadding is, and in which cases I can apply it and in which not? I intended to use it to avoid edge effects in the artifact detection. However, I get the following warning (only when applying fltpadding, my data does not actually contain NaNs): Warning: data contains NaNs, no filtering or preprocessing applied > In ft_warning (line 181) In preproc (line 282) In ft_artifact_zvalue (line 292) These are my settings: cfg = []; cfg.trl = temptrl; % all trials cfg.artfctdef.zvalue.channel = channel{ch}; % single channel cfg.artfctdef.zvalue.cutoff = 3; cfg.artfctdef.zvalue.fltpadding = 0.1; cfg.artfctdef.zvalue.bpfilter = 'yes'; cfg.artfctdef.zvalue.bpfilttype = 'but'; cfg.artfctdef.zvalue.bpfreq = [1 3]; cfg.artfctdef.zvalue.bpfiltord = 2; cfg.artfctdef.zvalue.hilbert = 'yes'; Thanks! Best, Julia -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Mon May 2 15:14:09 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Mon, 2 May 2016 15:14:09 +0200 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? Message-ID: Hello, could you please explain the purpose of ft_sourcedescriptives() in EEG source analysis? The documentation is very brief (“computes descriptive parameters of the source analysis results”) and I haven't found a single tutorial with proper explanation. I found it used here but without any explanation whatsoever. Thank you! Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Mon May 2 15:24:40 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Mon, 2 May 2016 15:24:40 +0200 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> Message-ID: Dear Julia, >From the FAQ section: http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts I hope that helps, Diego On 2 May 2016 at 15:08, Brehm, J. (Julia) wrote: > Dear list, > > I am having problems applying filterpadding when using ft_artifact_zvalue. > > Could someone please explain what exactly the effect of filterpadding is, > and in which cases I can apply it and in which not? > > I intended to use it to avoid edge effects in the artifact detection. > However, I get the following warning (only when applying fltpadding, my > data does not actually contain NaNs): > > Warning: data contains NaNs, no filtering or preprocessing applied > > In ft_warning (line 181) > In preproc (line 282) > In ft_artifact_zvalue (line 292) > > These are my settings: > cfg = []; > cfg.trl = temptrl; % all trials > > cfg.artfctdef.zvalue.channel = channel{ch}; % single channel > cfg.artfctdef.zvalue.cutoff = 3; > cfg.artfctdef.zvalue.fltpadding = 0.1; > > cfg.artfctdef.zvalue.bpfilter = 'yes'; > cfg.artfctdef.zvalue.bpfilttype = 'but'; > cfg.artfctdef.zvalue.bpfreq = [1 3]; > cfg.artfctdef.zvalue.bpfiltord = 2; > cfg.artfctdef.zvalue.hilbert = 'yes'; > > Thanks! > > Best, > Julia > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Mon May 2 15:27:23 2016 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Mon, 2 May 2016 15:27:23 +0200 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? In-Reply-To: References: Message-ID: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > Dear Andreas, > > Have you tried it with a more recent version? Also, I would recommend not > to use ft_sourcegrandaverage, but to use the syntax > ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the > single subject data represented in a cell-array of structures, with source1 > for condition 1 and source2 for condition 2. > > Best, > Jan-Mathijs > > > > > On 24 Apr 2016, at 18:36, Andreas Sauer wrote: > > Dear all, > > unfortunately, I am having problems to run source statistics on ERF > mismatch negativity data (recorded with a 4D system). > > With the following data structure as input (output from > ft_sourcegrandaverage), fieldtrip gives a warning that it „could not > determine dimord of „pow“ in the following data“ > > pow: [16x37696 double] > dim: [31 38 32] > inside: [37696x1 logical] > pos: [37696x3 double] > time: [1x900 double] > cfg: [1x1 struct] > > and later throws an error that „field „pow“ (is) not present in data“. I > checked the ft_sourcestatistic script step by step and found out that > ft_selectdata removes it after being called by ft_sourcestatistics. > > I am using the fieldtrip version from 15/05/2015. I also tried with older > versions, one from late 2014 and late 2013, but nothing worked. > > Unfortunately, since ft_selectdata removes the field "pow" from the data > during the call to ft_sourcestatistic, I can’t put it back in to the > structure. > > Any help with this (esp. why „pow“ is being removed) is highly appreciated! > > Thanks and best wishes, > > Andreas > > > > -- > Dipl.-Psych. Andreas Sauer > Max Planck Institute for Brain Research > Deutschordenstraße 46 > 60528 Frankfurt am Main > Germany > > T: +49 69 96769 278 > F: +49 69 96769 327 > Email: sauer.mpih at gmail.com > www.brain.mpg.de > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.brehm at uu.nl Mon May 2 16:31:43 2016 From: j.brehm at uu.nl (Brehm, J. (Julia)) Date: Mon, 2 May 2016 14:31:43 +0000 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl>, Message-ID: <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> Dear Diego, yes, thank you, I've seen that already. Unfortunately this does not really help me. Apparently filtering is not even applied in my case (as the warning says). It seems that the NaNs are introduced in ft_fetch_data, shouldn't these be replaced by zeros where it's not filled by actual data when applying filterpadding? I assume it does that at some other point I couldn't find!? Furthermore, in the interactive mode one can see that the z-values mimic the data in the first and last trial of the dataset. This leads to the detection of artifacts which are none and missing real artifacts (due to very large effects in those two trials). I have attached a screenshot to illustrate what I mean. As far as I understand filterpadding uses zero-padding, meaning I can use it on segmented (not continuous) data, correct? So why does this have such a large effect on my whole data instead of simply getting rid of edge effects? Sorry if I am missing something obvious. Best, Julia ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Diego Lozano-Soldevilla [dlozanosoldevilla at gmail.com] Sent: Monday, May 02, 2016 3:24 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] What exactly does filterpadding do? Dear Julia, >From the FAQ section: http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts I hope that helps, Diego On 2 May 2016 at 15:08, Brehm, J. (Julia) > wrote: Dear list, I am having problems applying filterpadding when using ft_artifact_zvalue. Could someone please explain what exactly the effect of filterpadding is, and in which cases I can apply it and in which not? I intended to use it to avoid edge effects in the artifact detection. However, I get the following warning (only when applying fltpadding, my data does not actually contain NaNs): Warning: data contains NaNs, no filtering or preprocessing applied > In ft_warning (line 181) In preproc (line 282) In ft_artifact_zvalue (line 292) These are my settings: cfg = []; cfg.trl = temptrl; % all trials cfg.artfctdef.zvalue.channel = channel{ch}; % single channel cfg.artfctdef.zvalue.cutoff = 3; cfg.artfctdef.zvalue.fltpadding = 0.1; cfg.artfctdef.zvalue.bpfilter = 'yes'; cfg.artfctdef.zvalue.bpfilttype = 'but'; cfg.artfctdef.zvalue.bpfreq = [1 3]; cfg.artfctdef.zvalue.bpfiltord = 2; cfg.artfctdef.zvalue.hilbert = 'yes'; Thanks! Best, Julia _______________________________________________ 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: fltpadding_demo.jpg Type: image/jpeg Size: 52120 bytes Desc: fltpadding_demo.jpg URL: From kaitlynlitcofsky at gmail.com Mon May 2 22:06:17 2016 From: kaitlynlitcofsky at gmail.com (Kaitlyn Litcofsky) Date: Mon, 2 May 2016 16:06:17 -0400 Subject: [FieldTrip] Behavior-power correlations Message-ID: Hello, I'm trying to conduct behavior-power correlations. This topic has been discussed a few times before ( http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2015-October/009720.html), but I'm still having issues getting it to work. I'm working with a grand averaged structure of 25 individuals' frequency data, and trying to correlate it with a proficiency measurement (one value per person). If I follow the instructions on the tutorial ( http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables), I get an error that "uvar must be specified for dependent samples statistics". I tried various permutations of the design including a uvar got the error "Invalid specification of the design array." When I tried a suggestion in the previous email threads to ​create a dummy variable that is a copy of my frequency data, and replace the power spectrum with the behavioral measure, and create a design with their code: cfg.design = []; cfg.design(1,:) = [ones(1,length(BehVar)) 2*ones(1,length(BehVar))]; cfg.design(2,:) = [1:length(BehVar) 1:length(BehVar)]; I get the error "the length of the design matrix (2) does not match the number of observations in the data (25)". My question is this: what is the appropriate design array for computing a correlation with ft_statfun_correlationT? Is the behavioral variable supposed to be part of the design or must it be part of a dummy structure designed to be similar in size and structure to the frequency data? Alternatively, is there a way to get, for every individual in the grand average, one value representing the average power for, e.g., 300-600ms in the 4-7Hz range? Thank you very much for your help, Kaitlyn Litcofsky -- Kaitlyn Litcofsky Graduate Student, Cognitive Psychology 006 Moore Building Pennsylvania State University University Park, PA 16802 Email: kal378 at psu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon May 2 22:41:34 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 2 May 2016 13:41:34 -0700 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: References: Message-ID: Hi Kaitlyn, My question is this: what is the appropriate design array for computing a > correlation with ft_statfun_correlationT? Is the behavioral variable > supposed to be part of the design or must it be part of a dummy structure > designed to be similar in size and structure to the frequency data? > It's really as described on the page you referred to ( http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables ) n1 = 3; % n1 is the number of subjects design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. cfg.design = design; cfg.ivar = 1; stat = ft_freqstatistics(cfg, data_brain{:}); where data_brain is a multiple subjects structure in case you're doing this at the second/group level (i.e. correlate a behavioral variable to a neural variable across subjects). Thus, a dummy variable is no longer needed. Alternatively, is there a way to get, for every individual in the grand > average, one value representing the average power for, e.g., 300-600ms in > the 4-7Hz range? > You may want to use ft_freqdescriptives for that, per subject. Best, Arjen > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Mon May 2 23:54:48 2016 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 02 May 2016 17:54:48 -0400 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: References: Message-ID: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> Hi Kaitlyn, Which version of Fiedtrip you are using? I got similar error message when I used old version, but no error when I updated to latest version. Hope this will help. Xiaoming >>> Arjen Stolk 5/2/2016 4:41 PM >>> Hi Kaitlyn, My question is this: what is the appropriate design array for computing a correlation with ft_statfun_correlationT? Is the behavioral variable supposed to be part of the design or must it be part of a dummy structure designed to be similar in size and structure to the frequency data? It's really as described on the page you referred to (http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables) n1 = 3; % n1 is the number of subjects design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. cfg.design = design; cfg.ivar = 1; stat = ft_freqstatistics(cfg, data_brain{:}); where data_brain is a multiple subjects structure in case you're doing this at the second/group level (i.e. correlate a behavioral variable to a neural variable across subjects). Thus, a dummy variable is no longer needed. Alternatively, is there a way to get, for every individual in the grand average, one value representing the average power for, e.g., 300-600ms in the 4-7Hz range? You may want to use ft_freqdescriptives for that, per subject. Best, Arjen -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaitlynlitcofsky at gmail.com Tue May 3 02:48:02 2016 From: kaitlynlitcofsky at gmail.com (Kaitlyn Litcofsky) Date: Mon, 2 May 2016 20:48:02 -0400 Subject: [FieldTrip] Behavior-power correlations In-Reply-To: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> References: <57279468020000DC0001A660@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming and Arjen, After updating to the latest Fieldtrip, the code from the tutorial worked. Thank you so much! Kaitlyn On Mon, May 2, 2016 at 5:54 PM, Xiaoming Du wrote: > Hi Kaitlyn, > > Which version of Fiedtrip you are using? > > I got similar error message when I used old version, but no error when I > updated to latest version. > > Hope this will help. > > Xiaoming > > > >>> Arjen Stolk 5/2/2016 4:41 PM >>> > Hi Kaitlyn, > > My question is this: what is the appropriate design array for computing a >> correlation with ft_statfun_correlationT? Is the behavioral variable >> supposed to be part of the design or must it be part of a dummy structure >> designed to be similar in size and structure to the frequency data? >> > > It's really as described on the page you referred to ( > http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables > ) > > n1 = 3; % n1 is the number of subjects > design(1,1:n1) = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects. > > cfg.design = design; > cfg.ivar = 1; > > stat = ft_freqstatistics(cfg, data_brain{:}); > > where data_brain is a multiple subjects structure in case you're doing > this at the second/group level (i.e. correlate a behavioral variable to a > neural variable across subjects). Thus, a dummy variable is no longer > needed. > > Alternatively, is there a way to get, for every individual in the grand >> average, one value representing the average power for, e.g., 300-600ms in >> the 4-7Hz range? >> > > You may want to use ft_freqdescriptives for that, per subject. > > Best, Arjen > >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Kaitlyn Litcofsky Graduate Student, Cognitive Psychology 006 Moore Building Pennsylvania State University University Park, PA 16802 Email: kal378 at psu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Tue May 3 10:23:48 2016 From: mkshiri at gmail.com (shiri makov) Date: Tue, 3 May 2016 11:23:48 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' Message-ID: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that *sometimes *when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Tue May 3 11:29:27 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Tue, 3 May 2016 11:29:27 +0200 Subject: [FieldTrip] What exactly does filterpadding do? In-Reply-To: <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> References: <385DDA785CF9764B8E184EF28D01ADE059BA96@WP0046.soliscom.uu.nl> <385DDA785CF9764B8E184EF28D01ADE059BAE6@WP0046.soliscom.uu.nl> Message-ID: Dear Julia, The filtering not being applied might be related to the data samples you're providing the bandpass filtering. Several things: Keep in mind: You're creating a bandpass butterworth filter [1-3hz] with filter order 2. This means you'll need enough data to filter so low frequencies. Briefly, the butterworth filter is an infinite impulse response filter (IIR) that filters the data recursively (not by convolution) and the filter order means the amount of samples from input and output the filter will use (please go http://www.dspguide.com/CH14.PDF if this is not clear). The higher the filter order, the sharper the frequency response, the stronger the "ringing". The finite impulse response (FIR) filters, by the contrary, are implemented by convolution and the filter order means the length of the filter-kernel. The higher the filter order, the higher the frequency resolution, the lower the temporal resolution, the longer the filter kernel. Then you'll have to make sure your filter order is appropriate given the length of your data, which is not intuitive for IIR filters. I'm not an expert on filtering and I find the Widmann, Schröger & Maess recent paper an excellent guide: http://www.ncbi.nlm.nih.gov/pubmed/25128257 To dig into this issue, you can apply the very same filter settings with ft_preprocessing separately and check what's happening before and after. Then you can discard if the filtering is what is creating the problem. Check: - Make sure the epoching you're using in cfg.trl = temptrl; is not too short for your filtering. My hunch is that the NaNs might be related to this - I don't know what kind of artifacts are you chasing filtering so low (drifts?) but the artifact padding you're using might be too short (artpadding = 0.1;) Regarding the very large effects in those two trials, I'd be pragmatic and I would delete them or I'd cut the edges that are problematic for you... I hope that helps! Diego On 2 May 2016 at 16:31, Brehm, J. (Julia) wrote: > Dear Diego, > > yes, thank you, I've seen that already. Unfortunately this does not really > help me. > > Apparently filtering is not even applied in my case (as the warning says). > It seems that the NaNs are introduced in ft_fetch_data, shouldn't these be > replaced by zeros where it's not filled by actual data when applying > filterpadding? I assume it does that at some other point I couldn't find!? > > Furthermore, in the interactive mode one can see that the z-values mimic > the data in the first and last trial of the dataset. This leads to the > detection of artifacts which are none and missing real artifacts (due to > very large effects in those two trials). I have attached a screenshot to > illustrate what I mean. > > As far as I understand filterpadding uses zero-padding, meaning I can use > it on segmented (not continuous) data, correct? So why does this have such > a large effect on my whole data instead of simply getting rid of edge > effects? > > Sorry if I am missing something obvious. > > Best, > Julia > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Diego Lozano-Soldevilla [dlozanosoldevilla at gmail.com] > *Sent:* Monday, May 02, 2016 3:24 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] What exactly does filterpadding do? > > Dear Julia, > > From the FAQ section: > > > http://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work > > > http://www.fieldtriptoolbox.org/faq/how_can_i_interpret_the_different_types_of_padding_that_i_find_when_dealing_with_artifacts > > > I hope that helps, > > Diego > > > > On 2 May 2016 at 15:08, Brehm, J. (Julia) > > wrote: > >> Dear list, >> >> I am having problems applying filterpadding when >> using ft_artifact_zvalue. >> >> Could someone please explain what exactly the effect of filterpadding is, >> and in which cases I can apply it and in which not? >> >> I intended to use it to avoid edge effects in the artifact detection. >> However, I get the following warning (only when applying fltpadding, my >> data does not actually contain NaNs): >> >> Warning: data contains NaNs, no filtering or preprocessing applied >> > In ft_warning (line 181) >> In preproc (line 282) >> In ft_artifact_zvalue (line 292) >> >> These are my settings: >> cfg = []; >> cfg.trl = temptrl; % all trials >> >> cfg.artfctdef.zvalue.channel = channel{ch}; % single channel >> cfg.artfctdef.zvalue.cutoff = 3; >> cfg.artfctdef.zvalue.fltpadding = 0.1; >> >> cfg.artfctdef.zvalue.bpfilter = 'yes'; >> cfg.artfctdef.zvalue.bpfilttype = 'but'; >> cfg.artfctdef.zvalue.bpfreq = [1 3]; >> cfg.artfctdef.zvalue.bpfiltord = 2; >> cfg.artfctdef.zvalue.hilbert = 'yes'; >> >> Thanks! >> >> Best, >> Julia >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> 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 Christoph.Kayser at glasgow.ac.uk Tue May 3 12:16:19 2016 From: Christoph.Kayser at glasgow.ac.uk (Christoph Kayser) Date: Tue, 3 May 2016 10:16:19 +0000 Subject: [FieldTrip] Post-Doc position in multisensory neuroimaging (MEG/EEG) studies at the Centre for Cognitive Neuroimaging, Glasgow, UK Message-ID: <330A4F21C29C8549A927275C10C1ADFB1FE87F73@CMS08-01.campus.gla.ac.uk> We are recruiting for 3 year post-doc position in the context of the EU-funded ERC project "Understanding the neural mechanisms of multisensory perception based on computational principles". The integrative neuroscience laboratory is dedicated to understanding the integration of multisensory information in the brain. The planned studies use state of the art imaging methodology (MEG, and possibly fMRI or EEG) combined with quantitative data analysis to better understand when and how the brain combines different sensory channels to inform perception. Further details about our research can be found on our website (http://inl.ccni.gla.ac.uk/). More details about the position and the link to the recruitment page can be found here http://www.jobs.ac.uk/job/ANO030/research-assistant-associate/ Job Ref: 013172 Closing data: 29th May 2016 The job requires all aspects of study design, implementation, data collection, data analysis as well as assisting in the supervision of junior lab members, presenting at conferences and participating in the writing up of the results. Applicants should have (or expect to receive in the near future) a PhD in neuroscience, cognitive science, psychology, mathematics, or a relevant discipline. We are especially interested in devotion to advanced quantitative data analysis including the capabilities to program or modify analysis code and the ideal applicant will have a strong analytical background and direct experience using MATLAB software. Experience with neuroimaging is required. Any applicant should have enthusiasm, and a clear, demonstrable capacity for acquiring expertise in these techniques. This position is funded for up to 3 years from November 2016, at UK RA Salary Grade 6 or 7 depending on experience. Questions may be directed to the PI: Christoph.Kayser at glasgow.ac.uk I'm sorry for multiple postings! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Tue May 3 13:07:18 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Tue, 3 May 2016 13:07:18 +0200 Subject: [FieldTrip] Cluster Permutation Message-ID: An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Tue May 3 15:34:14 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Tue, 3 May 2016 13:34:14 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <626588319.5432301.1462282454935.JavaMail.yahoo@mail.yahoo.com> Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Stephen Politzer-Ahles To: fieldtrip at science.ru.nl Sent: Wednesday, February 10, 2016 11:20 AM Subject: Re: [FieldTrip] importing large edf data Hi Leila (and Arjen): I just tried this out with a sample file, it looks like you can get this information if you use ft_read_header() rather than ft_preprocessing. The cfg structure I got from ft_preprocessing didn't contain the time-of-day information, but the structure returned from ft_read_header did: >> hdr = ft_read_header( cfg.dataset ); hdr.orig.T0 ans =         2005           9          15          10          18          42 I assume that's showing year, month, day, hour, minute (presumably based on the clock of the computer that made the recording). Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/  Message: 3 Date: Tue, 9 Feb 2016 15:40:35 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1722640118.1244946.1455032435939.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Thanks.I need to retrieve the time when the recordings occure and I don't see it. I get the Fs but no more.I am using this code : cfg = [];cfg.trl = [1 1000000 0];%cfg.trl = [100001 2000000 0];%cfg.trialdef.triallength = 5;cfg.dataset =fileName; %'For leila.edf';cfg= ft_definetrial( cfg );cfg.continuous = 'yes'; datastr = ft_preprocessing(cfg);data=datastr.trial{1,1};chanls=datastr.label;Fs=datastr.fsample; and getting this?datastr =? ? ? ? ? ? ?hdr: [1x1 struct]? ? ? ? ?label: {65x1 cell}? ? ? ? ? time: {[1x1000000 double]}? ? ? ? ?trial: {[65x1000000 double]}? ? ? ?fsample: 1024? ? sampleinfo: [1 1000000]? ? ? ? ? ?cfg: [1x1 struct] cfg =? ? ? ? ? ? ? ? ? ? trl: [1 1000000 0]? ? ? ? ? ? ? dataset: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? trackconfig: 'off'? ? ? ? ? checkconfig: 'loose'? ? ? ? ? ? checksize: 100000? ? ? ? ?showcallinfo: 'yes'? ? ? ? ? ? ? ? debug: 'no'? ? outputfilepresent: 'overwrite'? ? ? ? trackcallinfo: 'yes'? ? ? ? trackdatainfo: 'no'? ? ? ? ? ? ?callinfo: [1x1 struct]? ? ? ? ? ? ? version: [1x1 struct]? ? ? ? ? ? ?datafile: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? ?headerfile: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? ?dataformat: 'edf'? ? ? ? ?headerformat: 'edf'? ? ? ? ? ? ? ? event: []? ? ? ? ? ?continuous: 'yes' ?__________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London       From: Arjen Stolk  To: FieldTrip discussion list  Sent: Tuesday, February 9, 2016 3:32 PM  Subject: Re: [FieldTrip] importing large edf data Hi both,There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head.Arjen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 4 10:05:19 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 10:05:19 +0200 Subject: [FieldTrip] Fwd: Open PhD position in MEG studies of autism spectrum disorders... References: <61AE7C6258345149ADC0BA3AD9DA6E6201DD364CB0@exchccr1.neuro.gu.se> Message-ID: FYI Begin forwarded message: > From: Justin Schneiderman > Subject: Open PhD position in MEG studies of autism spectrum disorders... > Date: 4 May 2016 08:44:30 GMT+2 > To: Justin Schneiderman > > Hej! > My apologies if you receive this more than once. Please forward this to students interested in PhD studies in neuroscience, magnetoencephalography (MEG), neuroimaging, and autism spectrum disorders! > > We have an open PhD position at the Institute of Neuroscience and Physiology and the Gillberg Neuropsychiatry Centre here at the University of Gothenburg. The position is salaried and will be attached to our ongoing MEG neuroimaging study of autism spectrum disorders in connection to the Karolinska Institute's NatMEG center. For more information, please follow this link: > http://www.gu.se/english/about_the_university/announcements-in-the-job-application-portal/?languageId=100001&disableRedirect=true&returnUrl=http%3A%2F%2Fwww.gu.se%2Fomuniversitetet%2Faktuellt%2Fledigaanstallningar%2F%3Fid%3D19144%26Dnr%3D755868%26Type%3DS&Dnr=755868&Type=S > > If the link above doesn't work, then go to http://www.gu.se/english -> "About the university" -> "Job opportunities" -> "Doctoral student/ assistant/ teaching assistant" -> "PhD student position in medical science - Neurophysiological markers for autism (UR 2016/238)" > > Note: The deadline for applications is next Tuesday the 10th of May. > > Thanks! > -Justin > MedTech West > http://www.medtechwest.se > Institute of Neuroscience and Physiology > Sahlgrenska Academy & University of Gothenburg -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed May 4 10:51:24 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 08:51:24 +0000 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? In-Reply-To: References: Message-ID: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> Dear Harold, What extra documentation are you looking for? I think that a good start would be to read the description in the documentation part of the m-file itself (i.e. the stuff you get when typing ‘help ft_sourcedescriptives’). Note: if you don’t think you need the function, it’s alright not to use it :o). Best, Jan-Mathijs On 02 May 2016, at 15:14, Harold Cavendish > wrote: Hello, could you please explain the purpose of ft_sourcedescriptives() in EEG source analysis? The documentation is very brief (“computes descriptive parameters of the source analysis results”) and I haven't found a single tutorial with proper explanation. I found it used here but without any explanation whatsoever. Thank you! Harold _______________________________________________ fieldtrip 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 Wed May 4 11:08:05 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:08:05 +0000 Subject: [FieldTrip] FT clusterplot In-Reply-To: References: Message-ID: <2FCC2C77-A068-4B4B-8799-04491D7B2ACC@donders.ru.nl> Dear Hweeling, I am not a big fan of this function, and I would strongly recommend not to talk about ‘significant clusters’: using cluster-based permutation tests allows for inference about the difference across conditions/groups, based on a heuristic involving the estimation of clusters from the thresholded observed (and permuted) data, yet the clusters themselves are just a byproduct of this inferential procedure. >From what I can read in the code (which you also had a look at), indeed at some point a squeeze operation is performed in case the input data contains both a time and freq axis. Yet, note that the squeeze operation only has an effect if the freq dimension (the second dimension in the matrix) is singleton, i.e. if there’s only a single frequency bin in the data. In other words, even if the function does not crash when inputting time-frequency data, it will most likely produce ‘incorrect’ visualizations, or at least you think you are looking at something that will be different from the thing that you are actually looking at. The only way around this would be to do a pre-selection of a certain frequency range prior to calling ft_clusterplot. This preselection can be achieved with ft_selectdata in general (use cfg.frequency, and cfg.avgoverfreq), but will not likely produce the required output for the ‘posclusterslabelmat’ and ‘negclusterslabelmat’ fields, that are required for ft_clusterplot. At least, not if you select multiple frequency bins. Thus, in summary, you can pull this off, if you first use ft_selectdata, but in that case ensure that you select a single frequency bin. Best, Jan-Mathijs > On 02 May 2016, at 12:06, Hwee Ling Lee wrote: > > Dear all, > > I hope this email finds you well. > > I had a statistics results that I would like to use ft_clusterplot to plot the significant clusters. However, I'm experiencing some difficulties to specific the configuration. > > From the ft_clusterplot.m, I noticed that the function is able to squeeze the 3D matrix into a 2D matrix for plotting purposes. My current statistics results is in "chan-freq-time" dimension, and I was wondering how I could specific the configuration to select a specific frequency to plot. > > Can someone please help? > > Or do I have to adjust the statistics results variable manually such that it has a "chan-time" dimension for plotting? > > Thanks! > > Cheers, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 4 11:17:53 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:17:53 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? References: Message-ID: Hi Andreas, I think that the reason why ft_selectdata removes the ‘pow’-field is due to its overzealous bookkeeping. The data-structure you mentioned in a previous e-mail is not fully internally consistent (probably not your fault, by the way). Although it lacks a proper ‘dimord’ field, which specifies how the primary numeric data should be interpreted (in your case you probably want it to be: ‘subj_pos’), it also contains a ‘time’ field. In the absence of the dimord, FT is trying to create one from the data structure, and I suspect that the presence of the time-field will lead to something like ‘subj_pos_time’ or so. Subsequently, ft_seletdata only passes on those numeric data fields that are consistent with this dimord, which does not include pow. Anyway, my hunch is that if you do a rmfield(data,’time’), prior to calling ft_sourcestatistics the old-fashioned way (i.e. with the data being passed through ft_sourcegrandaverage), it may work as well. Best, Jan-Mathijs On 02 May 2016, at 15:27, Andreas Sauer > wrote: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) >: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip 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 Wed May 4 11:18:09 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 4 May 2016 09:18:09 +0000 Subject: [FieldTrip] Why does ft_selectdata remove "pow" from sourcedata during statistics? References: Message-ID: Hi Andreas, I think that the reason why ft_selectdata removes the ‘pow’-field is due to its overzealous bookkeeping. The data-structure you mentioned in a previous e-mail is not fully internally consistent (probably not your fault, by the way). Although it lacks a proper ‘dimord’ field, which specifies how the primary numeric data should be interpreted (in your case you probably want it to be: ‘subj_pos’), it also contains a ‘time’ field. In the absence of the dimord, FT is trying to create one from the data structure, and I suspect that the presence of the time-field will lead to something like ‘subj_pos_time’ or so. Subsequently, ft_seletdata only passes on those numeric data fields that are consistent with this dimord, which does not include pow. Anyway, my hunch is that if you do a rmfield(data,’time’), prior to calling ft_sourcestatistics the old-fashioned way (i.e. with the data being passed through ft_sourcegrandaverage), it may work as well. Best, Jan-Mathijs On 02 May 2016, at 15:27, Andreas Sauer > wrote: Dear Jan-Mathijs, thanks for your reply! In the meantime, another colleague also suggested to use a different syntax and that worked! I still don't understand, why ft_selectdata removes the "pow" field, but I can go on calculating my stats :-) . Best wishes, Andreas 2016-05-01 18:52 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) >: Dear Andreas, Have you tried it with a more recent version? Also, I would recommend not to use ft_sourcegrandaverage, but to use the syntax ft_sourcestatistics(cfg, source1{:}, source2{:}), assuming you have the single subject data represented in a cell-array of structures, with source1 for condition 1 and source2 for condition 2. Best, Jan-Mathijs On 24 Apr 2016, at 18:36, Andreas Sauer > wrote: Dear all, unfortunately, I am having problems to run source statistics on ERF mismatch negativity data (recorded with a 4D system). With the following data structure as input (output from ft_sourcegrandaverage), fieldtrip gives a warning that it „could not determine dimord of „pow“ in the following data“ pow: [16x37696 double] dim: [31 38 32] inside: [37696x1 logical] pos: [37696x3 double] time: [1x900 double] cfg: [1x1 struct] and later throws an error that „field „pow“ (is) not present in data“. I checked the ft_sourcestatistic script step by step and found out that ft_selectdata removes it after being called by ft_sourcestatistics. I am using the fieldtrip version from 15/05/2015. I also tried with older versions, one from late 2014 and late 2013, but nothing worked. Unfortunately, since ft_selectdata removes the field "pow" from the data during the call to ft_sourcestatistic, I can’t put it back in to the structure. Any help with this (esp. why „pow“ is being removed) is highly appreciated! Thanks and best wishes, Andreas -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Dipl.-Psych. Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: sauer.mpih at gmail.com www.brain.mpg.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lingwang at m.scnu.edu.cn Wed May 4 11:32:32 2016 From: lingwang at m.scnu.edu.cn (=?utf-8?B?TGluZyBXYW5n?=) Date: Wed, 4 May 2016 17:32:32 +0800 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Message-ID: Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Wed May 4 12:50:21 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Wed, 4 May 2016 10:50:21 +0000 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system In-Reply-To: References: Message-ID: <1462359023151.15592@cfin.au.dk> Dear Ling, Does your system consist of 148 magnetometors or gradiometers? In my previous lab at the University of Konstanz, we also had the Magnes 2500WH with 148 magnetometers. In our experience, the weights were not necessary for analyses at either the sensor or source level. If your system consists of gradiometers, however, maybe these weights would be necessary? If you really need those weights, I believe you can find them in the header structure, somewhere in data.hdr.orig. You will then need some knowledge on how to apply those weights. Cheers, Sarang ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Ling Wang Sent: Wednesday, May 4, 2016 11:32 AM To: fieldtrip Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 4 13:06:07 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 13:06:07 +0200 Subject: [FieldTrip] some issues with the sebserver hosting the wiki Message-ID: <79D7BF5F-97B6-436B-AA7C-1801AF32F7A1@donders.ru.nl> Dear community, The server that is also hosting the FieldTrip wiki (and some other Donders web sites) seems to have been under attack by hackers, trying to use it for sending email spam. We have not nailed down the issue yet. As a preventive measure we have blocked a whole list of suspicious IP addresses from accessing the FieldTrip wiki. If you cannot access the wiki any more, please let me know and I’ll unblock your IP address. Also if you notice anything unusual on the wiki (e.g. pages that youy think should not be there), please drop me a personal email. best regards, Robert From r.oostenveld at donders.ru.nl Wed May 4 15:38:37 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 4 May 2016 15:38:37 +0200 Subject: [FieldTrip] Donders Institute Toolkit on Non-invasive Brain Stimulation (TMS, tDCS, tACS) References: <6711FBFF69C42F41B4FCD956BE3BE6663DC974DE@exprd01.hosting.ru.nl> Message-ID: <579BF03C-3E14-48C9-9AA2-D5A6DDE7486D@donders.ru.nl> Dear all, On June 14-17, 2016, the annual Donders Institute Toolkit on Non-invasive Brain Stimulation (TMS, tDCS, tACS) will take place in Nijmegen, the Netherlands. This intensive 4-day methods-focused course will feature hands-on sessions, demos, and lectures from Donders Institute affiliates and external Keynote Speakers, regarding fundamentals of TMS, tDCS, tACS and neuroimaging applications (EEG, MEG and fMRI), with a particular focus on TMS-EEG. See preliminary schedule in attachment and http://www.ru.nl/donders/agenda-news/tool-kits-cognitive/transcranial-brain/. _________________________ Ian Cameron, PhD Senior Researcher Donders Centre for Cognitive Neuroimaging visiting address: Kapittelweg 29, 6525 EN mailing address: P.O. Box 9101, NL-6500 HB Nijmegen, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Toolkit of Cognitive Neuroscience2016_BrainStim_preliminary.compressed.pdf Type: application/pdf Size: 167190 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From lingwang at m.scnu.edu.cn Wed May 4 16:27:43 2016 From: lingwang at m.scnu.edu.cn (=?utf-8?B?TGluZyBXYW5n?=) Date: Wed, 4 May 2016 22:27:43 +0800 Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system In-Reply-To: <1462359023151.15592@cfin.au.dk> References: <1462359023151.15592@cfin.au.dk> Message-ID: Dear Sarang, Thanks for your reply. Our MEG system consists of 148 magnetometers. I searched the MEG papers published by researchers in your previous department at the University of Konstanz, and found two papers by Staudigl, Hanslmayr and colleagues (2013, 2015), in which the MEG data were collected with Magnes 2500WH 148-channel system and analyzed by FieldTrip. I'm happy about the papers. It seems that we can also use our MEG system to perform experiments. I'm new to the MEG field and am learning. Actually, I'm not sure about what the balancing weights are for. I read some scripts/functions of the FieldTrip toolbox, such as ft_read_header, bti2grad and read_4d_hdr. It says in the bti2grad function, "BTI2GRAD converts a 4D header to a gradiometer structure that can be understood by FieldTrip and Robert Oostenveld's low-level forward and inverse routines." So my understanding is that the balancing weights stored in hdr.grad is important for carrying out analyses at the source level? Or, the balancing weights are only necessary for gradieometers system but not for magnetometers system? Thanks again for the information. Best wishes, Ling ------------------ Original ------------------ From: "Sarang S. Dalal"; Date: Wed, May 4, 2016 06:50 PM To: "FieldTrip discussion list"; Subject: Re: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear Ling, Does your system consist of 148 magnetometors or gradiometers? In my previous lab at the University of Konstanz, we also had the Magnes 2500WH with 148 magnetometers. In our experience, the weights were not necessary for analyses at either the sensor or source level. If your system consists of gradiometers, however, maybe these weights would be necessary? If you really need those weights, I believe you can find them in the header structure, somewhere in data.hdr.orig. You will then need some knowledge on how to apply those weights. Cheers, Sarang From: fieldtrip-bounces at science.ru.nl on behalf of Ling Wang Sent: Wednesday, May 4, 2016 11:32 AM To: fieldtrip Subject: [FieldTrip] 4D-Neuroimaging Magnes 2500WH system Dear All, We recently started a joint study with the staff of a hospital specialized for brain diseases, where there is a 4D-Neuroimaging Magnes 2500WH system. We have collected a sample MEG data with the system to see if we can perform experiments with the system. I am trying to analyze the data with FieldTrip. As introduced in the tutorial (http://www.fieldtriptoolbox.org/getting_started/bti), the software currently reads digital balancing weights only for the Magnes 3600 system but not the 148-channel system. And yes, the software does not compute the balancing matrix for our MEG data, as indicated by the function, ft_read_header, "not applying digital weights in the gradiometer balancing matrix", when reading our MEG data. I have three questions about analyzing these Magnes 2500WH MEG data with FieldTrip. 1) Can we still carry out the analyses (ERF, TRF and connectivity) correctly at the sensory-level? 2) Is there a plan that FieldTrip would read the digital balancing weights for the MEG data of the Magnes 2500WH system? 3) If we want to program to read the weights, what information do we need and possibly where can find the related information (e.g., the user manual of the system?)? Thanks in advance. Best wishes, Ling Wang School of Psychology South China Normal University -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseluisblues at gmail.com Wed May 4 19:30:53 2016 From: joseluisblues at gmail.com (Jose) Date: Wed, 4 May 2016 19:30:53 +0200 Subject: [FieldTrip] integer frequencies in TFR Message-ID: dear list, I'm analysing CTF MEG data (sampling rate 1250 Hz). I'm epoching my data from -0.5 sec to 2.8 sec relative my marker of interest. % define the trial matrix trlFile = zeros(length(markers3), 3); for i_trial = 1:length(markers3) trlFile(i_trial,1) = markers3(i_trial,2) -625; % 0.5*1250 % SR = 1250, trlFile(i_trial,2) = markers3(i_trial,2) +3500; % 2.8*1250 % SR = 1250, trlFile(i_trial,3) = -625; trlFile(i_trial,4) = markers3(i_trial,1); end Once I pre-process the data, I run TF analyses with the wavelet method cfg = [ ]; cfg.trials = find(data2.trialinfo(:,1) == i_condition); cfg.channel = 'MEG'; cfg.method = 'wavelet'; cfg.width = 5; cfg.output = 'pow'; cfg.foi = 1:1:30; cfg.toi = -0.5:0.05:2.8; TFdata = ft_freqanalysis(cfg, data1); In the .freq field I realize that my frequency are not exact integers 0.907801418439716 2.11820330969267 3.02600472813239 3.93380614657210 5.14420803782506 6.05200945626478 6.95981087470449 7.86761229314421 9.07801418439716 9.98581560283688 ... I checked: http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies So, I decide to reduce one sample in my trial definition (so trlFile(i_trial,2) = markers3(i_trial,2) +3500-1; % 2.8*1250 % SR = 1250,) But, still I'm not having integers, 0.909090909090909 2.12121212121212 3.03030303030303 3.93939393939394 5.15151515151515 6.06060606060606 6.96969696969697 7.87878787878788 9.09090909090909 10 ... I suspect I can't obtain integer frequencies in my TFR due to my frequency sampling, Is there any recommendation regarding the frequencies used to compute the TFRs? Would that pose some issues for subsequent processing steps? thanks Jose -------------- next part -------------- An HTML attachment was scrubbed... URL: From leilayou_54 at yahoo.com Thu May 5 16:34:40 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Thu, 5 May 2016 14:34:40 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> References: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> Message-ID: <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com>  Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London From: Arjen Stolk To: FieldTrip discussion list Sent: Tuesday, February 9, 2016 3:32 PM Subject: Re: [FieldTrip] importing large edf data Hi both,There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head.Arjen On Feb 9, 2016, at 3:19 AM, Stephen Politzer-Ahles wrote: Hi Leila, I'm sorry but I'm afraid I have not quite understood your issue. Can you give some more detail about what the problem is? In general, the fieldtrip structure output by ft_preprocessing() should have a .time field (indicating what timepoint during the epoch each sample corresponds to) and an .fsample field indicating the sampling rate (which you would also be able to use to figure out the time of each sample). 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: Mon, 8 Feb 2016 11:51:05 +0000 (UTC) From: Leila Ayoubian To: FieldTrip discussion list Subject: Re: [FieldTrip] importing large edf data Message-ID:         <1195829915.655104.1454932265573.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Stephen:I just happen to realize that when I load the data as you mentioned below, I can not get hold of the real time of the EEG file. (e.g.18:32:43 ).Could you please point out as how I could retrieve the real time of the EEG file after loading. Thanks a lot.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: 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 _______________________________________________ fieldtrip 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 Thu May 5 16:35:07 2016 From: leilayou_54 at yahoo.com (Leila Ayoubian) Date: Thu, 5 May 2016 14:35:07 +0000 (UTC) Subject: [FieldTrip] importing large edf data In-Reply-To: References: Message-ID: <261952317.6531678.1462458907903.JavaMail.yahoo@mail.yahoo.com>  Hi,I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)Here is my code. It does create the 'a' file but it does not open as EDF.Any suggestion?   clc;clear all;close all;%%[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file1 = fullfile(pathName1, fileName1);cfg1 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg1.trialdef.triallength = 5;cfg1.dataset =file1; %'For leila.edf';cfg1= ft_definetrial( cfg1 );cfg1.continuous = 'yes';datastr1 = ft_preprocessing(cfg1);data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr;%% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');file2 = fullfile(pathName2, fileName2);cfg2 = [];%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 mscfg2.trialdef.triallength = 5;cfg2.dataset =file2; %'For leila.edf';cfg2= ft_definetrial( cfg2 );cfg2.continuous = 'yes';datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2)% EEG=EEG';% HDR=hdr1% out=EDFCreator(EEG); dat = cat(2,data1,data2);%%% write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ 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 gina.joue at univr.it Thu May 5 17:40:35 2016 From: gina.joue at univr.it (gj) Date: Thu, 5 May 2016 17:40:35 +0200 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572B6719.20906@univr.it> References: <572B6711.1050906@univr.it> <572B6719.20906@univr.it> Message-ID: <572B6973.4050104@univr.it> Hi again, I'm really stymied over this problem and can't move on with my analyses...help? Pretty please? Thank you in advance! Gina From jan.schoffelen at donders.ru.nl Thu May 5 19:11:32 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 17:11:32 +0000 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572B6973.4050104@univr.it> References: <572B6711.1050906@univr.it> <572B6719.20906@univr.it> <572B6973.4050104@univr.it> Message-ID: Hi Gina, In general I think that you really should provide a bit more information. I at least don’t remember what your problem is all about, and if you would like people to think along (who by the way all do this on a voluntary basis), you should really give us something to work on, and present things on a silver platter, rather than expecting us to dig through our (no doubt extensive) e-mail archives, which moreover relies on the assumption that we still have your earlier e-mails handy. This being said, I dug through my archive, and saw that I already replied to an e-mail of yours that has the same subject header. Here’s my earlier reply: ++++++++++++++++++++++++++++++++++++ Begin forwarded message: From: Jan Mathijs Schoffelen > Subject: Re: [FieldTrip] ft_source2sparse usage for EEG data Date: 11 April 2016 at 15:05:21 GMT+2 To: FieldTrip discussion list > Hi Gina, A dimensionality of 92232 ( ^ 2) suggests that you have 28 times the number of inside dipoles. I suspect a interaction between FieldTrip’s internal data bookkeeping and perhaps your specification of the input data/cfg. Where does this factor of 28 come from? Best, Jan-Mathijs ++++++++++++++++++++++++++++++++++++++++++ As you can see, this reply contained a question, which as far as I am concerned has not been answered. In other words, the ball is in your court. Best, Jan-Mathijs On 05 May 2016, at 17:40, gj > wrote: Hi again, I'm really stymied over this problem and can't move on with my analyses...help? Pretty please? Thank you in advance! Gina _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From brungio at gmail.com Thu May 5 20:37:51 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Thu, 5 May 2016 19:37:51 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign Message-ID: <572B92FF.9090502@gmail.com> Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From brungio at gmail.com Thu May 5 20:43:30 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Thu, 5 May 2016 19:43:30 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <572B92FF.9090502@gmail.com> References: <572B92FF.9090502@gmail.com> Message-ID: <572B9452.3060004@gmail.com> Please ignore this. I just tried with the current FT version, and the problem disappeared. Bruno On 05/05/2016 19:37, Bruno L. Giordano wrote: > Hello, > > I am trying to run these commands on different matlab versions(2013 vs. > 2015) and using different FT versions (20141209 vs. 20160317; let's call > them 2014 vs. 2016). > > The code I run is as follows: > > mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); > > cfg=[]; > cfg.method='fiducial'; > cfg.coordsys='4d'; > cfg.fiducial.nas=[59 168 104]; > cfg.fiducial.lpa=[138 133 28]; > cfg.fiducial.rpa=[147 138 169]; > mri=ft_volumerealign(cfg,mri); > > hs=ft_read_headshape(headshapefilename); > % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an > error, see v > > cfg=[]; > cfg.method='headshape'; > cfg.headshape=hs; > > mrihs=ft_volumerealign(cfg,mri); > > Unless otherwise noted, the code fails when I quit the interactive > alignment window. > > It fails in the following cases (errors below): > Matlab: 2015; FT: 2016 > Matlab: 2015; FT: 2014 > Matlab: 2013; FT: 2016 > > and is successful only for > Matlab: 2013; FT: 2014 > > Did anyone experience similar problems? Is there a workaround? If not, > would it be complicated to estimate the transformation matrices myself > once I know the right scale/translation/rotation parameters? > > Thank you, > > Bruno > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2013; FT: 2016 > Matlab: 2013; FT: 2016 > Fails when quitting interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Error using cell/ismember>cellismemberR2012a (line 193) > Input A of class cell and input B of class cell must be cell arrays of > strings, unless one is a string. > > Error in cell/ismember (line 57) > [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); > > Error in ft_senstype (line 303) > if (mean(ismember(ft_senslabel('ant128'), sens.label)) > > 0.8) > > Error in ft_datatype_sens (line 138) > ismeg = ft_senstype(sens, 'meg'); > > Error in ft_checkconfig (line 250) > cfg.elec = ft_datatype_sens(cfg.elec); > > Error in ft_interactiverealign (line 71) > cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', > 'headmodel'}); > > Error in ft_volumerealign (line 691) > tmpcfg = ft_interactiverealign(tmpcfg); > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2015; FT: 2016 > Matlab: 2015; FT: 2016 > hs.pnt=hs.pos; %required or will give another error > Fails when quitting interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Error using * > Inner matrix dimensions must agree. > > Error in ft_sourceinterpolate (line 328) > av = interpmat*fv; > > Error in ft_volumerealign (line 752) > smoothdist = ft_sourceinterpolate(tmpcfg, functional, > target); > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Matlab: 2015; FT: 2014 > Matlab: 2015; FT: 2014 > hs.pnt=hs.pos; %required or will give another error > Fails when creating the interactive alignment window > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > ield assignment to a non-structure array object. > > Error in ft_plot_mesh (line 61) > bnd.pnt = bnd; > > Error in ft_interactiverealign>cb_redraw (line 282) > ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', > 'vertexsize',10); > > Error in ft_interactiverealign (line 126) > cb_redraw(gca); > > Error in ft_volumerealign (line 584) > tmpcfg = ft_interactiverealign(tmpcfg); > > > > > > > > > > > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Thu May 5 21:00:03 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 19:00:03 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> Message-ID: <700BDF87-ABB0-457C-BDA8-3BA3801DA4CB@donders.ru.nl> Hi Bruno, I think we have just been looking into it. And with just, I mean really just. I just merged a pull request from Roemer van der Meij into github.com/fieldtrip/fieldtrip (#141). This merge is related to a graphics issue that needs to be resolved differently for different matlab versions (in particular for matlab>=2014 it requires a different solution than matlab<2014). I wonder whether this is related to the problem you report. We did not do an comparable extensive sweep of the possible combinations (i.e. matlab versions and fieldtrip versions), so could you pull a copy from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that explains one way of getting yourself a local copy of the code. Thanks, Jan-Mathijs On 05 May 2016, at 20:37, Bruno L. Giordano > wrote: Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ _______________________________________________ fieldtrip 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 Thu May 5 21:05:48 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 5 May 2016 19:05:48 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> Message-ID: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Hi Bruno, I think we have just been looking into it. And with just, I mean really just. I just merged a pull request from Roemer van der Meij into github.com/fieldtrip/fieldtrip (#141). This merge is related to a graphics issue that needs to be resolved differently for different matlab versions (in particular for matlab>=2014 it requires a different solution than matlab<2014). I wonder whether this is related to the problem you report. We did not do an comparable extensive sweep of the possible combinations (i.e. matlab versions and fieldtrip versions), so could you pull a copy from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that explains one way of getting yourself a local copy of the code. Thanks, Jan-Mathijs On 05 May 2016, at 20:37, Bruno L. Giordano > wrote: Hello, I am trying to run these commands on different matlab versions(2013 vs. 2015) and using different FT versions (20141209 vs. 20160317; let's call them 2014 vs. 2016). The code I run is as follows: mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); cfg=[]; cfg.method='fiducial'; cfg.coordsys='4d'; cfg.fiducial.nas=[59 168 104]; cfg.fiducial.lpa=[138 133 28]; cfg.fiducial.rpa=[147 138 169]; mri=ft_volumerealign(cfg,mri); hs=ft_read_headshape(headshapefilename); % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an error, see v cfg=[]; cfg.method='headshape'; cfg.headshape=hs; mrihs=ft_volumerealign(cfg,mri); Unless otherwise noted, the code fails when I quit the interactive alignment window. It fails in the following cases (errors below): Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2014 Matlab: 2013; FT: 2016 and is successful only for Matlab: 2013; FT: 2014 Did anyone experience similar problems? Is there a workaround? If not, would it be complicated to estimate the transformation matrices myself once I know the right scale/translation/rotation parameters? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2013; FT: 2016 Matlab: 2013; FT: 2016 Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using cell/ismember>cellismemberR2012a (line 193) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string. Error in cell/ismember (line 57) [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); Error in ft_senstype (line 303) if (mean(ismember(ft_senslabel('ant128'), sens.label)) > 0.8) Error in ft_datatype_sens (line 138) ismeg = ft_senstype(sens, 'meg'); Error in ft_checkconfig (line 250) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_interactiverealign (line 71) cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', 'headmodel'}); Error in ft_volumerealign (line 691) tmpcfg = ft_interactiverealign(tmpcfg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2016 Matlab: 2015; FT: 2016 hs.pnt=hs.pos; %required or will give another error Fails when quitting interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error using * Inner matrix dimensions must agree. Error in ft_sourceinterpolate (line 328) av = interpmat*fv; Error in ft_volumerealign (line 752) smoothdist = ft_sourceinterpolate(tmpcfg, functional, target); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Matlab: 2015; FT: 2014 Matlab: 2015; FT: 2014 hs.pnt=hs.pos; %required or will give another error Fails when creating the interactive alignment window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ield assignment to a non-structure array object. Error in ft_plot_mesh (line 61) bnd.pnt = bnd; Error in ft_interactiverealign>cb_redraw (line 282) ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', 'vertexsize',10); Error in ft_interactiverealign (line 126) cb_redraw(gca); Error in ft_volumerealign (line 584) tmpcfg = ft_interactiverealign(tmpcfg); -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From brungio at gmail.com Fri May 6 10:22:58 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 09:22:58 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Message-ID: <572C5462.5070809@gmail.com> Hi, thanks, I will look into it! One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: hs.pnt=hs.pos; Cheers, Bruno On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Bruno, > > I think we have just been looking into it. And with just, I mean really > just. I just merged a pull request from Roemer van der Meij into > github.com/fieldtrip/fieldtrip > (#141). This merge is related to > a graphics issue that needs to be resolved differently for different > matlab versions (in particular for matlab>=2014 it requires a different > solution than matlab<2014). I wonder whether this is related to the > problem you report. > We did not do an comparable extensive sweep of the possible combinations > (i.e. matlab versions and fieldtrip versions), so could you pull a copy > from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that > explains one way of getting yourself a local copy of the code. > > Thanks, > > Jan-Mathijs > > > > > >> On 05 May 2016, at 20:37, Bruno L. Giordano > > wrote: >> >> Hello, >> >> I am trying to run these commands on different matlab versions(2013 >> vs. 2015) and using different FT versions (20141209 vs. 20160317; >> let's call them 2014 vs. 2016). >> >> The code I run is as follows: >> >> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >> >> cfg=[]; >> cfg.method='fiducial'; >> cfg.coordsys='4d'; >> cfg.fiducial.nas=[59 168 104]; >> cfg.fiducial.lpa=[138 133 28]; >> cfg.fiducial.rpa=[147 138 169]; >> mri=ft_volumerealign(cfg,mri); >> >> hs=ft_read_headshape(headshapefilename); >> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >> error, see v >> >> cfg=[]; >> cfg.method='headshape'; >> cfg.headshape=hs; >> >> mrihs=ft_volumerealign(cfg,mri); >> >> Unless otherwise noted, the code fails when I quit the interactive >> alignment window. >> >> It fails in the following cases (errors below): >> Matlab: 2015; FT: 2016 >> Matlab: 2015; FT: 2014 >> Matlab: 2013; FT: 2016 >> >> and is successful only for >> Matlab: 2013; FT: 2014 >> >> Did anyone experience similar problems? Is there a workaround? If not, >> would it be complicated to estimate the transformation matrices myself >> once I know the right scale/translation/rotation parameters? >> >> Thank you, >> >> Bruno >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2013; FT: 2016 >> Matlab: 2013; FT: 2016 >> Fails when quitting interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Error using cell/ismember>cellismemberR2012a (line 193) >> Input A of class cell and input B of class cell must be cell arrays of >> strings, unless one is a string. >> >> Error in cell/ismember (line 57) >> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >> >> Error in ft_senstype (line 303) >> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >> > 0.8) >> >> Error in ft_datatype_sens (line 138) >> ismeg = ft_senstype(sens, 'meg'); >> >> Error in ft_checkconfig (line 250) >> cfg.elec = ft_datatype_sens(cfg.elec); >> >> Error in ft_interactiverealign (line 71) >> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >> 'headmodel'}); >> >> Error in ft_volumerealign (line 691) >> tmpcfg = ft_interactiverealign(tmpcfg); >> >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2015; FT: 2016 >> Matlab: 2015; FT: 2016 >> hs.pnt=hs.pos; %required or will give another error >> Fails when quitting interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in ft_sourceinterpolate (line 328) >> av = interpmat*fv; >> >> Error in ft_volumerealign (line 752) >> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >> target); >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Matlab: 2015; FT: 2014 >> Matlab: 2015; FT: 2014 >> hs.pnt=hs.pos; %required or will give another error >> Fails when creating the interactive alignment window >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> >> ield assignment to a non-structure array object. >> >> Error in ft_plot_mesh (line 61) >> bnd.pnt = bnd; >> >> Error in ft_interactiverealign>cb_redraw (line 282) >> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >> 'vertexsize',10); >> >> Error in ft_interactiverealign (line 126) >> cb_redraw(gca); >> >> Error in ft_volumerealign (line 584) >> tmpcfg = ft_interactiverealign(tmpcfg); >> >> >> >> >> >> >> >> >> >> >> >> -- >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Bruno L. Giordano, PhD >> Institute of Neuroscience and Psychology >> 58 Hillhead Street, University of Glasgow >> Glasgow, G12 8QB, Scotland >> T +44 (0) 141 330 5484 >> Www: http://www.brunolgiordano.net >> Email charter: http://www.emailcharter.org/ >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Fri May 6 10:25:00 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 6 May 2016 08:25:00 +0000 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <572C5462.5070809@gmail.com> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <572C5462.5070809@gmail.com> Message-ID: <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> Hi Bruno, Is this ‘hack’ done inside a function, or do you need to do it outside a function call? We recently tried and streamline the code to replace all occurrences of ‘pnt’ with ‘pos’. The fact that you need the hack suggests that we need to do some more code cleaning. It would be great if you could give us a pointer. JM > On 06 May 2016, at 10:22, Bruno L. Giordano wrote: > > Hi, > > thanks, I will look into it! > > One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: > > hs.pnt=hs.pos; > > Cheers, > > Bruno > > On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Bruno, >> >> I think we have just been looking into it. And with just, I mean really >> just. I just merged a pull request from Roemer van der Meij into >> github.com/fieldtrip/fieldtrip >> (#141). This merge is related to >> a graphics issue that needs to be resolved differently for different >> matlab versions (in particular for matlab>=2014 it requires a different >> solution than matlab<2014). I wonder whether this is related to the >> problem you report. >> We did not do an comparable extensive sweep of the possible combinations >> (i.e. matlab versions and fieldtrip versions), so could you pull a copy >> from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that >> explains one way of getting yourself a local copy of the code. >> >> Thanks, >> >> Jan-Mathijs >> >> >> >> >> >>> On 05 May 2016, at 20:37, Bruno L. Giordano >> > wrote: >>> >>> Hello, >>> >>> I am trying to run these commands on different matlab versions(2013 >>> vs. 2015) and using different FT versions (20141209 vs. 20160317; >>> let's call them 2014 vs. 2016). >>> >>> The code I run is as follows: >>> >>> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >>> >>> cfg=[]; >>> cfg.method='fiducial'; >>> cfg.coordsys='4d'; >>> cfg.fiducial.nas=[59 168 104]; >>> cfg.fiducial.lpa=[138 133 28]; >>> cfg.fiducial.rpa=[147 138 169]; >>> mri=ft_volumerealign(cfg,mri); >>> >>> hs=ft_read_headshape(headshapefilename); >>> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >>> error, see v >>> >>> cfg=[]; >>> cfg.method='headshape'; >>> cfg.headshape=hs; >>> >>> mrihs=ft_volumerealign(cfg,mri); >>> >>> Unless otherwise noted, the code fails when I quit the interactive >>> alignment window. >>> >>> It fails in the following cases (errors below): >>> Matlab: 2015; FT: 2016 >>> Matlab: 2015; FT: 2014 >>> Matlab: 2013; FT: 2016 >>> >>> and is successful only for >>> Matlab: 2013; FT: 2014 >>> >>> Did anyone experience similar problems? Is there a workaround? If not, >>> would it be complicated to estimate the transformation matrices myself >>> once I know the right scale/translation/rotation parameters? >>> >>> Thank you, >>> >>> Bruno >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2013; FT: 2016 >>> Matlab: 2013; FT: 2016 >>> Fails when quitting interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> Error using cell/ismember>cellismemberR2012a (line 193) >>> Input A of class cell and input B of class cell must be cell arrays of >>> strings, unless one is a string. >>> >>> Error in cell/ismember (line 57) >>> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >>> >>> Error in ft_senstype (line 303) >>> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >>> > 0.8) >>> >>> Error in ft_datatype_sens (line 138) >>> ismeg = ft_senstype(sens, 'meg'); >>> >>> Error in ft_checkconfig (line 250) >>> cfg.elec = ft_datatype_sens(cfg.elec); >>> >>> Error in ft_interactiverealign (line 71) >>> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >>> 'headmodel'}); >>> >>> Error in ft_volumerealign (line 691) >>> tmpcfg = ft_interactiverealign(tmpcfg); >>> >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2015; FT: 2016 >>> Matlab: 2015; FT: 2016 >>> hs.pnt=hs.pos; %required or will give another error >>> Fails when quitting interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> Error using * >>> Inner matrix dimensions must agree. >>> >>> Error in ft_sourceinterpolate (line 328) >>> av = interpmat*fv; >>> >>> Error in ft_volumerealign (line 752) >>> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >>> target); >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Matlab: 2015; FT: 2014 >>> Matlab: 2015; FT: 2014 >>> hs.pnt=hs.pos; %required or will give another error >>> Fails when creating the interactive alignment window >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> >>> ield assignment to a non-structure array object. >>> >>> Error in ft_plot_mesh (line 61) >>> bnd.pnt = bnd; >>> >>> Error in ft_interactiverealign>cb_redraw (line 282) >>> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >>> 'vertexsize',10); >>> >>> Error in ft_interactiverealign (line 126) >>> cb_redraw(gca); >>> >>> Error in ft_volumerealign (line 584) >>> tmpcfg = ft_interactiverealign(tmpcfg); >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> -- >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Bruno L. Giordano, PhD >>> Institute of Neuroscience and Psychology >>> 58 Hillhead Street, University of Glasgow >>> Glasgow, G12 8QB, Scotland >>> T +44 (0) 141 330 5484 >>> Www: http://www.brunolgiordano.net >>> Email charter: http://www.emailcharter.org/ >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Bruno L. Giordano, PhD > Institute of Neuroscience and Psychology > 58 Hillhead Street, University of Glasgow > Glasgow, G12 8QB, Scotland > T +44 (0) 141 330 5484 > Www: http://www.brunolgiordano.net > Email charter: http://www.emailcharter.org/ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From brungio at gmail.com Fri May 6 10:59:35 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 09:59:35 +0100 Subject: [FieldTrip] Dartel-based MNI group grid Message-ID: <572C5CF7.3020407@gmail.com> Hi, I usually prepare the native-space beamforming grid by warping non-linearly to the native space a MNI group-level grid: cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = groupgrid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_headshape; %native-space anatomical grid = ft_prepare_sourcemodel(cfg); I am wondering whether someone ever tried to do this warping through DARTEL (http://www.ncbi.nlm.nih.gov/pubmed/17761438 implemented in SPM). The approach would still be to define an MNI-space grid, but to back-project to native space through the DARTEL template. When compared to the SPM non-linear warping, this approach would ensure a much better correspondence between structures for the different participant, and promises to boost to a certain extent group statistics (that is, not considering source blurring). It would also be quite a good idea for multimodal MEG/fMRI studies, where fMRI group-level is strongly recommended to rely on DARTEL (if you use SPM). Thank you for sharing your experiences/code snippets, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From brungio at gmail.com Fri May 6 11:29:45 2016 From: brungio at gmail.com (Bruno L. Giordano) Date: Fri, 6 May 2016 10:29:45 +0100 Subject: [FieldTrip] odd interaction between matlab and ft version in ft_volumerealign In-Reply-To: <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <572C5462.5070809@gmail.com> <98A91849-CC23-4045-8453-BC7B358876D8@donders.ru.nl> Message-ID: <572C6409.5080504@gmail.com> Hi, we do this after getting the headshape with ft_readhsadshape, and before using the hs structure as cfg.headshape for mri-to-headshape realignment with ft_volumerealign. The switch to matlab2015 must have been a major headache for you guys ;-) Thanks for your hard work! Bruno On 06/05/2016 09:25, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Bruno, > > Is this ‘hack’ done inside a function, or do you need to do it outside a function call? > We recently tried and streamline the code to replace all occurrences of ‘pnt’ with ‘pos’. The fact that you need the hack suggests that we need to do some more code cleaning. It would be great if you could give us a pointer. > > JM > > >> On 06 May 2016, at 10:22, Bruno L. Giordano wrote: >> >> Hi, >> >> thanks, I will look into it! >> >> One of the problems below we have been consistently experiencing here is related to the headshape structure: to avoid errors, we have been doing: >> >> hs.pnt=hs.pos; >> >> Cheers, >> >> Bruno >> >> On 05/05/2016 20:05, Schoffelen, J.M. (Jan Mathijs) wrote: >>> Hi Bruno, >>> >>> I think we have just been looking into it. And with just, I mean really >>> just. I just merged a pull request from Roemer van der Meij into >>> github.com/fieldtrip/fieldtrip >>> (#141). This merge is related to >>> a graphics issue that needs to be resolved differently for different >>> matlab versions (in particular for matlab>=2014 it requires a different >>> solution than matlab<2014). I wonder whether this is related to the >>> problem you report. >>> We did not do an comparable extensive sweep of the possible combinations >>> (i.e. matlab versions and fieldtrip versions), so could you pull a copy >>> from git and try it out? We have a ‘tutorial’ on the fieldtrip wiki that >>> explains one way of getting yourself a local copy of the code. >>> >>> Thanks, >>> >>> Jan-Mathijs >>> >>> >>> >>> >>> >>>> On 05 May 2016, at 20:37, Bruno L. Giordano >>> > wrote: >>>> >>>> Hello, >>>> >>>> I am trying to run these commands on different matlab versions(2013 >>>> vs. 2015) and using different FT versions (20141209 vs. 20160317; >>>> let's call them 2014 vs. 2016). >>>> >>>> The code I run is as follows: >>>> >>>> mri=ft_read_mri(mrifilename,'dataformat','nifti_spm'); >>>> >>>> cfg=[]; >>>> cfg.method='fiducial'; >>>> cfg.coordsys='4d'; >>>> cfg.fiducial.nas=[59 168 104]; >>>> cfg.fiducial.lpa=[138 133 28]; >>>> cfg.fiducial.rpa=[147 138 169]; >>>> mri=ft_volumerealign(cfg,mri); >>>> >>>> hs=ft_read_headshape(headshapefilename); >>>> % hs.pnt=hs.pos; %required for later fieldtrip versions or gives an >>>> error, see v >>>> >>>> cfg=[]; >>>> cfg.method='headshape'; >>>> cfg.headshape=hs; >>>> >>>> mrihs=ft_volumerealign(cfg,mri); >>>> >>>> Unless otherwise noted, the code fails when I quit the interactive >>>> alignment window. >>>> >>>> It fails in the following cases (errors below): >>>> Matlab: 2015; FT: 2016 >>>> Matlab: 2015; FT: 2014 >>>> Matlab: 2013; FT: 2016 >>>> >>>> and is successful only for >>>> Matlab: 2013; FT: 2014 >>>> >>>> Did anyone experience similar problems? Is there a workaround? If not, >>>> would it be complicated to estimate the transformation matrices myself >>>> once I know the right scale/translation/rotation parameters? >>>> >>>> Thank you, >>>> >>>> Bruno >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2013; FT: 2016 >>>> Matlab: 2013; FT: 2016 >>>> Fails when quitting interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> Error using cell/ismember>cellismemberR2012a (line 193) >>>> Input A of class cell and input B of class cell must be cell arrays of >>>> strings, unless one is a string. >>>> >>>> Error in cell/ismember (line 57) >>>> [varargout{1:max(1,nargout)}] = cellismemberR2012a(A,B); >>>> >>>> Error in ft_senstype (line 303) >>>> if (mean(ismember(ft_senslabel('ant128'), sens.label)) >>>>> 0.8) >>>> >>>> Error in ft_datatype_sens (line 138) >>>> ismeg = ft_senstype(sens, 'meg'); >>>> >>>> Error in ft_checkconfig (line 250) >>>> cfg.elec = ft_datatype_sens(cfg.elec); >>>> >>>> Error in ft_interactiverealign (line 71) >>>> cfg.template = ft_checkconfig(cfg.template, 'renamed', {'vol', >>>> 'headmodel'}); >>>> >>>> Error in ft_volumerealign (line 691) >>>> tmpcfg = ft_interactiverealign(tmpcfg); >>>> >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2015; FT: 2016 >>>> Matlab: 2015; FT: 2016 >>>> hs.pnt=hs.pos; %required or will give another error >>>> Fails when quitting interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in ft_sourceinterpolate (line 328) >>>> av = interpmat*fv; >>>> >>>> Error in ft_volumerealign (line 752) >>>> smoothdist = ft_sourceinterpolate(tmpcfg, functional, >>>> target); >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Matlab: 2015; FT: 2014 >>>> Matlab: 2015; FT: 2014 >>>> hs.pnt=hs.pos; %required or will give another error >>>> Fails when creating the interactive alignment window >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> >>>> ield assignment to a non-structure array object. >>>> >>>> Error in ft_plot_mesh (line 61) >>>> bnd.pnt = bnd; >>>> >>>> Error in ft_interactiverealign>cb_redraw (line 282) >>>> ft_plot_mesh(template.elec.chanpos,'vertexcolor', 'b', >>>> 'vertexsize',10); >>>> >>>> Error in ft_interactiverealign (line 126) >>>> cb_redraw(gca); >>>> >>>> Error in ft_volumerealign (line 584) >>>> tmpcfg = ft_interactiverealign(tmpcfg); >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> Bruno L. Giordano, PhD >>>> Institute of Neuroscience and Psychology >>>> 58 Hillhead Street, University of Glasgow >>>> Glasgow, G12 8QB, Scotland >>>> T +44 (0) 141 330 5484 >>>> Www: http://www.brunolgiordano.net >>>> Email charter: http://www.emailcharter.org/ >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> -- >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Bruno L. Giordano, PhD >> Institute of Neuroscience and Psychology >> 58 Hillhead Street, University of Glasgow >> Glasgow, G12 8QB, Scotland >> T +44 (0) 141 330 5484 >> Www: http://www.brunolgiordano.net >> Email charter: http://www.emailcharter.org/ >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, PhD Institute of Neuroscience and Psychology 58 Hillhead Street, University of Glasgow Glasgow, G12 8QB, Scotland T +44 (0) 141 330 5484 Www: http://www.brunolgiordano.net Email charter: http://www.emailcharter.org/ From jan.schoffelen at donders.ru.nl Fri May 6 20:50:52 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 6 May 2016 18:50:52 +0000 Subject: [FieldTrip] integer frequencies in TFR In-Reply-To: References: Message-ID: <19D4FAE7-1E95-4549-AE5F-7F597952F5FF@donders.ru.nl> Hi José, The frequencies that are returned are constrained by the intrinsic frequency resolution of your epochs. Since your epochs are 3.3 seconds long, FT will round to the nearest attainable frequencies, quantized at 1./3.3. You can use cfg.pad for spectral interpolation. This parameter is the length (in s) until which the data are padded with 0’s, prior to the FFT. In this case, I suggest to use cfg.pad = 4. Best, Jan-Mathijs On 04 May 2016, at 19:30, Jose > wrote: dear list, I'm analysing CTF MEG data (sampling rate 1250 Hz). I'm epoching my data from -0.5 sec to 2.8 sec relative my marker of interest. % define the trial matrix trlFile = zeros(length(markers3), 3); for i_trial = 1:length(markers3) trlFile(i_trial,1) = markers3(i_trial,2) -625; % 0.5*1250 % SR = 1250, trlFile(i_trial,2) = markers3(i_trial,2) +3500; % 2.8*1250 % SR = 1250, trlFile(i_trial,3) = -625; trlFile(i_trial,4) = markers3(i_trial,1); end Once I pre-process the data, I run TF analyses with the wavelet method cfg = [ ]; cfg.trials = find(data2.trialinfo(:,1) == i_condition); cfg.channel = 'MEG'; cfg.method = 'wavelet'; cfg.width = 5; cfg.output = 'pow'; cfg.foi = 1:1:30; cfg.toi = -0.5:0.05:2.8; TFdata = ft_freqanalysis(cfg, data1); In the .freq field I realize that my frequency are not exact integers 0.907801418439716 2.11820330969267 3.02600472813239 3.93380614657210 5.14420803782506 6.05200945626478 6.95981087470449 7.86761229314421 9.07801418439716 9.98581560283688 ... I checked: http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies So, I decide to reduce one sample in my trial definition (so trlFile(i_trial,2) = markers3(i_trial,2) +3500-1; % 2.8*1250 % SR = 1250,) But, still I'm not having integers, 0.909090909090909 2.12121212121212 3.03030303030303 3.93939393939394 5.15151515151515 6.06060606060606 6.96969696969697 7.87878787878788 9.09090909090909 10 ... I suspect I can't obtain integer frequencies in my TFR due to my frequency sampling, Is there any recommendation regarding the frequencies used to compute the TFRs? Would that pose some issues for subsequent processing steps? thanks Jose _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Fri May 6 23:02:24 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Fri, 6 May 2016 17:02:24 -0400 Subject: [FieldTrip] Washington DC/NIH Fieldtrip Users Message-ID: Hi, I am a graduate student at georgetown trying to use FT for EEG source localization, I have a working pipeline but I am not getting meaningful/correct results. Would be really helpful to sit down with other Fieldtrip users in the washington DC area to work out some bugs. Please let me know and I can commute to your location. Thank you, Hassanm -------------- next part -------------- An HTML attachment was scrubbed... URL: From munsif.jatoi at gmail.com Sat May 7 06:28:31 2016 From: munsif.jatoi at gmail.com (Munsif Jatoi) Date: Sat, 7 May 2016 12:28:31 +0800 Subject: [FieldTrip] Washington DC/NIH Fieldtrip Users In-Reply-To: References: Message-ID: Dear Hassan Aleem, I have been working in EEG source localization for my PH.D. Try to read the latest literature first. I would like to suggest you for different softwares such as SPM which has field trip integration in it. Try BEM head modeling with MSP Loreta as inversion methods. You can contact me for any help. Best, Munsif Sent from my iPhone > On 7 May 2016, at 05:02, Hassan Aleem wrote: > > Hi, > > I am a graduate student at georgetown trying to use FT for EEG source localization, I have a working pipeline but I am not getting meaningful/correct results. Would be really helpful to sit down with other Fieldtrip users in the washington DC area to work out some bugs. Please let me know and I can commute to your location. > > Thank you, > > Hassanm > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sat May 7 08:21:21 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sat, 7 May 2016 06:21:21 +0000 Subject: [FieldTrip] importing large edf data In-Reply-To: <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com> References: <0817816F-2E1F-4CA9-8AA3-FABFE63A47DD@gmail.com> <612309863.6145259.1462458880583.JavaMail.yahoo@mail.yahoo.com> Message-ID: Leila, I don’t know much about the EDF format, but perhaps you should consider that the ‘hdr’ should probably stay consistent with the data. That is, some data formats have a header that specifies the number of data samples. If you create ‘new’ data with an extra number of samples, it could be that the header needs to be updated as well. Best, Jan-Mathijs On 05 May 2016, at 16:34, Leila Ayoubian > wrote: Hi, I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece) Here is my code. It does create the 'a' file but it does not open as EDF. Any suggestion? clc; clear all; close all; %% [fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file'); file1 = fullfile(pathName1, fileName1); cfg1 = []; %cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms cfg1.trialdef.triallength = 5; cfg1.dataset =file1; %'For leila.edf'; cfg1= ft_definetrial( cfg1 ); cfg1.continuous = 'yes'; datastr1 = ft_preprocessing(cfg1); data1=datastr1.trial{1,1}; Fs=datastr1.fsample; hdr=datastr1.hdr; %% [fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file'); file2 = fullfile(pathName2, fileName2); cfg2 = []; %cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms cfg2.trialdef.triallength = 5; cfg2.dataset =file2; %'For leila.edf'; cfg2= ft_definetrial( cfg2 ); cfg2.continuous = 'yes'; datastr2 = ft_preprocessing(cfg2); data2=datastr2.trial{1,1}; Fs2=datastr2.fsample; % EEG=cat(2,data1,data2) % EEG=EEG'; % HDR=hdr1 % out=EDFCreator(EEG); dat = cat(2,data1,data2); %% % write_edf('a', hdr, dat); ft_write_data('a', dat, 'header', hdr,'dataformat','edf' ) __________________________________________________ Leila Ayoubian, PhD. Institute of Psychiatry, Psychology and Neuroscience King's College London ________________________________ From: Arjen Stolk > To: FieldTrip discussion list > Sent: Tuesday, February 9, 2016 3:32 PM Subject: Re: [FieldTrip] importing large edf data Hi both, There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head. Arjen On Feb 9, 2016, at 3:19 AM, Stephen Politzer-Ahles > wrote: Hi Leila, I'm sorry but I'm afraid I have not quite understood your issue. Can you give some more detail about what the problem is? In general, the fieldtrip structure output by ft_preprocessing() should have a .time field (indicating what timepoint during the epoch each sample corresponds to) and an .fsample field indicating the sampling rate (which you would also be able to use to figure out the time of each sample). 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: Mon, 8 Feb 2016 11:51:05 +0000 (UTC) From: Leila Ayoubian > To: FieldTrip discussion list > Subject: Re: [FieldTrip] importing large edf data Message-ID: <1195829915.655104.1454932265573.JavaMail.yahoo at mail.yahoo.com> Content-Type: text/plain; charset="utf-8" Hi Stephen:I just happen to realize that when I load the data as you mentioned below, I can not get hold of the real time of the EEG file. (e.g.18:32:43 ).Could you please point out as how I could retrieve the real time of the EEG file after loading. Thanks a lot.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: 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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 gina.joue at univr.it Sat May 7 19:34:33 2016 From: gina.joue at univr.it (gj) Date: Sat, 7 May 2016 19:34:33 +0200 Subject: [FieldTrip] ft_source2sparse usage for EEG data Message-ID: <572E2729.8060701@univr.it> Hi, Sorry about that!! Good to know...I follow the forum threaded, so I made the false assumption that others do the same and that given the volume of emails/info overload and overworked forum-answering Samaritans these days that it was better to be concise rather than reiterate previous info...I do fully appreciate that people are kindly answering forum questions completely out of their good will -- without which I would be (more) lost and tearing more of my hair out -- so I FULLY appreciate you guys and, contrary to the end effect, I really do make an effort to try and package my questions.... To summarize, I am trying to use FieldTrip ver.20160309 to run a whole-brain network analysis on source level on a 2-sec continuous recording of EEG (preprocessed and averaged across all trials per condition per subject in another software -- I manually put the data in Fieldtrip format). Note that in trying to hack a way around the problem I've since reworked the data multiple times -- hence the numbers below are now not the same as what I previously posted, but the error is the same. Following the tutorials (for MEG: http://www.fieldtriptoolbox.org/tutorial/networkanalysis), I first run ft_source2sparse to reduce the matrix to only voxels inside the skull: >> source_sparse = ft_source2sparse(source_proj); total number of dipoles : 6804 number of dipoles inside brain: 3294 number of dipoles outside brain: 3510 When I then try to run the connectivity analysis (ft_connectivityanalysis), regardless of which connectivity method (I've tried the various options), e.g. cfg=[]; cfg.method ='coh'; cfg.complex = 'absimag'; source_conn = ft_connectivityanalysis(cfg, source_sparse); I get the error: ------------ error ----------- Requested 23058x23058 (7.9GB) 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 univariate2bivariate (line 314) data.crsspctrm = (transpose(mom)*conj(mom))./nrpt; Error in ft_connectivityanalysis (line 434) [data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm', dtype, 'cmb', cfg.refindx, 'keeprpt', 0); ------------ end error ----------- In univariate2bivariate(), it goes into "source moments are multivariate" with size(data.mom,1) = 3294 sizmom = [3, 7] Does this mean there were 3 dominant orientations of the source reconstructed data? I had done the projection with the following call: cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); At a loss -- not sure whether I set up something incorrectly? Thanks a mil in advance for any help or tips on where to troubleshoot!!! Gina From jan.schoffelen at donders.ru.nl Sun May 8 08:27:51 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 06:27:51 +0000 Subject: [FieldTrip] ft_source2sparse usage for EEG data In-Reply-To: <572E2729.8060701@univr.it> References: <572E2729.8060701@univr.it> Message-ID: Hi Gina, First of all: it is not possible to compute connectivity from data that contains just a single trial. Second, it is not clear to me what kind of source reconstruction you have done, so it is difficult to comment here. In general, although I haven’t tried this recently myself, the best chances of being successful with your approach would be in the following ‘pipeline’ (I only flash out the functions to be used + some small details regarding the settings): 0. start with your data in a fieldtrip structure containing multiple trials. 1. call ft_freqanalysis to get the spectral representation of the data. Use cfg.method = ‘mtmfft’, cfg.output = ‘fourier’ 2. call ft_sourceanalysis, using a frequency domain beamformer to get the voxel-wise spectral representation of the data. Staying entirely within fieldtrip (i.e. without using some small hacks), you probably need the following: cfg.method = ‘pcc’ (this will give you the ‘mom’ in the appropriate shape, such that ft_connectivityanalysis may swallow it), cfg.pcc.fixedori = ‘yes’ (this gives a single orientation per voxel, i.e. a mom that is 1xobservations) 3. call ft_connectivityanalysis. It could be that you have been doing all this already (since you mention the networkanalysis tutorial, where at first glance this procedure is followed), and in that case I would first address points 0 and 1 above. Good luck, Jan-Mathijs > On 07 May 2016, at 19:34, gj wrote: > > Hi, > > Sorry about that!! Good to know...I follow the forum threaded, so I made the false assumption that others do the same and that given the volume of emails/info overload and overworked forum-answering Samaritans these days that it was better to be concise rather than reiterate previous info...I do fully appreciate that people are kindly answering forum questions completely out of their good will -- without which I would be (more) lost and tearing more of my hair out -- so I FULLY appreciate you guys and, contrary to the end effect, I really do make an effort to try and package my questions.... > > > To summarize, I am trying to use FieldTrip ver.20160309 to run a whole-brain network analysis on source level on a 2-sec continuous recording of EEG (preprocessed and averaged across all trials per condition per subject in another software -- I manually put the data in Fieldtrip format). Note that in trying to hack a way around the problem I've since reworked the data multiple times -- hence the numbers below are now not the same as what I previously posted, but the error is the same. > > Following the tutorials (for MEG: http://www.fieldtriptoolbox.org/tutorial/networkanalysis), I first run ft_source2sparse to reduce the matrix to only voxels inside the skull: > > >>> source_sparse = ft_source2sparse(source_proj); > total number of dipoles : 6804 > number of dipoles inside brain: 3294 > number of dipoles outside brain: 3510 > > When I then try to run the connectivity analysis (ft_connectivityanalysis), regardless of which connectivity method (I've tried the various options), e.g. > > > cfg=[]; > cfg.method ='coh'; > cfg.complex = 'absimag'; > source_conn = ft_connectivityanalysis(cfg, source_sparse); > > > I get the error: > > ------------ error ----------- > Requested 23058x23058 (7.9GB) 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 univariate2bivariate (line 314) > data.crsspctrm = (transpose(mom)*conj(mom))./nrpt; > > Error in ft_connectivityanalysis (line 434) > [data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm', > dtype, 'cmb', cfg.refindx, 'keeprpt', 0); > ------------ end error ----------- > > > In univariate2bivariate(), it goes into "source moments are multivariate" with > > size(data.mom,1) = 3294 > sizmom = [3, 7] > > Does this mean there were 3 dominant orientations of the source reconstructed data? I had done the projection with the following call: > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > > At a loss -- not sure whether I set up something incorrectly? Thanks a mil in advance for any help or tips on where to troubleshoot!!! > Gina > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From christine.blume at sbg.ac.at Sun May 8 09:26:08 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Sun, 8 May 2016 07:26:08 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Message-ID: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sun May 8 09:46:24 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 07:46:24 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: Message-ID: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Sun May 8 14:10:49 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Sun, 8 May 2016 12:10:49 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> References: , <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generating tmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows in data_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Sun May 8 19:07:51 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 18:07:51 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> Message-ID: <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Dear all I was going through the tutorial: http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate My question involves the first realignment and reslicing followed by second realignment and reslicing. I do not understand the step below: -> T = transform_vox2ctf/transform_vox2spm= transform_vox2ctf*inv(transform_vox2spm) and this matrix is applied to sourcespace. What confuses me, is that a) we realign the anatomical voxel to spm (MNI) coordinates. b) we reslice and save it as shown in step "3. Preprocessing of the anatomical MRI: reslicing" && 4. Preprocessing of the anatomical MRI: save to disk At this stage we get the transformation matrix anatomical voxel to spm i.e transform_vox2spm Moreover, we reside in the SPM coordinates now. c) We then realign to CTF coordinates, no reslicing is done. we Should GET transform_spm2ctf. However, the obtained transform is called transform_vox2ct. Why??? We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); c) During the source creation, we are already in the MNI coordinates, because we are using Subject01.mgz. So, why in "STEP 4. Source model: Co-registration of the source space to the sensor-based head coordinate system we do we need to " T = transform_vox2ctf/transform_vox2spm; Should it not be transform_vox2ctf changed to transform_spm2ctf and T=transform_spm2ctf ??? best regards parham From jan.schoffelen at donders.ru.nl Sun May 8 21:35:38 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:35:38 +0000 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: Hi Parham, > On 08 May 2016, at 19:07, parham hashemzadeh wrote: > > Dear all > I was going through the tutorial: http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > My question involves the first realignment and reslicing followed by second realignment and reslicing. I do not understand the step below: > > -> T = transform_vox2ctf/transform_vox2spm= transform_vox2ctf*inv(transform_vox2spm) > and this matrix is applied to sourcespace. > > What confuses me, is that > a) we realign the anatomical voxel to spm (MNI) coordinates. > b) we reslice and save it as shown in step "3. Preprocessing of the anatomical MRI: reslicing" > && 4. Preprocessing of the anatomical MRI: save to disk > At this stage we get the transformation matrix anatomical voxel to spm i.e transform_vox2spm > Moreover, we reside in the SPM coordinates now. > c) We then realign to CTF coordinates, no reslicing is done. we Should > GET transform_spm2ctf. However, the obtained transform is called transform_vox2ct. Why??? Because the transformation matrix that is attached to the mri structure is always going from voxel space to a human interpretable coordinate system. > We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); > c) During the source creation, we are already in the MNI coordinates, because we are using Subject01.mgz. The fact that the file has the extension *.mgz does not mean that it is in MNI coordinates. The Subject01.mgz is created in the tutorial to have a transformation attached to it, that goes from (resliced) voxels to MNI. > So, why in "STEP 4. Source model: Co-registration of the source space to the sensor-based head coordinate system we do we need to " > T = transform_vox2ctf/transform_vox2spm; > Should it not be transform_vox2ctf changed to transform_spm2ctf > and T=transform_spm2ctf ??? No, it shouldn’t. Best, Jan-Mathijs > best regards parham > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Sun May 8 21:43:34 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:43:34 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: <484A7AF5-98E5-435B-94E1-5493DE82C575@donders.ru.nl> Hi Christine, Checking for the number of unique rows in the sampleinfo field does not ensure that the data are not overlapping. e.g. data.sampleinfo = [1 200; 100 300]; is a valid specification, and unique(data.sampleinfo, ‘rows’) gives 2, yet the samples are overlapping. I don’t think the loss of chronology is causing the problem. Best, Jan-Mathijs On 08 May 2016, at 14:10, Blume Christine > wrote: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generatingtmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows indata_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 jan.schoffelen at donders.ru.nl Sun May 8 21:43:44 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 8 May 2016 19:43:44 +0000 Subject: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected In-Reply-To: References: <6EFDE7FF-4572-4741-8D04-68344A78580A@donders.ru.nl> Message-ID: <32600EDE-3BCA-4EC9-BC25-911FF5B83B2F@donders.ru.nl> Hi Christine, Checking for the number of unique rows in the sampleinfo field does not ensure that the data are not overlapping. e.g. data.sampleinfo = [1 200; 100 300]; is a valid specification, and unique(data.sampleinfo, ‘rows’) gives 2, yet the samples are overlapping. I don’t think the loss of chronology is causing the problem. Best, Jan-Mathijs On 08 May 2016, at 14:10, Blume Christine > wrote: Dear Jan-Mathijs, Many thanks for your swift response. You were right, I am losing the sampleinfo generatingtmpdata_small. However, even when I use the original data, i.e. data_segm_offsetcorr that includes the sampleinfo, the problem continues to occur. However, I now get the warning that samples are present in multiple trials. Checking the the number of unique rows indata_segm_offsetcorr.sampleinfo however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect). My trials are not in chronological order, though, but sorted according to data_segm_offsetcorr.trialinfo. May that confuse fieldtrip? Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl] Gesendet: Sonntag, 08. Mai 2016 09:46 An: FieldTrip discussion list Betreff: Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected Hi Christine, Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’. Best, Jan-Mathijs On 08 May 2016, at 09:26, Blume Christine > wrote: Good morning, I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial. cfg = []; cfg.latency = [-2 2]; % period of interest tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr); cfg = []; cfg.layout = layout2; cfg.showlabel = 'yes'; cfg.channel = 'EEG'; cfg.gradscale = 0.04; cfg.continuous = 'no'; % filtering only for artifact rejection cfg.preproc.lpfilter = 'yes'; cfg.preproc.lpfreq = 40; cfg_databrowser = ft_databrowser(cfg, tmpdata_small); data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr); If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me: detected 10 visual artifacts rejected 8 artifacts completely Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time, which is when usually none of the marked artefacts are rejected at all. Any idea where the problem could be? Many thanks! Best, Christine _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ph442 at cam.ac.uk Sun May 8 23:26:48 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 22:26:48 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: <7e6574fd0963df6d9993020635800764@cam.ac.uk> Hi Jan Thank you. best regards parham On 2016-05-08 20:35, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > >> On 08 May 2016, at 19:07, parham hashemzadeh wrote: >> >> Dear all >> I was going through the tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> My question involves the first realignment and reslicing followed by >> second realignment and reslicing. I do not understand the step below: >> >> -> T = transform_vox2ctf/transform_vox2spm= >> transform_vox2ctf*inv(transform_vox2spm) >> and this matrix is applied to sourcespace. >> >> What confuses me, is that >> a) we realign the anatomical voxel to spm (MNI) coordinates. >> b) we reslice and save it as shown in step "3. Preprocessing of the >> anatomical MRI: reslicing" >> && 4. Preprocessing of the >> anatomical MRI: save to disk >> At this stage we get the transformation matrix anatomical voxel to spm >> i.e transform_vox2spm >> Moreover, we reside in the SPM coordinates now. >> c) We then realign to CTF coordinates, no reslicing is done. we Should >> GET transform_spm2ctf. However, the obtained transform is called >> transform_vox2ct. Why??? > > Because the transformation matrix that is attached to the mri > structure is always going from voxel space to a human interpretable > coordinate system. > >> We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); >> c) During the source creation, we are already in the MNI coordinates, >> because we are using Subject01.mgz. > > The fact that the file has the extension *.mgz does not mean that it > is in MNI coordinates. The Subject01.mgz is created in the tutorial to > have a transformation attached to it, that goes from (resliced) voxels > to MNI. > >> So, why in "STEP 4. Source model: Co-registration of the source space >> to the sensor-based head coordinate system we do we need to " >> T = transform_vox2ctf/transform_vox2spm; >> Should it not be transform_vox2ctf changed to transform_spm2ctf >> and T=transform_spm2ctf ??? > > No, it shouldn’t. > > Best, > Jan-Mathijs > > >> best regards parham >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From cecile.issard at etu.parisdescartes.fr Sun May 8 23:30:13 2016 From: cecile.issard at etu.parisdescartes.fr (Cecile Issard) Date: Sun, 8 May 2016 21:30:13 +0000 Subject: [FieldTrip] two events per trial ? Message-ID: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, Cécile — Cécile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Université Paris Descartes 45 rue des Saints-Pères 75006 Paris From ph442 at cam.ac.uk Sun May 8 23:54:52 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Sun, 08 May 2016 22:54:52 +0100 Subject: [FieldTrip] Question on tutorial http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate In-Reply-To: References: <549907DE-CABC-40FD-AF61-B3D49E84E0B8@gmail.com> <814E587E-1023-4227-803D-545F39416579@donders.ru.nl> <2226064f6ee432bcf2696dd9b77b2f6f@cam.ac.uk> Message-ID: <234e99e29effe199b4124764558bcf68@cam.ac.uk> Hi Jan Thank you for your previous response. I guess, what confuses me http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate is the text in the section "1. Source model: Volumetric processing in FreeSurfer" "To create a skullstripped anatomical image, you can do the following. We assume that you have executed all steps that are described in the section about preprocessing of the anatomical MRI, and that you have a file that contains the resliced anatomical image, expressed in the MNI-RAS coordinate system. " It explicitly states that resliced anatomical image is expressed in MNI-RAS coordinates. I guess, the source must be in the MNI coordinates. such that T=transform_vox2ctf * inv(transform_vox2spm) can be applied to source as in the tutorial % go to the Subject01/bem directory sourcespace = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); sourcespace = ft_convert_units(sourcespace, 'mm'); sourcespace = ft_transform_geometry(T, sourcespace); save sourcespace sourcespace the transformation matrix above multiplies the source points from the left. If we denote the source points by S, then T*S is that right??? Many thanks best regards parham hashemzadeh On 2016-05-08 20:35, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > >> On 08 May 2016, at 19:07, parham hashemzadeh wrote: >> >> Dear all >> I was going through the tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> My question involves the first realignment and reslicing followed by >> second realignment and reslicing. I do not understand the step below: >> >> -> T = transform_vox2ctf/transform_vox2spm= >> transform_vox2ctf*inv(transform_vox2spm) >> and this matrix is applied to sourcespace. >> >> What confuses me, is that >> a) we realign the anatomical voxel to spm (MNI) coordinates. >> b) we reslice and save it as shown in step "3. Preprocessing of the >> anatomical MRI: reslicing" >> && 4. Preprocessing of the >> anatomical MRI: save to disk >> At this stage we get the transformation matrix anatomical voxel to spm >> i.e transform_vox2spm >> Moreover, we reside in the SPM coordinates now. >> c) We then realign to CTF coordinates, no reslicing is done. we Should >> GET transform_spm2ctf. However, the obtained transform is called >> transform_vox2ct. Why??? > > Because the transformation matrix that is attached to the mri > structure is always going from voxel space to a human interpretable > coordinate system. > >> We are using the resliced image mrirs= ft_volumereslice(cfg, mri_spm); >> c) During the source creation, we are already in the MNI coordinates, >> because we are using Subject01.mgz. > > The fact that the file has the extension *.mgz does not mean that it > is in MNI coordinates. The Subject01.mgz is created in the tutorial to > have a transformation attached to it, that goes from (resliced) voxels > to MNI. > >> So, why in "STEP 4. Source model: Co-registration of the source space >> to the sensor-based head coordinate system we do we need to " >> T = transform_vox2ctf/transform_vox2spm; >> Should it not be transform_vox2ctf changed to transform_spm2ctf >> and T=transform_spm2ctf ??? > > No, it shouldn’t. > > Best, > Jan-Mathijs > > >> best regards parham >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From cogsci.tuna at gmail.com Mon May 9 17:26:01 2016 From: cogsci.tuna at gmail.com (Tuna Cakar) Date: Mon, 9 May 2016 18:26:01 +0300 Subject: [FieldTrip] About calculation of total power in TFr analysis Message-ID: Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Tue May 10 01:06:33 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Mon, 9 May 2016 19:06:33 -0400 Subject: [FieldTrip] Beam form source time discrepancy In-Reply-To: References: Message-ID: Hi, Doing source analysis on a visual training task and am seeing source power showing up at 0-20ms. Can anyine with latency based localization please advise? let me know if you need more information Best, Hassan -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.borbaruah at student.utwente.nl Tue May 10 10:00:19 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 08:00:19 +0000 Subject: [FieldTrip] Function is asking for raw data as input Message-ID: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Tue May 10 10:12:04 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Tue, 10 May 2016 08:12:04 +0000 Subject: [FieldTrip] About calculation of total power in TFr analysis In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C3F90F5D6@exprd03.hosting.ru.nl> Dear Tuna, As far as I understand, the morlet-TFR example as used in the tutorial (http://www.fieldtriptoolbox.org/tutorial/timefrequencyanalysis) computes total (evoked and induced) power, per trial and time bin, and then averages over trials. To compute total power in the 1000ms epoch, I would suggest using cfg.method=’mtmfft’. E.g., something like the following, assuming that your data is organized in trials in a variable called ‘data’. BTW, note that because of your 1000ms data epoch, the intrinsic frequency resolution of your data is 1 Hz (1/1), thus spectral power below 1 Hz will be poorly estimated. cfg=[]; cfg.toilim=[0.0 1.0]; %1000ms time window data_ep=ft_redefinetrial(cfg,data); cfg=[]; cfg.pad=10; cfg.method=’mtmfft’; cfg.outpu=’pow’; cfg.foilim= [0.1 40]; cfg.channel = ‘all’; data_ep_pow=ft_freqanalysis(cfg,data_ep); 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 Tuna Cakar Sent: maandag 9 mei 2016 17:26 To: fieldtrip at science.ru.nl Subject: [FieldTrip] About calculation of total power in TFr analysis Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 663 bytes Desc: image001.gif URL: From tineke.snijders at donders.ru.nl Tue May 10 10:34:19 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 08:34:19 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Tue May 10 10:55:39 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 08:55:39 +0000 Subject: [FieldTrip] two events per trial ? In-Reply-To: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> References: <8741B668-D3D1-407C-966A-C9D4645A8436@etu.parisdescartes.fr> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F@exprd04.hosting.ru.nl> Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, Cécile — Cécile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Université Paris Descartes 45 rue des Saints-Pères 75006 Paris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From s.borbaruah at student.utwente.nl Tue May 10 11:27:58 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 11:27:58 +0200 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) < tineke.snijders at donders.ru.nl> wrote: > Dear Soujata, > > Have you checked what data is in Dat(i,j,k)? The data input of > ft_timelockanalysis should be organised in a structure as obtained from > ft_preprocessing, with trial-based data. > > Best, > Tineke > > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] > *Sent:* Tuesday, May 10, 2016 10:00 AM > *To:* fieldtrip, donders > *Subject:* [FieldTrip] Function is asking for raw data as input > > Hello, I am working on statistical analysis of EEG data from subjects. I > am trying to perform time lock analysis on the data available but while > executing the script these are the following errors I get: > > Error using ft_checkdata (line 464) > This function requires raw+comp or raw data as input. > > Error in ft_timelockanalysis (line 106) > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', > 'yes', 'hassampleinfo', 'yes'); > > Error in Actual_Timelockanalysis_MTT_EP (line 20) > EP{i,j,k}.All = > ft_timelockanalysis(cfg,Dat(i,j,k)); > > Error in Noise_MTT_EP (line 8) > [ep] = Actual_Timelockanalysis_MTT_EP(Data) > > Please let me know if you require any more information. > > > > Sent with MailTrack > > > _______________________________________________ > fieldtrip 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 Tue May 10 14:36:04 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Tue, 10 May 2016 12:36:04 +0000 Subject: [FieldTrip] About calculation of total power in TFr analysis In-Reply-To: References: <7CCA2706D7A4DA45931A892DF3C2894C3F90F5D6@exprd03.hosting.ru.nl> Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C3F91068D@exprd03.hosting.ru.nl> Dear Tuna, In your code power is calculated relative to a baseline. So what you end up with is power change, not absolute power per se. Please check for yourself whether you want to have the data baselined or not. Secondly, assuming that you want to compute total power in the entire 1s epoch, a time-resolved FFT as you have now is not necessary. I would suggest using a regular FFT on the entire epoch (see my previous reply), without any baselining. Finally, the power now is only computed within the 1-40Hz range, which is less than ‘total’ of course. I would also advice you to go through some of the FT-tutorials on Fourier analyses, and search through the (extensive) mailing list-archive, see e.g. this thread: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-January/006114.html Best, Stan PS. Replying to the mailinglist is more useful than to specific persons individually, since the discussion might help others, too, and other people might want to add to the discussion. From: Tuna Cakar [mailto:cogsci.tuna at gmail.com] Sent: dinsdag 10 mei 2016 13:44 To: Pelt, S. van (Stan) Subject: Re: [FieldTrip] About calculation of total power in TFr analysis Dear Dr. van Pelt, I would like to thank you a lot for your response that also includes the necessary codes. The code I have performed is as below: cfg = []; cfg.baseline = [-0.4 -0.2]; cfg.baselinetype = 'relative'; %'absolute'; cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 1:1:40; cfg.toi = -0.4:0.01:0.99; cfg.keeptrials = 'yes'; TFR_MW_Px = ft_freqanalysis(cfg, data_out); Does it also calculate the total power then? I am supposed to perform wavelet analysis via Morlet and then calculate the total power. I may also look for trial-based analyses. It is also of my further interest to do the induced and evoked power calculations in the next steps. I would really appreciate your further support. Best, Tuna 2016-05-10 14:26 GMT+03:00 Tuna Cakar >: Dear Dr. van Pelt, I would like to thank you a lot for your response that also includes the necessary codes. The code I have performed is as below: cfg = [];cfg.baseline = [-0.4 -0.2]; cfg.baselinetype = 'relative'; %'absolute';cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 1:1:40; cfg.toi = -0.4:0.01:0.99;cfg.keeptrials = 'yes';TFR_MW_Px = ft_freqanalysis(cfg, data_out); Does it also calculate the total power then? I am supposed to perform wavelet analysis via Morlet and then calculate the total power. I may also look for trial-based analyses. It is also of my further interest to do the induced and evoked power calculations in the next steps. I would really appreciate your further support. Best, Tuna Dear Tuna, As far as I understand, the morlet-TFR example as used in the tutorial (http://www.fieldtriptoolbox.org/tutorial/timefrequencyanalysis) computes total (evoked and induced) power, per trial and time bin, and then averages over trials. To compute total power in the 1000ms epoch, I would suggest using cfg.method=’mtmfft’. E.g., something like the following, assuming that your data is organized in trials in a variable called ‘data’. BTW, note that because of your 1000ms data epoch, the intrinsic frequency resolution of your data is 1 Hz (1/1), thus spectral power below 1 Hz will be poorly estimated. cfg=[]; cfg.toilim=[0.0 1.0]; %1000ms time window data_ep=ft_redefinetrial(cfg,data); cfg=[]; cfg.pad=10; cfg.method=’mtmfft’; cfg.outpu=’pow’; cfg.foilim= [0.1 40]; cfg.channel = ‘all’; data_ep_pow=ft_freqanalysis(cfg,data_ep); 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 Tuna Cakar Sent: maandag 9 mei 2016 17:26 To: fieldtrip at science.ru.nl Subject: [FieldTrip] About calculation of total power in TFr analysis Dear all, Although I have been using Fieldtrip over a year for the ERP analyses mostly, I am new in this e-mail list. I want to ask a simple question that has been challenging for me. Regarding the time-frequency analysis (Morlet), I would like to calculate the total power over 1000 milliseconds and 0.1-40 Hz range. I realised that the codes in tutorial provides the calculation of evoked power. Could someone please help me with that? Thanks very much in advance. Kind regards, best, Tuna _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Tue May 10 17:15:17 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Tue, 10 May 2016 18:15:17 +0300 Subject: [FieldTrip] SVD did not converge. Message-ID: Dear fieldtrippers, I was doing the source reconstruction from MEG data based on individual headmodel (vol) and on individualized template grid (gridT). The following script cfg = []; cfg.method = 'lcmv'; %cfg.hdmfile = 'SubjectCMC.hdm'; cfg.headmodel = vol;%_nii_neuromag; %or project grad to common headmodel? cfg.grid = gridT; cfg.keepfilter = 'yes'; cfg.lcmv.fixedori='yes'; %use optimal orientation source = ft_sourceanalysis(cfg, timelock); worked fine for most subjects and even for this subject but in different condition. By some unknown reasons it shows error here. " *Error using svd SVD did not converge."* Could someone comment on this? below is a full copy from matlab output: > In ft_checkconfig at 475 In ft_sourceanalysis at 213 the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 0 MB using gradiometers specified in the data converting units from 'm' to 'cm' computing surface normals creating dipole grid based on user specified dipole positions using gradiometers specified in the configuration 3294 dipoles inside, 3510 dipoles outside brain the call to "ft_prepare_sourcemodel" took 1 seconds and required the additional allocation of an estimated 0 MB scanning repetition 1 *Error using svdSVD did not converge.Error in beamformer_lcmv>pinv (line 387) [U,S,V] = svd(A,0);Error in beamformer_lcmv (line 175)invCy = pinv(Cy + lambda * eye(size(Cy)));Error in ft_sourceanalysis (line 900) dip(i) = beamformer_lcmv(grid, sens, headmodel, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:});* Best Regards, Olga S. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Tue May 10 17:38:06 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Tue, 10 May 2016 15:38:06 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl>, Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF318@exprd04.hosting.ru.nl> Hi Soujata, This probably happens because matlab is case-sensitive. So use .label instead of .Label; .trial instead of .Trial; .time instead of .Time. Then fieldtrip will recognize the correct fields. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 11:27 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Function is asking for raw data as input Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) > wrote: Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From cecile.issard at etu.parisdescartes.fr Tue May 10 18:16:48 2016 From: cecile.issard at etu.parisdescartes.fr (Cecile Issard) Date: Tue, 10 May 2016 16:16:48 +0000 Subject: [FieldTrip] two events per trial Message-ID: Hi Tineke, My problem is that the triggers for the onset and the offset of the stimulus are the same… — Message: 6 Date: Tue, 10 May 2016 08:55:39 +0000 From: "Snijders, T.M. (Tineke)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] two events per trial ? Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F at exprd04.hosting.ru.nl> Content-Type: text/plain; charset="Windows-1252" Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, C?cile ? C?cile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Universit? Paris Descartes 45 rue des Saints-P?res 75006 Paris Cécile Issard Doctorante 01.42.86.43.20 Laboratoire Psychologie de la Perception - UMR8242 45 rue des Sts Pères 75270 Paris cedex 06 http://lpp.psycho.univ-paris5.fr/index.php Labo bébé : http://recherche.parisdescartes.fr/LBB -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.borbaruah at student.utwente.nl Tue May 10 18:20:28 2016 From: s.borbaruah at student.utwente.nl (Soujata Borbaruah) Date: Tue, 10 May 2016 18:20:28 +0200 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, Many many thanks for the suggestion. It works now, however, instead of averaging trials in the three channels that is listed in cfg.channel, the script is performing the averaging in all 64 channels. Is it possible to correct it? After the script is executed, cfg contains a cell called channels with 6x1 cell and another cell called channel with 64x1 cell. I think the script is taking the data from channel. Regards, Soujata Sent with MailTrack On Tue, May 10, 2016 at 11:27 AM, Soujata Borbaruah < s.borbaruah at student.utwente.nl> wrote: > Dear Tineke, > > I have created a function that performs timelock analysis on trials > present in Dat which is obtained from Data of a subject. > > Script Average calls the function: > > Sub = 'Subject1'; % Need to perform for all the > subjects > load(['MTT_EP_data_',Sub,'.mat']); > > [ep] = Actual_Timelockanalysis_MTT_EP(Data) > > > function [EP] = Actual_Timelockanalysis_MTT_EP(Data) > > cfg = []; > cfg.channels = {'Cz';'M1';'M2'}; > > for i = 1; % Only for NOP=1 > S = unique(Data(i).Stimuli); % To find the unique stimuli > for j = 1:length(S) > Indices = find(Data(i).Stimuli == S(j)); % comparison > Idx{1} = 1:length(Indices); % Trials per amplitude, both > perceived and not perceived > for k = 1; > Dat(i,j,k).Stimuli = S(j); % Corresponding unique > stimuli > Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % > Extract the trials from Data(1).Trials and place in the new Dat structure > Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 > length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much > of time) > Dat(i,j,k).fsample = Data(i).fsample; > Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all > the 64 channels and the selection of the channels can be done using > cfg.channels > > if ~isempty(Idx{1}) > EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); > else > EP{i,j} = []; > > end > end > end > end > > Dat is supposed to be a 1x10 (because there are 10 unique stimuli) > structure with 5 fields which are: > 1. Type of stimuli > 2. Number of trials for the respective stimuli (64x4000 double for each > trial) > 3. Time of the trials (1x4000 double which is the same for every trial) > 4. fsample (1000) > 5. Labels of the EEG (64 channels). > > The Dat structure is created, however when the data in it is called for > timelockanalysis, it fails and the warning says it is not raw data. > > Sent with MailTrack > > > On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) < > tineke.snijders at donders.ru.nl> wrote: > >> Dear Soujata, >> >> Have you checked what data is in Dat(i,j,k)? The data input of >> ft_timelockanalysis should be organised in a structure as obtained from >> ft_preprocessing, with trial-based data. >> >> Best, >> Tineke >> >> >> >> ------------------------------ >> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] >> on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] >> *Sent:* Tuesday, May 10, 2016 10:00 AM >> *To:* fieldtrip, donders >> *Subject:* [FieldTrip] Function is asking for raw data as input >> >> Hello, I am working on statistical analysis of EEG data from subjects. I >> am trying to perform time lock analysis on the data available but while >> executing the script these are the following errors I get: >> >> Error using ft_checkdata (line 464) >> This function requires raw+comp or raw data as input. >> >> Error in ft_timelockanalysis (line 106) >> data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', >> 'yes', 'hassampleinfo', 'yes'); >> >> Error in Actual_Timelockanalysis_MTT_EP (line 20) >> EP{i,j,k}.All = >> ft_timelockanalysis(cfg,Dat(i,j,k)); >> >> Error in Noise_MTT_EP (line 8) >> [ep] = Actual_Timelockanalysis_MTT_EP(Data) >> >> Please let me know if you require any more information. >> >> >> >> Sent with MailTrack >> >> >> _______________________________________________ >> fieldtrip 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 Tue May 10 20:43:41 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 10 May 2016 18:43:41 +0000 Subject: [FieldTrip] two events per trial In-Reply-To: References: Message-ID: <12382FFA-DF60-4EDD-823D-439722B81DEB@donders.ru.nl> Hi Cecile, This sounds like a quasi serious flaw in your experimental setup. In general I would advice against the definition of the same event code for different events. In case one (or more) triggers are lost upon collection, it will be not trivial to correctly reconstruct the events post-hoc (in which case you always need to rely on an extra source of data , e.g. a logfile written out by your stimulus presentation software, where you then have to assume that all went well). Anyway, after this pedagogical note, the only thing I could come up with, is to write a custom ‘trialfun’ for your purposes, which selects every second equally valued event to be the ‘begin-of-trial’ trigger. Best, Jan-Mathijs On 10 May 2016, at 18:16, Cecile Issard > wrote: Hi Tineke, My problem is that the triggers for the onset and the offset of the stimulus are the same… — Message: 6 Date: Tue, 10 May 2016 08:55:39 +0000 From: "Snijders, T.M. (Tineke)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] two events per trial ? Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF25F at exprd04.hosting.ru.nl> Content-Type: text/plain; charset="Windows-1252" Hi Cecile, One option is to run ft_definetrial two times. First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1). Then you run cfg_begin=ft_definetrial(cfg) This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later). Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0. You run: cfg_offset=ft_definetrial(cfg) This gives you cfg_offset.trl, with the first column being the offset sample points in your data. Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset trl=cfg_begin.trl; for i=1:size(cfg_offset.trl) trl(i,2)=cfg_offset.trl(i,1); end For ft_preprocessing you then give cfg.trl=trl. Best, Tineke ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr] Sent: Sunday, May 08, 2016 11:30 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] two events per trial ? Hello, How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ? Best, C?cile ? C?cile Issard PhD student Laboratoire Psychologie de la Perception CNRS UMR8242 - Universit? Paris Descartes 45 rue des Saints-P?res 75006 Paris Cécile Issard Doctorante 01.42.86.43.20 Laboratoire Psychologie de la Perception - UMR8242 45 rue des Sts Pères 75270 Paris cedex 06 http://lpp.psycho.univ-paris5.fr/index.php Labo bébé : http://recherche.parisdescartes.fr/LBB _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lindseyrtate at ou.edu Wed May 11 07:11:24 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Wed, 11 May 2016 05:11:24 +0000 Subject: [FieldTrip] Beamformer Tutorial, ft_prepare_headmodel Error Message-ID: Hello FieldTrip community, I'm working through the Beamformer tutorial on this page (http://www.fieldtriptoolbox.org/tutorial/beamformer) using MEG data from a saccade task. This code for constructing the head model, copied from the page, is giving me an error: % forward model mri segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat'); cfg = []; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, segmentedmri); This is the complete text of the error: Error using ft_convert_units (line 150) cannot determine geometrical units Error in ft_checkdata (line 543) data = ft_convert_units(data); Error in ft_prepare_headmodel (line 203) data = ft_checkdata(data, 'hasunit', 'yes'); Error in LindseysBF (line 48) headmodel = ft_prepare_headmodel(cfg, segmentedmri); When I check the struct segmentedmri, it has a field called unit with a value of 'mm.' Because this code is using a file downloaded from the tutorial (i.e., segmentedmri, which can be downloaded from the link above) and is copy/pasted from the tutorial page, I can't figure out what's wrong or what to investigate. Can someone tell me if I'm making an error in the code, if there's something I could change about the code to make it work, or if this is a bug? Any help would be greatly appreciated. Thank you, Lindsey Tate Graduate Research Assistant Brian and Biomarker Lab University of Oklahoma -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed May 11 09:17:00 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 11 May 2016 09:17:00 +0200 Subject: [FieldTrip] Beamformer Tutorial, ft_prepare_headmodel Error In-Reply-To: References: Message-ID: <335A47C0-BC52-49D4-8C65-8582274B5338@donders.ru.nl> Dear Lindsey, The error lies in the way the data is loaded. > segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat’); produces this: segmentedmri = segmentedmri: [1x1 struct] The solution is quite easy, just replace the line by this: > load('C:\Users\EEG1\Documents\Data\segmentedmri.mat’); and it should look like this: segmentedmri = dim: [256 256 256] transform: [4x4 double] coordsys: 'ctf' unit: 'mm' gray: [256x256x256 double] white: [256x256x256 double] csf: [256x256x256 double] cfg: [1x1 struct] Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 11 May 2016, at 07:11, Tate, Lindsey R. wrote: > > Hello FieldTrip community, > > > I'm working through the Beamformer tutorial on this page (http://www.fieldtriptoolbox.org/tutorial/beamformer ) using MEG data from a saccade task. > > > > This code for constructing the head model, copied from the page, is giving me an error: > % forward model mri > segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat'); > cfg = []; > cfg.method = 'singleshell'; > headmodel = ft_prepare_headmodel(cfg, segmentedmri); > > > This is the complete text of the error: > Error using ft_convert_units (line 150) > cannot determine geometrical units > > Error in ft_checkdata (line 543) > data = ft_convert_units(data); > > Error in ft_prepare_headmodel (line 203) > data = ft_checkdata(data, 'hasunit', 'yes'); > > Error in LindseysBF (line 48) > headmodel = ft_prepare_headmodel(cfg, segmentedmri); > > > When I check the struct segmentedmri, it has a field called unit with a value of 'mm.' Because this code is using a file downloaded from the tutorial (i.e., segmentedmri, which can be downloaded from the link above) and is copy/pasted from the tutorial page, I can't figure out what's wrong or what to investigate. Can someone tell me if I'm making an error in the code, if there's something I could change about the code to make it work, or if this is a bug? Any help would be greatly appreciated. > > > Thank you, > > Lindsey Tate > Graduate Research Assistant > Brian and Biomarker Lab > University of Oklahoma > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Wed May 11 09:23:47 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Wed, 11 May 2016 07:23:47 +0000 Subject: [FieldTrip] Function is asking for raw data as input In-Reply-To: References: <69eaa32c20284e89860fbde2b0c0521f@EXPRD02.hosting.ru.nl> <815A9820E75FBC4F96B7CD3A8089D11C378BF237@exprd04.hosting.ru.nl> , Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378BF381@exprd04.hosting.ru.nl> Hi Soujata, So then you have to correct your script, so that you specify cfg.channel= {'Cz';'M1';'M2'}; instead of cfg.channels. I guess you could have worked that one out yourself... If you type 'help ft_timelockanalysis' you see it takes cfg.channel and not cfg.channels. Cheers, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 6:20 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Function is asking for raw data as input Dear Tineke, Many many thanks for the suggestion. It works now, however, instead of averaging trials in the three channels that is listed in cfg.channel, the script is performing the averaging in all 64 channels. Is it possible to correct it? After the script is executed, cfg contains a cell called channels with 6x1 cell and another cell called channel with 64x1 cell. I think the script is taking the data from channel. Regards, Soujata Sent with MailTrack On Tue, May 10, 2016 at 11:27 AM, Soujata Borbaruah > wrote: Dear Tineke, I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject. Script Average calls the function: Sub = 'Subject1'; % Need to perform for all the subjects load(['MTT_EP_data_',Sub,'.mat']); [ep] = Actual_Timelockanalysis_MTT_EP(Data) function [EP] = Actual_Timelockanalysis_MTT_EP(Data) cfg = []; cfg.channels = {'Cz';'M1';'M2'}; for i = 1; % Only for NOP=1 S = unique(Data(i).Stimuli); % To find the unique stimuli for j = 1:length(S) Indices = find(Data(i).Stimuli == S(j)); % comparison Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived for k = 1; Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time) Dat(i,j,k).fsample = Data(i).fsample; Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels if ~isempty(Idx{1}) EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j)); else EP{i,j} = []; end end end end Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are: 1. Type of stimuli 2. Number of trials for the respective stimuli (64x4000 double for each trial) 3. Time of the trials (1x4000 double which is the same for every trial) 4. fsample (1000) 5. Labels of the EEG (64 channels). The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data. Sent with MailTrack On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) > wrote: Dear Soujata, Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data. Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl] Sent: Tuesday, May 10, 2016 10:00 AM To: fieldtrip, donders Subject: [FieldTrip] Function is asking for raw data as input Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get: Error using ft_checkdata (line 464) This function requires raw+comp or raw data as input. Error in ft_timelockanalysis (line 106) data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in Actual_Timelockanalysis_MTT_EP (line 20) EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k)); Error in Noise_MTT_EP (line 8) [ep] = Actual_Timelockanalysis_MTT_EP(Data) Please let me know if you require any more information. Sent with MailTrack _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Wed May 11 20:04:38 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Wed, 11 May 2016 20:04:38 +0200 Subject: [FieldTrip] What is the purpose of ft_sourcedescriptives()? In-Reply-To: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> References: <38094B2B-AA32-42DB-919E-B8F167664EAD@donders.ru.nl> Message-ID: Dear Jan-Mathijs, thank you for your answer and please accept my apologies for the delay. I read that documentation but like I said, “computes descriptive parameters of the source analysis results” doesn't provide a meaningful explanation. What are those descriptive parameters? When should one use it? As for not using the function as an option, I'm trying to understand how to use FieldTrip and whether that function is important or not is beyond the scope of my current knowledge, hence why I'm trying to find the answer here. If I were to take your suggested approach every time, I don't think I'd ever succeed. ;-) Thank you and have a nice day! Harold On 4 May 2016 at 10:51, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Dear Harold, > > What extra documentation are you looking for? I think that a good start > would be to read the description in the documentation part of the m-file > itself (i.e. the stuff you get when typing ‘help ft_sourcedescriptives’). > Note: if you don’t think you need the function, it’s alright not to use it > :o). > > > Best, > Jan-Mathijs > > > On 02 May 2016, at 15:14, Harold Cavendish wrote: > > Hello, could you please explain the purpose of ft_sourcedescriptives() in > EEG source analysis? > > The documentation is very brief (“computes descriptive parameters of the > source analysis results”) and I haven't found a single tutorial with proper > explanation. I found it used here > but > without any explanation whatsoever. > > Thank you! > > Harold > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 elam4hcp at gmail.com Wed May 11 23:19:43 2016 From: elam4hcp at gmail.com (Jennifer Elam) Date: Wed, 11 May 2016 16:19:43 -0500 Subject: [FieldTrip] Announcing the the HCP Course 2016 in Boston Aug 28-Sept 1 Message-ID: The Human Connectome Project (HCP) is pleased to announce the 2016 HCP Course: “Exploring the Human Connectome” , to be held August 28-September 1 (Sunday-Thursday) at the Joseph B. Martin Conference Center at Harvard Medical School, in Boston, Massachusetts, USA. This 5-day intensive course will provide training in the acquisition, analysis and visualization of whole-brain imaging and behavioral data from the Human Connectome Project (HCP) using methods and informatics tools developed by the WU-Minn HCP consortium plus data made freely available to the neuroscience community. The course is designed for investigators who are interested in: *using data being collected and distributed by HCP *acquiring and analyzing HCP-style imaging and behavioral data at your own institution *processing your own non-HCP imaging data using HCP pipelines and methods *learning to use Connectome Workbench tools and the CIFTI connectivity data format *learning HCP multi-modal neuroimaging analysis methods, including those that combine MEG and MRI data *positioning yourself to capitalize on HCP-style data from forthcoming large-scale projects (e.g., Lifespan HCP and Connectomes Related to Human Disease) Participants will learn how to acquire, analyze, visualize, and interpret data from four major MR modalities (structural MR, resting-state fMRI, diffusion imaging, task-evoked fMRI) plus magnetoencephalography (MEG) and extensive behavioral data. Lectures and labs will provide grounding in neurobiological as well as methodological issues involved in interpreting multimodal data, and will span the range from single-voxel/vertex to brain network analysis approaches. The course is open to graduate students, postdocs, faculty, and industry participants. The course is aimed at both new and existing users of HCP data, methods, and tools, and will cover both basic and advanced topics. Prior experience in human neuroimaging or in computational analysis of brain networks is desirable, preferably including familiarity with FSL and Freesurfer software. For more info and to register visit the HCP Course website . We hope to see you in Bah-ston! Best, 2016 HCP Course Organizers -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 11:17:35 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 12:17:35 +0300 Subject: [FieldTrip] Allow overlap - ft_fetch_data Message-ID: Hello, How can I allow overlap between trials when using ft_fetch_data ? Many thanks, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 11:02:28 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 12:02:28 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' Message-ID: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that *sometimes *when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu May 12 11:46:12 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 12 May 2016 09:46:12 +0000 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' In-Reply-To: References: Message-ID: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> If your purpose is just to detrend, I would use ft_preprocessing: cfg = []; cfg.detrend = ‘yes’; data = ft_preprocessing(cfg, data); ft_resampledata is for resampling (what’s in a name), and allows for optional detrending prior to the downsampling (because a large trend may lead to edge artifacts upon the downsampling). best, Jan-Mathijs PS: I would also recommend to review your path settings, since you get some warnings about octave functions On 12 May 2016, at 11:02, shiri makov > wrote: Dear community, My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system. I tried using ft_resampledata to detrend the data. The weird thing is that sometimes when I call ft_resampledata, I get an error message: the input is raw data with 8 channels and 60 trials resampling data Octave functions should not run on Matlab Removing path ... Error using .* Matrix dimensions must agree. Error in resample (line 71) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; Error in ft_resampledata (line 208) data.trial{itr} = transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data). The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines. The cfg I use is very basic: >> display(cfg); cfg = detrend: 'yes' It happened to me on many data structs, so I share a link with just one of them (http://www.filedropper.com/dataexample). Here too, I got the error and right after that I ran the function line again and worked well. I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? Best, Shiri _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkshiri at gmail.com Thu May 12 12:13:03 2016 From: mkshiri at gmail.com (shiri makov) Date: Thu, 12 May 2016 13:13:03 +0300 Subject: [FieldTrip] ft_resampledata error 'Matrix dimensions must agree' In-Reply-To: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> References: <4F28C85E-CD49-4C21-ABA7-59BDBE5A4603@donders.ru.nl> Message-ID: Thank you for your quick reply :) Actually I also need ft_resampledata for resampling... I get the same problem when trying to sownsample. I refreshed the path settings, do you think it should fix it? Best, S. 2016-05-12 12:46 GMT+03:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > If your purpose is just to detrend, I would use ft_preprocessing: > > cfg = []; > cfg.detrend = ‘yes’; > data = ft_preprocessing(cfg, data); > > ft_resampledata is for resampling (what’s in a name), and allows for > optional detrending prior to the downsampling (because a large trend may > lead to edge artifacts upon the downsampling). > > best, > Jan-Mathijs > > PS: I would also recommend to review your path settings, since you get > some warnings about octave functions > > > > On 12 May 2016, at 11:02, shiri makov wrote: > > > > Dear community, > > My name is Shiri and I am a student at Tel-Aviv Univesrity. I study > perception during sleep using EEG. Currently I am analysing EEG data > collected with EGI system. > > I tried using ft_resampledata to detrend the data. The weird thing is that * > sometimes *when I call ft_resampledata, I get an error message: > > the input is raw data with 8 channels and 60 trials > resampling data > Octave functions should not run on Matlab > Removing path ... > Error using .* > Matrix dimensions must agree. > Error in resample (line 71) > h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ; > Error in ft_resampledata (line 208) > data.trial{itr} = > transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); > > > As noted, this error appears only sometimes. If I run ft_resampledata > again immidiately after receiving the error, it works well (same cfg, same > data). > The error always happens when I call the function within a parfor loop. It > almost never happens when I run the function line individually, without > preceeding script lines. > > > The cfg I use is very basic: > > >> display(cfg); > > cfg = > > detrend: 'yes' > > It happened to me on many data structs, so I share a link with just one of > them (http://www.filedropper.com/dataexample). Here too, I got the error > and right after that I ran the function line again and worked well. > > I don't think it's ok to live in peace with this function erroring from > time to time, can someone tell me what this error means? Did I not use the > function correctly? > > Best, > > Shiri > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 randomguy3167 at yahoo.com Thu May 12 20:54:00 2016 From: randomguy3167 at yahoo.com (Anon ymous) Date: Thu, 12 May 2016 18:54:00 +0000 (UTC) Subject: [FieldTrip] Help with Spike/LFP Tutorial Issue References: <660323151.1356054.1463079240955.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <660323151.1356054.1463079240955.JavaMail.yahoo@mail.yahoo.com> Hello Fieldtrip Community, I do realize this is probably really basic, but I was following the tutorial on analyzing spike and LFP data: http://www.fieldtriptoolbox.org/tutorial/spikefield. I've followed the tutorial almost exactly (with inconsequential changes) using the sample data provided in the tutorial.  It all works except for the STA plot for pre-stimulus. I get the correct plot as shown in the tutorial for my post-stimulus plot but then for some reason get the same thing for my pre-stimulus plot, which doesn't make sense. I have no idea what is causing this. The only differences I see between the two are the cfg.latency settings and all else is the same.      pre: cfg.latency = [-2.75 0];     post: cfg.latency = [0.3 10]; I've attached my script (as it is small) for reference. The plots and sample data are in the tutorial. Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Preprocessing.m Type: application/octet-stream Size: 2575 bytes Desc: not available URL: From christine.blume at sbg.ac.at Fri May 13 08:22:51 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Fri, 13 May 2016 06:22:51 +0000 Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation In-Reply-To: References: Message-ID: Dear community, I would like to do the following steps, however fieldtrip does not seem to like this in my case: 1. Artefact rejection on continuous data using ft_databrowser as I do not like ft_rejectvisual’s visualization (needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser). Calling ft_rejectartifact following that procedure to exclude major artefacts before ICA. 2. ICA on cleaned continuous data, mainly to remove EOG artefacts 3. Another round of manual/visual artefact rejection on cleaned/eog-rejected continuous data using ft_databrowser visualization (again, needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser) 4. Segmentation of cleaned data I am experiencing problems with the artefact rejection (1) and the following segmentation (4), though. It works fine if I segment my data using ft_redefinetrial and then call ft_rejectartifact with the cfg returned from the (first) call to ft_databrowser. However, if I reject artefacts first and then try to apply ft_redefinetrial to the cleaned data, “bad” trials are not excluded. Any ideas how to solve this are highly appreciated. Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Fri May 13 11:05:57 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Fri, 13 May 2016 14:35:57 +0530 Subject: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout Message-ID: Dear Fieldtrip team, I need 64 channels and 32 channels layout and labelings/nomenclature of those respective channels in compatible with fieldtrip.I have biosemi32.lay and biosemi64.lay.Please acknowledge me. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Fri May 13 12:20:10 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Fri, 13 May 2016 10:20:10 +0000 Subject: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout In-Reply-To: References: Message-ID: Hi Laxmi, Am I assuming correctly that you would like to prepare a layout file? The following should work: cfg = []; cfg.layout = ‘yourpath_to_the_biosemi32.lay’; biosemi32_layout = ft_prepare_layout(cfg); Following this, you can specify the layout every time you need one as: cfg = []; cfg.layout = biosemi32_layout; Best, Christine Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Laxmi Shaw Gesendet: Freitag, 13. Mai 2016 11:06 An: fieldtrip at science.ru.nl Betreff: [FieldTrip] Query aboutb channel labels w.r.t biosemi32-64 layout Dear Fieldtrip team, I need 64 channels and 32 channels layout and labelings/nomenclature of those respective channels in compatible with fieldtrip.I have biosemi32.lay and biosemi64.lay.Please acknowledge me. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Fri May 13 20:21:59 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Fri, 13 May 2016 19:21:59 +0100 Subject: [FieldTrip] Neuromag coordinate transformation In-Reply-To: References: Message-ID: Dear All I have read in some data (MNE-sample data set). I have this command in the script hdr = ft_read_header(raw_data_filename); %your fif-filename hdr.grad gives the below structure ans = balance: [1x1 struct] chanori: [306x3 double] chanpos: [306x3 double] chantype: {306x1 cell} chanunit: {306x1 cell} coilori: [510x3 double] coilpos: [510x3 double] coordsys: 'neuromag' label: {306x1 cell} tra: [306x510 double] type: 'neuromag306' unit: 'cm' It says that I am in "neuromag coordinate" system. The corresponding number for this coordinate system is device=1.0. I have a transformation matrix T14.trans (coord system=1 to coord system=4) that takes me to head coordinate system i.e T14 = from: 1 to: 4 trans: [4x4 double] When I apply the transformation, to the coil position, the sensor array looks tilted to one side. But, without the transformation, it looks more reasonable (visually). Maybe he was tilting !!! My question is: Is it anyway possible that the transformation T14 has already been applied by the function hdr = ft_read_header(raw_data_filename); I have attached a picture of what I am describing. many thanks best regards parham hashemzadeh -------------- next part -------------- A non-text attachment was scrubbed... Name: coilpos.jpg Type: image/jpeg Size: 72267 bytes Desc: not available URL: From rabbani.6 at buckeyemail.osu.edu Fri May 13 22:19:11 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Fri, 13 May 2016 20:19:11 +0000 Subject: [FieldTrip] File Format Issue Message-ID: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Sat May 14 19:17:26 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Sat, 14 May 2016 22:47:26 +0530 Subject: [FieldTrip] Queries_related to structures Message-ID: Dear Fieldtrip list, I am having an issue with the data GA_FC. There is a structure inside the data named GA_FC.cfg and GA_FC.grad. So these two fields are showing dimension of 184*356. I have attached the structure with this mail.Could you please help me in what those structure signifies and how those can be define for any datasets. [image: Inline image 1] -- Thanks in advance Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 31543 bytes Desc: not available URL: From laxmi.shaw22 at gmail.com Mon May 16 18:27:31 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Mon, 16 May 2016 21:57:31 +0530 Subject: [FieldTrip] Queries using GRAD Message-ID: Dear Fieldtrip maillist, I am facing problem regarding the online available data of GA_FC, TFRhann and avg_FC. These files contain the structure field named grad. I am unable to understand the construction of this grad. I am getting the following errors while using our data set with that grad files. The errors are mentioned below: Error using fixdimord (line 85) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 80) timelock = fixdimord(timelock); Error in ft_checkdata (line 221) data = ft_datatype_timelock(data); Error in topoplot_common (line 74) data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}); Error in ft_topoplotER (line 195) cfg = topoplot_common(cfg, varargin{:}); Error in trial_3 (line 14) ft_topoplotER(cfg,STR_eEPDC); colorbar; Your help is always appreciated. Thanks and regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon May 16 19:42:44 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 16 May 2016 17:42:44 +0000 Subject: [FieldTrip] Queries using GRAD In-Reply-To: References: Message-ID: <52F8D9D2-B6F8-4D35-9B55-1CADA82A4E15@donders.ru.nl> Hi Laxmi, Why do you think that your current problem is caused by the ‘grad’ field in GA_FC? The error message you get suggests otherwise (it actually suggests that the data you use as an input to ft_topoplotER is not recognized as a properly formatted fieldtrip data structure), and indicates that the variable STR_eEPDC is internally inconsistent. The most likely cause of this is that the fields that describe the physical interpretation of the numeric data fields is not in line with the size of the data. Here’s a link that describes the type of data that (I think) you try to use as an input to the plotting routine: http://www.fieldtriptoolbox.org/reference/ft_datatype_timelock , but perhaps you also would like to look into http://www.fieldtriptoolbox.org/reference/ft_datatype_freq Here’s a link that describes the grad-structure (although I don’t think that you need this): http://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs > On 16 May 2016, at 18:27, Laxmi Shaw wrote: > > Dear Fieldtrip maillist, > I am facing problem regarding the online available data of GA_FC, TFRhann and avg_FC. > These files contain the structure field named grad. > I am unable to understand the construction of this grad. > I am getting the following errors while using our data set with that grad files. > The errors are mentioned below: > > > Error using fixdimord (line 85) > the data does not contain a dimord, but it also does not resemble raw or component data > > Error in ft_datatype_timelock (line 80) > timelock = fixdimord(timelock); > > Error in ft_checkdata (line 221) > data = ft_datatype_timelock(data); > > Error in topoplot_common (line 74) > data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}); > > Error in ft_topoplotER (line 195) > cfg = topoplot_common(cfg, varargin{:}); > > Error in trial_3 (line 14) > ft_topoplotER(cfg,STR_eEPDC); colorbar; > > Your help is always appreciated. > Thanks and regards > > -- > Laxmi Shaw > Research Scholar(PhD) > IIT Kharagpur > West Bengal > Ph no-08388837821 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From alex.sel at psy.ox.ac.uk Mon May 16 20:55:01 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Mon, 16 May 2016 18:55:01 +0000 Subject: [FieldTrip] depsamplesF Message-ID: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Dear list, I would like to run a non-parametric cluster-based permutation analysis. My experiment has a 2X2 within-subject design, i.e. I would like to compare more than two experimental conditions. I am using the cfg.statistics = 'depsamplesFmultivariate'. I wonder if this would be the correct option considering that I only have ONE dependent variable (i.e. ANOVA) and not multiple dependent variables (i.e. MANOVA). If this is not the correct statistic, would you be able to tell me what is the correct statistic that should be apply to tests differences between more than 2 experimental conditions in a within subject design? Any insight on this would be much appreciated. Best wishes, Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From bknakker at gmail.com Mon May 16 22:22:37 2016 From: bknakker at gmail.com (=?UTF-8?Q?Bal=C3=A1zs_Knakker?=) Date: Mon, 16 May 2016 22:22:37 +0200 Subject: [FieldTrip] depsamplesF In-Reply-To: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> References: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Message-ID: Dear Alex, As far as I know, depsamplesFmultivariate corresponds to what used to be the default option to perform a dependent samples F-test (it was called depsamplesF), which tolerates nonsphericity when there are more than 2 levels by dealing with the question from a multivariate standpoint. But in your case, you can also test main effects and interactions in your 2×2 design, and in that case I think these will yield identical results, and you could as well be using T-tests (comparing averages over the other factor for the main effects, and comparing the differences along one factor at both levels of the other factor for the interaction, see also this http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests ). If you would decide to disregard the factor structure of your data and would do something like a one-way ANOVA with 4 levels, I would stick with the MANOVA approach. I would be curious to know whether the univarate version is recommended, apart from the case when one wants results comparable to a conventional ANOVA F-test. Greetings, Balázs Knakker On Mon, May 16, 2016 at 8:55 PM, Alex Sel wrote: > Dear list, > > > > I would like to run a non-parametric cluster-based permutation analysis. > My experiment has a 2X2 within-subject design, i.e. I would like to compare > more than two experimental conditions. I am using the cfg.statistics = > ‘depsamplesFmultivariate’. I wonder if this would be the correct option > considering that I only have ONE dependent variable (i.e. ANOVA) and not > multiple dependent variables (i.e. MANOVA). If this is not the correct > statistic, would you be able to tell me what is the correct statistic that > should be apply to tests differences between more than 2 experimental > conditions in a within subject design? > > > > Any insight on this would be much appreciated. > > > > Best wishes, > > Alex Sel, PhD > > Postdoctoral Researcher > > Department of Experimental Psychology, > > University of Oxford, > > 9 South Parks Road, > > OX1 3UD > > Tel: 01865 271 340 > > Email: Alex.sel at psy.ox.ac.uk > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Mon May 16 22:26:57 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Mon, 16 May 2016 20:26:57 +0000 Subject: [FieldTrip] depsamplesF In-Reply-To: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> References: <3123912FD054FE44A023073D2EFD213C8B9823@MBX02.ad.oak.ox.ac.uk> Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378E0380@exprd04.hosting.ru.nl> Dear Alex, In your case the easiest is to just use depsamplesT. For testing the main effects you can then use the average of the 2 conditions, and for testing the interaction you can use the two difference scores. Good luck, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alex Sel [alex.sel at psy.ox.ac.uk] Sent: Monday, May 16, 2016 8:55 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] depsamplesF Dear list, I would like to run a non-parametric cluster-based permutation analysis. My experiment has a 2X2 within-subject design, i.e. I would like to compare more than two experimental conditions. I am using the cfg.statistics = ‘depsamplesFmultivariate’. I wonder if this would be the correct option considering that I only have ONE dependent variable (i.e. ANOVA) and not multiple dependent variables (i.e. MANOVA). If this is not the correct statistic, would you be able to tell me what is the correct statistic that should be apply to tests differences between more than 2 experimental conditions in a within subject design? Any insight on this would be much appreciated. Best wishes, Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabbani.6 at buckeyemail.osu.edu Mon May 16 22:38:10 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Mon, 16 May 2016 20:38:10 +0000 Subject: [FieldTrip] File Format Issue In-Reply-To: References: Message-ID: <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> Dear Fieldtrip Community, I don't seem to have gotten a response back for my issue. Forgive me if this is too soon. Please direct me to the right resource if you know of one. It's just a simple issue of formatting, but all the data is there. I would like to add that the specific error I get is with the initial step reading in the spike data with ft_read_spike. The error simply says "unsupported file format." I'm still new to all this and would really appreciate the help so I can move forward with the actual analysis. Thank you all for your time, Qinwan Rabbani On May 13, 2016, at 4:19 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabbani.6 at buckeyemail.osu.edu Mon May 16 22:40:11 2016 From: rabbani.6 at buckeyemail.osu.edu (Rabbani, Qinwan) Date: Mon, 16 May 2016 20:40:11 +0000 Subject: [FieldTrip] File Format Issue In-Reply-To: <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> References: , <7BCB178D-FA9E-489A-9F4D-AF58FA1B4E09@buckeyemail.osu.edu> Message-ID: My apologies for the double email. It says unsupported data format not file format. On May 16, 2016, at 4:38 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip Community, I don't seem to have gotten a response back for my issue. Forgive me if this is too soon. Please direct me to the right resource if you know of one. It's just a simple issue of formatting, but all the data is there. I would like to add that the specific error I get is with the initial step reading in the spike data with ft_read_spike. The error simply says "unsupported file format." I'm still new to all this and would really appreciate the help so I can move forward with the actual analysis. Thank you all for your time, Qinwan Rabbani On May 13, 2016, at 4:19 PM, Rabbani, Qinwan > wrote: Dear Fieldtrip community, I work in a medical lab doing DBS research. I am doing data analysis for my lab for use in a paper. I've never used Fieldtrip before so I've been following this tutorial: http://www.fieldtriptoolbox.org/tutorial/spikefield. I was able to successfully walk through it using the sample data. However, when trying to use my own data, I ran into a little bit of a problem. I tried to read in my data from the various different file formats available to me, but none of them seem to be supported. The original spike/LFP data was acquired via an Alpha Omega system, which outputs the data into .mpax format. However, the data was then cleaned up to extract out only the relevant time windows using Spike2 (v8.06) software. The resulting data from Spike2 can be output into .smrx, .mat, .emf, .emw, or .txt format, none of which seem to be supported. How would I convert my spike/LFP data from one of those formats so that it will be compatible with Fieldtrip? Ideally, I'd want to directly convert the already cleaned up data into a supported format such as .nex rather than having to use the not cleaned up data in the original ,mpax file. I tried searching online but couldn't find anything that worked. I can't move forward with the data analysis until I figure this out. I'd really appreciate it if someone could help me out. Thank you in advance, Qinwan Rabbani -------------- next part -------------- An HTML attachment was scrubbed... URL: From SXM1085 at student.bham.ac.uk Tue May 17 18:37:16 2016 From: SXM1085 at student.bham.ac.uk (Sebastian Michelmann) Date: Tue, 17 May 2016 16:37:16 +0000 Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation In-Reply-To: References: Message-ID: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EEF309E@EX13.adf.bham.ac.uk> Hi Christine, I'm sure that there is a "clean" fieldtrip way to solve your problem which should be the preferred solution. However here is an idea for debugging and a potential workaround that might help. So ft_databrowser marks the artefacts you selected by storing the sampleinfo of the beginning and the end of you selection (these are two sampling points, counted from the beginning of your recording). They are stored in two column vectors (look it up in cfg.artfctdef.visual). I think something might have gone wrong when you cut your data because fieldtrip eventually removes and/or reconstructs sampleinfo if it is inconsistent or missing (don't ask me how and when this does and does not happen). So my guess for debugging would be: check at every step, what happens to your data.sampleinfo. It's also worth to read through the command line output because you should get a warning if something funny is going on. If you know your sampleinfo to be correct, here a workaround you might want to try: % 1st Manually read out the trials that contain artifacts (right after you marked them: cfg_art= ft_databrowser(cfg, data)); a_trials =[]; % trials with artifacts artifacts=cfg_art.artfctdef.visual; % info about the artifacts for n=1:size(artifacts.artifact,1) a_trials = [a_trials;find(data.sampleinfo(:,1) <= artifacts.artifact(n,1) ... & data.sampleinfo(:,2) >= artifacts.artifact(n,1))]; %concatenate the trials that contain artifacts end % find out which trials are artefact free trials=1:numel(data.trial); % all the trials trialsel=find(~ismember(trials,a_trials)); % the selected trials are trials that are not member of the artifact trials % Call ft_preprocessing (or ft_selectdata...) to select only the artefact free trials. cfg=[]; cfg.trials=trialsel; data_clean = ft_selectdata(cfg, data); I hope that helps. Best, Sebastian From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Blume Christine Sent: 13 May 2016 07:23 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Artefact rejection & ICA on continuous data followed by segmentation Dear community, I would like to do the following steps, however fieldtrip does not seem to like this in my case: 1. Artefact rejection on continuous data using ft_databrowser as I do not like ft_rejectvisual's visualization (needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser). Calling ft_rejectartifact following that procedure to exclude major artefacts before ICA. 2. ICA on cleaned continuous data, mainly to remove EOG artefacts 3. Another round of manual/visual artefact rejection on cleaned/eog-rejected continuous data using ft_databrowser visualization (again, needs to be done on continuous data as I will have overlapping segments once I segment, which is not supported by ft_databrowser) 4. Segmentation of cleaned data I am experiencing problems with the artefact rejection (1) and the following segmentation (4), though. It works fine if I segment my data using ft_redefinetrial and then call ft_rejectartifact with the cfg returned from the (first) call to ft_databrowser. However, if I reject artefacts first and then try to apply ft_redefinetrial to the cleaned data, "bad" trials are not excluded. Any ideas how to solve this are highly appreciated. Best, Christine -------------- next part -------------- An HTML attachment was scrubbed... URL: From darinkat87 at gmail.com Wed May 18 12:12:58 2016 From: darinkat87 at gmail.com (=?UTF-8?Q?Darinka_Tr=C3=BCbutschek?=) Date: Wed, 18 May 2016 12:12:58 +0200 Subject: [FieldTrip] Baseline correction during ICA & then again before timelock? Message-ID: Dear all, I am using fieldtrip to preprocess (epoching, trial rejection, ICA to remove eye blinks, etc., filtering) my MEG data and have a question regarding baseline correction.I have noticed that, in the default settings for ft_componentanalysis, cfg.demean is set to 'yes', so I assume that the mean of the entire trial is subrated. What does this setting imply for future analyses of this data (at the sensor-level), for example timelock analyses of different conditions. Should one still implement another baseline-correction? Why/why not? In advance, many thanks for your help. I very much appreciate all of the knowledge of this community! Best, Darinka -- Darinka Trübutschek (PhD Candidate) Inserm-CEA Cognitive Neuroimaging Unit CEA/SAC/DSV/DRM/Neurospin Bât 145, Point Courier 156 F-91191 Gif-sur-Yvette website: https://sites.google.com/site/dtruebutschek/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From behzadiravani at gmail.com Wed May 18 13:05:15 2016 From: behzadiravani at gmail.com (Behzad Iravani) Date: Wed, 18 May 2016 13:05:15 +0200 Subject: [FieldTrip] Micro State Analysis Message-ID: Dear fieldtrip experts, I'm wondering if there is an implemented function to do the micro state analysis. If it's not then I managed to find some dominant states (let's say 8, so basically now I have data matrix 8*number of channels) and I want to determine the sources associate with these brain states but I'm not sure what the best way is to do it. Best Behzad Iravani Research Assistant, Karolinska Institutet -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmq1990 at gmail.com Wed May 18 18:33:41 2016 From: xmq1990 at gmail.com (Mengqi Xing) Date: Wed, 18 May 2016 16:33:41 +0000 Subject: [FieldTrip] EEG connectivity without averaging over the trials. Message-ID: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Dear all, I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a few questions about trial averaging in ft_connectivityanalysis. I realized regardless which method I'm using, the ft_connectivityanalysis tends to averaging over trials (dimension rpt), which sacrifices the dynamic of the data. Is it possible not let the function averaging over trials while still getting a meaningful result? ( I tried to duplicate trial and let it average itself and it reported some errors.) Or is there a connectivity method that allows non-trial-averaging to run? Thank you very much! Maggie Xing -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed May 18 18:59:05 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 18 May 2016 18:59:05 +0200 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: Dear Maggie, As connectivity in principle relies on the correlation between trials (very very very simplified), it's not possible to compute single trial connectivity. However, what has been done is taking the single-trial deviance from the average phase as a measure of connectivity. See Keil et al 2014, Cerebral Cortex or Hanslmayr et al 2007, NeuroImage for a description. Good Luck, Julian Am Mittwoch, 18. Mai 2016 schrieb Mengqi Xing : > Dear all, > > I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a > few questions about trial averaging in ft_connectivityanalysis. I realized > regardless which method I'm using, the ft_connectivityanalysis tends to > averaging over trials (dimension rpt), which sacrifices the dynamic of the > data. Is it possible not let the function averaging over trials while still > getting a meaningful result? ( I tried to duplicate trial and let it > average itself and it reported some errors.) Or is there a connectivity > method that allows non-trial-averaging to run? Thank you very much! > > Maggie Xing > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gcosta18 at gmail.com Wed May 18 19:50:56 2016 From: gcosta18 at gmail.com (Gabriel Costa) Date: Wed, 18 May 2016 17:50:56 +0000 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: <6afd5d9ac3664154ba3027791bc11548@EXPRD02.hosting.ru.nl> Dear Maggie, If I'm not mistaken, connectivity estimates can be obtained at single trial if one estimates phase correlation over time (see Cohen, 2014 Analyzing Neural Time Series). If you are not interested in the time dimension you could just obtain a single value of coherence for each trial, estimating phase coherence over time, which you can then average over trials. If you still want to maintain time dimension and get a time(x)-frequency(y) plot of coherence, than you should use a sliding window. I believe this method (coherence over time) is not integrated in either Fieldtrip or EEGLAB, but it's not that difficult to implement this from the matrix with the complex fourier spectra (ft_freqanalysis with cfg.output = 'fourier'). Good luck, Gabriel Costa . On Wed, May 18, 2016 at 5:33 PM, Mengqi Xing > wrote: Dear all, I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a few questions about trial averaging in ft_connectivityanalysis. I realized regardless which method I'm using, the ft_connectivityanalysis tends to averaging over trials (dimension rpt), which sacrifices the dynamic of the data. Is it possible not let the function averaging over trials while still getting a meaningful result? ( I tried to duplicate trial and let it average itself and it reported some errors.) Or is there a connectivity method that allows non-trial-averaging to run? Thank you very much! Maggie Xing _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From gcosta18 at gmail.com Wed May 18 19:50:56 2016 From: gcosta18 at gmail.com (Gabriel Costa) Date: Wed, 18 May 2016 18:50:56 +0100 Subject: [FieldTrip] EEG connectivity without averaging over the trials. In-Reply-To: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> References: <31756135ffc8457598b947b093672cc0@EXPRD02.hosting.ru.nl> Message-ID: Dear Maggie, If I'm not mistaken, connectivity estimates can be obtained at single trial if one estimates phase correlation over time (see Cohen, 2014 Analyzing Neural Time Series). If you are not interested in the time dimension you could just obtain a single value of coherence for each trial, estimating phase coherence over time, which you can then average over trials. If you still want to maintain time dimension and get a time(x)-frequency(y) plot of coherence, than you should use a sliding window. I believe this method (coherence over time) is not integrated in either Fieldtrip or EEGLAB, but it's not that difficult to implement this from the matrix with the complex fourier spectra (ft_freqanalysis with cfg.output = 'fourier'). Good luck, Gabriel Costa . On Wed, May 18, 2016 at 5:33 PM, Mengqi Xing wrote: > Dear all, > > I'm using fieldtrip to do dynamic EEG connectivity analyses and I have a > few questions about trial averaging in ft_connectivityanalysis. I realized > regardless which method I'm using, the ft_connectivityanalysis tends to > averaging over trials (dimension rpt), which sacrifices the dynamic of the > data. Is it possible not let the function averaging over trials while still > getting a meaningful result? ( I tried to duplicate trial and let it > average itself and it reported some errors.) Or is there a connectivity > method that allows non-trial-averaging to run? Thank you very much! > > Maggie Xing > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Thu May 19 18:28:01 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Thu, 19 May 2016 21:58:01 +0530 Subject: [FieldTrip] Queries_3 Message-ID: Dear Fieldtrip list, I am having doubt in the cfg structure, how the cfg.xlim and cfg.zlim has been set for GA_FC data. How can we define for our datasets. What is the .lay files signifies. I mean biosemi64.lay and EEG1020.lay defines what. Your help and advice is always appreciated. Regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gina.joue at univr.it Thu May 19 18:36:38 2016 From: gina.joue at univr.it (gj) Date: Thu, 19 May 2016 18:36:38 +0200 Subject: [FieldTrip] head model mat contains only NaN values Message-ID: <573DEB96.4050100@univr.it> Hi FieldTrippers, While trying to calculate a head model (FT ver.20160309), the head model contains only NaNs, and I get the following errors: ------------- beg error ------------ Warning: NaN detected, trying once more with slightly different vertex positions > In ft_prepare_headmodel (line 280) Warning: No conductivity is declared, assuming standard values > In ft_headmodel_bemcp (line 79) In ft_prepare_headmodel (line 281) Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In ft_headmodel_bemcp (line 185) In ft_prepare_headmodel (line 281) ------------- end error ------------ This was what I ran: ----------- smri = ft_read_mri(smrifn); % subject's own structural MRI cfg = []; mri.coordsys = 'MNI'; cfg.brainthreshold = 0.5; cfg.output = {'brain','skull','scalp'}; smri_seg = ft_volumesegment(cfg, smri); cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.method = 'projectmesh'; cfg.numvertices = [2400 1600 800]; mesh_hd=ft_prepare_mesh(cfg,smri_seg); cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg, mesh_hd); ----------- Not sure if this might be related, but we have head+neck MRIs and when I plot the meshes, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I've tried different ft_prepare_mesh methods, different number of vertices.... Thanks in advance for any advice! Gina -------------- next part -------------- A non-text attachment was scrubbed... Name: FTmesh-lat.png Type: image/png Size: 48876 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FTmesh-sup.png Type: image/png Size: 43865 bytes Desc: not available URL: From S.Homolle at donders.ru.nl Thu May 19 19:42:50 2016 From: S.Homolle at donders.ru.nl (=?iso-8859-1?Q?Hom=F6lle=2C_S=2E_=28Simon=29?=) Date: Thu, 19 May 2016 17:42:50 +0000 Subject: [FieldTrip] head model mat contains only NaN values In-Reply-To: <573DEB96.4050100@univr.it> References: <573DEB96.4050100@univr.it> Message-ID: <2247A6E8AF3DB04AAB11BDDD86B72F8315878CC5@exprd02.hosting.ru.nl> Dear Gina, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I guess this is the reason why you get the NaN values. BEM needs nested and sufficiently distant surfaces. As I don't know the quality and sequence (T1, T2?) of your MRI I suggest you to look at the segmentation to be sure that this is well done. With a good segmentation preparing the mesh is not a problem. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of gj [gina.joue at univr.it] Sent: Thursday, May 19, 2016 6:36 PM To: FieldTrip discussion list Subject: [FieldTrip] head model mat contains only NaN values Hi FieldTrippers, While trying to calculate a head model (FT ver.20160309), the head model contains only NaNs, and I get the following errors: ------------- beg error ------------ Warning: NaN detected, trying once more with slightly different vertex positions > In ft_prepare_headmodel (line 280) Warning: No conductivity is declared, assuming standard values > In ft_headmodel_bemcp (line 79) In ft_prepare_headmodel (line 281) Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In ft_headmodel_bemcp (line 185) In ft_prepare_headmodel (line 281) ------------- end error ------------ This was what I ran: ----------- smri = ft_read_mri(smrifn); % subject's own structural MRI cfg = []; mri.coordsys = 'MNI'; cfg.brainthreshold = 0.5; cfg.output = {'brain','skull','scalp'}; smri_seg = ft_volumesegment(cfg, smri); cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.method = 'projectmesh'; cfg.numvertices = [2400 1600 800]; mesh_hd=ft_prepare_mesh(cfg,smri_seg); cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg, mesh_hd); ----------- Not sure if this might be related, but we have head+neck MRIs and when I plot the meshes, I see that the "scalp" has vertices that connect planes internal to the brain (see images attached). I've tried different ft_prepare_mesh methods, different number of vertices.... Thanks in advance for any advice! Gina From gina.joue at univr.it Fri May 20 11:26:35 2016 From: gina.joue at univr.it (gj) Date: Fri, 20 May 2016 11:26:35 +0200 Subject: [FieldTrip] head model mat contains only NaN values In-Reply-To: <573ED025.40808@univr.it> References: <573DEB96.4050100@univr.it> <573ED025.40808@univr.it> Message-ID: <573ED84B.5030609@univr.it> Thanks for your reply, Simon. I had plotted the segmentation and it seems to look fine (see attached), which makes me think that it's the meshing, but I tried a slew of methods and number of vertices but I can't get rid of the scalp planes internal to the brain. Any advice on what to try greatly appreciated! Gina > Dear Gina, > > I see that the "scalp" has vertices that connect planes > internal to the brain (see images attached). > > I guess this is the reason why you get the NaN values. BEM needs > nested and sufficiently distant surfaces. > As I don't know the quality and sequence (T1, T2?) of your MRI I > suggest you to look at the segmentation to be sure that this is well done. With a good segmentation preparing the mesh is not a problem. > Bests, > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 20/05/2016 10:51, gj wrote: > > > On 19/05/2016 18:36, gj wrote: >> Hi FieldTrippers, >> >> While trying to calculate a head model (FT ver.20160309), the head model >> contains only NaNs, and I get the following errors: >> >> ------------- beg error ------------ >> Warning: NaN detected, trying once more with slightly different vertex >> positions >> > In ft_prepare_headmodel (line 280) >> Warning: No conductivity is declared, assuming standard values >> > In ft_headmodel_bemcp (line 79) >> In ft_prepare_headmodel (line 281) >> >> Warning: Matrix is singular, close to singular or badly scaled. Results >> may be inaccurate. RCOND = NaN. >> > In ft_headmodel_bemcp (line 185) >> In ft_prepare_headmodel (line 281) >> ------------- end error ------------ >> >> >> >> This was what I ran: >> >> ----------- >> smri = ft_read_mri(smrifn); % subject's own structural MRI >> >> cfg = []; >> mri.coordsys = 'MNI'; >> cfg.brainthreshold = 0.5; >> cfg.output = {'brain','skull','scalp'}; >> smri_seg = ft_volumesegment(cfg, smri); >> >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.method = 'projectmesh'; >> cfg.numvertices = [2400 1600 800]; >> mesh_hd=ft_prepare_mesh(cfg,smri_seg); >> >> cfg = []; >> cfg.method = 'bemcp'; >> headmodel = ft_prepare_headmodel(cfg, mesh_hd); >> ----------- >> >> Not sure if this might be related, but we have head+neck MRIs and when I >> plot the meshes, I see that the "scalp" has vertices that connect planes >> internal to the brain (see images attached). I've tried different >> ft_prepare_mesh methods, different number of vertices.... >> >> Thanks in advance for any advice! >> Gina -------------- next part -------------- A non-text attachment was scrubbed... Name: FTseg.png Type: image/png Size: 20730 bytes Desc: not available URL: From figueiredo.aeon at gmail.com Fri May 20 16:32:33 2016 From: figueiredo.aeon at gmail.com (Thiago Figueiredo) Date: Fri, 20 May 2016 16:32:33 +0200 Subject: [FieldTrip] Partial Directed Coherence threshold with few trials Message-ID: Hello Fieldtrip Community, I was analyzing corticocortical (EEG-EEG) and corticomuscular (EEG-sEMG) partial directed coherence with the ft_connectivityanalysis() function and later calculating a frequency dependent threshold for the coherence values in a session using my own implementation of the statistics described in Schelter, Björn, et al. "*Testing for directed influences among neural signals using partial directed coherence*." *Journal of neuroscience methods* (2006). I then considered in my analysis only the significant values higher than this threshold. The problem is that now we are applying a more strict preprocessing method that rejects many more trials, leaving us with a ​small number of trials ​(sometimes 20 or sometimes even less than 10 trials per session, instead of the 50 or 60 that we had before). This leads us to the problem of the validity of the coherence estimates with few trials and to the problem of the thresholding method, which is based on a theoretical asymptotic limit and gives incorrect results for such a small number of trials. So my question is twofold: 1- What is the minimum number of trials that we are allowed to use, in order to obtain a reasonable estimate for the PDC with ft_connectivityanalysis() 2- Do you know of any method for calculating the significance of the coherence values to a given significance level, considering that we have a small number of trials? (permutation tests? something else?) Thank you -- Thiago da Cruz Figueiredo Neuroprosthetics Laboratory, Institute for Medical Psychology and Behavioural Neurobiology - University of Tübingen, Germany Núcleo de Inovação Tecnológica em Reabilitação (NITRE) - Universidade Federal da Bahia, Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.sel at psy.ox.ac.uk Fri May 20 17:30:17 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Fri, 20 May 2016 15:30:17 +0000 Subject: [FieldTrip] 2x2 within subject design with covariate Message-ID: <3123912FD054FE44A023073D2EFD213C8C4209@MBX02.ad.oak.ox.ac.uk> Dear List, I am trying to perform a cluster-based permutation test. I have an experimental design with 2 within variables (2x2 design) and a covariate. I wonder how I can define the statistics in the script to include both the within-subject variables and the covariate. I am using the cfg.statistics = 'depsamplesFmultivariate' but I am unsure how to define the covariate in the model. Any insight on this would be much appreciated. Best wishes Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Sun May 22 17:28:39 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Sun, 22 May 2016 20:58:39 +0530 Subject: [FieldTrip] Queries:4 Message-ID: Dear Fieldtrip user, I am getting an that , i am using the layout of biosemi 64 and out of 64 ...8 selected electrodes.But the code is working fine,while investing i found that the out of 8, 4 electrodes are outsides the topoplot. I have doubt regarding the EEG 10-20 system, all the standards electrodes positions have to be same then how come X,Y ,z and theta values are differed in other layouts. How can i fix this problem of such 10-20 channels location.In biosemi 64 and EEG10-20.lay what are the 4 columns signifies and how can i define for my own 64 channels. Your help and suggestions are always appreciable. Thanks and regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.sel at psy.ox.ac.uk Tue May 24 10:57:46 2016 From: alex.sel at psy.ox.ac.uk (Alex Sel) Date: Tue, 24 May 2016 08:57:46 +0000 Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA Message-ID: <3123912FD054FE44A023073D2EFD213C8CA53F@MBX02.ad.oak.ox.ac.uk> Dear List, Apologies for the reposting... I am trying to perform a cluster-based permutation test. I have an experimental design with 2 within variables (2x2 design) and a covariate. I wonder how I can define the statistics in the script to include both the within-subject variables and the covariate. I am using the cfg.statistics = 'depsamplesFmultivariate' but I am unsure how to define the covariate in the model. Any insight on this would be much appreciated. Best wishes Alex Sel, PhD Postdoctoral Researcher Department of Experimental Psychology, University of Oxford, 9 South Parks Road, OX1 3UD Tel: 01865 271 340 Email: Alex.sel at psy.ox.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Tue May 24 11:56:55 2016 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 24 May 2016 02:56:55 -0700 Subject: [FieldTrip] Can I rename the CTF HLC0011 etc... to {'nasX'; 'nasY'; 'nasZ'; 'lpaX'; 'lpaY'; 'lpaZ'; 'rpaX'; 'rpaY'; 'rpaZ'}? Message-ID: Dear FieldTrippers, I'm using ft_megrealign after timelocking my data for each participant and recording, and before appending these different recording sessions (and subsequently taking grand averages over subjects). Since the experiment consisted of different sessions a few weeks apart, I'd like to minimise noise due to differences in head position (we used online head localisation, but this did not work very well for all participants when coming back a few weeks later. After making the headmodel (and ensuring it's aligned with the gradiometers), this works quite well: % realign to template sensor positions cfg = []; cfg.template = {'ctf275.mat'}; cfg.headmodel = headmodel; % For a realistic single-shell volume conduction model based on the brain surface, you % should probably use an inward shift of about 1 cm. cfg.inwardshift = 1; cfg.feedback = 'no'; data2 = ft_megrealign(cfg, data); However, when looking into the ft_megrealign function I found that there is the option of doing this per trial based on the CTF coil positions (rather than once based on the gradiometer definition at the beginning of the run). This seems sensible for participants who moved quite a bit during a recording. However, CTF does not originally output the {'nasX';'nasY';'nasZ';'lpaX';'lpaY';'lpaZ';'rpaX';'rpaY';'rpaZ'} that the function looks for. In ft_headmovement (and also buried somewhere in the CTF documentation), I could find % HLC0011 HLC0012 HLC0013 x, y, z coordinates of nasion-coil in m. % HLC0021 HLC0022 HLC0023 x, y, z coordinates of lpa-coil in m. % HLC0031 HLC0032 HLC0033 x, y, z coordinates of rpa-coil in m. So it seems reasonable to simply rename these to the channel names that ft_megrealign is looking for. When doing this, realignment indeed happens at the single trial level. However, I wanted to check if there is a reason for using the nasX nasY... channel names rather than the original HLC0011.. ones? Can I rename them while keeping the rest of the HLC channels (of which there are 24) the same? I can't think of a reason why this would cause any issues, but since I could not find the 'per-trial' option documented I thought I'd check what the rationale behind using per-trial or per-run is. Thanks! Cheers, — Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie Universitätsklinikum Hamburg-Eppendorf | Martinistrasse 52, 20246 | Hamburg, Germany www.anneurai.net / @AnneEUrai -------------- next part -------------- An HTML attachment was scrubbed... URL: From koreykam at gmail.com Tue May 24 17:15:51 2016 From: koreykam at gmail.com (Korey Kam) Date: Tue, 24 May 2016 15:15:51 +0000 Subject: [FieldTrip] coefficient of variation on raw data Message-ID: Hi all, I'm interested in computing the coefficient of variation on raw data for single trials (as opposed to averaging them). In order to maintain cfg bookkeeping, I've been trying ft_math for this purpose. However, I've been unable to call ft_math in a single trial manner to effectively compute this: coeff(i) = std(trial(i))/mean(trial(i)); Does anyone have a recommendation on doing this in FT? Alternatively, I've used nested loops over trials and channels, but would much rather maintain cfg history. Thanks, Korey -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.caballero at bcbl.eu Wed May 25 12:35:48 2016 From: c.caballero at bcbl.eu (Cesar Caballero) Date: Wed, 25 May 2016 12:35:48 +0200 (CEST) Subject: [FieldTrip] postdoctoral position on MEG correlates of statistical learning and language processing: BCBL, San Sebastian, Spain In-Reply-To: References: <6DDD80C5-EECF-467C-BABF-385AE1B6CB78@gmail.com> Message-ID: <2011274752.1506286.1464172548396.JavaMail.zimbra@bcbl.eu> Dear all, The Basque Center on Cognition Brain and Language – BCBL- (San Sebastián, Basque Country, Spain) is offering a postdoctoral position focused on the MEG correlates of statistical learning and language processing , as part of ERC-funded research project (PI: Ram Frost). The successful candidate will have a rigorous background in MEG data acquisition and analysis, have a high level of independence, and a strong publication record. The candidate should also be able to contribute to the broader research goals of the project which include computational, behavioural, and fMRI investigations of the neural basis of statistical learning and language learning conducted in collaboration with research groups at the Hebrew University and the University of Toronto. Individuals interested in undertaking research in the fields described in www.bcbl.eu (research) should apply through the BCBL web page http://www.bcbl.eu/jobs ( MEG Postdoc 2016) Deadline: July 15 th , 2016. For more information about the specifics of the position, please contact Ram Frost ( ram.frost at mail.huji.ac.il ) and for broader information about the BCBL please contact Manuel Carreiras ( info at bcbl.eu ). ---------------------------------------------------------------------- Cesar Caballero www.bcbl.eu Twitter: @caballerogaudes www.researchgate.net/profile/Cesar_Caballero2 Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From laxmi.shaw22 at gmail.com Wed May 25 13:16:17 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Wed, 25 May 2016 16:46:17 +0530 Subject: [FieldTrip] Queries Message-ID: Dear fieldtrippers, I am trying to make a topoplot of my data, which has 8 channels. As there was no layout for 8 channels, I made my own layout for 8 channels with the same channel coordinates which were for 64 channel (biosemi64). And while plotting 4 of the electrodes are lying outside the head layout. Can you kindly suggest me a way how I can bring the layout points inside the head layout. Find the attached image file of the snap of the topoplot. Thanks in advance -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur West Bengal Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eEPDC_13.jpg Type: image/jpeg Size: 25679 bytes Desc: not available URL: From gina.joue at univr.it Wed May 25 13:39:00 2016 From: gina.joue at univr.it (gj) Date: Wed, 25 May 2016 13:39:00 +0200 Subject: [FieldTrip] "Out of memory" during ft_sourceplot Message-ID: <57458ED4.3060101@univr.it> Hi FieldTrippers, I am trying to do source analysis (eventually source-level connectivity analysis) and while plotting the source analysis results with ft_sourceplot, I get the following error: -------------------- error --------------------------------- Error using ' Out of memory. Type HELP MEMORY for your options. Error in pos2transform (line 33) transform = pos(:,sel)/ind(:,sel); Error in ft_sourceplot (line 291) functional.transform = pos2transform(functional.pos, functional.dim); -------------------------------------------------------------- Could someone guide me in what I should doublecheck along the way for possible errors and how? Below are the commands I executed leading to the plot command. Thanks in advance! Gina --------------------------------------- cfg = []; cfg.frequency = fft.freq; cfg.elec = elecR; % realigned electrodes cfg.method = 'dics'; % only dics seems to give noise proj? cfg.grid = lf; % lf.pos is a 6804x3 double arr lf.dim=18,21,18] cfg.headmodel = headmodel; % bemcp in mm, mat is 330x4330 double arr cfg.keeptrials = 'yes'; cfg.pcc.fixedori = 'yes'; cfg.dics.projectnoise = 'yes'; % to norm power in ctr of brain cfg.dics.lambda = 0; source_avg = ft_sourceanalysis(cfg, fft); % fft = output from ft_freqanalysis with meth 'mtmfft' and output 'fourier' % calc to reduce center of head bias sourceNAI = source_avg; sourceNAI.avg.pow = source_avg.avg.pow ./ source_avg.avg.noise; % reduce the source reconstructed data to the dominant orientation cfg = []; cfg.projectmom = 'yes'; % project to the direction that explains most of the source variance; The three rows of the moment are the strength of the source in the x-, y- and z-direction -- how do you limit to one direction?? source_proj = ft_sourcedescriptives(cfg,sourceNAI); % src_proj.inside = 6804x1 logical matrix (like template grid) % after source recon still in indiv space -- put into std space source_proj.dim = std_grid.sourcemodel.dim; source_proj.pos = std_grid.sourcemodel.pos; % interpolate onto the MNI template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'all'; cfg.interpmethod = 'linear'; source_interp = ft_sourceinterpolate(cfg, source_proj, smri); % source_interp.inside/nai/noise/pow is a 41943040x1 double arr!! % MESSAGES: % the input is volume data with dimensions [512 512 160] % the input is source data with 6804 brainordinates on a [18 21 18] grid cfg = []; cfg.method = 'slice'; cfg.funparameter = 'pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; ft_sourceplot(cfg,source_interp); % MESSAGES: % the input is source data with 41943040 brainordinates on a % [512 512 160] grid From gina.joue at univr.it Wed May 25 13:58:58 2016 From: gina.joue at univr.it (gj) Date: Wed, 25 May 2016 13:58:58 +0200 Subject: [FieldTrip] head model mat contains only NaN values Message-ID: <57459382.90209@univr.it> Hi, Just to keep questions-answers in the same thread, the problem I had with only NaNs in the head model appears indeed to be because of the internal intersecting mesh plans in the "scalp" (at least the problem disappeared once I got the scalp mesh not to intersect). After much digging, I found these previous posts http://mailman.science.ru.nl/pipermail/fieldtrip/2014-January/007433.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006365.html from Gregor who noticed that the finer the mesh, the more likely self intersections occur. He also suggested using om_check_vol() on the prepare mesh output to check for intersections, but I couldn't get it to work (om_check_vol expects a "skin" structure?) so relied on visual inspection with ft_plot_mesh. After much persistence with playing with different cfg.numvertices values for ft_prepare_mesh (for those wondering I ended up specifying 330 vertices for the "scalp" of an MRI with head+neck), I was able to get a mesh with no self-intersections and was able to calculate a head model with more meaningful values. g From conrado.bosman at gmail.com Wed May 25 14:28:09 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 14:28:09 +0200 Subject: [FieldTrip] Error in ft_hastoolbox Message-ID: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); of a Neuralynx -------------- next part -------------- An HTML attachment was scrubbed... URL: From conrado.bosman at gmail.com Wed May 25 14:33:57 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 12:33:57 +0000 Subject: [FieldTrip] Error in ft_hastoolbox References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at gmail.com Wed May 25 15:23:35 2016 From: michelic72 at gmail.com (Cristiano Micheli) Date: Wed, 25 May 2016 15:23:35 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: Dear Conrado, I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). Which version of MatLab are you running? try to apply this change: if exist(varname) -> if exist(varname,'var') That should do it I hope this helped! Cris On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman wrote: > Dear fieldtrippers, > > I’m trying to read the header of a Neuralynx dataset, using the last > FieldTrip version available at Github, running on a Linux machine. I > encounter the following error (see below). > > Originally, I thought that the problem could be related to a FieldTrip > dependency on a .mex file, that should be downloaded from the Neuralynx > website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS > X’), so I downloaded, compiled and placed the toolbox on a recognizable > MATLAB path. > Then, when I run ft_hastoolbox, I noticed that the value of the variable > dependency is “3”, which is the expected outcome from the MATLAB function > “exist" (which is used in the helper function has_mex from ft_hastoolbox > (l539)), when you have a recognizable mex file. However, the value 3 > provides you the cryptic error message in “is_present” at line 576 > > Do you have any clue if I’m doing something wrong? > > Thanks in advance! > Conrado > > K>> Error using ft_hastoolbox>is_present (line 576) > this should not happen > > Error in ft_hastoolbox (line 378) > status = is_present(dependency); > > Error in read_neuralynx_ncs (line 57) > isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for > debug > > Error in read_neuralynx_ds (line 84) > orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); > > Error in ft_read_header (line 1576) > hdr = read_neuralynx_ds(filename); > of a Neuralynx > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed May 25 15:26:25 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 13:26:25 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans Message-ID: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Hi FieldTrippers, I hope someone can help me with the following. My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. Best wishes, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at donders.ru.nl Wed May 25 15:34:59 2016 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 25 May 2016 13:34:59 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From j.herring at donders.ru.nl Wed May 25 15:34:59 2016 From: j.herring at donders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 25 May 2016 13:34:59 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 25 15:40:06 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 25 May 2016 13:40:06 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: <0DAE8198-1597-4A3C-B22C-6CBED9ED6D6A@donders.ru.nl> Hi Stephen, > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > Perhaps you have to :o). This is the only (relatively straightforward) way I can think of at least. If you ensure your trialinfo field to have trial counter prior to doing the partial rejection, you will have the necessary bookkeeping info to glue things together again. > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. I am afraid that this is impossible. Reason: algorithmically ft_specest_mtmconvol is exploiting the fact that convolution in the time domain is equivalent to multiplication in the frequency domain (which is what makes the function fast). The bottom line is that an FFT is done on the whole epoch (followed by a multiplication with the FFT of tapered sine/cosine waves), which, if the data epoch contains NaNs, returns NaNs all over the place. Best, JM > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed May 25 15:48:18 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 25 May 2016 13:48:18 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Stephen, This is how you could ‘glue’ together the fragments of your trials: freq.powspctrm(~isfinite(freq.powspctrm)) = 0; % converting the nans to 0 allows for summation nrpt = numel(unique(freq.trialinfo(:,1))); % assume that the first column of trialinfo is the counter of the original trials siz = size(freq.powspctrm); newpowspctrm = zeros([nrpt siz(2:end)]); for k = 1:nrpt for m = find(freq.trialinfo(:,1)==k)’ newpowspctrm(k,:,:,:) = newpowspctrm(k,:,:,:)+freq.powspctrm(m,:,:,:); end end newpowspctrm(newpowspctrm==0) = nan; % now you can create your new freq structure with the additional metadata (possibly corrected for the new number of ‘rpt’s. Best, JM > On 25 May 2016, at 15:26, Stephen Whitmarsh wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From conrado.bosman at gmail.com Wed May 25 15:50:20 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Wed, 25 May 2016 15:50:20 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> Message-ID: <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> Hey Cristiano, Thanks for the advice! The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code best Conrado > On 25 May 2016, at 15:23, Cristiano Micheli wrote: > > Dear Conrado, > I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). > Which version of MatLab are you running? > > try to apply this change: > if exist(varname) -> if exist(varname,'var') > > That should do it > I hope this helped! > > > Cris > > On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: > Dear fieldtrippers, > > I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). > > Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. > Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 > > Do you have any clue if I’m doing something wrong? > > Thanks in advance! > Conrado > > K>> Error using ft_hastoolbox>is_present (line 576) > this should not happen > > Error in ft_hastoolbox (line 378) > status = is_present(dependency); > > Error in read_neuralynx_ncs (line 57) > isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug > > Error in read_neuralynx_ds (line 84) > orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); > > Error in ft_read_header (line 1576) > hdr = read_neuralynx_ds(filename); > of a Neuralynx > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 15:58:35 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 13:58:35 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: <7ca8318372b946b98295e516ce8554bf@EXPRD02.hosting.ru.nl> Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 16:08:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 14:08:34 +0000 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: As a follow-up: I guess the best solution in the case would then be to make my TFR, and replace those values with nans based on the sample number from the time-series artifact detection. Cheers, Stephen On 25 May 2016 at 15:58, Stephen Whitmarsh > wrote: Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: Hi Stephen, As far as I know this is expected as mtmconvol is actually multiplying the fft of the entire trial with the fft of your tapered windows. Perhaps it will work of you use one of the methods that actually uses convolution in the time domain rather than multiplication in the frequency domain. Best, Jim > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > Hi FieldTrippers, > > I hope someone can help me with the following. > > My problem is that I like to maintain my original rpt/chan/time/freq size after artefact rejection based on the time series data, i.e. to have the same dimensions of the TFR as if I did not reject data. This is for reasons of bookkeeping between different types of channels that are processed differently throughout my analysis. > > What works well is to detect artifacts in the data and replace those intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So far this is perfect for the approach I had in mind. > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as nans whenever a (small) period has nans. What I would need - and in fact expect - is that only those time/frequency windows that have (one or more) nan values will output nan, while the rest should merrily go round giving power values. After all, the data is there. > > It is unclear to me whether this is expected behaviour or not. I might be making a mistake but some simple tests replicated this behaviour. > > Is there a solution that still allows me to end up with a rpt/chan/time/freq representation of the same size as when i would not have rejected artifacts? > > The only other FieldTrip-like option I can think of is to use ft_rejectartifact with method = 'partial', do the freqanalysis on trial parts, and somehow glue the separate trial parts together again afterwards. But I really don't want to go in that direction. > > In the end I'm afraid I don't understand the core of ft_specest_mtmconvol enough to see where I could hack it. I hope some of you might be able to help. > > Best wishes, > Stephen > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 stephen.whitmarsh at gmail.com Wed May 25 16:08:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 16:08:34 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: As a follow-up: I guess the best solution in the case would then be to make my TFR, and replace those values with nans based on the sample number from the time-series artifact detection. Cheers, Stephen On 25 May 2016 at 15:58, Stephen Whitmarsh wrote: > Hi Jim! > > Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and > method = 'tfr' give the same problem. I'm afraid I'll end up writing my own > code, cutting up data and using an FFT :-/ > > Thank again, > > Stephen > > On 25 May 2016 at 15:34, Herring, J.D. (Jim) > wrote: > >> Hi Stephen, >> >> As far as I know this is expected as mtmconvol is actually multiplying >> the fft of the entire trial with the fft of your tapered windows. Perhaps >> it will work of you use one of the methods that actually uses convolution >> in the time domain rather than multiplication in the frequency domain. >> >> Best, >> >> Jim >> >> >> >> > On 25 May 2016, at 15:29, Stephen Whitmarsh < >> stephen.whitmarsh at gmail.com> wrote: >> > >> > Hi FieldTrippers, >> > >> > I hope someone can help me with the following. >> > >> > My problem is that I like to maintain my original rpt/chan/time/freq >> size after artefact rejection based on the time series data, i.e. to have >> the same dimensions of the TFR as if I did not reject data. This is for >> reasons of bookkeeping between different types of channels that are >> processed differently throughout my analysis. >> > >> > What works well is to detect artifacts in the data and replace those >> intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So >> far this is perfect for the approach I had in mind. >> > >> > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as >> nans whenever a (small) period has nans. What I would need - and in fact >> expect - is that only those time/frequency windows that have (one or more) >> nan values will output nan, while the rest should merrily go round giving >> power values. After all, the data is there. >> > >> > It is unclear to me whether this is expected behaviour or not. I might >> be making a mistake but some simple tests replicated this behaviour. >> > >> > Is there a solution that still allows me to end up with a >> rpt/chan/time/freq representation of the same size as when i would not have >> rejected artifacts? >> > >> > The only other FieldTrip-like option I can think of is to use >> ft_rejectartifact with method = 'partial', do the freqanalysis on trial >> parts, and somehow glue the separate trial parts together again afterwards. >> But I really don't want to go in that direction. >> > >> > In the end I'm afraid I don't understand the core of >> ft_specest_mtmconvol enough to see where I could hack it. I hope some of >> you might be able to help. >> > >> > Best wishes, >> > Stephen >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > 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 stephen.whitmarsh at gmail.com Wed May 25 15:58:35 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 25 May 2016 15:58:35 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Hi Jim! Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and method = 'tfr' give the same problem. I'm afraid I'll end up writing my own code, cutting up data and using an FFT :-/ Thank again, Stephen On 25 May 2016 at 15:34, Herring, J.D. (Jim) wrote: > Hi Stephen, > > As far as I know this is expected as mtmconvol is actually multiplying the > fft of the entire trial with the fft of your tapered windows. Perhaps it > will work of you use one of the methods that actually uses convolution in > the time domain rather than multiplication in the frequency domain. > > Best, > > Jim > > > > > On 25 May 2016, at 15:29, Stephen Whitmarsh > wrote: > > > > Hi FieldTrippers, > > > > I hope someone can help me with the following. > > > > My problem is that I like to maintain my original rpt/chan/time/freq > size after artefact rejection based on the time series data, i.e. to have > the same dimensions of the TFR as if I did not reject data. This is for > reasons of bookkeeping between different types of channels that are > processed differently throughout my analysis. > > > > What works well is to detect artifacts in the data and replace those > intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So > far this is perfect for the approach I had in mind. > > > > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials as > nans whenever a (small) period has nans. What I would need - and in fact > expect - is that only those time/frequency windows that have (one or more) > nan values will output nan, while the rest should merrily go round giving > power values. After all, the data is there. > > > > It is unclear to me whether this is expected behaviour or not. I might > be making a mistake but some simple tests replicated this behaviour. > > > > Is there a solution that still allows me to end up with a > rpt/chan/time/freq representation of the same size as when i would not have > rejected artifacts? > > > > The only other FieldTrip-like option I can think of is to use > ft_rejectartifact with method = 'partial', do the freqanalysis on trial > parts, and somehow glue the separate trial parts together again afterwards. > But I really don't want to go in that direction. > > > > In the end I'm afraid I don't understand the core of > ft_specest_mtmconvol enough to see where I could hack it. I hope some of > you might be able to help. > > > > Best wishes, > > Stephen > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed May 25 23:14:00 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 25 May 2016 23:14:00 +0200 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> Message-ID: <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> Hi Conrado, that should not hapen, as the code also tells you ;-) Could you try replacing line 539 in ft_hastoolbox from status = exist(full_name, 'file'); into status = (exist(full_name, 'file')==3); After that you should make sure that the ft_hastoolbox copy (which is present in multipe private directories) is updated by (on your Mac) running in a terminal fieldtrip/bin/synchronize-private.sh the synchronize-private script runs autmatically upon each git commit, but with a manual change you sometimes have to do it by hand. The recent change in this section of FieldTrip code was (as Cristiano mentioned) triggered by recent matlab incompatibilities in file detection, and in making it more octave compatible. But apparently we did not test all possible cases. Please let me know whether it works, I’ll then integrate it in the release version. Best regards Robert > On 25 May 2016, at 15:50, Conrado Bosman wrote: > > Hey Cristiano, > Thanks for the advice! > The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct > The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code > > best > Conrado >> On 25 May 2016, at 15:23, Cristiano Micheli > wrote: >> >> Dear Conrado, >> I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). >> Which version of MatLab are you running? >> >> try to apply this change: >> if exist(varname) -> if exist(varname,'var') >> >> That should do it >> I hope this helped! >> >> >> Cris >> >> On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: >> Dear fieldtrippers, >> >> I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). >> >> Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. >> Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 >> >> Do you have any clue if I’m doing something wrong? >> >> Thanks in advance! >> Conrado >> >> K>> Error using ft_hastoolbox>is_present (line 576) >> this should not happen >> >> Error in ft_hastoolbox (line 378) >> status = is_present(dependency); >> >> Error in read_neuralynx_ncs (line 57) >> isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug >> >> Error in read_neuralynx_ds (line 84) >> orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); >> >> Error in ft_read_header (line 1576) >> hdr = read_neuralynx_ds(filename); >> of a Neuralynx >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan at ustc.edu.cn Thu May 26 08:02:07 2016 From: tzvetan at ustc.edu.cn (Tzvetomir) Date: Thu, 26 May 2016 14:02:07 +0800 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Dear Stephen, you could also apply the nanconv() function of B.Kraus, available on Matlab's fileexchange. (http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv) I'm doing my own wavelet processing for the reason that part of my epochs are filled with nan's due to experimental design. But fieldtrip website remains a huge source of infos, tips and solutions where to look for :) all the best, Tzvetomir On 2016-05-25 10:08 PM, Stephen Whitmarsh wrote: > As a follow-up: I guess the best solution in the case would then be to > make my TFR, and replace those values with nans based on the sample > number from the time-series artifact detection. > > Cheers, > Stephen > > On 25 May 2016 at 15:58, Stephen Whitmarsh > > wrote: > > Hi Jim! > > Thanks. Ofcourse, that's the problem. However, method = 'wavelet', > and method = 'tfr' give the same problem. I'm afraid I'll end up > writing my own code, cutting up data and using an FFT :-/ > > Thank again, > > Stephen > > On 25 May 2016 at 15:34, Herring, J.D. (Jim) > > wrote: > > Hi Stephen, > > As far as I know this is expected as mtmconvol is actually > multiplying the fft of the entire trial with the fft of your > tapered windows. Perhaps it will work of you use one of the > methods that actually uses convolution in the time domain > rather than multiplication in the frequency domain. > > Best, > > Jim > > > > > On 25 May 2016, at 15:29, Stephen Whitmarsh > > wrote: > > > > Hi FieldTrippers, > > > > I hope someone can help me with the following. > > > > My problem is that I like to maintain my original > rpt/chan/time/freq size after artefact rejection based on the > time series data, i.e. to have the same dimensions of the TFR > as if I did not reject data. This is for reasons of > bookkeeping between different types of channels that are > processed differently throughout my analysis. > > > > What works well is to detect artifacts in the data and > replace those intervals with nans using ft_rejectartifact, > with cfg.reject = 'nan'. So far this is perfect for the > approach I had in mind. > > > > However, ft_freqanalysis (method = 'mtmconvol') outputs > whole trials as nans whenever a (small) period has nans. What > I would need - and in fact expect - is that only those > time/frequency windows that have (one or more) nan values will > output nan, while the rest should merrily go round giving > power values. After all, the data is there. > > > > It is unclear to me whether this is expected behaviour or > not. I might be making a mistake but some simple tests > replicated this behaviour. > > > > Is there a solution that still allows me to end up with a > rpt/chan/time/freq representation of the same size as when i > would not have rejected artifacts? > > > > The only other FieldTrip-like option I can think of is to > use ft_rejectartifact with method = 'partial', do the > freqanalysis on trial parts, and somehow glue the separate > trial parts together again afterwards. But I really don't want > to go in that direction. > > > > In the end I'm afraid I don't understand the core of > ft_specest_mtmconvol enough to see where I could hack it. I > hope some of you might be able to help. > > > > Best wishes, > > Stephen > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- __________________________________________________ Tzvetomir Tzvetanov, PhD (赐为) Associate Professor Vision Research Laboratory, School of Life Sciences, CAS Key Laboratory of Brain Function and Disease, University of Science & Technology of China Hefei, Anhui 230027, P.R.China http://vision.ustc.edu.cn/ Email: tzvetan at ustc.edu.cn -------------- next part -------------- An HTML attachment was scrubbed... URL: From conrado.bosman at gmail.com Thu May 26 10:24:22 2016 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Thu, 26 May 2016 08:24:22 +0000 Subject: [FieldTrip] Error in ft_hastoolbox In-Reply-To: <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> References: <7D80A509-22E5-4B0A-A969-FC33C24A028A@gmail.com> <2750D015-7D74-4DD6-90A7-57EBC2454A1B@gmail.com> <1C2E4398-B1D5-4A13-8A49-AF9033A222EA@donders.ru.nl> Message-ID: <840de86e5f884294b4a5855b3cd9de6b@EXPRD02.hosting.ru.nl> Hi Robert, Thanks! this little change solved the bug. Best, Conrado On 25 May 2016, at 23:14, Robert Oostenveld > wrote: Hi Conrado, that should not hapen, as the code also tells you ;-) Could you try replacing line 539 in ft_hastoolbox from status = exist(full_name, 'file'); into status = (exist(full_name, 'file')==3); After that you should make sure that the ft_hastoolbox copy (which is present in multipe private directories) is updated by (on your Mac) running in a terminal fieldtrip/bin/synchronize-private.sh the synchronize-private script runs autmatically upon each git commit, but with a manual change you sometimes have to do it by hand. The recent change in this section of FieldTrip code was (as Cristiano mentioned) triggered by recent matlab incompatibilities in file detection, and in making it more octave compatible. But apparently we did not test all possible cases. Please let me know whether it works, I’ll then integrate it in the release version. Best regards Robert On 25 May 2016, at 15:50, Conrado Bosman > wrote: Hey Cristiano, Thanks for the advice! The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code best Conrado On 25 May 2016, at 15:23, Cristiano Micheli > wrote: Dear Conrado, I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well). Which version of MatLab are you running? try to apply this change: if exist(varname) -> if exist(varname,'var') That should do it I hope this helped! Cris On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman > wrote: Dear fieldtrippers, I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below). Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576 Do you have any clue if I’m doing something wrong? Thanks in advance! Conrado K>> Error using ft_hastoolbox>is_present (line 576) this should not happen Error in ft_hastoolbox (line 378) status = is_present(dependency); Error in read_neuralynx_ncs (line 57) isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug Error in read_neuralynx_ds (line 84) orig(i) = read_neuralynx_ncs(fname{i}, 0, 0); Error in ft_read_header (line 1576) hdr = read_neuralynx_ds(filename); of a Neuralynx _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Thu May 26 10:58:16 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Thu, 26 May 2016 10:58:16 +0200 Subject: [FieldTrip] No mtmconvol on data with partial nans In-Reply-To: References: <83b38033d0634bf580ff0820ac2f220b@EXPRD02.hosting.ru.nl> Message-ID: Dear Tzvetomir, Thank you so much! That is very helpful. And I concur fully with the praise of FT, and the mailinglist :-) Best wishes, Stephen On 26 May 2016 at 08:02, Tzvetomir wrote: > Dear Stephen, > > you could also apply the nanconv() function of B.Kraus, available on > Matlab's fileexchange. > > (http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv) > > I'm doing my own wavelet processing for the reason that part of my epochs > are filled with nan's due to experimental design. > > But fieldtrip website remains a huge source of infos, tips and solutions > where to look for :) > > all the best, > > Tzvetomir > On 2016-05-25 10:08 PM, Stephen Whitmarsh wrote: > > As a follow-up: I guess the best solution in the case would then be to > make my TFR, and replace those values with nans based on the sample number > from the time-series artifact detection. > > Cheers, > Stephen > > On 25 May 2016 at 15:58, Stephen Whitmarsh > wrote: > >> Hi Jim! >> >> Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and >> method = 'tfr' give the same problem. I'm afraid I'll end up writing my own >> code, cutting up data and using an FFT :-/ >> >> Thank again, >> >> Stephen >> >> On 25 May 2016 at 15:34, Herring, J.D. (Jim) < >> j.herring at donders.ru.nl> wrote: >> >>> Hi Stephen, >>> >>> As far as I know this is expected as mtmconvol is actually multiplying >>> the fft of the entire trial with the fft of your tapered windows. Perhaps >>> it will work of you use one of the methods that actually uses convolution >>> in the time domain rather than multiplication in the frequency domain. >>> >>> Best, >>> >>> Jim >>> >>> >>> >>> > On 25 May 2016, at 15:29, Stephen Whitmarsh < >>> stephen.whitmarsh at gmail.com> wrote: >>> > >>> > Hi FieldTrippers, >>> > >>> > I hope someone can help me with the following. >>> > >>> > My problem is that I like to maintain my original rpt/chan/time/freq >>> size after artefact rejection based on the time series data, i.e. to have >>> the same dimensions of the TFR as if I did not reject data. This is for >>> reasons of bookkeeping between different types of channels that are >>> processed differently throughout my analysis. >>> > >>> > What works well is to detect artifacts in the data and replace those >>> intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So >>> far this is perfect for the approach I had in mind. >>> > >>> > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials >>> as nans whenever a (small) period has nans. What I would need - and in fact >>> expect - is that only those time/frequency windows that have (one or more) >>> nan values will output nan, while the rest should merrily go round giving >>> power values. After all, the data is there. >>> > >>> > It is unclear to me whether this is expected behaviour or not. I might >>> be making a mistake but some simple tests replicated this behaviour. >>> > >>> > Is there a solution that still allows me to end up with a >>> rpt/chan/time/freq representation of the same size as when i would not have >>> rejected artifacts? >>> > >>> > The only other FieldTrip-like option I can think of is to use >>> ft_rejectartifact with method = 'partial', do the freqanalysis on trial >>> parts, and somehow glue the separate trial parts together again afterwards. >>> But I really don't want to go in that direction. >>> > >>> > In the end I'm afraid I don't understand the core of >>> ft_specest_mtmconvol enough to see where I could hack it. I hope some of >>> you might be able to help. >>> > >>> > Best wishes, >>> > Stephen >>> > >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > __________________________________________________ > > Tzvetomir Tzvetanov, PhD > (赐为) > > Associate Professor > Vision Research Laboratory, School of Life Sciences, > CAS Key Laboratory of Brain Function and Disease, > University of Science & Technology of China > Hefei, Anhui 230027, P.R.Chinahttp://vision.ustc.edu.cn/ > Email: tzvetan at ustc.edu.cn > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From icelandhouse at gmail.com Thu May 26 20:12:47 2016 From: icelandhouse at gmail.com (Maris Skujevskis) Date: Thu, 26 May 2016 20:12:47 +0200 Subject: [FieldTrip] Average referencing and demeaning prior to beamformer Message-ID: Hi fieldtrip users, I have a question of clarification regarding common average referencing during beamformer source reconstruction. The yellow warning box in the tutorial http://www.fieldtriptoolbox.org/tutorial/beamformer stresses the importance of common average referencing but leaves me confused as to when exactly it needs to be done. Suppose I have an set of EEG trials (i.e., a set of multichannel time series). The entire data set has already been demeaned and common average referenced. I then cut out two time windows of interest on which I wish to apply a beamformer filter. Question 1: after I combine the the two cut-out time windows to calculate the common filter, do I need to average reference the combined data set prior to calculating the beamformer filter? Question 2: Do I need to separately average reference each of the two cut-out windows prior to applying the beamformer on each of the cut-out data segments? Question 3 on demeaning: do the cut-out combined/separate time windows should also be demeaned or demeaning doesn't make any difference for beamformer source reconstruction? Thanks! Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From SXM1170 at student.bham.ac.uk Thu May 26 20:46:43 2016 From: SXM1170 at student.bham.ac.uk (Stefan Maslanka) Date: Thu, 26 May 2016 18:46:43 +0000 Subject: [FieldTrip] Reading BCI2000 files with stimulus codes Message-ID: Dear FieldTrip users, I have recently been using the Emotiv Epoc with BCI2000 to develop a BCI. I was using BCILAB to create a model to use online but recently came across FieldTrip and its buffer. Unfortunately I am having issues reading my BCI2000 files and processing based on stimulation time points. The BCI2000 '.dat' files are saved with an event field called 'StimulusCode' with values relating to a left or right arrow (1 or 2) and a fixation cross (5). This is clearly seen when loading the header, each samples code is stored in 'hdr.orig.states.StimulusCode'. However when loading the events FieldTrip does not detect these stimulus codes, only listing the 5's for the rest condition, the values of 1 and 2 are not picked up. Is this a known .dat or BCI2000 issue? I was hoping to create a simple model and train a classifier to use in an online environment. Thank you for your time, Stefan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri May 27 09:31:45 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 27 May 2016 08:31:45 +0100 Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA Message-ID: Hi list, Eventually we managed to figure this out off-list, but I just wanted to post a response here to show that it's been resolved (and in case someone in the future has a similar issue and finds this thread). We ended up handling this by making a difference-of-differences wave to quantify the 2x2 within-subjects interaction (per http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests) and then using ft_statfun_indepsamplesregrT to correlate that interaction effect with the subject-wise covariate (as opposed to comparing it to 0 with a regular t-test). For the cfg.design matrix we just used the list of the subjects' values on the covariate. The results we got seemed to make sense (i.e., they were consistent with what had been observed in the same dataset with a time-window analysis before this), but of course if we've done anything wrong or if anyone has suggestions for a better way to do this then we'd be happy to hear. 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: Tue, 24 May 2016 08:57:46 +0000 > From: Alex Sel > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Cluster-based permutation analysis statfun ANCOVA > Message-ID: > <3123912FD054FE44A023073D2EFD213C8CA53F at MBX02.ad.oak.ox.ac.uk> > Content-Type: text/plain; charset="us-ascii" > > Dear List, > > > > Apologies for the reposting... > > > > I am trying to perform a cluster-based permutation test. I have an > experimental design with 2 within variables (2x2 design) and a covariate. I > wonder how I can define the statistics in the script to include both the > within-subject variables and the covariate. I am using the cfg.statistics > = 'depsamplesFmultivariate' but I am unsure how to define the covariate in > the model. > > > > Any insight on this would be much appreciated. > > > > Best wishes > > > > Alex Sel, PhD > Postdoctoral Researcher > Department of Experimental Psychology, > University of Oxford, > 9 South Parks Road, > OX1 3UD > Tel: 01865 271 340 > Email: Alex.sel at psy.ox.ac.uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seymourr at aston.ac.uk Fri May 27 15:39:58 2016 From: seymourr at aston.ac.uk (Seymour, Robert (Research Student)) Date: Fri, 27 May 2016 13:39:58 +0000 Subject: [FieldTrip] Combining GRADS+MAGS Message-ID: Dear Fieldtrip Users, I am using an Elekta Neuromag 306 scaner which obviously has both magnetometers and gradiometers. When performing source localisation using an LCMV beamformer I would like to use both MAGS and GRADS (i.e. use cfg.channel = 'MEG' '-badchans'). I know that there is a scaling issue between MAGS and GRADS.. so I was wondering if Fieldtrip compensates for this during leadfield creation and/or ft_sourceanalysis, and if so how? Many thanks, Robert Seymour (PhD Student, Aston Brain Centre) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon May 30 05:38:53 2016 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 30 May 2016 13:38:53 +1000 Subject: [FieldTrip] Problem with EGI file Message-ID: Dear fieldtrip community, I am trying to analyse eeg recorded from EGI. I want to highpass filter the data before epoching and I managed to create the following script from the fieldtrip documentation. However I am getting an error (please see below). Could someone suggest a fix. Thank you, Arti datadir = 'D:\EGITest'; dataset = fullfile(datadir, 's01_CH.mff'); headerformat = 'egi_mff_v2'; dataformat = 'egi_mff_v2'; eventformat = 'egi_mff_v2'; hdr = ft_read_header(dataset, 'headerformat', headerformat); dat = ft_read_data(dataset, 'headerformat', headerformat, 'dataformat', dataformat); event = ft_read_event(dataset, 'headerformat', headerformat, 'eventformat', eventformat); fg = []; cfg.data = dat; cfg.headerfile=hdr; cfg.trialdef.triallength = Inf; cfg.trialdef.ntrials = 1; cfg = ft_definetrial(cfg); cfg.hpfilter = 'yes'; cfg.hpfreq = .1; cfg.hpfilttype = 'firws'; cfg.hpfiltdir = 'onepass-zerophase'; alldata = ft_preprocessing(cfg); I am getting the following error Undefined function 'exist' for input arguments of type 'struct'. Error in isdir (line 10) result = exist(dirpath,'dir') == 7; Error in ft_filetype (line 150) if isdir(filename) Error in ft_checkconfig (line 559) cfg.dataformat = ft_filetype(cfg.datafile); Error in ft_definetrial (line 128) cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.blume at sbg.ac.at Mon May 30 09:48:12 2016 From: christine.blume at sbg.ac.at (Blume Christine) Date: Mon, 30 May 2016 07:48:12 +0000 Subject: [FieldTrip] Problem with EGI file In-Reply-To: References: Message-ID: Dear Arti, You could try to adapt the following code: % -------------------------------- % Load & preprocess continuous files % --------------------------------- cfg = []; cfg.dataset = tmpfilename; cfg.continuous='yes'; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; cfg.hpfreq = 0.5; % Hz cfg.channel = elecs_183_selec; data_cont = ft_preprocessing(cfg); % ----------------------------------------- % define trials %----------------------------------------- cfg = []; cfg.dataset = tmpfilename; % datafile to read events from cfg.eventformat = 'egi_mff_v2'; cfg.trialdef.prestim = 2; % in seconds cfg.trialdef.poststim = 2; % in seconds cfg.trialdef.eventtype = {'DIN12'}; cfgDIN12 = ft_definetrial(cfg); tmp_data_segm12 = ft_redefinetrial(cfgDIN12, data_cont); %Segmentation The problem is that for me, it does not import the trialinfo. Therefore, I do the segmentation (here for DIN12) separately for all triggers, then append all tmp_data_segm and write the following code for adding the trialinfo: data_segm.trialinfo=[ones(1, length(tmp_data_segm12.trial))*12] Hope that helps! Best, Christine ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arti Abhishek [mailtome.2113 at gmail.com] Gesendet: Montag, 30. Mai 2016 05:38 An: FieldTrip discussion list Betreff: [FieldTrip] Problem with EGI file Dear fieldtrip community, I am trying to analyse eeg recorded from EGI. I want to highpass filter the data before epoching and I managed to create the following script from the fieldtrip documentation. However I am getting an error (please see below). Could someone suggest a fix. Thank you, Arti datadir = 'D:\EGITest'; dataset = fullfile(datadir, 's01_CH.mff'); headerformat = 'egi_mff_v2'; dataformat = 'egi_mff_v2'; eventformat = 'egi_mff_v2'; hdr = ft_read_header(dataset, 'headerformat', headerformat); dat = ft_read_data(dataset, 'headerformat', headerformat, 'dataformat', dataformat); event = ft_read_event(dataset, 'headerformat', headerformat, 'eventformat', eventformat); fg = []; cfg.data = dat; cfg.headerfile=hdr; cfg.trialdef.triallength = Inf; cfg.trialdef.ntrials = 1; cfg = ft_definetrial(cfg); cfg.hpfilter = 'yes'; cfg.hpfreq = .1; cfg.hpfilttype = 'firws'; cfg.hpfiltdir = 'onepass-zerophase'; alldata = ft_preprocessing(cfg); I am getting the following error Undefined function 'exist' for input arguments of type 'struct'. Error in isdir (line 10) result = exist(dirpath,'dir') == 7; Error in ft_filetype (line 150) if isdir(filename) Error in ft_checkconfig (line 559) cfg.dataformat = ft_filetype(cfg.datafile); Error in ft_definetrial (line 128) cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); -------------- next part -------------- An HTML attachment was scrubbed... URL: From Claudio.Georgii at stud.sbg.ac.at Mon May 30 10:53:22 2016 From: Claudio.Georgii at stud.sbg.ac.at (Claudio Georgii) Date: Mon, 30 May 2016 10:53:22 +0200 Subject: [FieldTrip] Problem with EGI file In-Reply-To: References: Message-ID: Hey, i guess a more convenient & less error prone way to import the trialinfo would be to specify your own trialfun. Within you trialfun, just search for the stimulus value (trigger value) and add it to a 4th column of your trl structure: % Search for trials: stimulus_value = {event(find(strcmp('Stimulus', {event.type}))).value}'; % add to 4th colum of trl trl(:,4) = str2double(stimulus_value); After using ft_preprocessing, the 4th colum will be automatically added to the trialinfo. Best, Claudio 2016-05-30 9:48 GMT+02:00 Blume Christine : > Dear Arti, > > You could try to adapt the following code: > > % -------------------------------- > % Load & preprocess continuous files > % --------------------------------- > cfg = []; > cfg.dataset = tmpfilename; > cfg.continuous='yes'; > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > cfg.hpfreq = 0.5; % Hz > cfg.channel = elecs_183_selec; > data_cont = ft_preprocessing(cfg); > > % ----------------------------------------- > % define trials > %----------------------------------------- > cfg = []; > cfg.dataset = tmpfilename; % datafile to read events from > cfg.eventformat = 'egi_mff_v2'; > cfg.trialdef.prestim = 2; % in seconds > cfg.trialdef.poststim = 2; % in seconds > > cfg.trialdef.eventtype = {'DIN12'}; > cfgDIN12 = ft_definetrial(cfg); > > tmp_data_segm12 = ft_redefinetrial(cfgDIN12, data_cont); %Segmentation > > The problem is that for me, it does not import the trialinfo. Therefore, I > do the segmentation (here for DIN12) separately for all triggers, then > append all tmp_data_segm and write the following code for adding the > trialinfo: > > data_segm.trialinfo=[ones(1, length(tmp_data_segm12.trial))*12] > > Hope that helps! > > Best, > Christine > > > ------------------------------ > *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" > im Auftrag von "Arti Abhishek [mailtome.2113 at gmail.com] > *Gesendet:* Montag, 30. Mai 2016 05:38 > *An:* FieldTrip discussion list > *Betreff:* [FieldTrip] Problem with EGI file > > Dear fieldtrip community, > > I am trying to analyse eeg recorded from EGI. I want to highpass filter > the data before epoching and I managed to create the following script from > the fieldtrip documentation. However I am getting an error (please see > below). Could someone suggest a fix. > > Thank you, > Arti > > > datadir = 'D:\EGITest'; > dataset = fullfile(datadir, 's01_CH.mff'); > headerformat = 'egi_mff_v2'; > dataformat = 'egi_mff_v2'; > eventformat = 'egi_mff_v2'; > hdr = ft_read_header(dataset, 'headerformat', headerformat); > dat = ft_read_data(dataset, 'headerformat', headerformat, > 'dataformat', dataformat); > event = ft_read_event(dataset, 'headerformat', headerformat, > 'eventformat', eventformat); > fg = []; > cfg.data = dat; > cfg.headerfile=hdr; > cfg.trialdef.triallength = Inf; > cfg.trialdef.ntrials = 1; > cfg = ft_definetrial(cfg); > cfg.hpfilter = 'yes'; > cfg.hpfreq = .1; > cfg.hpfilttype = 'firws'; > cfg.hpfiltdir = 'onepass-zerophase'; > alldata = ft_preprocessing(cfg); > > I am getting the following error > > Undefined function 'exist' for input arguments of type > 'struct'. > > Error in isdir (line 10) > result = exist(dirpath,'dir') == 7; > > Error in ft_filetype (line 150) > if isdir(filename) > > Error in ft_checkconfig (line 559) > cfg.dataformat = ft_filetype(cfg.datafile); > > Error in ft_definetrial (line 128) > cfg = ft_checkconfig(cfg, 'dataset2files', 'yes'); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Claudio Georgii, MSc. Phd student University of Salzburg - Department of Psychology Eating Behavior Laboratory Hellbrunnerstraße 34 5020 Salzburg - Austria Phone: 0043- (0)662 8044 5164 E-Mail: claudio.georgii at sbg.ac.at -------------- next part -------------- An HTML attachment was scrubbed... URL: