A Julia package for EEG/ERP data analysis and visualization. Currently under active development.
The documentation includes:
- Installation instructions and getting started guide
- Tutorials and Demos
- Complete API reference
You can install EegFun.jl through the standard Julia package manager.
From the Julia REPL, enter Pkg mode by pressing ] and run:
add EegFunOr using Pkg in the code:
using Pkg
Pkg.add("EegFun")To install the latest development version directly from GitHub:
using Pkg
Pkg.add(url="https://github.com/igmmgi/EegFun.jl")- EEG/ERP Analysis
- EEG/ERP Interactive Plots (via Makie.jl)
- Time-Frequency Analysis
- Raw data to full ERP batch preprocessing pipelines
Show Code
using EegFun
# raw data file and channel coordinates
dat = EegFun.read_raw_data("my_raw_file.bdf");
layout_file = EegFun.read_layout("my_layout.csv");
EegFun.polar_to_cartesian_xy!(layout_file)
# Julia EegFun type
dat = EegFun.create_eegfun_data(dat, layout_file);
EegFun.plot_databrowser(dat);Show Code
using EegFun
# raw data file and channel coordinates
dat = EegFun.read_raw_data("my_raw_file.bdf");
layout_file = EegFun.read_layout("my_layout.csv");
EegFun.polar_to_cartesian_xy!(layout_file)
dat = EegFun.create_eegfun_data(dat, layout_file);
# rereference data and apply 1Hz high-pass filter for ICA
EegFun.rereference!(dat, :avg)
EegFun.highpass_filter!(dat, 1)
# calculate EOG channels
EegFun.channel_difference!(
dat,
channel_selection1 = EegFun.channels([:Fp1, :Fp2]),
channel_selection2 = EegFun.channels([:IO1, :IO2]),
channel_out = :vEOG,
); # vertical EOG = mean(Fp1, Fp2) - mean(IO1, I02)
EegFun.channel_difference!(
dat,
channel_selection1 = EegFun.channels([:F9]),
channel_selection2 = EegFun.channels([:F10]),
channel_out = :hEOG,
); # horizontal EOG = F9 - F10
# detect some extreme values
EegFun.is_extreme_value!(dat, 200);
# ICA on continuous data without extreme values
ica_result = EegFun.run_ica(dat; sample_selection = EegFun.samples_not(:is_extreme_value_200))
EegFun.plot_ica_component_activation(dat, ica_result)| Epochs (Grid Layout) | ERP (Topo Layout) |
![]() |
![]() |
| ICA Component Topographies | ICA Component Spectra |
![]() |
![]() |
| ERP Measurement GUI | ERP Filter GUI |
![]() |
![]() |
| Time-Frequency Analysis | Triggers |
![]() |
![]() |
| Plot GUI | Artifact Detection |
![]() |
![]() |













