Skip to content

Commit

Permalink
add BIDS reference; update others
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneSkukies committed Mar 5, 2024
1 parent dcd49bc commit 5db5ed9
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/literate/HowTo/ApplyPreprocessing.jl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# placeholder
# # Apply MNE preprocessing
38 changes: 38 additions & 0 deletions docs/literate/reference/BIDS.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# # Brain Imaging Data Structure
# If you are using UnfoldBIDS we assume you are already familiar with the BIDS format.
# However, since the package only works if your dataset is BIDS formatted, here is a quick reminder.
# If you want a more in-depth explanation, please refer to the official [BIDS documentation](https://bids-specification.readthedocs.io/en/stable/)

# ## Folder Structure
# Folders have to follow the following structure:

# |-BIDS-Root/
# |--- [required meta files]
# |--- sub-<label>/
# |--- eeg/
# |--- sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_eeg.<extension>
# |--- sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_eeg.json
# |--- sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.json
# |--- sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.tsv
# |--- derivatives/ <- for (pre-processed data)
# |--- [required meta files]
# |--- sub-<label>/
# |--- eeg/
# |--- sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_eeg.<extension>
# |--- sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_eeg.json
# |--- sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.json
# |--- sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.tsv

# ## File formats
# By BIDS standard your files have to be in one of the following formats:
# *EEG*
# - edf (European Data Fromat; single file)
# - vhdr (BrainVision format; file triplet of .vhdr, .vmrk and .eeg)
# - set (EEGLAB saved file; .fdt file optional)
# - fif (MNE save file; not BIDS conform, but implemented for convenience)
#
# *Events*
# UnfoldBIDS.jl will automatically try to load accompanying events.tsv files. Loading events from the EEG data files is currently not supported, and not BIDS conform.

# ## BIDS Transformation
# If your dataset is not yet BIDS conform you can use [MNE-BIDS](https://mne.tools/mne-bids/v0.5/index.html) to transform your data.
2 changes: 1 addition & 1 deletion docs/literate/reference/overview.jl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# placeholder
# # Toolbox overview
23 changes: 17 additions & 6 deletions docs/literate/tutorials/quickstart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,32 @@ using UnfoldBIDS

# To load use UnfoldBIDS to find the paths to all subject specific data you can uye the bidsLayout function:

path_to_bids_root = "/store/data/2023EEGManyLabs"
layout_df = bidsLayout(path_to_bids_root, derivative=false)

# ```julia
# path_to_bids_root = "/store/data/2023EEGManyLabs"
# layout_df = bidsLayout(path_to_bids_root, derivative=false)
# ```
# This will give you a DataFrame containing the paths too the eeg files of all subjects plus their accompanying event files

# !!! note
# Since we set the derivative keyword to false here UnfoldBIDS will only look for the raw EEG files. However, by default UnfoldBIDS assumes you have preprocessed data in a derivatives folder and try to look for those.

# Subsequently, you can load the data of all subjects into memory

eeg_df = load_bids_eeg_data(layout_df)

# ```julia
# eeg_df = load_bids_eeg_data(layout_df)
# ```
#
# !!! note
# The data is not actually loaded into memory, but uses MNE's lazy loading functionality.

# Lastly, current functionality only supports explicit loading of the events. In the future this will be done automatically with the previous step.

load_events(layoutDF)
# ```julia
# events_df = load_events(layoutDF)
# ```

# ## Run unfold type models

# ```julia
# resultsAll = runUnfold(eeg_df, events_df, bfDict; channels=nothing, eventcolumn="trial_type")
# ```
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ makedocs(;
],
"Reference" => [
"Overview: Toolbox Functions" => "./generated/reference/overview.md",
"Brain Imaging Data Structure" => "./generated/reference/BIDS.md"
],
"HowTo" => [
"Apply preprocessing functions" => "./generated/HowTo/ApplyPreprocessing.md",
Expand Down

0 comments on commit 5db5ed9

Please sign in to comment.