I wanna know how to open dataset from Openneuro

Hello I am a college student and I wanna use eeg data from Openneuro.
But I don’t know how to open this data…
I have python and MATLAB. How can I open and check these datas?
I searched in google but I can’t find how to open…
Thank you for read…

Hi @kimmh1533 and welcome to neurostars!

Here is the output from ChatGPT, which you might find helpful: ChatGPT - Open EDF files MATLAB Python


To open an EDF (European Data Format) file, commonly used for biosignals like EEG, you can use specific libraries both in MATLAB and Python. Here’s how you can do it in each:

In MATLAB:

You can use the biosig toolbox to load EDF files.

  1. Install the biosig toolbox if you don’t already have it. You can find it at The BioSig Homepage is available at Sourceforge.
  2. Once installed, you can load the EDF file using the sload function.

Example MATLAB code:

% Load the EDF file
[data, header] = sload('yourfile.edf');

% 'data' contains the signals, and 'header' contains metadata like sampling rate, labels, etc.
disp(header);
plot(data(:,1)); % Plot the first channel of the EDF file

In Python:

You can use the pyedflib or mne libraries to read EDF files.

Using pyedflib:

  1. Install pyedflib:
pip install pyedflib
  1. Open the EDF file:

Example Python code:

import pyedflib

# Open the EDF file
edf_file = pyedflib.EdfReader('yourfile.edf')

# Get the number of signals (channels)
n_channels = edf_file.signals_in_file

# Read the signals
signals = []
for i in range(n_channels):
    signals.append(edf_file.readSignal(i))

# Close the file after reading
edf_file.close()

# signals is a list where each element corresponds to a channel
print(signals[0])  # Print the first channel

Using mne:

  1. Install mne:
pip install mne
  1. Load and visualize the EDF file:

Example Python code:

import mne

# Load the EDF file
raw = mne.io.read_raw_edf('yourfile.edf', preload=True)

# Plot the signals
raw.plot()

# Access data
data, times = raw[:]

# 'data' is the signal, 'times' is the time array
print(data.shape)  # Check the shape of the data

Both libraries are commonly used for working with EEG or other biosignal data, so you can choose one based on your project’s requirements.


Best,
Steven