Skip to content

Commit c1d59ec

Browse files
authored
Add chpi to known channel list (#1325)
* add chpi to known channel list * removed some ch types from testing * change chpi to BIDS type HLU * adapt changelog * remove myself from authors again?
1 parent a0ff786 commit c1d59ec

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

doc/whats_new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The following authors contributed for the first time. Thank you so much! 🤩
2020
* `Aaron Earle-Richardson`_
2121
* `Amaia Benitez`_
2222
* `Kaare Mikkelsen`_
23+
* `Simon Kern`_
2324
* `Thomas Hartmann`_
2425
* `William Turner`_
2526

@@ -55,6 +56,7 @@ Detailed list of changes
5556
🪲 Bug fixes
5657
^^^^^^^^^^^^
5758

59+
- Writing MEGIN data with MNE channel types `chpi` will now map to BIDS type HLU by `Simon Kern`_ (:gh:`1325`)
5860
- When anonymizing the date of a recording, MNE-BIDS will no longer error during `~mne_bids.write_raw_bids` if passing a `~mne.io.Raw` instance to ``empty_room``, by `Daniel McCloy`_ (:gh:`1270`)
5961
- Dealing with alphanumeric ``sub`` entity labels is now fixed for :func:`~mne_bids.write_raw_bids`, by `Aaron Earle-Richardson`_ (:gh:`1291`)
6062
- When processing subject_info data that MNE Python imports as numpy arrays with only one item, MNE-BIDS now unpacks these, resulting in a correct participants.tsv, by `Thomas Hartmann`_ (:gh:`1310`)

mne_bids/tests/test_utils.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,36 @@ def test_get_ch_type_mapping():
3939
with pytest.raises(ValueError, match='specified from "bogus" to "mne"'):
4040
_get_ch_type_mapping(fro="bogus", to="mne")
4141

42+
# check that all mne types have a corresponding BIDS translation
43+
# last update from mne 0.19.0.
44+
mne_valid_types = [
45+
"bio",
46+
"chpi",
47+
"dbs",
48+
# "dipole", # currently not converted
49+
"ecg",
50+
"ecog",
51+
"eeg",
52+
"emg",
53+
"eog",
54+
"exci",
55+
# "eyetrack", # currently not converted
56+
# "fnirs", # currently not converted
57+
# "gof", # currently not converted
58+
"gsr",
59+
"ias",
60+
"misc",
61+
# "meg", # inferred in more detail
62+
"resp",
63+
"seeg",
64+
"stim",
65+
"syst",
66+
"temperature",
67+
]
68+
map_mne_to_bids = _get_ch_type_mapping(fro="mne", to="bids")
69+
for ch_type in mne_valid_types:
70+
assert ch_type in map_mne_to_bids
71+
4272

4373
def test_handle_datatype():
4474
"""Test the automatic extraction of datatype from the data."""

mne_bids/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def _get_ch_type_mapping(fro="mne", to="bids"):
8282
megrefgradaxial="MEGREFGRADAXIAL",
8383
meggradplanar="MEGGRADPLANAR",
8484
megrefmag="MEGREFMAG",
85+
chpi="HLU",
8586
ias="MEGOTHER",
8687
syst="MEGOTHER",
8788
exci="MEGOTHER",

0 commit comments

Comments
 (0)