Computing Connectivity 1Samp Cluster

External Email - Use Caution

Hello,

I am trying to compute the connectivity matrix after having morphed all my Ss to fsaverage so I can perform a cluster permutation test. I keep getting this error:

ValueError: connectivity (len 8196) must be of the correct size, i.e. be equal to or evenly divide the number of tests (50370156).

If connectivity was computed for a source space, try using the fwd["src"] or inv["src"] as some original source space vertices can be excluded during forward computation

This is the function I am using to get stcs for each Subject and Condition;

def morph_data_to_fsaverage(subject, inverse, path6, stc, save_dir, subjects_dir, method, overwrite):
    inverse_operator = read_inverse_operator(inverse + subject + '-inv.fif') # each subject inv file
    src=mne.read_source_spaces(path6 +'fsaverage-oct-6-src.fif') #fsaverage src

    stcs = mne.read_source_estimate(stc + subject + '_' + 'NS' + '_' + 'dSPM' + '-lh.stc') # only left hemisphere

    subject_to = 'fsaverage'
    stc_morph_name = subject + '_' + 'VO6' + '_' + method + '_morph'
    stc_morph_path = save_dir + stc_morph_name

    src=inverse_operator['src']
    stcs_morph = mne.compute_source_morph(src,subject_to,
                                                    subjects_dir=subjects_dir).apply(stcs)

    stcs_morph.save(stc_morph_path)

External Email - Use Caution

    inverse_operator = read_inverse_operator(inverse + subject +
'-inv.fif') # each subject inv file
    stcs_morph = mne.compute_source_morph(src,subject_to,

subjects_dir=subjects_dir).apply(stcs)

Here the "spacing" parameter controls the destination source space. The
default is "5", which means "ico-5 source space for fsaverage", which has
20484 total vertices. If you look at `stcs_morph.vertices`, it should be a
list of two arrays, each array containing np.arange(10242) (fsaverage is
special in that its ico-5 source space consists of the first 10242 vertices
in each hemisphere).

If you want to use your ico-6 fsaverage source space (which has 8196
vertices) as the destination, you'd want to do something like:

src_fs = mne.read_source_spaces(path6 +'fsaverage-oct-6-src.fif')
morpher = mne.compute_source_morph(src, subject_to,
spacing=[src_fs[0]['vertno'], src_fs[1]['vertno']])
stcs_morph = morpher.apply(stcs)

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20191030/782fa503/attachment.html