ufvceiec / EEGRAPH

EEGraph: Convert EEGs to graphs with frequency and time-frequency domain connectivity measures.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't load .eeg files ! convert .eeg to .edf format?

Surya-Teja-Menta opened this issue · comments

How to load .eeg files in python instead of .edf files. or else any function to convert .eeg to .edf format

Hi @Surya-Teja-Menta, have you managed to figure this out? I have converted my data into numpy arrays to run it through my preprocessing pipeline and would like to create a modelate instance without creating a load_data instance, otherwise I will have to convert the numpy files back into edf files. Thanks!

Hi, @Surya-Teja-Menta if the .eeg file corresponds to a brain vision file then simply provide the .vhdr file. Otherwise, you can convert to .edf and import the data.

@melissafasol importing from numpy could easily be done as data is handled with mne under the hood. Have a look at this tutorial if you are not sure how to do that.

###########
Exemplary step by step example (you would need to adjust to your needs!):

  1. Create a mne raw data structure from your numpy
    raw = mne.io.RawArray(numpy_data, info)

  2. Initialize a eegraph object:
    G = eegraph.Graph()

  3. Hand over the mne object to eegraph:
    G.data = raw

  4. Set a montage:
    e.g.: G.data.set_montage("standard_1020")

  5. Hand over the channel names to eegraph:
    G.ch_names = raw.info['ch_names']