UPDATE megplanar input structure / gerneral usage of planar gradients fpr ERFs

Michael Wibral michael.wibral at WEB.DE
Thu Sep 23 11:18:33 CEST 2010


Dear Akiko,

I just remebered the problem you get when trying to do stats on planar gradient data: Any corrcetion method that takes spatial distance between sensors into account - such as Eric's cluster based correction - can not handle planar grdaiometer data properly - for fundamental reasons discussed earlier in this forum. But stats with FDR should work on the planar gradient inputs. Perhaps you will have to add a fake grad field (with 2xN entries !) to the output of megplanar.m to make timelockstatistics run.

Michael


-----Ursprüngliche Nachricht-----
Von: "Michael Wibral" <michael.wibral at WEB.DE>
Gesendet: Sep 23, 2010 11:12:36 AM
An: FIELDTRIP at NIC.SURFNET.NL
Betreff: Re: [FIELDTRIP] megplanar input structure / gerneral usage of plamar gradients fpr ERFs

>Dear Akiko,
>
>maybe I can help with the confusion. Not in terms of fieldtrip usage but rather in the logic of using planar gradients for ERFs.
>
>When computing ERFs you count on non-repeateable signals to average to zero and on repeatable signals to average to non-zero quantities. This requires that your signals carry a sign (i.e. they're positive and negative). Clearly this is not the case anymore  after combineplanar. Hence, any averaging that you do should occur before combineplanar, otherwise averaging to get an ERF-like construct does not make sense.
>
>I remeber that putting the gradient structure that you obtain after megplanar into the statistics was sometimes a problem (do not know whetherthis is still the case, though).
>
>So you basically have two options:
>(1) Do everything in axial gradiometers, including ERFS and stats. As a last step you may visualize the raw effect in planar gardients (i.e. do megplanar and combineplanar on your raw effect). See  Grützner et al., J Neuroscience, 2010  for an example of what you get that way.
>(2) Compute the planar gradients as a first thing on the raw signals (but do NOT use combineplanar afterwards), do any averaging and stats that you'd like to do on the full 2xN gradient signals. Afterwards use combineplanar for visualization of the  effects.
>
>As these two methods only differ in the arrangement of linear processing steps they are fully equivalent. Note that in both cases the nonlinear step (combineplaner) is done last. This is necessary because due to its nonlinear nature it does not commute with any other analysis step without dratsically changig the results and affecting the interpretation of what it is that you see.
>
>Michael
>
>-----Ursprüngliche Nachricht-----
>Von: "Akiko Ikkai" [
>Gesendet: Sep 23, 2010 1:20:19 AM
>An: FIELDTRIP at NIC.SURFNET.NL
>Betreff: Re: [FIELDTRIP] megplanar input structure
>
>>Thank you very much for suggestions earlier. Visualization of the ERF using planar gradient runs smoothly (with cfg.keeptrials = 'no';). 
>>
>>I'm now trying to run cluster-based permutation tests on ERF with planar gradient, following the tutorial. I'm confused with what the input structure should look like. 
>>
>>My confusions come from the difference between figure1 (tutorial:cluster_permutation_erf:clusperm_erf_anaprot_stat_planar_ficvsfc.png) and the middle part of the tutorial page ("Using planar gradient data" in cluster_permutation_timelock). In figure, there is additional timelockanalysis between megplanar and combineplanar, whereas in the main text, combineplanar directly follows megplanar.
>>
>>I tried 3 things: 1. Without timelockanalysis (after megplanar), I get an error in permutation with an input 
>>ERF1 = 
>>
>>      trial: {1x137 cell}
>>      label: {157x1 cell}
>>       grad: [1x1 struct]
>>    fsample: 500
>>       time: {1x137 cell}
>>        cfg: [1x1 struct]
>>
>>[stat] = timelockstatistics(cfg, ERF1, ERF2); 
>>
>>??? Reference to non-existent field 'dimord'.
>>
>>Error in ==> prepare_timefreq_data>forcedimord at 577
>>inputdim  = tokenize(input.dimord, '_');
>>
>>Error in ==> prepare_timefreq_data at 176
>>  [remember{c}, hascrsspctrm] = forcedimord(varargin{c});
>>
>>Error in ==> statistics_wrapper at 318
>>  [cfg, data] = prepare_timefreq_data(cfg, varargin{:});
>>
>>Error in ==> timelockstatistics at 115
>>[stat, cfg] = statistics_wrapper(cfg, varargin{:});
>>
>>Error in ==> cluster_ERF_bwTrialtest_planar at 50
>>[stat] = timelockstatistics(cfg, ERF1, ERF2); 
>>
>>2. manually added dimord to the same input
>>ERF1.dimord = 'rpt_chan_time'; 
>>
>>[stat] = timelockstatistics(cfg, ERF1, ERF2); 
>>
>>??? Undefined function or method 'isnan' for input arguments of type 'cell'.
>>
>>Error in ==> prepare_timefreq_data at 215
>>  if isempty(findstr(remember{c}.dimord, 'time')) || all(isnan(remember{c}.time))
>>
>>Error in ==> statistics_wrapper at 318
>>  [cfg, data] = prepare_timefreq_data(cfg, varargin{:});
>>
>>Error in ==> timelockstatistics at 115
>>[stat, cfg] = statistics_wrapper(cfg, varargin{:});
>>
>>3. With timelockanalysis (after megplanar), it crashes during combineplanar 
>>
>>??? Subscripted assignment dimension mismatch.
>>
>>Error in ==> checkdata>raw2timelock at 1136
>>    tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i};
>>
>>Error in ==> checkdata at 366
>>        data = raw2timelock(data);
>>
>>Error in ==> combineplanar at 356
>>    data = checkdata(data, 'datatype', 'timelock', 'feedback', 'yes');
>>
>>
>>... so, I'm trying to figure out what input structure timelockstatistics requires in order to run with planar gradient. I'm converting all inputs to single in order to avoid memory error, but I don't think that is the cause of the problem.   
>>
>>Thanks in advance! Akiko
>>
>>
>>----- Original Message -----
>>From: jan-mathijs schoffelen <jan.schoffelen at DONDERS.RU.NL>
>>Date: Tuesday, September 21, 2010 5:37 am
>>Subject: Re: [FIELDTRIP] megplanar input structure
>>To: FIELDTRIP at NIC.SURFNET.NL
>>
>>> Dear Akiko,
>>> 
>>> I think that your crash may be related to the issue of missing  
>>> channels. Antony already pointed you to a way how to fix this. As to  
>>> 
>>> your first question: ft_megplanar indeed works with data containing a  
>>> 
>>> trial field (as cell-array). However, no need for you to worry about  
>>> 
>>> this; if your input data is for example a 'timelock' structure,  
>>> fieldtrip automatically converts this structure into one containing a  
>>> 
>>> 'trial'.
>>> 
>>> Best wishes,
>>> 
>>> Jan-Mathijs
>>
>>----------------------------------
>>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>
>----------------------------------
>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Michael Wibral.vcf
Type: text/x-vcard
Size: 628 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100923/9cb5fb5f/attachment.vcf>


More information about the fieldtrip mailing list