Disappearing EEG montages

Hello!

When I create new custom EEG montages, they keep disappearing among those available, i.e. they do not show up in the list as in the picture. Also, if I try to save a new montage with a previously disappeared name, I receive a notice saying that it already exists.

I am working with matlab R2018a.

Thank you!

The montages displayed in the montage editor depend on the signals that are displayed in the selected figure, it may not represent all the montages that could be applied for this dataset.

The function that guesses which montages are available is the following:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/gui/panel_montage.m#L1197
The part I suspect to be dysfunctional is the last test:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/gui/panel_montage.m#L1256
If you are familiar with Matlab coding/debugging, you could check this out and suggest a better test.

In case the pre-selection is not satisfying, you can always display all the available montages by clicking on the button "ALL", just above the list of montages.
The problem is that if the montage you want to edit is not in this list, it would not show either in the list of available montages for the figure (in the Montages popup menu for the figure, or in the Record tab)

Hi Francois,

That is indeed the offending piece of code - it's somehow removing the montages we want to use though they make sense for the channels and references. We both tried it on several databases, Matlab and Brainstorm versions. We can see but not select the desired montage using the ALL button, and same for new montages made on the same traces, they are not accessible. I'm afraid we are not coders enough to suggest and debug a better solution - but we do have an ugly work-around (the montage is essential to our sleep scoring). We can comment the lines 1248-1261 in panel_montage. This means all montages appear in the drop-down menu and we can't access the ones we want as they're off the page and it doesn't scroll, but if we make a new one and rename it AAA_..., it appears at the top of the list and can be used for visualization. (I know this will have to be redone each time we update brainstorm, so is not a great solution.)

Best,

Emily

To improve the tests that reject montages that are not applicable, it would help me a lot to know what is the list of channels in your recordings and in your montages.
Please .zip together the channel.mat of your recordings and the montage_*.mat file you can't use (in the montage editor with the button ALL selected, click on the montage, then on the save button - change the file format to "brainstorm .mat"). Upload this file somewhere and copy the download link here.

Thanks

Hi Francois,

Here are channel and montage .mat files.

Thanks!
Keelin

Thanks for the example montage.
The problem was that the montages were selected based on the channels available in the figure instead of all the channels available in the channel file. If you were displaying MEG signals, your montage was not selected because it does not contain any MEG channel. But it was available when reviewing EMG signals (right-click on the data file > EMG > Display time series).

As this was not very intuitive, I changed the logic to allow all montages matching any channel of the channel file, even if this is not the appropriate modality that is displayed in the first place:
https://github.com/brainstorm-tools/brainstorm3/commit/56e2c299b4b0a1f05bc416da505cb0d145b41530
Update Brainstorm to get this fix.

However, this would also have other undesirable side effects. If you display the EMG+C4 channels starting from an MEG time series figure, you would get all the contextual menus and default options associated with MEG signals, because the figure is still registered as "MEG".
Therefore, for displaying montages that are mostly containing EEG or EMG channels, prefer using the appropriate modality in the first place (right-click on data file > EEG/EMG > Display time series) instead of simply double-clicking on the file (with opens the MEG by default).

1 Like

Thanks, Francois!