Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Jul 31, 2022
1 parent d8860e7 commit 12bf17f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
1 change: 0 additions & 1 deletion doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@
.. _Simon Kern: https://github.com/skjerns
.. _Yorguin Mantilla: https://github.com/yjmantilla
.. _Swastika Gupta: https://swastyy.github.io
.. _Mathieu Scheltienne: https://github.com/mscheltienne
.. _Scott Huberty: https://github.com/scott-huberty
2 changes: 0 additions & 2 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ Detailed list of changes

- :func:`~mne_bids.write_raw_bids` now correctly excludes stim channels when writing to electrodes.tsv, by `Scott Huberty`_ (:gh:`1023`)

- :func:`~mne_bids.write_raw_bids` now correctly excludes eog, ecg, emg channels when writing to electrodes.tsv, by `Mathieu Scheltienne`_ (:gh:`1032`)

:doc:`Find out what was new in previous releases <whats_new_previous_releases>`

.. include:: authors.rst
12 changes: 3 additions & 9 deletions mne_bids/dig.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,9 @@ def _write_electrodes_tsv(raw, fname, datatype, overwrite=False):
# create list of channel coordinates and names
x, y, z, names = list(), list(), list(), list()
for ch in raw.info['chs']:
if ch['kind'] in (
FIFF.FIFFV_STIM_CH,
FIFF.FIFFV_EMG_CH,
FIFF.FIFFV_EOG_CH,
FIFF.FIFFV_ECG_CH,
):
logger.debug(
f"Not writing channel {ch['ch_name']} to electrodes.tsv"
)
if ch['kind'] == FIFF.FIFFV_STIM_CH:
logger.debug(f"Not writing stim chan {ch['ch_name']} "
f"to electrodes.tsv")
continue
elif (
np.isnan(ch['loc'][:3]).any() or
Expand Down
6 changes: 1 addition & 5 deletions mne_bids/tests/test_dig.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,7 @@ def test_convert_montage():
def test_electrodes_io(tmp_path):
"""Ensure only electrodes end up in *_electrodes.json."""
raw = _load_raw()
raw.pick_types(eeg=True, eog=True, stim=True) # we don't need meg channels
# fake some EMG/ECG channels
raw.del_proj()
raw.set_channel_types({"EEG 059": "ecg", "EEG 060": "emg"})
raw.rename_channels({"EEG 059": "ECG", "EEG 060": "EMG"})
raw.pick_types(eeg=True, stim=True) # we don't need meg channels
bids_root = tmp_path / 'bids1'
bids_path = _bids_path.copy().update(root=bids_root, datatype='eeg')
write_raw_bids(raw=raw, bids_path=bids_path)
Expand Down

0 comments on commit 12bf17f

Please sign in to comment.