file does not start with a file id tag :((

:question: If you have a question or issue with MNE-Python, please include the following info:

  • MNE version: 1.7.1
  • operating system: Windows 11

I wanna open a dataset with .fif format but It gives an error:
ValueError: file ‘D:\py_project\sub15_sess1_50_ica_eeg.fif’ does not start with a file id tag

do you know how can i solve it?

It looks like the file might be corrupt. How did you try to open it? Can you open other files using that same code?

1 Like

Also, you are using mne.preprocessing.read_ica and not mne.io.read_raw or mne.io.read_raw_fif?

EDIT: disregarg, I thought the file was an ICA file.

Mathieu

hello, thanks for your answer, i forgot upload the codes: this is the picture of code:

import sys

import mne
from mne import preprocessing
import pandas as pd
from mne.io import eeglab
import numpy as np
import os.path
from os import path

paremeters

cap_size = ‘medium’ # either ‘small’, ‘medium’ or ‘large’
ppt_num = ‘3’
session = ‘3’ #either 1, 2 or 3
pathdata = ‘sub’+ppt_num+‘_sess’+session+‘_50_ica_eeg.fif’
xpath = ‘D:\MSc\term_4\datasets\Holly_Wilson\derivatives\preprocessed\sub_03\ses_03\eeg\’
pathdata = xpath + pathdata
pathdata
#data=mne.preprocessing.read_ica.fif(pathdata)
data = mne.io.read_raw_fif(pathdata, preload=True)
print(data.info)

The code looks fine, but can you read other FIF files?

Also, your data seems to be in BIDS format, so you might want to consider using MNE BIDS to load it.

1 Like