[FieldTrip] TFR Cluster permutation on Single-sensor

Tahereh Toosi tahere.toosi at gmail.com
Fri Jun 5 18:52:52 CEST 2015


Hi fieldtripers,

I am trying to do a cluster permutation on Time-frequency data of a single
channel (of 64 channel EEG) in a between subject design based on the
example provided here
<http://www.fieldtriptoolbox.org/example/apply_clusterrandanalysis_on_tfrs_of_power_that_were_computed_with_besa>.
Two weird things happen.
First, although I set cfg.frequency = 'all' for stats, but it always
returns results for only ~1-10Hz instead of 1:15 Hz I have in my freq data
(to be precise : stat.cfg.frequency =[0.9995    9.9951]).
Second, based on the explanation in this paper
<http://www.sciencedirect.com/science/article/pii/S0165027007001707>, I
assume cfg.neighbourdist in single-sensor test somehow shows the number of
adjacent points, but when I change this number the clusters don't change at
all.
Here is my code, I would appreciate if anyone could tell me what is
happening.

Thanks,
Tahereh

% Time frequency analysis
cfg = [];
cfg.output     = 'pow';
cfg.method     = 'mtmconvol';
cfg.taper      = 'hanning';
f1 = 1;f2 = 15; fstep = 0.1;
cfg.foi        =f1:fstep:f2;
t1 = -1; t2 = 1;
cfg.toi        = t1:0.02:t2;
n_cycles = 5;
cfg.t_ftimwin  = n_cycles ./cfg.foi;
cfg.keeptrials ='no';

[freqdata] = ft_freqanalysis(cfg, data);

%store freq data for each condition/subject
 TFDesc(Condition,subject) =  {ft_freqdescriptives(cfg,freqdata)}

%Comparing Condition1 and Condition2
cfg = [];
Condition1_avg= ft_freqgrandaverage(cfg, TFDesc{cond1,: });
Condition2_avg =  ft_freqgrandaverage(cfg,  TFDesc{cond2,: });

% make a dummy structure with the difference between Condition 1 & 2
avgDiff = Condition1_avg;
avgDiff.powspctrm = Condition1_avg.powspctrm-Condition2_avg.powspctrm;

cfg = [];
cfg.channel          =  'FP2'
cfg.frequency        = 'all'
cfg.neighbourdist    = 4;
cfg.latency          = 'all'
cfg.avgovertime      = 'no';
cfg.avgoverfreq      ='no';
cfg.avgoverchan      = 'no';

cfg.clusteralpha     = 0.05;
cfg.statistic        = 'ft_statfun_depsamplesT';
cfg.numrandomization = 500;
cfg.correctm         =   'cluster';
cfg.method           = 'montecarlo';
cfg.design           = [
    1 2 3 4 5 6 7 8 9  1 2 3 4 5 6 7  8 9     % subject number
    1 1 1 1 1 1 1 1 1   2 2 2 2 2 2 2 2 2   ];  % condition number
cfg.uvar = 1;                                   % "subject" is unit of
observation
cfg.ivar = 2;                                   % "condition" is the
independent variable
cfg
stat = ft_freqstatistics(cfg, TFDesc{cond1,selectedSubj},
TFDesc{cond2,selectedSubj});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150605/b0500926/attachment.html>


More information about the fieldtrip mailing list