File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 25
25
had previously already been marked as bad in the dataset. Resulting entries in the TSV file may now look like:
26
26
`"pre-existing (before MNE-BIDS-pipeline was run) & auto-noisy"` (previously: only `"auto-noisy"`). (#930 by @hoechenberger)
27
27
- The `ica_ctps_ecg_threshold` has been renamed to [`ica_ecg_threshold`][mne_bids_pipeline._config.ica_ecg_threshold]. (#935 by @hoechenberger)
28
+ - We changed the behavior when setting an EEG montage:
29
+ - When applying the montage, we now also check for channel aliases (e.g. `M1 -> TP9`).
30
+ - If the data contains a channel that is not present in the montage, we now abort with an exception (previously, we emitted a warning).
31
+ This is to prevent silent errors. To proceed in this situation, select a different montage, or drop the respective channels via
32
+ the [`drop_channels`][mne_bids_pipeline._config.drop_channels] configuration option. (#960 by @hoechenberger)
28
33
29
34
### :package: Requirements
30
35
Original file line number Diff line number Diff line change 346
346
You can find an overview of supported template montages at
347
347
https://mne.tools/stable/generated/mne.channels.make_standard_montage.html
348
348
349
+ !!! warning
350
+ If the data contains channel names that are not part of the template montage, the
351
+ pipeline run will fail with an error message. You must either pick a different
352
+ montage or remove those channels via
353
+ [`drop_channels`][mne_bids_pipeline._config.drop_channels] to continue.
354
+
355
+
349
356
???+ example "Example"
350
357
Do not apply template montage:
351
358
```python
362
369
"""
363
370
Names of channels to remove from the data. This can be useful, for example,
364
371
if you have added a new bipolar channel via `eeg_bipolar_channels` and now wish
365
- to remove the anode, cathode, or both.
372
+ to remove the anode, cathode, or both; or if your selected EEG template montage
373
+ doesn't contain coordinates for some channels.
366
374
367
375
???+ example "Example"
368
376
Exclude channels `Fp1` and `Cz` from processing:
Original file line number Diff line number Diff line change @@ -326,14 +326,10 @@ def _set_eeg_montage(
326
326
Modifies ``raw`` in-place.
327
327
"""
328
328
montage = cfg .eeg_template_montage
329
- is_mne_montage = isinstance (montage , mne .channels .montage .DigMontage )
330
- montage_name = "custom_montage" if is_mne_montage else montage
331
329
if cfg .datatype == "eeg" and montage :
332
330
msg = f"Setting EEG channel locations to template montage: " f"{ montage } ."
333
331
logger .info (** gen_log_kwargs (message = msg ))
334
- if not is_mne_montage :
335
- montage = mne .channels .make_standard_montage (montage_name )
336
- raw .set_montage (montage , match_case = False , on_missing = "warn" )
332
+ raw .set_montage (montage , match_case = False , match_alias = True )
337
333
338
334
339
335
def _fix_stim_artifact_func (cfg : SimpleNamespace , raw : mne .io .BaseRaw ) -> None :
You can’t perform that action at this time.
0 commit comments