Skip to content

Commit 775bf66

Browse files
committed
LSLAutoBIDS tutorial update
1 parent 0d2a4e1 commit 775bf66

File tree

2 files changed

+49
-13
lines changed

2 files changed

+49
-13
lines changed
57.6 KB
Loading

docs/tutorial.md

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Tutorial
22
## Getting Started with LSLAutoBIDS
33

4+
![](images/2025-09-12_lsl-flowchart.png)
5+
46
This tutorial will guide you through the steps to set up and use the LSLAutoBIDS package for converting EEG recordings to BIDS format, version controlling the data with Datalad, and uploading it to a Dataverse repository with a practical example.
57

68
### Installation and Download
@@ -11,11 +13,29 @@ git clone https://github.com/s-ccs/LSLAutoBIDS.git
1113
2. Pip install the package
1214
```
1315
cd LSLAutoBIDS
14-
pip install lslautobids
16+
pip install .
1517
```
1618
3. Download the dummy dataset for testing in the LSLAutoBIDS root directory - ([tutorial_sample_dataset](https://files.de-1.osf.io/v1/resources/wz7g9/providers/osfstorage/68c3c636e33eca3b0feffa2c/?zip=))
1719

1820
The dataset has a sample project called the test project "test-project" which contains an EEG recording file in the projects directory, a sample eyetracking recording in the `project_stimulus/data` directory and a dummy experimental code file `project_stimulus/experiment` directory.
21+
```
22+
sample_data
23+
└── project_stimulus
24+
└── test-project
25+
├── data
26+
└── sub-999
27+
└── ses-001
28+
└── beh
29+
└── behavioral_files((lab notebook, CSV, EDF file, etc))
30+
├── experiment
31+
└── experimental_files (Matlab code, opensesame files, etc)
32+
└── projects
33+
└── test-project
34+
└── sub-999
35+
└── ses-001
36+
└── eeg
37+
└── xdf file
38+
```
1939

2040
### Configuration
2141
1. Generate the global configuration file
@@ -27,16 +47,16 @@ This will create a configuration file template in folder `~/.config/lslautobids/
2747
2. Create a Dataverse account and get the API token
2848
- Create a dataverse account in your institution's dataverse server (e.g. https://darus.uni-stuttgart.de/dataverse/darus)
2949
- Create a new dataverse for your project
30-
- Create a new API token from your dataverse account settings page.
50+
- Create a new API token from your dataverse account settings page (http://guides.dataverse.org/en/latest/user/index.html).
3151

3252
3. Open the configuration file `~/.config/lslautobids/autobids_config.yaml` and fill in the details
3353
- Edit the file e.g. via `nano ~/.config/lslautobids/autobids_config.yaml` to add the dataverse and project root details.
3454

3555
Configuration file template:
3656
```yaml
37-
"BIDS_ROOT": "# relative to home/users directory: LSLAutoBIDS/data/bids/",
38-
"PROJECT_ROOT" : "# relative to home/users: LSLAutoBIDS/data/projects/",
39-
"PROJECT_STIM_ROOT" : "# path relative to home/users: LSLAutoBIDS/data/project_stimulus/",
57+
"BIDS_ROOT": "# relative to home/users directory: LSLAutoBIDS/sample_data/bids/",
58+
"PROJECT_ROOT" : "# relative to home/users: LSLAutoBIDS/sample_data/projects/",
59+
"PROJECT_STIM_ROOT" : "# path relative to home/users: LSLAutoBIDS/sample_data/project_stimulus/",
4060
"BASE_URL": "https://darus.uni-stuttgart.de", # The base URL for the service.
4161
"API_KEY": "# Paste your dataverse API token here", # Your API token for authentication.
4262
"PARENT_DATAVERSE_NAME": "simtech_pn7_computational_cognitive_science" # The name of the dataverse to which datasets will be uploaded. When you in the dataverses page , you can see this name in the URL after 'dataverse/'.
@@ -49,13 +69,13 @@ This will create a project-specific configuration file template in the specified
4969
```
5070
lslautobids gen-proj-config --project TestProject2025
5171
```
52-
Fill in the details in the configuration file `LSLAutoBIDS/data/projects/TestProject2025/TestProject2025_config.toml` file.
72+
Fill in the details in the configuration file `LSLAutoBIDS/sample_data/projects/test-project/test-project_config.toml` file.
5373

5474
You can find the details about the parameters in the comments of the template configuration file generated. For this tutorial you might want to just change the author and email fields. Rest of the fields are already filled in for the test project.
5575

5676
## Example Case 1
5777

58-
A lab wants to conduct an EEG-EyeTracking experiment and wants to make this dataset publicly available for the other neuroscience researchers. To assure data provenence and reproducibility within and across labs, they want to have a standardized structure for storing the data and code files.
78+
A lab wants to conduct an EEG-EyeTracking experiment and wants to make this dataset publicly available for the other neuroscience researchers. To assure data provenence and reproducibility within and across labs, they want to have a standardized structure for storing the data and code files.
5979

6080
In this example we will see how to use the LSLAutoBIDS package to:
6181
1. Convert the recorded EEG data in xdf format to BIDS format.
@@ -64,8 +84,7 @@ In this example we will see how to use the LSLAutoBIDS package to:
6484
4. Upload the dataset to a dataverse repository for public access.
6585

6686
### How to run the example?
67-
68-
1. Check if the toml configuration file `LSLAutoBIDS/data/projects/TestProject2025/TestProject2025_config.toml` is filled in with the correct details, specially the stimulusComputerUsed and expectedFiles fields. For this example we are using eye tracking data as a behavioral file, thus the stimulusComputerUsed field should be set to true and the expectedFiles field should contain the expected stimulus file extensions.
87+
1. Check if the toml configuration file `LSLAutoBIDS/sample_data/projects/test-project/test-project_config.toml` is filled in with the correct details, specially the stimulusComputerUsed and expectedFiles fields. For this example we are using eye tracking data as a behavioral file, thus the stimulusComputerUsed field should be set to true and the expectedFiles field should contain the expected stimulus file extensions.
6988
```toml
7089
[Computers]
7190
stimulusComputerUsed = true
@@ -75,17 +94,34 @@ In this example we will see how to use the LSLAutoBIDS package to:
7594
```
7695
2. Run the conversion and upload command to convert the xdf files to BIDS format and upload the data to the dataverse.
7796
```
78-
lslautobids run -p TestData2025
97+
lslautobids run -p test-project
7998
```
8099

81-
1. This will convert the xdf file in the `LSLAutoBIDS/data/projects/TestProject2025/sub-001/ses-001/eeg/` directory to BIDS format and store it in the `LSLAutoBIDS/data/bids/TestProject2025/sub-001/ses-001/` directory.
82-
2. You can check the logs in the log file `LSLAutoBIDS/data/bids/TestProject2025/code/TestProject2025.log` file.
83-
3. The source data i.e. the raw xdf file, behavioral data (e.g. eye-tracking recording) and the experimental code files in `PROJECT_STIM_ROOT/TestProject2025/experiment` (all files e.g. .py, .oxexp will be compressed to a `tar.gz` archive) will be copied to the `LSLAutoBIDS/data/bids/TestProject2025/source_data/`, `LSLAutoBIDS/data/bids/TestProject2025/beh/` and `LSLAutoBIDS/data/bids/TestProject2025/misc/` directories respectively.
100+
1. This will convert the xdf file in the `LSLAutoBIDS/sample_data/projects/test-project/sub-999/ses-001/eeg/` directory to BIDS format and store it in the `LSLAutoBIDS/sample_data/bids/test-project/sub-999/ses-001/` directory.
101+
2. You can check the logs in the log file `LSLAutoBIDS/sample_data/bids/test-project/code/test-project.log` file.
102+
3. The source data i.e. the raw xdf file, behavioral data (e.g. eye-tracking recording) and the experimental code files in `PROJECT_STIM_ROOT/test-project/experiment` (all files e.g. .py, .oxexp will be compressed to a `tar.gz` archive) will be copied to the `LSLAutoBIDS/sample_data/bids/test-project/source_data/`, `LSLAutoBIDS/sample_data/bids/test-project/beh/` and `LSLAutoBIDS/sample_data/bids/test-project/misc/` directories respectively.
84103

85104
## Example Case 2
105+
In this case the experimenter wants to publish **only the raw EEG recordings and the converted EEG files**, but **exclude the stimulus files and experiment code**.
106+
107+
### How to run the example?
108+
1. The workflow is almost identical to Example Case 1, except **stimulus and experiment files are excluded**.
109+
2. Check if the toml configuration file `LSLAutoBIDS/sample_data/projects/test-project/test-project_config.toml` is filled in with the correct details.
110+
111+
```toml
112+
[Computers]
113+
stimulusComputerUsed = False
114+
```
115+
3. Run the conversion and upload command to convert the xdf files to BIDS format and upload the data to the dataverse.
116+
```
117+
lslautobids run -p test-project
118+
```
119+
1. This will convert the xdf file, and you can check the logs in the log file as shwon in example case 1.
120+
2. `LSLAutoBIDS/sample_data/bids/test-project/beh` and `LSLAutoBIDS/sample_data/bids/test-project/misc` directories are not exist in the **converted bids**.
86121

87122

88123

124+
## Example Case 3
89125

90126
## After publishing the dataset (Out of Scope of this package)
91127

0 commit comments

Comments
 (0)