[Mne_analysis] ValueError: connectivity must be of the correct size

Nicola Jastrzebski njasterzebski at swin.edu.au
Wed Oct 21 22:23:25 EDT 2015
Search archives:

Hello MNE list I hope you are well,



I have been using the spatio-temporal cluster analysis of MEG sources found in the MNE-Python examples page, however have had no success in getting significant clusters for within or between groups differences for any of my conditions -- even with a p_threshold of .05. I have tried almost everything I can think of to get sig. clusters, but wont bore you with the details, it was getting pretty depressing.



>From looking at each of my subjects individually, I think it might have had something to do with  inter-subject variability of the all ready diffuse source distributions. My MEG experiments involved visual stimulation that spanned quite widely across the visual field (surround-masking), and now I think I'm paying for that through multiple comparisons overkill!



Anyway, I felt hope anew when I recently encountered the hack Denis Engemann created to do the same type of cluster analysis, only within labels. This will reduce my multiple comparisons problem substantially yeah?



https://gist.github.com/dengemann/ea482183be869568412c

In running this analysis, I have successfully managed to read in each of my subjects labels, tack them to each subjects source/stc file, and then morph them to the average brain I made in MNE-C. While it reads in all my data well, things go awry however, after I run the permutations...



This is the line of code that my label based cluster analysis hates:



T_obs, clusters, cluster_p_values, H0 = clu =\
                spatio_temporal_cluster_test(X, connectivity=connectivity, n_jobs=2,
                 threshold=f_threshold, n_permutations=n_permutations, tail=1)

After a minute or 2 of running the permutations without hassle, it spits out the following complaint:

707 if connectivity is not None:



--> 708 connectivity = _setup_connectivity(connectivity, n_tests, n_times)
709
710 if (exclude is not None) and not exclude.size == n_tests:



/mne/stats/cluster_level.pyc in _setup_connectivity(connectivity, n_vertices, n_times)



520 else: # use temporal adjacency algorithm
521 if not round(n_vertices / float(connectivity.shape[0])) == n_times:
--> 522 raise ValueError('connectivity must be of the correct size')
523 # we claim to only use upper triangular part... not true here
524 connectivity = (connectivity + connectivity.transpose()).tocsr()





ValueError: connectivity must be of the correct size



>From my limited understanding, I figure that one or more of my labels are broken somehow. I don't understand what is meant by 'connectivity must be of the correct size', or what I need to do to my subjects labels in order to run the permutations succesfully.



I really wouldn't know where to begin on how to overcome this issue, and would be very grateful for any clarification on what is meant by 'connectivity must be of the correct size', and what I need to do to fix this.



Thank you in advance,



Nikki

______________________________________________________
Nicola Jastrzebski

PhD candidate
Brain and Psychological Sciences Research Centre (BPsyC)

Swinburne University of Technology - Hawthorn campus
______________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20151022/3aaa44f1/attachment.html 


More information about the Mne_analysis mailing list