Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update paper.md #30

Closed
wants to merge 128 commits into from
Closed
Show file tree
Hide file tree
Changes from 123 commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
8c605f3
headmodel better tests
behinger Nov 6, 2023
2e52583
fix closestsrc test
behinger Nov 6, 2023
a9060b2
Merge branch 'main' into multichannel
behinger Nov 6, 2023
4b90b92
multichannel support
behinger Nov 7, 2023
b8207c4
Update paper.md
behinger Nov 8, 2023
433cc6c
add label/helper
behinger Nov 8, 2023
8e05d42
added tutorial, fix some bug, scaling 1000
behinger Nov 8, 2023
bda44f5
fix docs
behinger Nov 8, 2023
58e502c
forgot to add package Random
behinger Nov 8, 2023
146bd0b
actually added Random...
behinger Nov 8, 2023
3aa7ad8
Update paper.md
behinger Nov 10, 2023
3cd06bc
fix MultiChannel, new Overview doc
behinger Nov 10, 2023
cf04383
Export MultichannelComponent
behinger Nov 10, 2023
aa460dc
Correct mistake in README.md
jschepers Nov 10, 2023
8694f52
Merge pull request #33 from unfoldtoolbox/README-mistake
behinger Nov 10, 2023
1aacd9c
Merge pull request #29 from unfoldtoolbox/multichannel
behinger Nov 10, 2023
b9ac5cc
v0.1.7
behinger Nov 10, 2023
ffe67ec
fix a electrode scaling issue
behinger Nov 13, 2023
4287d5e
Merge branch 'multichannel'
behinger Nov 13, 2023
dbd7b0c
moved literate to extra folder for compat with liveserver
maanikmarathe Nov 15, 2023
ef87b5d
added liveserver script
behinger Nov 15, 2023
e65da17
Merge branch 'main' of https://github.com/unfoldtoolbox/UnfoldSim.jl
behinger Nov 15, 2023
8dc38bc
Create .all-contributorsrc
ReboreExplore Nov 15, 2023
1e7cd9c
added markdown configuration for @all-contributors
ReboreExplore Nov 15, 2023
a2e4357
Merge pull request #34 from ReboreExplore/main
behinger Nov 15, 2023
12f614e
facelift of docs
behinger Nov 16, 2023
1daaec8
small cleanup changes
maanikmarathe Nov 20, 2023
34bab0e
docs: update README.md
allcontributors[bot] Nov 20, 2023
8699198
docs: update .all-contributorsrc
allcontributors[bot] Nov 20, 2023
2b9cd37
Merge pull request #36 from maanikmarathe/docs-2023-11
behinger Nov 20, 2023
94829a6
Merge pull request #37 from unfoldtoolbox/all-contributors/add-maanik…
behinger Nov 20, 2023
008cfcf
docs: update README.md
allcontributors[bot] Nov 20, 2023
d312d94
docs: update .all-contributorsrc
allcontributors[bot] Nov 20, 2023
fa298c7
Merge pull request #39 from unfoldtoolbox/all-contributors/add-behinger
behinger Nov 20, 2023
3fdb6e4
docs: update README.md
allcontributors[bot] Nov 20, 2023
0ed00a3
docs: update .all-contributorsrc
allcontributors[bot] Nov 20, 2023
ab86319
docs: update README.md
allcontributors[bot] Nov 20, 2023
bb1f6f4
docs: update .all-contributorsrc
allcontributors[bot] Nov 20, 2023
6342214
Merge pull request #41 from unfoldtoolbox/all-contributors/add-jschepers
behinger Nov 20, 2023
41bb21f
docs: update README.md
allcontributors[bot] Nov 20, 2023
dca29b5
docs: update .all-contributorsrc
allcontributors[bot] Nov 20, 2023
68f15c3
Merge pull request #42 from unfoldtoolbox/all-contributors/add-vladdez
behinger Nov 20, 2023
1aa531b
docs: update README.md
allcontributors[bot] Nov 20, 2023
937c1a3
docs: update .all-contributorsrc
allcontributors[bot] Nov 20, 2023
2b37642
Merge pull request #43 from unfoldtoolbox/all-contributors/add-Rebore…
behinger Nov 20, 2023
39a0d98
docs: update README.md
allcontributors[bot] Nov 20, 2023
0d22db9
docs: update .all-contributorsrc
allcontributors[bot] Nov 20, 2023
d1acc78
docs: update README.md
allcontributors[bot] Nov 20, 2023
9193454
docs: update .all-contributorsrc
allcontributors[bot] Nov 20, 2023
b422394
Merge pull request #44 from unfoldtoolbox/all-contributors/add-ReneSk…
behinger Nov 20, 2023
2be2707
Merge branch 'main' into all-contributors/add-jschepers
behinger Nov 20, 2023
b21c1f3
Merge pull request #45 from unfoldtoolbox/all-contributors/add-jschepers
behinger Nov 20, 2023
30b1b51
Update README.md
behinger Nov 20, 2023
17a5069
Merge pull request #46 from unfoldtoolbox/behinger-patch-1
behinger Nov 20, 2023
42b3ff1
Deleted obsolete code from convert function
jschepers Nov 22, 2023
505593b
Adapted simulation function to return the multi-subject eeg data as a…
jschepers Nov 22, 2023
6060446
fix indentation
jschepers Nov 23, 2023
eabc810
deleted obsolete code and added todo
jschepers Nov 23, 2023
150a74d
Added tests for simulate for single vs. multi subject and single vs. …
jschepers Nov 23, 2023
3ce9907
Create darus-dataverse.yml
behinger Nov 27, 2023
a789487
Merge pull request #48 from unfoldtoolbox/darus-dataverse
behinger Nov 27, 2023
5a3d545
Update darus-dataverse.yml
behinger Nov 27, 2023
c74937a
Update darus-dataverse.yml
behinger Nov 27, 2023
6a7e5cb
Update darus-dataverse.yml
behinger Nov 27, 2023
62964c3
Update darus-dataverse.yml
behinger Nov 27, 2023
cef481d
Update darus-dataverse.yml
behinger Nov 27, 2023
29317b9
Merge pull request #51 from unfoldtoolbox/main
behinger Nov 27, 2023
88fd0c2
Update darus-dataverse.yml
behinger Nov 28, 2023
89f6f94
Merge branch 'main' into all-contributors/add-llips
behinger Nov 28, 2023
e2a20da
Merge pull request #40 from unfoldtoolbox/all-contributors/add-llips
behinger Nov 28, 2023
e86e89d
Merge branch 'main' into betterdocs
behinger Nov 28, 2023
4f92c42
Merge pull request #35 from unfoldtoolbox/betterdocs
behinger Nov 28, 2023
1dcd428
Merge pull request #50 from unfoldtoolbox/test-darus-1
behinger Nov 28, 2023
86c29e7
fixed mistake in multiple_subjects-multiple_channels case
jschepers Nov 28, 2023
2a278d8
fixed bug in return_epoched=true condition due to onsets
jschepers Nov 29, 2023
b8043ee
Add NoNoise() as default
jschepers Nov 29, 2023
c943aec
Create format.yml
behinger Nov 30, 2023
0059b77
Merge pull request #52 from unfoldtoolbox/autoformat
behinger Nov 30, 2023
2b15dea
Merge pull request #47 from unfoldtoolbox/adapt-simulate-output
behinger Nov 30, 2023
b2a9b0a
fix
behinger Dec 1, 2023
df145e6
Merge pull request #53 from unfoldtoolbox/unfoldmakie0.4
behinger Dec 1, 2023
529c28d
added onsettype page to make.jl and changed repo parameter in makedocs
jschepers Dec 7, 2023
223b680
added reference about the onset types
jschepers Dec 7, 2023
df7bc62
Update docs/literate/reference/onsettypes.jl
jschepers Dec 7, 2023
069e50e
Apply suggestions from code review (JuliaFormatter)
jschepers Dec 7, 2023
12f5e44
added hide comments to hide the code
jschepers Dec 7, 2023
cd8ae22
Apply suggestions from code review (JuliaFormatter)
jschepers Dec 7, 2023
e2b0c3e
Merge pull request #54 from unfoldtoolbox/reference-onset_distributions
behinger Dec 7, 2023
fc1adb2
docs: update README.md
allcontributors[bot] Dec 7, 2023
c10d973
docs: update .all-contributorsrc
allcontributors[bot] Dec 7, 2023
75d9449
Merge branch 'main' into all-contributors/add-jschepers
behinger Dec 7, 2023
fa743c7
Merge pull request #55 from unfoldtoolbox/all-contributors/add-jschepers
behinger Dec 7, 2023
791d328
docs: update README.md
allcontributors[bot] Dec 7, 2023
e31d2b0
docs: update .all-contributorsrc
allcontributors[bot] Dec 7, 2023
75e019c
Merge pull request #56 from unfoldtoolbox/all-contributors/add-jschepers
behinger Dec 7, 2023
7adf98b
Create joss.yml
behinger Dec 12, 2023
604f020
Added splines and fixed overlapping legend and colorbar
jschepers Dec 13, 2023
2bf38da
JuliaFormatter: Apply suggestions from code review
jschepers Dec 13, 2023
2b64f93
JuliaFormatter: Apply suggestions from code review
jschepers Dec 13, 2023
4173741
JuliaFormatter: Apply suggestions from code review
jschepers Dec 13, 2023
3d033af
apply formatting
jschepers Dec 13, 2023
e54c979
adapt formatting
jschepers Dec 13, 2023
b89fe54
adapt formatting
jschepers Dec 13, 2023
6456ac3
adapt formatting
jschepers Dec 13, 2023
c572436
Apply suggestions from code review (JuliaFormatter)
jschepers Dec 13, 2023
23e716b
Merge pull request #58 from unfoldtoolbox/modify-simulateERP
behinger Dec 14, 2023
95024c9
fixed comments
jschepers Dec 14, 2023
4f75add
fixed typo + formatting
jschepers Dec 14, 2023
da6e04f
moved text below empty hint box to the box
jschepers Dec 14, 2023
82d7d7d
removed title argument from figure since it's not used
jschepers Dec 14, 2023
5e44254
removed outdated information about dv column + formatting
jschepers Dec 14, 2023
939c95a
adapted outdated package description + added link to documentation
jschepers Dec 14, 2023
9bea415
adapted package description
jschepers Dec 14, 2023
d32c962
Apply suggestions from code review (JuliaFormatter)
jschepers Dec 14, 2023
e2b446d
Merge pull request #59 from unfoldtoolbox/small-fixes
behinger Dec 14, 2023
b26df2a
Update CITATION.cff
jschepers Dec 14, 2023
fd592be
Delete CITATION.bib
jschepers Dec 14, 2023
f8b603f
Merge pull request #60 from unfoldtoolbox/jschepers-update-citation.cff
jschepers Jan 2, 2024
ba10ed0
Update paper.md
behinger Nov 8, 2023
5c12370
Update paper.md
behinger Nov 10, 2023
8951b47
Create joss.yml
behinger Dec 12, 2023
8a860ba
Merge branch 'joss-paper' of github.com:unfoldtoolbox/UnfoldSim.jl in…
jschepers Jan 3, 2024
7a9f273
created joss_paper folder and moved paper.md there
jschepers Jan 3, 2024
a7d4d52
add .bib file for joss paper
jschepers Jan 5, 2024
f6b4445
Update joss.yml
behinger Jan 16, 2024
7fdce3b
Update joss.yml
behinger Jan 16, 2024
ba7fe88
Update joss.yml
behinger Jan 16, 2024
7674487
Update joss.yml
behinger Jan 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"projectName": "UnfoldSim.jl",
"projectOwner": "unfoldtoolbox",
"files": [
"README.md"
],
"commitType": "docs",
"commitConvention": "angular",
"contributorsPerLine": 7,
"contributors": [
{
"login": "maanikmarathe",
"name": "Maanik Marathe",
"avatar_url": "https://avatars.githubusercontent.com/u/66105649?v=4",
"profile": "https://github.com/maanikmarathe",
"contributions": [
"doc",
"code"
]
},
{
"login": "behinger",
"name": "Benedikt Ehinger",
"avatar_url": "https://avatars.githubusercontent.com/u/10183650?v=4",
"profile": "http://www.benediktehinger.de",
"contributions": [
"bug",
"code",
"doc",
"ideas",
"infra",
"maintenance",
"review",
"test",
"tutorial"
]
},
{
"login": "llips",
"name": "Luis",
"avatar_url": "https://avatars.githubusercontent.com/u/38983684?v=4",
"profile": "https://github.com/llips",
"contributions": [
"bug",
"code",
"doc",
"ideas"
]
},
{
"login": "jschepers",
"name": "Judith Schepers",
"avatar_url": "https://avatars.githubusercontent.com/u/22366977?v=4",
"profile": "https://github.com/jschepers",
"contributions": [
"ideas",
"bug",
"doc",
"tutorial",
"code"
]
},
{
"login": "vladdez",
"name": "Vladimir Mikheev",
"avatar_url": "https://avatars.githubusercontent.com/u/33777074?v=4",
"profile": "https://github.com/vladdez",
"contributions": [
"bug"
]
},
{
"login": "ReboreExplore",
"name": "Manpa Barman",
"avatar_url": "https://avatars.githubusercontent.com/u/43548330?v=4",
"profile": "https://reboreexplore.github.io/",
"contributions": [
"infra"
]
},
{
"login": "ReneSkukies",
"name": "René Skukies",
"avatar_url": "https://avatars.githubusercontent.com/u/57703446?v=4",
"profile": "https://reneskukies.de/",
"contributions": [
"doc"
]
}
]
}
19 changes: 19 additions & 0 deletions .github/workflows/darus-dataverse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: DARUS dataverse sync

