mne.io.read_raw_brainvision reads incorrect number of datapoints
See original GitHub issueI am writing a simple time series visualization script basing on MNE. I need to read data from EDF and BrainVision txt files, I have a sample that was exported to both. I discovered a strange behaviour that probably is a bug in mne.io.read_raw_brainvision
, it is illustrated by
#!/usr/bin/env python
import mne
edf = mne.io.read_raw_edf("datasets/example.edf")
bv = mne.io.read_raw_brainvision("datasets/dattxt/example.vhdr")
print("Number of datapoints per channel ", edf.n_times, bv.n_times)
which prints in my case ('Number of datapoints per channel ', 831488, 73)
. It can be found (together with sample data) in this repo. I would expect that edf.n_times
and bv.n_times
be equal.
Additionally, when I try to read data from bv
like so
data, time = bv[:, :1000]
I get
Traceback (most recent call last):
File "./test.py", line 9, in <module>
data, time = bv[:, :1000]
File "/home/arccha/.conda/envs/pfb/lib/python2.7/site-packages/mne/io/base.py", line 841, in __getitem__
verbose=self.verbose)
File "/home/arccha/.conda/envs/pfb/lib/python2.7/site-packages/mne/io/base.py", line 523, in _read_segment
cals, mult)
File "/home/arccha/.conda/envs/pfb/lib/python2.7/site-packages/mne/io/brainvision/brainvision.py", line 116, in _read_segment_file
_read_segments_c(self, data, idx, fi, start, stop, cals, mult)
File "/home/arccha/.conda/envs/pfb/lib/python2.7/site-packages/mne/io/brainvision/brainvision.py", line 174, in _read_segments_c
dtype = _fmt_dtype_dict[raw.orig_format]
TypeError: unhashable type: 'dict'
Am I doing something wrong or is it indeed a bug?
EDIT: I’ve tested this against MNE 0.15.2 and master branch.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
mne.io.read_raw_brainvision — MNE 1.3.dev0 documentation
Returns: rawinstance of RawBrainVision. A Raw object containing BrainVision data. See also. mne.io.Raw. Documentation of attribute and methods.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cbrnr as this files are rather big I’ve used GIT LFS to put them in the repository. You need to have it installed in order to clone them.
ok sounds like a plan
can you open a PR?