Hello, new to mne-python and could use some help. I’m currently trying to convert raw data from mff files into BIDS. At the moment I can read in and create a BIDS data structure with raw mff data, but I cannot convert a .bin file (from the mff file) into fif format.
At the moment my program looks like this:
import matplotlib
import pathlib
import mne
import mne_bids
matplotlib.use('Qt5Agg')
mne.set_log_level('warning')
raw_fname = pathlib.Path('subject_data') / 'WM_1_isi0_s1c_20191110_020011.mff'
raw = mne.io.read_raw_egi(raw_fname)
out_path = pathlib.Path('out_data2/sample_BIDS') #Into which directory the data should go
bids_path = mne_bids.BIDSPath(subject='01',
session='01',
task='WM1 isi0',
datatype='eeg',
root=out_path)
mne_bids.write_raw_bids(raw, bids_path=bids_path, events_data=events, format='FIF', allow_preload=True,
event_id=event_id, overwrite=True)
And spits out this error:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Input In [6], in <cell line: 9>()
1 out_path = pathlib.Path('out_data2/sample_BIDS') #Into which directory the data should go
3 bids_path = mne_bids.BIDSPath(subject='01',
4 session='01',
5 task='WM1 isi0',
6 datatype='eeg',
7 root=out_path) #An object that specifies the location of BIDS files
----> 9 mne_bids.write_raw_bids(raw, bids_path=bids_path, events_data=events, format='FIF', allow_preload=True,
10 event_id=event_id, overwrite=True)
File <decorator-gen-585>:12, in write_raw_bids(raw, bids_path, events_data, event_id, anonymize, format, symlink, empty_room, allow_preload, montage, acpc_aligned, overwrite, verbose)
File ~\anaconda3\envs\mne\lib\site-packages\mne_bids\write.py:1668, in write_raw_bids(***failed resolving arguments***)
1663 make_dataset_description(bids_path.root, name=" ", overwrite=False)
1665 _sidecar_json(raw, task=bids_path.task, manufacturer=manufacturer,
1666 fname=sidecar_path.fpath, datatype=bids_path.datatype,
1667 emptyroom_fname=associated_er_path, overwrite=overwrite)
-> 1668 _channels_tsv(raw, channels_path.fpath, overwrite)
1670 # create parent directories if needed
1671 _mkdir_p(os.path.dirname(data_path))
File ~\anaconda3\envs\mne\lib\site-packages\mne_bids\write.py:110, in _channels_tsv(raw, fname, overwrite)
108 # get the manufacturer from the file in the Raw object
109 _, ext = _parse_ext(raw.filenames[0])
--> 110 manufacturer = MANUFACTURERS[ext]
112 ignored_channels = IGNORED_CHANNELS.get(manufacturer, list())
114 status, ch_type, description = list(), list(), list()
KeyError: '.bin'
-----------------------------------
It appears that write_raw_bids is having problems converting .bin files into an fif format, though it could definitely be something else.