Skip to content

Read montage from a .bvef file #7114

@WilliamLabCea

Description

@WilliamLabCea

Hi,

I meet some difficulties when I want to load a .bvef (montage files with mne 0.19.2). With previous version of mne (0.18.2) I used 'mne.channels.read_montage' function to load .bvef

With the new function 'mne.channels.read_custom_montage' mne report an value error:

Montage_fname = "/MontageAntneuro2.bvef" ...Montage = mne.channels.read_custom_montage(Montage_fname, head_size=None, unit='auto') raw = mne.io.read_raw_brainvision(vhdr_fname, montage=Montage, misc='auto', scale=1.0, preload=True, ... verbose=None) Extracting parameters from /media/258884/VERBATIM HD/EEG_Data/EEG_SoundTTC_2sp/Pilote-EEG2_YN_2019-12-04_14-54-58.vhdr... Setting channel info structure... Reading 0 ... 481250 = 0.000 ... 939.941 secs... <input>:2: RuntimeWarning: Limited 1 annotation(s) that were expanding outside the data range. Traceback (most recent call last): File "<input>", line 2, in <module> File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/io/brainvision/brainvision.py", line 825, in read_raw_brainvision verbose=verbose) File "</home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/externals/decorator.py:decorator-gen-151>", line 2, in __init__ File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/utils/_logging.py", line 90, in wrapper return function(*args, **kwargs) File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/io/brainvision/brainvision.py", line 100, in __init__ _deprecate_montage(self, "read_raw_brainvision", montage) File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/io/utils.py", line 32, in _deprecate_montage raw.set_montage(montage, **kwargs) File "</home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/externals/decorator.py:decorator-gen-30>", line 2, in set_montage File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/utils/_logging.py", line 90, in wrapper return function(*args, **kwargs) File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/channels/channels.py", line 488, in set_montage set_dig=set_dig, raise_if_subset=raise_if_subset) File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/channels/montage.py", line 1545, in _set_montage _mnt = _get_montage_in_head(montage) File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/channels/montage.py", line 1356, in _get_montage_in_head return transform_to_head(montage.copy()) File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/channels/montage.py", line 935, in transform_to_head native_head_t = get_ras_to_neuromag_trans(nasion, lpa, rpa) File "/home/258884/anaconda3/envs/NewPycharm/lib/python3.7/site-packages/mne/transforms.py", line 650, in get_ras_to_neuromag_trans raise ValueError("Points have to be provided as one dimensional " ValueError: Points have to be provided as one dimensional arrays of length 3.

Thanks for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions