- MNE-Python version: 0.22.1
- operating system: macOS Big Sur, version 11.0
Dear mne-pythonistas,
we are testing volume source space reconstruction with @mmagnuski
and stumbled across a problem with volume source space label identification.
In short - none of the large labels that we tested could be found in the volume source space.
For example after doing:
vol_stc_label = stc.in_label('wm-lh-supramarginal', mri, src)
We get the following message:
Reading a source space...
[done]
1 source spaces read
Reading atlas /Users/futuru/Dropbox/DATA/DiamSar/diamsar_theta/test_volume_src_in_label/src/fsaverage/mri/aseg.mgz
0/1 atlas regions had at least one vertex in the source space
The alignment of the mri and the volume source space looks ok:
We tried to narrow down the problem in the debugging mode and found that
in _volume_labels
function _get_atlas_values
returns following unique
values and counts:
(array([ 0., 2., 3., 4., 5., 7., 8., 10., 11., 12., 13.,
14., 15., 16., 17., 18., 24., 26., 28., 30., 31., 41.,
42., 43., 44., 46., 47., 49., 50., 51., 52., 53., 54.,
58., 60., 63., 251., 252., 253., 254., 255.]), array([5756, 2055, 2538, 160, 5, 103, 531, 68, 30, 57, 15,
17, 16, 208, 39, 14, 12, 7, 44, 1, 16, 2102,
2522, 152, 6, 104, 503, 73, 34, 59, 15, 42, 19,
5, 41, 3, 9, 5, 3, 5, 8]))
None of the volume source space atlas values matches the label value:
labels.values()
dict_values([3031])
We are not sure who is to blame: us (user error) or mne-python (bug).
To help reproducing the problem here is the code we use:
the required files can be found in this Dropbox directory: