Skip to content

AttributeError during reading the raw MEG fif file using read_raw_fif #7844

Closed

Description

@levchenkoegor

Hello!

I tried to read my raw MEG .fif file using the mne.io.read_raw_fif function and the next error apperas:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "Y:\LevchenkoE\ISC\Experiment3_videos_MEG\MCCA-MEG\venv\lib\site-packages\mne\io\fiff\raw.py", line 453, in read_raw_fif preload=preload, verbose=verbose)

  File "<decorator-gen-169>", line 21, in __init__

  File "Y:\LevchenkoE\ISC\Experiment3_videos_MEG\MCCA-MEG\venv\lib\site-packages\mne\io\fiff\raw.py", line 117, in __init__ self._preload_data(preload)
  File "<decorator-gen-150>", line 21, in _preload_data

  File "Y:\LevchenkoE\ISC\Experiment3_videos_MEG\MCCA-MEG\venv\lib\site-packages\mne\io\base.py", line 488, in _preload_data self._data = self._read_segment(data_buffer=data_buffer)

  File "<decorator-gen-148>", line 21, in _read_segment

  File "Y:\LevchenkoE\ISC\Experiment3_videos_MEG\MCCA-MEG\venv\lib\site-packages\mne\io\base.py", line 387, in _read_segment cals, mult)

  File "Y:\LevchenkoE\ISC\Experiment3_videos_MEG\MCCA-MEG\venv\lib\site-packages\mne\io\fiff\raw.py", line 355, in _read_segment_file one.shape = (picksamp, self.info['nchan'])

AttributeError: 'NoneType' object has no attribute 'shape'

I tried to read the same file with BrainStrom and it is reading successfully, but without events. At the same time if I open the raw file without preload=True parameter I can see the events:

[{'channels': array([309]), 
'list': array([358353,      0,      1, 358358,      
1,      0, 388651,      0,
2, 388657,      2,      0])}]

For me this is very strange because I can read other files of the same subject. The parameters of recording were exactly the same. The record is splitted to several files just because our MEG system cannot record more than 2Gb in one file and that is why, during the break, we need to push stop (and save the file) and start recording to a new file, but the acquistion parameters weren't changed at all.

I have attached the link to files: one readable (good) and one with an error (bad).

I am using:
mne '0.20.0'
python '3.7.3'

Do you have any ideas?

Activity

  1. larsoner commented on May 28, 2020

    @larsoner
    Member

    Was this file produced by the standard acquisition system? The FIF tag header in one of the raw buffers says that there is no data:

    <Tag | kind 0 - type 0 - size 0 - next 0 - pos 0 - data None>
    

    This is despite the entry in the FIF directory tree indicating that it should be non-zero:

    <Tag | kind 300 - type 3 - size 1292000 - next 842462849 - pos 842462849 - data None>
    

    We can turn this into a series of zeros, but to properly mark it as an acquisition skip will be a bit harder...

    It would be better to fix this at the acquisition end if possible instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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