plv analysis

Bernhard Spitzer bernhard.spitzer at BCCN-BERLIN.DE
Mon Jul 5 15:02:15 CEST 2010


Dear ft_list,

I am trying to perform plv analysis using Fieldtrip, on EEG data
converted from SPM to Fieldtrip using ftraw.
Frequanalysis on the imported data works fine, I obtain the powspctrm
and crsspctrm, and I can succeed
with connectivityanalyis to compute e.g., coherence without problems.
However, when I set cfg.method to 'plv', connectivityanalysis throws the
following error:

??? Conversion to cell from double is not possible.

Error in ==> avgoverdim at 17
reduceddim(avgdimnum) = 1;

Error in ==> selectdata at 445
     if avgoverrpt,  tmpdata = avgoverdim(tmpdata, 'rpt');   end

Error in ==> ft_connectivityanalysis at 256
     data   = selectdata(data, 'avgoverrpt', 'yes');

any suggestions?
best & many thanks
Bernhard



%Here the settings I use for  frequanalysis (which seems to work fine)
cfg = [];
cfg.output ='powandcsd';
cfg.taper = 'dpss';
cfg.channel = unique(S.chancomb(:));
cfg.channelcmb = S.chancomb;
cfg.method          = 'mtmconvol';
cfg.keeptrials = 'yes';
cfg.keeptapers = 'no';
cfg.foi             = (1/timewin):(1/timewin):S.freqwin(2); % Frequency axis
cfg.foi             = cfg.foi(cfg.foi>=S.freqwin(1));
numfoi              = length(cfg.foi);
cfg.t_ftimwin       = zeros(1,numfoi);
cfg.t_ftimwin(:)    = timewin; % Time resolution
cfg.tapsmofrq       = zeros(1,numfoi); % Initialize to zero
cfg.tapsmofrq(:)    = 1/timewin; % Set initial resolution to 1/timewin
(i.e. 2.5 Hz) for all frequencis
cfg.tapsmofrq(cfg.foi>10*(1/timewin))    =
0.1*cfg.foi(cfg.foi>10*(1/timewin));
cfg.tapsmofrq(cfg.foi>50)                = 5;
cfg.toi=(prestim+(timewin/2)):step:(poststim-(timewin/2)-1/data.fsample); %
Time axis
freq = ft_freqanalysis(cfg, data);

%And the part for connectivityanalysis (which works for coherence, but
not for plv)
cfg=[];
cfg.method  = 'plv';
[stat] = ft_connectivityanalysis(cfg,  freqs)

----------------------------------
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.



More information about the fieldtrip mailing list