Skip to content

Commit 8b877f6

Browse files
committed
iEEG re-referencing, native-rate tutorial datasets, BIDS import support, README tutorial
- iEEG re-referencing is its own step (#11): menu iEEGLAB > iEEG re-referencing (pop_ieeglab_reref) with CARLA (CCEP data), common average and the lowest-covariance subset. The baseline is re-applied after re-referencing, so the result equals re-referencing inside preprocessing. The Preprocess dialog no longer re-references. - Divisive baseline correction removed; only subtraction is offered. - No vistasoft needed (#8): ieeglab_read_gifti reads .surf.gii files. - #9: legacy CAR variance no longer uses var(..., 'omitnan'). - Loading after File > Import data > BIDS: sidecars are found from EEG.BIDS.sourcefile or the derivatives output folder; the event column moved into EEG.event.type is followed through EEG.BIDS.eInfo; channel labels that EEG-BIDS assigned by position are restored from channels.tsv with a warning. - Native-rate tutorial datasets as small BIDS datasets: tutorial/ieeglab_tutorial_seeg (OpenNeuro ds004696 sub-02) and tutorial/ieeglab_tutorial_ecog (ds004080 sub-ccepAgeUMCU02), built by tutorial/make_tutorial_datasets.m. - Tutorial rewritten (ieeglab_tutorial.m and README): sEEG with CARLA and CRP, ECoG with N1, from the menus or the command line. - ieeglab_check_install lists the MEF3, bva-io and EEG-BIDS plugins. - Local notes, papers and old scripts are no longer tracked.
1 parent ffda15b commit 8b877f6

106 files changed

Lines changed: 1680 additions & 5516 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/CLAUDE.md‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎.claude/HANDOFF.md‎

Lines changed: 0 additions & 85 deletions
This file was deleted.

‎.claude/LESSONS.md‎

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎.gitignore‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,17 @@ Thumbs.db
99
*acpc.nii
1010
*tmp.nii
1111
**/freesurfer/
12+
!tutorial/ieeglab_tutorial_seeg/derivatives/freesurfer/
1213
**/fsaverage
14+
15+
# EEGLAB BIDS import output when running the tutorial
16+
tutorial/*/derivatives/eeglab/
17+
18+
# Local notes, papers and old scripts: kept locally, not distributed with the plugin
19+
.claude/
20+
worklog/
21+
TODO.md
22+
ressources/
23+
archive/
24+
ieeglab_prep_tuto_datasets.m
25+
*.docx

‎CHANGELOG.md‎

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,49 @@
11
# Changelog
22

3-
## Unreleased (2026-09-21)
3+
## Unreleased (2026-09-25)
4+
5+
- **iEEG re-referencing is its own step (issue #11).** New menu item iEEGLAB >
6+
iEEG re-referencing (`pop_ieeglab_reref`): method (CARLA per stimulation site
7+
for CCEP data; common average; the lowest-covariance subset of Ojeda Valencia
8+
et al., 2023) and its options in one dialog, where bipolar, Laplacian and
9+
ICA-based referencing will be added. It runs on preprocessed epochs; when a
10+
baseline was removed it is removed again afterwards, which gives
11+
exactly the result of re-referencing inside preprocessing (checked in
12+
`tests/test_ieeglab_reref.m`, CARLA and CAR). The Preprocess dialog no longer
13+
re-references; `ieeglab_preprocess` keeps `apply_car` for scripts.
14+
15+
- **Works after EEGLAB's BIDS import (File > Import data > BIDS).** Sidecars are
16+
found next to the raw BIDS file (from `EEG.BIDS.sourcefile` when EEG-BIDS
17+
records it, else by mapping its default `derivatives/<pipeline>/sub-...`
18+
output folder back to the raw dataset). The event column EEG-BIDS moved into
19+
`EEG.event.type` is followed through `EEG.BIDS.eInfo`, so the stimulation site
20+
is used instead of `trial_type` (which labelled every pulse the same).
21+
- **Channel labels restored after EEGLAB's BIDS import.** EEG-BIDS assigns
22+
electrodes.tsv rows to channels by position; on ds004696 sub-02 this gives most
23+
contacts the wrong label. While every channel is present, labels are restored
24+
from channels.tsv (data order) with warning `ieeglab_load:bidsImportLabels`,
25+
and coordinates are matched by name. The fix itself is on branch
26+
`fix-chanlocs-by-name` of EEG-BIDS (2c03423), to be proposed upstream.
27+
- **No vistasoft needed (issue #8).** `ieeglab_read_gifti` reads .surf.gii files
28+
(ASCII, base64, gzip; either array order), identical to the @gifti class on all
29+
tutorial surfaces. `ieeglab_check_install` now lists the MEF3, bva-io and
30+
EEG-BIDS plugins instead of vistasoft and matmef.
31+
- **Issue #9:** the variance in the legacy fixed-fraction CAR no longer uses
32+
`var(..., 'omitnan')`, which failed on some MATLAB installations.
33+
- **Native-rate tutorial datasets** `tutorial/ieeglab_tutorial_seeg` (ds004696
34+
sub-02, 18 contacts, 3 sites, 2048 Hz) and `tutorial/ieeglab_tutorial_ecog`
35+
(ds004080 sub-ccepAgeUMCU02, 20 contacts, 3 sites, 2048 Hz), each a small BIDS
36+
dataset, built and checked against the source by `tutorial/make_tutorial_datasets.m`.
37+
- **Test: `tests/test_ieeglab_bids_import.m`** (GIfTI reader, sidecar lookup,
38+
loading after `pop_importbids`).
39+
- **Divisive baseline correction removed.** It is not meaningful for
40+
time-domain iEEG (the baseline mean is near zero after high-pass filtering);
41+
only subtraction is offered.
42+
- **Tutorial rewritten** for the native-rate datasets (`ieeglab_tutorial.m` and
43+
the README), sEEG with CRP and ECoG with N1.
44+
- Events whose type is empty or `n/a` are dropped whichever event field is used.
45+
46+
## 2026-09-21
447

548
- **N1 detection gains erdetect's rule as options.** `ieeglab_detect_n1` now
649
takes `polarity` ('abs' default, 'negative' as erdetect, 'positive') and
@@ -37,16 +80,16 @@
3780
baseline correction, and broke Hermitian symmetry so part of the signal was
3881
discarded.
3982
- **Baseline correction is guarded** against windows outside the epoch, windows
40-
crossing t = 0, too few samples, unsafe divisive baselining, and overlap with
41-
the blanked stimulation window.
83+
crossing t = 0, too few samples, and overlap with the blanked stimulation
84+
window. Only subtractive baselines are offered.
4285
- **Removing a contact no longer drops unrelated trials.** Several steps matched
4386
stimulation sites with a substring test, so removing `RA1` also removed every
4487
`RA10-RA9` trial.
4588
- **Electrode coordinates are never assigned by row order silently.** When no
4689
label matched, the loader relabelled every channel by TSV row and reported a
4790
100% match.
4891

49-
### Adversarial audit — 48 confirmed findings, all fixed
92+
### Other fixes
5093

5194
- **N1 significance ignored that the peak was searched for.** The z-score of
5295
the largest deflection in the window was tested as if the latency were fixed.

0 commit comments

Comments
 (0)