treder / MVPA-Light

Matlab toolbox for classification and regression of multi-dimensional data
MIT License
70 stars 35 forks source link

Searchlight analysis on MEG data #35

Closed SanjeevNara-01 closed 2 years ago

SanjeevNara-01 commented 2 years ago

Hi Matthias,

I am using MVPA light to implement the searchlight method for 204-channel MEG gradiometer data. When I use a searchlight without neighbours, I see an effect in the right hemisphere which actually make sense to me, but when I specify two neighbours to make the topo-plot smoother, the statistical analysis shows almost all the channels as significant channels. I used a permutation test with cluster correction (50000 iterations).

Could you please suggest why are increasing neighbours creating this problem?

I used the following code for searchlight (without neighbours): cfg = []; cfg.metric = 'auc'; cfg.cv = 'kfold'; cfg.k = 5; cfg.repeat = 10; cfg.preprocess = 'undersample'; cfg.feature_dimension = 3; % now the time points act as features cfg.dimension_names = {'samples' 'electrodes' 'time points'}; % name the dimensions for nicer output [perf_auc_searchlight_logreg{comparisions,n_sub}, result_auc_searchlight_logreg{comparisions,n_sub}] = mv_classify(cfg, dat.trial, clabel);

For neighbours:

     cfg=[];
    cfg_neighb=[];
    cfg_neighb.method        = 'template';
    cfg_neighb.template      = 'neuromag306planar_neighb.mat';
    neighbours               = ft_prepare_neighbours (cfg_neighb)

   nChan = numel(dat.label);

    % Create neighbours matrix
    nb_mat = zeros(nChan);

    for ii=1:nChan

        % Find index of current channel in neighbours array
        idx = find(ismember({neighbours.label},dat.label{ii}));

        % Find indices of its neighbours in dat.label
        idx_nb = find(ismember(dat.label, neighbours(idx).neighblabel))';

        % We only take 2 neighbours
        nb_mat(ii,[ii, idx_nb]) = 1;

    end

    cfg = [];
    cfg.metric              = 'auc';
    cfg.cv              = 'kfold';
    cfg.k               = 5;
    cfg.repeat          = 10;
    cfg.neighbours = nb_mat;
    cfg.average = 1;
    cfg.preprocess      = 'undersample';
    cfg.feature_dimension   = 3;        % now the time points act as features
    cfg.dimension_names     = {'samples' 'electrodes' 'time points'}; % name the dimensions for nicer output
    [perf_auc_searchlight_logreg{comparisions,n_sub}, result_auc_searchlight_logreg{comparisions,n_sub}] = mv_classify(cfg, 

dat.trial, clabel);

Could you please suggest your expert opinion to resolve the issue?

Thanks

Best regards Sanjeev

image

image