[FieldTrip] Connectivity analysis after applying Welch's method

Dragos Stanciu dragos at example.com
Thu Jul 31 00:06:25 CEST 2014


Hello Jörn,

Thank you so much for responding. The suggested changes were spot on and
ft_connectivityanalysis executed successfully.
In the end, I went with the approach of redefining the 10s epoch in 2s
minitrials and performing ft_freqanalysis on these minitrials with
*cfg.output='fourier'* and *keeptrial='yes'. *I then did
ft_connectivityanalysis on the frequency structures resulted from
processing the segmented data. This would give me connectivity matrices for
each 10s epoch, which I then average to get one connectivity matrix for the
subject (technically, I have a connectivity matrix for each frequency bin,
but I can again average across the frequency spectrum).

I have a question on the debiased weighted phase lag index measure. The
values in the matrix vary between -1 and 1 (depending if the relative phase
lags or leads). When I construct the adjacency matrices, is it just a
matter of taking the absolute value of these values?

I would also like some advice on plotting connectivity matrices. I was able
to plot one matrix with ft_plot_matrix, but it would be really nice if I
could plot a connectivity graph where the thickness of the edges correspond
to the strength of the connectivity measure. I tried ft_topoplotER with
4D148.lay as the layout file and 'gui' as refchannel, but I didn't get
anything interesting. As my data is MEG, it doesn't make sense to me to
choose a reference channel...
Ideally, I would like to combine the layout (4D148.lay) with the
connectivity matrix for plotting the graph. Do you have any ideas for this?
Also, do you have any other suggestions on what other plotting functions
can be used with these connectivity matrices? I've looked through the
tutorial, but the functions don't seem very relevant to my type of data.

Thank you for your help.

Regards,
Dragos Stanciu


