Skip to content

How to import EEG-lab / .set EEG.events field for Unfold? #275

Answered by behinger
behinger asked this question in Q&A
Discussion options

You must be logged in to vote

Let's first download a dataset:

	using OpenScienceFramework 
        const OSF = OpenScienceFramework
        osf_proj = OSF.project(OSF.Client(), "wbz7x") 
        cp(readdir(osf_proj)[1], tempdir()*"/unfold_tempdata.zip") # copy / download
        run(`unzip  $(tempdir()*"/unfold_tempdata.zip") -d  $(tempdir()*"/unfold_tempdata_unzipped/")`) # unzip

Now that we have an eeglab-file, we can extract the events:

	using MAT
	using DataFrames
        EEG = MAT.matread("/tmp/unfold_tempdata_unzipped/face_saccades_opendata_fig10.set")
        evts = DataFrame([k=>dropdims(v,dims=1) for (k,v) in EEG["EEG"]["event"]])

Why so complicated with dropdims? Because MATLAB automatically saves vectors as…

Replies: 2 comments 4 replies

Comment options

behinger
May 26, 2025
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by behinger
Comment options

You must be logged in to vote
4 replies
@behinger
Comment options

behinger May 28, 2025
Maintainer Author

@EmmanuelleKris
Comment options

@EmmanuelleKris
Comment options

@behinger
Comment options

behinger May 28, 2025
Maintainer Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants