[Mne_analysis] BrainVision files

Boris BURLE boris.burle at univ-amu.fr
Tue Jan 5 04:17:59 EST 2016
Search archives:

Dear colleagues,

I'm just starting to use MNE-python, and I face a problem opening 
BrainVisionAnalyer files. When calling the 
"mne.io.read_raw_brainvision", I get the following error (full traceback 
at the end):

--> 462     params, settings = settings.split('[Comment]')
     463     cfg = configparser.ConfigParser()
     464     if hasattr(cfg, 'read_file'):  # newer API

ValueError: need more than 1 value to unpack

It appears that 'read_raw_brainvision' is searching for a "section" 
untitled "Comment" in the header (vhdr) file. I have been using 
BrainVision files quite a lot (actually, I would like to get rid of it 
by using mne-python...), and I never encountered such a "Comment" field 
in my vhdr files. However, I always worked with data **exported** from 
BrainVision, not acquired with it. So I guess the "Comment" field the 
parser is searching might come from the files created by 
BrainVisionRecorder. But since I do not have any such file, I cannot check.

I do have python code that, I believe, open all variants of files 
**exported** from BrainVisionAnalyser (be they ASCII or binary, 16, 32 
... bits etc...). The code outputs a dictionary for the header (vhdr) 
file, a numpy.array for the data, and a list of events for the 
markers/events/triggers. Although I guess it should also open files 
created by BrainVisionRecorder, I cannot be sure.

So, if someone could provide me with a small file that is currently 
openable by "mne.io.read_raw_brainvision", I would be happy to check 
whether my code also open it. And, if you find it useful, I would be 
more than happy to share the code and adapt it to mne-python (with a bit 
of help from you, probably ...)

   All the best,
     B.

full traceback:
In [4]: mne.io.read_raw_brainvision('COUBA_EMG_PC_CompLeft.vhdr')
Extracting eeg Parameters from COUBA_EMG_PC_CompLeft.vhdr...
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-b9123e703050> in <module>()
----> 1 mne.io.read_raw_brainvision('COUBA_EMG_PC_CompLeft.vhdr')

/usr/lib/python2.7/dist-packages/mne/io/brainvision/brainvision.pyc in 
read_raw_brainvision(vhdr_fname, elp_fname, elp_names, preload, 
reference, eog, ch_names, verbose)
     681     """
     682     raw = RawBrainVision(vhdr_fname, elp_fname, elp_names, preload,
--> 683                          reference, eog, ch_names, verbose)
     684     return raw

/usr/lib/python2.7/dist-packages/mne/io/brainvision/brainvision.pyc in 
__init__(self, vhdr_fname, elp_fname, elp_names, preload, reference, 
eog, ch_names, verbose)

/usr/lib/python2.7/dist-packages/mne/utils.pyc in verbose(function, 
*args, **kwargs)
     549         return ret
     550     else:
--> 551         ret = function(*args, **kwargs)
     552         return ret
     553

/usr/lib/python2.7/dist-packages/mne/io/brainvision/brainvision.pyc in 
__init__(self, vhdr_fname, elp_fname, elp_names, preload, reference, 
eog, ch_names, verbose)
      82         self.info, self._eeg_info, events = 
_get_eeg_info(vhdr_fname,
      83 
elp_fname, elp_names,
---> 84 
reference, eog)
      85         self.set_brainvision_events(events)
      86         logger.info('Creating Raw.info structure...')

/usr/lib/python2.7/dist-packages/mne/io/brainvision/brainvision.pyc in 
_get_eeg_info(vhdr_fname, elp_fname, elp_names, reference, eog)
     460         settings = f.read()
     461
--> 462     params, settings = settings.split('[Comment]')
     463     cfg = configparser.ConfigParser()
     464     if hasattr(cfg, 'read_file'):  # newer API

ValueError: need more than 1 value to unpack

In [5]:


More information about the Mne_analysis mailing list