logo_UnfoldSim jl_120px

Dev Build Status Coverage DOI

rERP EEG visualisation EEG Simulations BIDS pipeline Decode EEG data Statistical testing

A package to simulate single timeseries model-based ERPs, fMRI activity, pupil dilation etc. If you have one channel, it is a timeseries of (overlapping) event-related activity and some noise - you might have fun here!

Many Tutorials, Guides, How-Tos and References available in the documentation!

grafik

Install

Julia

Click to expand

The recommended way to install julia is juliaup. It allows you to, e.g., easily update Julia at a later point, but also test out alpha/beta versions etc.

TL:DR; If you dont want to read the explicit instructions, just copy the following command

Windows

AppStore -> JuliaUp, or winget install julia -s msstore in CMD

Mac & Linux

curl -fsSL https://install.julialang.org | sh in any shell

Unfold.jl

using Pkg
Pkg.add("https://github.com/unfoldtoolbox/UnfoldSim.jl/tree/main")

Once the toolbox is registered this will translate to Pkg.add("UnfoldSim")

Quickstart

data,evts = UnfoldSim.predef_eeg(;n_repeats=1,noiselevel=0.8)

Produces continuous "EEG" with PinkNoise and some Overlap between 20 events (2 conditions * 10 levels of continuous variable).

Slightly longer

# start by defining the design / event-table
design = SingleSubjectDesign(;conditions=Dict(:condA=>["levelA","levelB"])) |> d->RepeatDesign(d,10);
# next define a ground-truth signal + relation to events/design with Wilkinson Formulas
signal = LinearModelComponent(;
        basis=[0,0,0,0.5,1,1,0.5,0,0],
        formula = @formula(0~1+condA),
        β = [1,0.5]
        );
# finally, define some Onset Distribution and Noise, and simulate!
data,events = simulate(Random.MersenneTwister(1),design, signal,  UniformOnset(;offset=5,width=4), PinkNoise());

All components (design, components, onsets, noise) can be easily modified and you can simply plugin your own!

Contributions

Contributions are very welcome. These could be typos, bugreports, feature-requests, speed-optimization, new solvers, better code, better documentation.

How-to Contribute

You are very welcome to raise issues and start pull requests!

Adding Documentation

  1. We recommend to write a Literate.jl document and place it in docs/literate/FOLDER/FILENAME.jl with FOLDER being HowTo, Explanation, Tutorial or Reference (recommended reading on the 4 categories).
  2. Literate.jl converts the .jl file to a .md automatically and places it in docs/src/generated/FOLDER/FILENAME.md.
  3. Edit make.jl with a reference to docs/src/generated/FOLDER/FILENAME.md.

Contributors (alphabetically)

  • Benedikt Ehinger
  • Luis Lips
  • Maanik Marathe
  • Judith Schepers

Citation

TBA

Acknowledgements

Funded by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany´s Excellence Strategy – EXC 2075 – 390740016