Issue with Vertices in Source Localization Analysis

It depends how you constructed your matrix X_ROI. if it has len(src[0]['vertno']) + len(src[1]['vertno']) rows and the first row contains the activity of the vertex with the number: src[0]['vertno'][0] I think your masking should work. :thinking:

It’s true that the numbering will differ, because not every vertex of the atlas has an associated source point (depends on the setup of the source space). It may be better to use the mne.extract_label_time_course function or similar, as the poster above suggested.

For verifying the ROI_vertices, I like:

brain = mne.viz.Brain('fsaverage', 'lh', 'pial', subjects_dir=subjects_dir)
brain.add_foci(ROI_vertices, hemi='lh', coords_as_verts=True, color='r', scale_factor=0.1)

which let’s you check whether the points you wanted have been selected. (I think for HCPMMP1 you would select more, because more stuff has V1 in the label.name.)