> Message: 9
> Date: Wed, 30 Jul 2014 10:28:50 +0200
> From: "J?rn M. Horschig" <jm.horschig at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Connectivity analysis after applying Welch's
>         method
>
> Hi Dragos,
>
> while quickly browisng through your mail, it appears to me that you
> simply need to set single_epoch_freq.dimord = 'rpt_chan_freq'. FieldTrip
> is using the dimord field to infer the order of the dimensions
> (*dim*ension *ord*er). The actual dimensions of powspctrm and crsspctrm
> are now inconsistent with the dimord specifications.
>
> Best,
> J?rn
>
>
> On 7/30/2014 1:18 AM, Dragos Stanciu wrote:
> > Dear FieldTrippers,
> >
> > I'm Dragos Stanciu and I'm working on my MSc in Neuroinformatics
> > dissertation at the University of Edinburgh. My project involves
> > analysis of resting-state functional connectivity using graph theory
> > in Alzheimer's disease based on MEG data.
> >
> > Each of my subjects has a number of 10s epochs (trials) associated
> > with him/her. I was able to compute the coherence and weighted phase
> > lag index measures (with /ft_freqanalysis /and
> > /ft_connectivityanalysis) /by treating my 10s epochs as trials, but
> > now I would like to reduce the amount of noise in the estimation of
> > the frequency spectrum by employing Welch's method.
> >
> > For this, I split each 10s epoch in 2s segments (minitrials) with 50%
> > overlap:
> >
> >     [sep_epoch_data] = ft_redefinetrial(cfg_cut, single_epoch_data)/. /
> >
> >
> > I then apply /ft_preprocessing /on the minitrials:
> >
> >      [processed_single_epoch] = ft_preprocessing(cfg, sep_epoch_data);
> >
> > I then do frequency analysis on the preprocessed segmented data:
> >
> >     [single_epoch_freq] = ft_freqanalysis(cfg_freq,
> >     processed_single_epoch);
> >
> > where
> >
> >     display(cfg_freq)
> >             method: 'mtmfft'
> >              taper: 'hanning'
> >             foilim: [0.5000 4]
> >             output: 'powandcsd'
> >            channel: {148x1 cell}    % 148 channels labelled from A1 to
> >     A148
> >          keeptrial: 'no'     % don't keep the minitrials, as we want
> >     to average them
> >         keeptapers: 'no'
> >
> > Please note that I average the minitrials (/keeptrial = 'no'/) as I
> > want to get an average of the frequencies.
> >
> > The resulting /single_epoch_freq/ structure looks like:
> >
> >     display(single_epoch_freq)
> >     label: {148x1 cell}
> >            dimord: 'chan_freq'
> >              freq: [0.5001 1.0002 1.5004 2.0005 2.5006 3.0007 3.5008
> >     4.0009]
> >         powspctrm: [148x8 double]
> >          labelcmb: {10878x2 cell}     % channel combinations (148*147/2)
> >         crsspctrm: [10878x8 double]
> >               cfg: [1x1 struct]
> >
> >
> > The last step is to append the averaged frequency structures of each
> > 10s epoch together and perform connectivity analysis on the main 10s
> > epochs. I do the concatenation like so:
> > freq_avgs_powspctrm = [freq_avgs_powspctrm;
> > permute(single_epoch_freq.powspctrm, [3,1,2])];
> >
> > freq_avgs_crsspctrm = [freq_avgs_crsspctrm;
> > permute(single_epoch_freq.crsspctrm, [3,1,2])];
> >
> > The idea behind /permute(..., [3, 1, 2])/ is that I want the first
> > dimension to represent trials, the second dimension channel
> > combinations and the third dimension frequencies, as this is needed
> > for the input of /ft_connectivity_wpli /(Repetitions x
> > Channelcombination (x Frequency)).
> >
> > I then call stat_conn = ft_connectivityanalysis(cfg_conn, freq_avgs);
> > where:
> >
> >     display(cfg_conn)
> >          method: 'wpli_debiased'
> >         channel: {148x1 cell}
> >
> > and
> >
> >     display(freq_avgs)
> >          powspctrm: [4x148x8 double]      % as I have 4 ten second epochs
> >         crsspctrm: [4x10878x8 double]     % as I have 4 ten second epochs
> >             label: {148x1 cell}
> >            dimord: 'chan_freq'
> >              freq: [0.5001 1.0002 1.5004 2.0005 2.5006 3.0007 3.5008
> >     4.0009]
> >          labelcmb: {10878x2 cell}
> >               cfg: [1x1 struct]
> >
> >
> > The error that I get when running /ft_connectivityanalysis/ is:
> >
> >     Error using cat
> >     CAT arguments dimensions are not consistent.
> >     Error in ft_checkdata>fixcsd (line 1170)
> >         data.crsspctrm = cat(catdim, data.powspctrm, data.crsspctrm);
> >
> >
> > When debugging, /catdim/ is equal to 1. The error occurs because the
> > 2nd dimension of data.powspctrm and data.crsspctrm are not equal
> > (former is 148, latter is 10878). Do you have any suggestions on
> > getting around this problem? Should I construct /freq_avgs /(data
> > input to ft_connectivityanalysis) differently? I'm also open to
> > different approaches to working out Welch's method in FieldTrip.
> >
> > Please download this archive that contains my test script and 4
> > example 10s epochs of a subject:
> > https://www.dropbox.com/s/js7pztai02f5p27/Welch_fieldtrip.zip The code
> > should make things clearer (or the opposite).
> > Observations: I thought about using /ft_freqanalysis_mtmwelch/, but
> > apparently it's deprecated.
> >
> > Thank you all in advance for your feedback.
> >
> > Kind regards,
> > Dragos Stanciu
> >
>
>
> --
> J?rn M. Horschig
> PhD Student
> Donders Institute for Brain, Cognition and Behaviour
> Centre for Cognitive Neuroimaging
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140730/bffb64b5/attachment.html>


More information about the fieldtrip mailing list