You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appears to be a limitation with the mne.viz.plot_topomap function. When using the names parameter to display channel labels, the mask parameter affects which labels are shown, even in cases where it shouldn't. This behavior is inconsistent with the expected functionality of the mask parameter.
Steps to reproduce
Install MNE-Python and its dependencies.
Run the following code:
importmneimportnumpyasnp# Create a sample raw objectsample_data_folder=mne.datasets.sample.data_path()
sample_data_raw_file= (sample_data_folder/'MEG'/'sample'/'sample_audvis_raw.fif')
raw=mne.io.read_raw_fif(sample_data_raw_file, preload=True)
# Select only EEG channelsraw.pick_types(meg=False, eeg=True)
# Create dummy data for visualizationdata=np.random.rand(len(raw.ch_names))
# Case 1: No mask (all labels shown)mne.viz.plot_topomap(data, raw.info, names=raw.ch_names)
# Case 2: Mask with all False (should be equivalent to mask=None)mask=np.zeros(len(raw.ch_names), dtype=bool)
mne.viz.plot_topomap(data, raw.info, names=raw.ch_names, mask=mask)
# Case 3: Mask with some True valuesmask[0] =True# Set "EEG 001" to Truemne.viz.plot_topomap(data, raw.info, names=raw.ch_names, mask=mask)
Link to data
No response
Expected results
Case 1: All channel labels should be displayed.
Case 2: All channel labels should be displayed (equivalent to Case 1).
Case 3: All channel labels should be displayed, with "EEG 001" highlighted or emphasized due to the True value in the mask.
Actual results
Case 1: All channel labels are displayed correctly.
Case 2: No channel labels are displayed, despite the mask being all False (which according to the documentation is equivalent to the default None)
Case 3: Only the "EEG 001" label is displayed, corresponding to the True value in the mask. The other labels are missing.
Hah yes this seems like an internal confusion with how mask is interpreted. We should do with the labels whatever we do with the sensors themselves (and hopefully this is what we say will be done in the docstring). PR welcome to fix it!
Description of the problem
There appears to be a limitation with the mne.viz.plot_topomap function. When using the names parameter to display channel labels, the mask parameter affects which labels are shown, even in cases where it shouldn't. This behavior is inconsistent with the expected functionality of the mask parameter.
Steps to reproduce
Link to data
No response
Expected results
True
value in the mask.Actual results
None
)Additional information
The text was updated successfully, but these errors were encountered: