question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect number of samples error when loading a Synamps Neuroscan Curry file

See original GitHub issue

Describe the bug

When trying to read the data of a Neuroscan Synamps .dat file containing a recording with 128 EEG-electrodes, I am presented with the following error:

RuntimeError: Incorrect number of samples (7623792 != 24999876), please report this error to MNE-Python developers

The file loads correctly in Matlab using EEGLAB and the loadcurry plugin. I believe this issue to be different than #8391, since the number of channels looks correct and the reported number of samples is a lot smaller than the actual number of samples.

Steps to reproduce

import mne
mne.io.read_raw_curry('subject_01.dat', preload=True)

I cannot legally share the .dat data file, but the accompanying metadata files in the same directory can be found here:

Expected results

The file loads correctly

Actual results

Leaving device<->head transform as None (no landmarks found)
Reading 0 ... 1748799  =      0.000 ...  1748.799 secs...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<decorator-gen-242>", line 24, in read_raw_curry
  File "/data/Workspace/PhD/mne-python/mne/io/curry/curry.py", line 470, in read_raw_curry
    return RawCurry(fname, preload, verbose)
  File "<decorator-gen-243>", line 24, in __init__
  File "/data/Workspace/PhD/mne-python/mne/io/curry/curry.py", line 503, in __init__
    super(RawCurry, self).__init__(
  File "<decorator-gen-179>", line 24, in __init__
  File "/data/Workspace/PhD/mne-python/mne/io/base.py", line 254, in __init__
    self._preload_data(preload)
  File "/data/Workspace/PhD/mne-python/mne/io/base.py", line 534, in _preload_data
    self._data = self._read_segment(
  File "<decorator-gen-181>", line 24, in _read_segment
  File "/data/Workspace/PhD/mne-python/mne/io/base.py", line 419, in _read_segment
    _ReadSegmentFileProtector(self)._read_segment_file(
  File "/data/Workspace/PhD/mne-python/mne/io/base.py", line 2013, in _read_segment_file
    return self.__raw.__class__._read_segment_file(
  File "/data/Workspace/PhD/mne-python/mne/io/curry/curry.py", line 533, in _read_segment_file
    _read_segments_file(
  File "/data/Workspace/PhD/mne-python/mne/io/utils.py", line 222, in _read_segments_file
    raise RuntimeError('Incorrect number of samples (%s != %s), '
RuntimeError: Incorrect number of samples (7623792 != 24999876), please report this error to MNE-Python developers

Additional information

Platform:      Linux-5.11.11-200.fc33.x86_64-x86_64-with-glibc2.32
Python:        3.9.2 (default, Feb 20 2021, 00:00:00)  [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)]
Executable:    /data/Workspace/PhD/mne-python/.venv/bin/python
CPU:           x86_64: 12 cores
Memory:        Unavailable (requires "psutil" package)
mne:           0.23.dev0
numpy:         1.20.2 {blas=openblas, lapack=openblas}
scipy:         1.6.2
matplotlib:    Not found

sklearn:       Not found
numba:         Not found
nibabel:       Not found
nilearn:       Not found
dipy:          Not found
cupy:          Not found
pandas:        Not found
mayavi:        Not found
pyvista:       Not found
vtk:           Not found
``

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
arnevdkcommented, Jun 28, 2021

The .dat file contains 830491200 bytes with encoding binary. Here is a version of the file with all bytes overwritten with 0: https://cloud.vandenkerchove.com/index.php/s/XaPobpicDkGQrJf . After inispection, it looks like ignoring the error does not result in missing samples or channels, or corrupted samples or channels, but I might be missing some minor corruption. The number of samples loaded corresponds to the number of samples in the .dap file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Neuroscan FAQs
Install acquisition software (CURRY has 32 and 64 bit drivers for NuAmps; ... impossible to resolve many batch issues without the batch file...
Read more >
CURRY 8 User Guide
CURRY will assist in loading data and digitizer files, ... amplifier, the resulting filesize depends on the sampling rate and number of channels...
Read more >
loadcurry() - MSU College of Education
This EEGLAB toolbox is designed for loading data recorded with Compumedics Neuroscan CURRY neuroimaging suite software. The current version is compatible ...
Read more >
104 questions with answers in EEG SOFTWARE | Science topic
The sampling frequency represents the number of captured values (samples) in ... Data in the Eprime files correspond to good and wrong answers...
Read more >
An Action-Independent Role for Midfrontal Theta Activity Prior ...
Here, we aimed to test pre- and post-error EEG patterns for different types of motor responses and investigate the neuronal mechanisms leading to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found