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)