question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding a reference does not work after a montage has been set

See original GitHub issue

The order in which you perform assigning a montage and adding a reference matters, which probably shouldn’t be the case.

Consider the following example using the testing data from mne/io/brainvision/tests/data/test.* (the first two lines could be combined by supplying the montage argument in the call to mne.io.read_raw_brainvision):

raw = mne.io.read_raw_brainvision("test.vhdr", preload=True)
raw.set_montage("standard_1020")
raw = mne.io.add_reference_channels(raw, "T3")

This assigns the montage first and then adds a new reference channel which wasn’t part of the data. This produces a RuntimeWarning: The locations of multiple reference channels are ignored (set to zero)., which results in an incorrect location of the newly added channel T3.

If instead you first add the reference channel and then set the montage, everything works as expected:

raw = mne.io.read_raw_brainvision("test.vhdr", preload=True)
raw = mne.io.add_reference_channels(raw, "T3")
raw.set_montage("standard_1020")

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
massichcommented, Jun 7, 2019

I guess I should make an issue with the notes of the plan we discussed with @larsoner so that is easier to follow the status for everyone. Right now I only have messy notes.

1reaction
agramfortcommented, Oct 19, 2018

I prefer the clear doc + warning approach than the more magical one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MONTAGE Owner's Manual - Yamaha Music
- Some object has been dropped into the instrument. - There is a sudden loss of sound during use of the instrument. Power...
Read more >
BESA Research Montage Editor
Each new click will alternately define a new montage channel and its reference. When done adding new channels, click on the Set chan....
Read more >
Tutorials/MontageEditor - Brainstorm
The montages are not applied to the recordings, they are for visualization only. To re-reference correctly your EEG recordings, use the process ...
Read more >
Everything You Need to Know About Montages - ScreenCraft
Montages are the visual equivalent of the idea that a whole can be ... There's nothing wrong with a good montage sequence, so...
Read more >
How To Play A Random Animation Montage - YouTube
Hey guys, in today's video, I'm going to be showing you how to play a random animation montage. ... Your browser can 't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found