[FieldTrip] Error using ft_clusterplot (line 153)

MUSTAFA YAVUZ m.yavuz.18 at ogr.iu.edu.tr
Wed Jun 2 16:47:03 CEST 2021


Dear Bruno,

Thank you for your clarification. I guess the difference between your
example and the FT documentation is that the example on the webpage only
focuses on 1 frequency bin (e.g. 20  Hz). I guess the difference with your
example would be this which affects your data structure to be plotted.


Best wishes,
Mustafa

Bruno Mansur via fieldtrip <fieldtrip at science.ru.nl>, 2 Haz 2021 Çar, 17:30
tarihinde şunu yazdı:

> Dear Mustafa,
>
> Thanks a lot for your answer!
>
> The result I'm pursuing is similar to the one in the tutorial found in the
> fieldtrip webpage in the section '*within subjects experiments*':
>
> https://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq/#within-subjects-experiments
>
> There they use the function *ft_clusterplot* to plot the data structure
> in a figure containing subplots, spaced by a certain time interval. I would
> like to reproduce that with my data.
> Besides that, I don't know if the *ft_multiplotTFR* function would
> account for the spatial resolution of the cluster formations, because it
> just plots the freq range over a time axis for each electrode,
> independently.
>
> Best,
>
> Am Di., 1. Juni 2021 um 17:48 Uhr schrieb MUSTAFA YAVUZ via fieldtrip <
> fieldtrip at science.ru.nl>:
>
>> Dear Bruno,
>>
>> As far as I know, ft_clusterplot cannot handle the given data structure
>> of your stat output variable. You may consider using ft_multiplotTFR with
>> the mask created by the ft_freqstatistics by adding the mask to the struct
>> data you have for plotting.
>>
>> For instance;
>> %% Prior to calling plot functions;
>> your_TFR_data_to_be_plotted.mask = your_stat_variable.mask
>> cfg = [];
>> cfg.layout = your_layout;
>> cfg.maskparameter = 'mask';
>> cfg.maskstyle = 'outline';
>> ft_multiplotTFR(cfg,your_TFR_data_to_be_plotted)
>>
>>
>> Hope I am not mistaken and it helps,
>> Best,
>> Mustafa
>>
>> Bruno Mansur via fieldtrip <fieldtrip at science.ru.nl>, 1 Haz 2021 Sal,
>> 17:35 tarihinde şunu yazdı:
>>
>>> Dear fieldtrip list members,
>>>
>>> I'm trying to perform a *cluster based permutation test* on
>>> *time-frequency* data obtained from 'FT_FREQANALYSIS'.
>>>
>>> I execute the following command for it:
>>>
>>> % 2. Permutation test
>>>
>>> cfg = [];
>>> cfg.channel           = {'EEG'};
>>> cfg.latency            = [0 1.8];
>>> cfg.frequency        = 'all';% all frequencies from 2 to 48
>>> cfg.method            = 'montecarlo';
>>> cfg.statistic            = 'ft_statfun_depsamplesT';
>>> cfg.correctm          = 'cluster';
>>> cfg.clusteralpha     = 0.05;
>>> cfg.clusterstatistic  = 'maxsum';
>>> cfg.minnbchan       = 2;
>>> cfg.tail                    = 0;
>>> cfg.clustertail         = 0;
>>> cfg.alpha                = 0.05;
>>> cfg.numrandomization = 500;
>>>
>>> % 3. Find the channel neighbours for spatial clustering
>>>
>>> cfg_neighb.method    = 'distance';
>>> cfg.neighbours       = ft_prepare_neighbours(cfg_neighb,
>>> Tfr_Ogt_ogt{1,1});
>>>
>>> ft_neighbourplot(cfg_neighb, Tfr_Ogt_ogt{1:1})% to check neighbours
>>>
>>> %------------------------
>>>
>>> % 4. Setting the design for the cluster permutation test
>>>
>>> Nsubj  = 33;
>>> design = zeros(2, Nsubj*2);
>>> design(1,:) = [1:Nsubj 1:Nsubj];
>>> design(2,:) = [ones(1,Nsubj) ones(1,Nsubj)*2];
>>>
>>> cfg.design = design;
>>> cfg.uvar   = 1;
>>> cfg.ivar   = 2;
>>>
>>> [stat] = ft_freqstatistics(cfg, Tfr_Ogt_ogt{:}, Tfr_Ogt_low{:});
>>>
>>> %
>>> ------------------------------------------------------------------------
>>>
>>> Until here I get no error messages and the 'stat' variable seems to have
>>> been created (I got 14 negative clusters). Though *when I try plotting
>>> it, I get the following error message*;
>>>
>>> Input:
>>> % 5. Plot with ft_clusterplot:
>>>
>>> cfg = [];
>>> cfg.alpha  = 0.05;
>>> cfg.parameter = 'stat';
>>> cfg.zlim   = 'maxmin';
>>> cfg.layout = 'acticap-64ch-standard2.mat';
>>> ft_clusterplot(cfg, stat);
>>>
>>> Output:
>>>
>>> >> cfg = [];
>>> cfg.alpha  = 0.05;
>>> cfg.parameter = 'stat';
>>> cfg.zlim   = 'maxmin';
>>> cfg.layout = 'acticap-64ch-standard2.mat';
>>> ft_clusterplot(cfg, stat);
>>> the input is freq data with 64 channels, 48 frequencybins and 37 timebins
>>> reading layout from file acticap-64ch-standard2.mat
>>> the call to "ft_prepare_layout" took 0 seconds and required the
>>> additional allocation of an estimated 0 MB
>>>
>>> *Error using ft_clusterplot (line 153)if you input time-frequency data
>>> this only works if either frequency or time is a singleton dimension*
>>>
>>> Does anyone know what I can do to plot my data correctly? I would really
>>> appreciate any inputs.
>>>
>>> Best,
>>>
>>> --
>>> *Bruno*
>>> _______________________________________________
>>> fieldtrip mailing list
>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>> https://doi.org/10.1371/journal.pcbi.1002202
>>>
>>
>>
>> --
>> *Mustafa Yavuz *
>>
>> M.Sc. in Neuroscience
>> RA in HUBAL Neuroimaging Unit
>> Department of Neuroscience
>> İstanbul University
>> _______________________________________________
>> fieldtrip mailing list
>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> https://doi.org/10.1371/journal.pcbi.1002202
>>
>
>
> --
> *Bruno de Matos Mansur, M.Sc.*
> Neurocybernetics und Rehabilitation
> University Hospital Magdeburg
> Leipziger Strasse 44, 39120 Magdeburg, Germany
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>


-- 
*Mustafa Yavuz *

M.Sc. in Neuroscience
RA in HUBAL Neuroimaging Unit
Department of Neuroscience
İstanbul University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210602/1bb73d9a/attachment.htm>


More information about the fieldtrip mailing list