on:
pull_request:
types: [labeled, opened, synchronize, reopened]


jobs:
dv-sync:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'sync darus')
steps:
- uses: actions/checkout@v2
- name: Synchronize to DV
uses: SimTech-Research-Data-Management/dataverse-sync@main
with:
dataverse_url: "https://darus.uni-stuttgart.de/"
api_token: ${{ secrets.DV_API_TOKEN }}
persistent_id: "doi:10.18419/darus-3804"
8 changes: 8 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Format suggestions
on:
pull_request:
jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/[email protected]
2 changes: 2 additions & 0 deletions .github/workflows/joss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- name: Open Journals PDF Generator
uses: openjournals/[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/docs/Manifest.toml
/docs/build/
/docs/src/literate/*/*.md
/docs/src/generated
6 changes: 6 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[hartmut]
git-tree-sha1 = "07d7f285b4fed914b2ab5dc25dae3e108b8ce35e"

[[hartmut.download]]
sha256 = "8fa88ed124e2307ad757956fcdf4f670193a6c58974f3adb8473b56afeb995a7"
url = "https://gist.github.com/behinger/96973aae77e56a73ddeea83792bc52ad/raw/07d7f285b4fed914b2ab5dc25dae3e108b8ce35e.tar.gz"
8 changes: 0 additions & 8 deletions CITATION.bib

This file was deleted.

17 changes: 8 additions & 9 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: UnfoldSim
title: UnfoldSim.jl
message: 'If you use this page, please cite it as below.'
type: software
authors:
- given-names: Judith
family-names: Schepers
- given-names: Luis
family-names: Lips
- given-names: Maanik
family-names: Marathe
- given-names: Benedikt
family-names: Ehinger
orcid: 'https://orcid.org/0000-0002-6276-3332'
- given-names: Maanik
family-names: Marathe
- given-names: Luis
family-names: Lips

identifiers:
- type: doi
value: 10.5281/zenodo.8375512
value: 10.5281/zenodo.7738651
repository-code: 'https://github.com/unfoldtoolbox/UnfoldSim.jl'
version: 0.1.6
date-released: '2023-09-25'
14 changes: 12 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
name = "UnfoldSim"
uuid = "ed8ae6d2-84d3-44c6-ab46-0baf21700804"
authors = ["Benedikt Ehinger","Luis Lips", "Judith Schepers","Maanik Marathe"]
version = "0.1.6"
authors = ["Benedikt Ehinger", "Luis Lips", "Judith Schepers", "Maanik Marathe"]
version = "0.1.7"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
ImageFiltering = "6a3955dd-da59-5b1f-98d4-e7296123deb5"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MixedModels = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
MixedModelsSim = "d5ae56c5-23ca-4a1f-b505-9fc4796fc1fe"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SignalAnalysis = "df1fea92-c066-49dd-8b36-eace3378ea47"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"
ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"

[compat]
Artifacts = "1"
DSP = "0.7"
DataFrames = "1"
Distributions = "0.25"
FileIO = "1"
HDF5 = "0.17"
ImageFiltering = "0.7"
LinearAlgebra = "1"
MixedModels = "4"
MixedModelsSim = "0.2"
Parameters = "0.12"
Random = "1"
SignalAnalysis = "0.4, 0.5,0.6"
Statistics = "1"
StatsModels = "0.6,0.7"
ToeplitzMatrices = "0.7, 0.8"
julia = "1"
Expand Down
42 changes: 32 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
|---|---|---|---|---|---|
| <a href="https://github.com/unfoldtoolbox/Unfold.jl/tree/main"><img src="https://github-production-user-asset-6210df.s3.amazonaws.com/10183650/277623787-757575d0-aeb9-4d94-a5f8-832f13dcd2dd.png"></a> | <a href="https://github.com/unfoldtoolbox/UnfoldMakie.jl"><img src="https://github-production-user-asset-6210df.s3.amazonaws.com/10183650/277623793-37af35a0-c99c-4374-827b-40fc37de7c2b.png"></a>|<a href="https://github.com/unfoldtoolbox/UnfoldSim.jl"><img src="https://github-production-user-asset-6210df.s3.amazonaws.com/10183650/277623795-328a4ccd-8860-4b13-9fb6-64d3df9e2091.png"></a>|<a href="https://github.com/unfoldtoolbox/UnfoldBIDS.jl"><img src="https://github-production-user-asset-6210df.s3.amazonaws.com/10183650/277622460-2956ca20-9c48-4066-9e50-c5d25c50f0d1.png"></a>|<a href="https://github.com/unfoldtoolbox/UnfoldDecode.jl"><img src="https://github-production-user-asset-6210df.s3.amazonaws.com/10183650/277622487-802002c0-a1f2-4236-9123-562684d39dcf.png"></a>|<a href="https://github.com/unfoldtoolbox/UnfoldStats.jl"><img src="https://github-production-user-asset-6210df.s3.amazonaws.com/10183650/277623799-4c8f2b5a-ea84-4ee3-82f9-01ef05b4f4c6.png"></a>|

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!
A Julia package to simulate multivariate time series, e.g. model-based ERPs, fMRI activity, pupil dilation etc.
UnfoldSim.jl provides multi-channel support via EEG-forward models. Moreover, it is possible to simulate overlapping event-related activity and to add noise of a certain type e.g. Pink noise.

Many Tutorials, Guides, How-Tos and References available in the documentation!
Many Tutorials, Guides, How-Tos and References available in the [documentation](https://unfoldtoolbox.github.io/UnfoldSim.jl/dev/)!

![grafik](https://user-images.githubusercontent.com/10183650/213565922-90feec23-3b51-4602-b50c-31561dbfc261.png)

Expand Down Expand Up @@ -49,9 +49,9 @@ Once the toolbox is registered this will translate to ```Pkg.add("UnfoldSim")```

# Quickstart
```julia
data,evts = UnfoldSim.predef_eeg(;n_trials=20,noiselevel=0.8)
data,evts = UnfoldSim.predef_eeg(;n_repeats=1,noiselevel=0.8)
```
Produces continuous "EEG" with PinkNoise and some Overlap between 20 events
Produces continuous "EEG" with PinkNoise and some Overlap between 20 events (2 conditions * 10 levels of continuous variable).

## Slightly longer
```julia
Expand Down Expand Up @@ -82,12 +82,34 @@ You are very welcome to raise issues and start pull requests!
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](https://github.com/unfoldtoolbox/Unfold.jl/blob/main/docs/make.jl) with a reference to `docs/src/generated/FOLDER/FILENAME.md`.

## Contributors (alphabetically)
## Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/maanikmarathe"><img src="https://avatars.githubusercontent.com/u/66105649?v=4?s=100" width="100px;" alt="Maanik Marathe"/><br /><sub><b>Maanik Marathe</b></sub></a><br /><a href="#doc-maanikmarathe" title="Documentation">📖</a> <a href="#code-maanikmarathe" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.benediktehinger.de"><img src="https://avatars.githubusercontent.com/u/10183650?v=4?s=100" width="100px;" alt="Benedikt Ehinger"/><br /><sub><b>Benedikt Ehinger</b></sub></a><br /><a href="#bug-behinger" title="Bug reports">🐛</a> <a href="#code-behinger" title="Code">💻</a> <a href="#doc-behinger" title="Documentation">📖</a> <a href="#ideas-behinger" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-behinger" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-behinger" title="Maintenance">🚧</a> <a href="#review-behinger" title="Reviewed Pull Requests">👀</a> <a href="#test-behinger" title="Tests">⚠️</a> <a href="#tutorial-behinger" title="Tutorials">✅</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/llips"><img src="https://avatars.githubusercontent.com/u/38983684?v=4?s=100" width="100px;" alt="Luis"/><br /><sub><b>Luis</b></sub></a><br /><a href="#bug-llips" title="Bug reports">🐛</a> <a href="#code-llips" title="Code">💻</a> <a href="#doc-llips" title="Documentation">📖</a> <a href="#ideas-llips" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jschepers"><img src="https://avatars.githubusercontent.com/u/22366977?v=4?s=100" width="100px;" alt="Judith Schepers"/><br /><sub><b>Judith Schepers</b></sub></a><br /><a href="#ideas-jschepers" title="Ideas, Planning, & Feedback">🤔</a> <a href="#bug-jschepers" title="Bug reports">🐛</a> <a href="#doc-jschepers" title="Documentation">📖</a> <a href="#tutorial-jschepers" title="Tutorials">✅</a> <a href="#code-jschepers" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vladdez"><img src="https://avatars.githubusercontent.com/u/33777074?v=4?s=100" width="100px;" alt="Vladimir Mikheev"/><br /><sub><b>Vladimir Mikheev</b></sub></a><br /><a href="#bug-vladdez" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://reboreexplore.github.io/"><img src="https://avatars.githubusercontent.com/u/43548330?v=4?s=100" width="100px;" alt="Manpa Barman"/><br /><sub><b>Manpa Barman</b></sub></a><br /><a href="#infra-ReboreExplore" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://reneskukies.de/"><img src="https://avatars.githubusercontent.com/u/57703446?v=4?s=100" width="100px;" alt="René Skukies"/><br /><sub><b>René Skukies</b></sub></a><br /><a href="#doc-ReneSkukies" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>

- **Benedikt Ehinger**
- **Luis Lips**
- **Maanik Marathe**
- **Judith Schepers**
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->



This project follows the [all-contributors](https://allcontributors.org/docs/en/specification) specification.

Contributions of any kind welcome!

## Citation

Expand Down
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
HypothesisTests = "09f84164-cd44-5f33-b23f-e6b0d136a0d5"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Expand Down
58 changes: 58 additions & 0 deletions docs/literate/HowTo/multichannel.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

using UnfoldSim
using UnfoldMakie
using CairoMakie
using DataFrames
using Random


# ## Specifying a design

# We are using a one-level design for testing here.
design = SingleSubjectDesign(conditions=Dict(:condA=>["levelA"]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
design = SingleSubjectDesign(conditions=Dict(:condA=>["levelA"]))
design = SingleSubjectDesign(conditions = Dict(:condA => ["levelA"]))


# Next we generate two simple components at two different times without any formula attached (we have a single condition anyway)
c = LinearModelComponent(;basis=p100(),formula = @formula(0~1),β = [1]);
c2 = LinearModelComponent(;basis=p300(),formula = @formula(0~1),β = [1]);
Comment on lines +15 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
c = LinearModelComponent(;basis=p100(),formula = @formula(0~1),β = [1]);
c2 = LinearModelComponent(;basis=p300(),formula = @formula(0~1),β = [1]);
c = LinearModelComponent(; basis = p100(), formula = @formula(0 ~ 1), β = [1]);
c2 = LinearModelComponent(; basis = p300(), formula = @formula(0 ~ 1), β = [1]);



# ## The multichannel component
# next similar to the nested design above, we can nest the component in a `MultichannelComponent`. We could either provide the projection marix manually, e.g.:
mc = UnfoldSim.MultichannelComponent(c, [1,2,-1,3,5,2.3,1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
mc = UnfoldSim.MultichannelComponent(c, [1,2,-1,3,5,2.3,1])
mc = UnfoldSim.MultichannelComponent(c, [1, 2, -1, 3, 5, 2.3, 1])


# or maybe more convenient: use the pair-syntax: Headmodel=>Label which makes use of a headmodel (HaRTmuT is currently easily available in UnfoldSim)
hart = headmodel(type="hartmut")
mc = UnfoldSim.MultichannelComponent(c, hart=>"Left Postcentral Gyrus")
mc2 = UnfoldSim.MultichannelComponent(c2, hart=>"Right Occipital Pole")
Comment on lines +24 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
hart = headmodel(type="hartmut")
mc = UnfoldSim.MultichannelComponent(c, hart=>"Left Postcentral Gyrus")
mc2 = UnfoldSim.MultichannelComponent(c2, hart=>"Right Occipital Pole")
hart = headmodel(type = "hartmut")
mc = UnfoldSim.MultichannelComponent(c, hart => "Left Postcentral Gyrus")
mc2 = UnfoldSim.MultichannelComponent(c2, hart => "Right Occipital Pole")


# !!! hint
# You could also specify a noise-specific component which is applied prior to projection & summing with other components
#
# finally we need to define the onsets of the signal
onset = UniformOnset(;width=20,offset=4);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
onset = UniformOnset(;width=20,offset=4);
onset = UniformOnset(; width = 20, offset = 4);


# ## Simulation

# Now as usual we simulate data. Inspecting data shows our result is now indeed ~230 Electrodes large! Nice!
data,events = simulate(MersenneTwister(1),design, [mc,mc2], onset, PinkNoise(noiselevel=0.05))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
data,events = simulate(MersenneTwister(1),design, [mc,mc2], onset, PinkNoise(noiselevel=0.05))
data, events =
simulate(MersenneTwister(1), design, [mc, mc2], onset, PinkNoise(noiselevel = 0.05))

size(data)


# !!! hint
# The noise declared in the `simulate` function is added after mixing to channels, each channel receives independent noise. It is also possible to add noise to each individual component+source prior to projection. This would introduce correlated noise.
#
# ## Plotting
# Let's plot using Butterfly & Topoplot
# first we convert the electrodes to positions usable in TopoPlots.jl
pos3d = hart.electrodes["pos"];
pos2d = to_positions(pos3d')
pos2d = [Point2f(p[1]+0.5,p[2]+0.5) for p in pos2d];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
pos2d = [Point2f(p[1]+0.5,p[2]+0.5) for p in pos2d];
pos2d = [Point2f(p[1] + 0.5, p[2] + 0.5) for p in pos2d];


# now plot!
f = Figure()
df = DataFrame(:estimate => data[:],:channel => repeat(1:size(data,1),outer=size(data,2)),:time => repeat(1:size(data,2),inner=size(data,1)))
plot_butterfly!(f[1,1:2],df;positions=pos2d)
plot_topoplot!(f[2,1],df[df.time .== 28,:];positions=pos2d,visual=(;enlarge=0.5,label_scatter=false),axis=(;limits=((0,1),(0,0.9))))
plot_topoplot!(f[2,2],df[df.time .== 48,:];positions=pos2d,visual=(;enlarge=0.5,label_scatter=false),axis=(;limits=((0,1),(0,0.9))))
Comment on lines +53 to +56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
df = DataFrame(:estimate => data[:],:channel => repeat(1:size(data,1),outer=size(data,2)),:time => repeat(1:size(data,2),inner=size(data,1)))
plot_butterfly!(f[1,1:2],df;positions=pos2d)
plot_topoplot!(f[2,1],df[df.time .== 28,:];positions=pos2d,visual=(;enlarge=0.5,label_scatter=false),axis=(;limits=((0,1),(0,0.9))))
plot_topoplot!(f[2,2],df[df.time .== 48,:];positions=pos2d,visual=(;enlarge=0.5,label_scatter=false),axis=(;limits=((0,1),(0,0.9))))
df = DataFrame(
:estimate => data[:],
:channel => repeat(1:size(data, 1), outer = size(data, 2)),
:time => repeat(1:size(data, 2), inner = size(data, 1)),
)
plot_butterfly!(f[1, 1:2], df; positions = pos2d)
plot_topoplot!(
f[2, 1],
df[df.time.==28, :];
positions = pos2d,
visual = (; enlarge = 0.5, label_scatter = false),
axis = (; limits = ((0, 1), (0, 0.9))),
)
plot_topoplot!(
f[2, 2],
df[df.time.==48, :];
positions = pos2d,
visual = (; enlarge = 0.5, label_scatter = false),
axis = (; limits = ((0, 1), (0, 0.9))),
)

f

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
basisfunction::Any
maxlength::Any

Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# # New component: Duration + Shift
# We want a new component that changes it's duration and shift depending on a column in the event-design. This is somewhat already implemented in the HRF + Pupil bases
begin
using UnfoldSim
using Unfold
using Random
using DSP
using CairoMakie
end

# We want a new component that changes its duration and shift depending on a column in the event-design. This is somewhat already implemented in the HRF + Pupil bases
using UnfoldSim
using Unfold
using Random
using DSP
using CairoMakie, UnfoldMakie

sfreq = 100
sfreq = 100;

## Design
# Let's genrate a design with two columns, shift + duration
# ## Design
# Let's generate a design with two columns, shift + duration
design = UnfoldSim.SingleSubjectDesign(;conditions= Dict(
:shift => rand(100).*sfreq/5,
:duration=>20 .+rand(100).*sfreq/5))
Comment on lines 14 to 16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
design = UnfoldSim.SingleSubjectDesign(;conditions= Dict(
:shift => rand(100).*sfreq/5,
:duration=>20 .+rand(100).*sfreq/5))
design = UnfoldSim.SingleSubjectDesign(;
conditions = Dict(
:shift => rand(100) .* sfreq / 5,
:duration => 20 .+ rand(100) .* sfreq / 5,
),
)

Expand All @@ -24,7 +22,7 @@ struct TimeVaryingComponent <: AbstractComponent
maxlength
end

# we have to define the length of a component
# We have to define the length of a component
Base.length(c::TimeVaryingComponent) = length(c.maxlength)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

# While we could have put the TimeVaryingComponent.basisfunction directly into the simulate function, I thought this is a bit more modular
Expand Down Expand Up @@ -52,4 +50,4 @@ end


erp = UnfoldSim.simulate(MersenneTwister(1),TimeVaryingComponent(basis_shiftduration,50),design)
heatmap(hcat(erp...))
plot_erpimage(hcat(erp...),sortvalues=generate(design).shift)
Loading
Loading