2

I tried to run this 3 lines of Code:

import mne

myfile = 'test_raw.fif'
raw = mne.io.read_raw_fif(myfile)

It should load a .fif-File Its the example from http://martinos.org/mne/stable/index.html

When I try it with their sample-Data it works! When I run it with my own recordet Data I get this Errorstack:

> runfile('C:/Felix/Uni/Bachelorarbeit/mne/untitled2.py',
> wdir='C:/Felix/Uni/Bachelorarbeit/mne') Opening raw data file
> C:\Felix\Uni\Bachelorarbeit\mne\test_raw.fif... Traceback (most recent
> call last):   File "<stdin>", line 1, in <module>   File
> "C:\Users\Felix\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py",
> line 866, in runfile
>     execfile(filename, namespace)   File "C:\Users\Felix\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py",
> line 87, in execfile
>     exec(compile(scripttext, filename, 'exec'), glob, loc)   File "C:/Felix/Uni/Bachelorarbeit/mne/untitled2.py", line 4, in <module>
>     raw = mne.io.read_raw_fif(myfile)   File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\fiff\raw.py", line
> 519, in read_raw_fif
>     add_eeg_ref=add_eeg_ref, fnames=fnames, verbose=verbose)   File "<string>", line 2, in __init__   File
> "C:\Users\Felix\Anaconda2\lib\site-packages\mne\utils.py", line 708,
> in verbose
>     return function(*args, **kwargs)   File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\fiff\raw.py", line
> 109, in __init__
>     preload, do_check_fname)   File "<string>", line 2, in _read_raw_file   File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\utils.py", line 708,
> in verbose
>     return function(*args, **kwargs)   File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\fiff\raw.py", line
> 186, in _read_raw_file
>     ff, tree, _ = fiff_open(fname, preload=whole_file)   File "<string>", line 2, in fiff_open   File
> "C:\Users\Felix\Anaconda2\lib\site-packages\mne\utils.py", line 708,
> in verbose
>     return function(*args, **kwargs)   File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\open.py", line 146,
> in fiff_open
>     tree, _ = make_dir_tree(fid, directory)   File "<string>", line 2, in make_dir_tree   File
> "C:\Users\Felix\Anaconda2\lib\site-packages\mne\utils.py", line 708,
> in verbose
>     return function(*args, **kwargs)   File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\tree.py", line 56,
> in make_dir_tree
>     if directory[start].kind == FIFF_BLOCK_START: TypeError: 'NoneType' object has no attribute '__getitem__'

I downloadet "brainstorm" wich can illustrate .fif-Files. The Sampledate from MNE can be displayed. If I try mine, they wont.

:/

S.A.
  • 1,819
  • 1
  • 24
  • 39
  • Can you try the following?: `mne.io.read_raw_fif(myfile, allow_maxshield=True)` – armatita Feb 21 '17 at 12:41
  • Tried this also ... Does not work :/ – Flx Glandorf Feb 21 '17 at 12:42
  • 1
    Is this a binary file? Do you have an alternative software or library to check if it loads? That is to say: are you sure your file is correct? (Disclaimer: I'm not in the field so I don't really know what kind o standard do `fif`files follow). – armatita Feb 21 '17 at 12:46
  • As i said, if I load the Samplefiles with "brainstorm" they work and I get them displayed. If I try to open my files with this programm, I get an error. – Flx Glandorf Feb 21 '17 at 13:27
  • [ERROR-PICTURE](http://www.bilder-upload.eu/show.php?file=041526-1487684232.png). – Flx Glandorf Feb 21 '17 at 13:36
  • Than perhaps its either a library bug, or an incompatibility in the file standard (different versions of `fif`). But I'm just guessing. My suggestion is that you contact the MNE developer(s) directly (even if you are waiting for an answer here in SO). Sorry I couldn't be of more help. Best of luck. – armatita Feb 21 '17 at 13:43
  • That was my guess too! Thank you so far! – Flx Glandorf Feb 21 '17 at 13:48

0 Answers0