FIX: Add brainvision captrack ref channels when set_montage#6797
FIX: Add brainvision captrack ref channels when set_montage#6797larsoner merged 9 commits intomne-tools:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6797 +/- ##
==========================================
+ Coverage 89.59% 89.63% +0.04%
==========================================
Files 422 422
Lines 76406 76486 +80
Branches 12490 12500 +10
==========================================
+ Hits 68458 68561 +103
+ Misses 5138 5122 -16
+ Partials 2810 2803 -7 |
|
I've been trying to find what where this 'GND' and 'REF' locations in the doc and googling but I couldn't find it. @agramfort suggested to plot the postitions and if they are truly the same as import os.path as op
from mne.channels import (Montage, read_montage, read_dig_montage,
get_builtin_montages, DigMontage,
read_dig_egi, read_dig_captrack, read_dig_fif,
make_standard_montage)
from mne import create_info
import mne
import matplotlib.pyplot as plt
from mne.viz import plot_alignment, set_3d_view
from mne.datasets import fetch_fsaverage
plt.switch_backend('Qt5Agg')
data_path = mne.datasets.testing.data_path(download=False)
subjects_dir = op.dirname(fetch_fsaverage())
montage = read_dig_captrack(
fname=op.join(data_path, 'montage', 'captrak_coords.bvct')
)
info = create_info(ch_names=['GND', 'REF'], sfreq=1, ch_types='eeg',
montage=montage)
fig = plot_alignment(
info=info,
show_axes=True, dig=True, surfaces='head', trans=None,
subject='fsaverage', subjects_dir=subjects_dir,
)
set_3d_view(figure=fig, azimuth=135, elevation=80)What I would do is what this PR is doing, add those channels and positions to the montage. |
|
it's weird to have both GND and REF. One should correspond to EEG000 with neuromag/fif conventions. If it's not called EEG000 then set_montage should be modified to understand that GND or REF are the reference. @jona-sassenhagen @mmagnuski any idea what GND or REF correspond to here and why there are two things? Should we ignore GND and just take REF as the EEG000 electrode? |
|
This is why: https://pressrelease.brainproducts.com/referencing/#11 In the end we can ignore the ground and use REF as EEG000 |
|
ok this changes one of the dig['ident'] with respect of the fif reference file. Not really sure why. Any clues? |
It is possible that in this instance we are actually doing something better/more correct than the C code, for example if it does not have an |
|
Ok then, I'll ignore |
|
@larsoner I did it for one of the two. The other one is more annoying. Please merge if green and happy |
|
Thanks @massich @agramfort |
…s#6797) * WIP: Add ref * revert reference in set_montage * Add REF back * Just use the position for comparison since the reference is incomplete * fix tests * ups * keep GND * cleanup * address comments

fixes #6788
However I'm not sure that this is the right call. It does not
make sense that a single montage has 2 reference points.
And atleast in our test file we have 'GND' and 'REF' in the
same file. Which also seems to be the case
in https://github.com/mne-tools/mne-python/blob/master/mne/io/brainvision/tests/data/test.hpts
as reported #6764 (comment)
cc: @sappelhoff, @agramfort