Kerem Kurban
Kerem Kurban

Reputation: 11

.csv to .edf or other EEG reading formats

I'm using a EEG detection kit called Gtec.NAUTILUS which gives me binary data for 32 channels at 500hz. The data is then converted to CSV format. Now I want to process these data in Microsoft Azure using python 3.5.1 however CSV file is not recognized in MNE library (which is used for EEG data analysis). There are also other formats that are supported in MNE. ( .cnt , .edf , .bdf , .egi , .set ) Additional info @ : http://martinos.org/mne/stable/manual/io.html#ch-convert

My primary question is; - How can i convert csv file to one of the supported formats?

Additionaly; - How can i convert binary file to one of the supported formats in mne? (if previous question is not possible)

Also; - Does someone have an experience in processing EEG data? Am i doing an essential mistake while data processing?

Note : I am performing this process for EEG data analysis in MATLAB, however it seems microsoft azure does not support it. Therefore I'm trying to learn python for compatibility.

Thanks in advance.


For those who are interested:

Free programs from third party developers: http://www.biosemi.com/download.htm

Upvotes: 1

Views: 9628

Answers (2)

Marijn van Vliet
Marijn van Vliet

Reputation: 5399

MNE doesn't support reading from Gtec devices out of the box. However, reading the CSV file with Numpy and creating an MNE Raw object is not that difficult:

import numpy as np
import mne

# Read the CSV file as a NumPy array
data = np.loadtxt('path/to/csv/file', delimiter=',')

# Some information about the channels
ch_names = ['CH 1', 'CH 2', 'CH 3']  # TODO: finish this list

# Sampling rate of the Nautilus machine
sfreq = 500  # Hz

# Create the info structure needed by MNE
info = mne.create_info(ch_names, sfreq)

# Finally, create the Raw object
raw = mne.io.RawArray(data, info)

# Plot it!
raw.plot()

Upvotes: 6

Peter Pan
Peter Pan

Reputation: 24128

I searched the GitHub project EEGrunt which can read EEG data from CSV files.

According to their offical site, the EEGrunt & MNE all depend on the package Numpy, so I think you can try to read raw data from CSV file using EEGrunt and read the raw data from memory usingMNE`.

Hope it helps.

Upvotes: 0

Related Questions