# error in reading brain vision raw files

**URL:** <https://mne.discourse.group/t/error-in-reading-brain-vision-raw-files/1248>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [June 26, 2017, 11:10pm UTC](https://mne.discourse.group/t/error-in-reading-brain-vision-raw-files/1248 "2017-06-26T23:10:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 26, 2017, 11:10pm UTC](https://mne.discourse.group/t/error-in-reading-brain-vision-raw-files/1248/1 "2017-06-26T23:10:25Z")

</div>

Dear MNE developers and users,

I had some problem opening brain vision files generated by Brain Vision's  
Recorder software. (files link  
[https://www.dropbox.com/sh/8b73u9hjc3ol2iw/AACQVhe\_az7Mie8Qm-IQQxN\_a?dl=0](https://www.dropbox.com/sh/8b73u9hjc3ol2iw/AACQVhe_az7Mie8Qm-IQQxN_a?dl=0)).  
Previously, I was able to open other brain vision raw files.

mne.io.read\_raw\_brainvision("test\_bv\_files/test6.vhdr")  
Extracting parameters from test\_bv\_files/test6.vhdr...  
Traceback (most recent call last):  
&nbsp;&nbsp;File "\<stdin\>", line 1, in \<module\>  
&nbsp;&nbsp;File "/home/ying/anaconda2/lib/python2.7/site-packages/mne/  
io/brainvision/brainvision.py", line 717, in read\_raw\_brainvision  
&nbsp;&nbsp;&nbsp;&nbsp;event\_id=event\_id, verbose=verbose)  
&nbsp;&nbsp;File "\<string\>", line 2, in \_\_init\_\_  
&nbsp;&nbsp;File "/home/ying/anaconda2/lib/python2.7/site-packages/mne/utils.py",  
line 707, in verbose  
&nbsp;&nbsp;&nbsp;&nbsp;return function(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "/home/ying/anaconda2/lib/python2.7/site-packages/mne/  
io/brainvision/brainvision.py", line 85, in \_\_init\_\_  
&nbsp;&nbsp;&nbsp;&nbsp;\_get\_vhdr\_info(vhdr\_fname, eog, misc, scale, montage)  
&nbsp;&nbsp;File "/home/ying/anaconda2/lib/python2.7/site-packages/mne/  
io/brainvision/brainvision.py", line 512, in \_get\_vhdr\_info  
&nbsp;&nbsp;&nbsp;&nbsp;assert ch in line\_amp  
AssertionError

The error seemed to indicate some format issue in the header file. I have  
manually looked at the header file, but could not find anything that might  
cause the issue.

Any input is appreciated! Thanks.

Best,  
Ying  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20170626/5b3f3281/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170626/5b3f3281/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 27, 2017, 6:25am UTC](https://mne.discourse.group/t/error-in-reading-brain-vision-raw-files/1248/2 "2017-06-27T06:25:13Z")

</div>

Hi Ying,

I checked the file, and the problem is with channels named 'photosensor'  
and 'respiration'. In the code the splitting function uses multiple spaces  
as the separator, so for now, adding one more space after the channel name  
in the header fixes it ('photosensor 129' -\> photosensor 129'). See also  
[https://github.com/mne-tools/mne-python/pull/4354](https://github.com/mne-tools/mne-python/pull/4354).

Hope this helps.  
-Jaakko
