[FieldTrip] plotting neighbours

victoria schroeder vic.schroeder2 at gmail.com
Tue Jan 19 18:49:21 CET 2016


Thank you very much Philipp and Tzvetan!

Things have become much clearer now.

I would like to follow up with a very related question. I am trying to
replicate the analysis for the cluster based permutation test using the
code and the data provided. However, i run into two problems here

First, i get the following error if i use the original code:
Attempted to access cfg.frequency(2); index out of bounds because
numel(cfg.frequency)=1.

Error in ft_freqstatistics (line 187)
cfg.frequency = [max(cfg.frequency(1), fmin), min(cfg.frequency(2), fmax)];

Therefore , i change the input cfg.frequency=20 to cfg.frequency=[20 20].
However, then no significant clusters are found. Which becomes clear when
trying to plot the cluster or by looking at the output of
ft_freqstatistics.

Does the change in the code , change the output? How can i avoid the error
mentioned above and still get the same output from ft_freqstatistics as the
one provided on the webpage?


The relevant section of the toturial is provided below.
Thank you!

Victoria

Permutation test

Now, run *ft_freqstatistics
<http://www.fieldtriptoolbox.org/reference/ft_freqstatistics>* to compare
freqFIC_planar_cmb and freqFC_planar_cmb. Except for the field cfg.latency,
the following configuration is identical to the configuration that was used
for comparing event-related averages in the cluster-based permutation tests
on event related fields tutorial
<http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_timelock>.
Also see this tutorial
<http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_timelock> for
a detailed explanation of all the configuration settings. You can read more
about the *ft_prepare_neighbours
<http://www.fieldtriptoolbox.org/reference/ft_prepare_neighbours>* function
in the FAQ's
<http://www.fieldtriptoolbox.org/faq/how_does_ft_prepare_neighbours_work>.

To load the planar gradient TFRs (also available on the FieldTrip FTP
 servers,freqFIC_planar_cmb.mat
<ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/cluster_permutation_freq/freqFIC_planar_cmb.mat>
 and freqFC_planar_cmb.mat
<ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/cluster_permutation_freq/freqFC_planar_cmb.mat>),
use:

load freqFIC_planar_cmb
load freqFC_planar_cmb

cfg = [];
cfg.channel          = {'MEG', '-MLP31', '-MLO12'};
cfg.latency          = 'all';
cfg.frequency        = 20;
cfg.method           = 'montecarlo';
cfg.statistic        = 'ft_statfun_indepsamplesT';
cfg.correctm         = 'cluster';
cfg.clusteralpha     = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan        = 2;
cfg.tail             = 0;
cfg.clustertail      = 0;
cfg.alpha            = 0.025;
cfg.numrandomization = 500;
% prepare_neighbours determines what sensors may form clusters
cfg_neighb.method    = 'distance';
cfg.neighbours       = ft_prepare_neighbours(cfg_neighb, dataFC);

design = zeros(1,size(freqFIC_planar_cmb.powspctrm,1) +
size(freqFC_planar_cmb.powspctrm,1));
design(1,1:size(freqFIC_planar_cmb.powspctrm,1)) = 1;
design(1,(size(freqFIC_planar_cmb.powspctrm,1)+1):(size(freqFIC_planar_cmb.powspctrm,1)+...
  size(freqFC_planar_cmb.powspctrm,1))) = 2;

cfg.design           = design;
cfg.ivar             = 1;

[stat] = ft_freqstatistics(cfg, freqFIC_planar_cmb, freqFC_planar_cmb);



2016-01-18 17:57 GMT+00:00 Tzvetan Popov <tzvetan.popov at uni-konstanz.de>:

>
> Hi Victoria,
>
> oopsy, I think I confused you dramatically. I’m sorry for this. You are
> right I was only scrolling up to the part where the mags were analyzed. As
> for combining the MEG*2 and MEG*3 I was wrong there too. Of course you can
> threat them separately, as I was naively thinking as non-neuormag user, but
> indeed combination of both is recommended as I have now learned :-)(thanks
> Phillip). I ran the following steps and I guess this should work for you.
> best
> tzvetan
>
> %%
> cfg = [];
> ComCon = ft_combineplanar(cfg,FreqCon);
> %%
> cfg = []
> cfg.method = 'triangulation';
> cfg.layout           = 'neuromag306cmb.lay';
> cfg.senstype         = 'MEG';
> neighbours = ft_prepare_neighbours(cfg, ComCon)
> %%
> % plot neighbours
> cfg=[];
> cfg.neighbours = neighbours;
> cfg.layout           = 'neuromag306cmb.lay';
> ft_neighbourplot(cfg);
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160119/de08d8f1/attachment-0002.html>


More information about the fieldtrip mailing list