Skip to content

Commit 394ee2c

Browse files
LychfindelAlessandro Toninsappelhofflarsoner
authored
Avoid lowpass=0 in brainvision data (#10517)
* Avoid lowpass=0 in brainvision data * Add changelog * Update doc/changes/latest.inc Co-authored-by: Stefan Appelhoff <[email protected]> Co-authored-by: Alessandro Tonin <[email protected]> Co-authored-by: Stefan Appelhoff <[email protected]> Co-authored-by: Eric Larson <[email protected]>
1 parent a264cdb commit 394ee2c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

doc/changes/latest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Enhancements
2727

2828
Bugs
2929
~~~~
30+
- Fix bug in :func:`mne.io.read_raw_brainvision` when BrainVision data are acquired with the Brain Products "V-Amp" amplifier and disabled lowpass filter is marked with value ``0`` (:gh:`10517` by :newcontrib:`Alessandro Tonin`)
31+
3032
- Fix bug in :func:`mne.pick_types` and related methods where ``csd=True`` was not passed handled properly (:gh:`10470` by :newcontrib:`Matthias Dold`)
3133

3234
- Fix bug where plots produced using the ``'qt'`` / ``mne_qt_browser`` backend could not be added using :meth:`mne.Report.add_figure` (:gh:`10485` by `Eric Larson`_)

doc/changes/names.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@
426426
427427
.. _Senwen Deng: https://snwn.de
428428
429+
.. _Alessandro Tonin: https://wysscenter.ch/team/alessandro-tonin
430+
429431
.. _Michiru Kaneda: https://github.com/rcmdnk
430432
431433
.. _Scott Huberty: https://orcid.org/0000-0003-2637-031X

mne/io/brainvision/brainvision.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ def _get_vhdr_info(vhdr_fname, eog, misc, scale):
725725
if len(lowpass) == 0:
726726
pass
727727
elif len(set(lowpass)) == 1:
728-
if lowpass[0] in ('NaN', 'Off'):
728+
if lowpass[0] in ('NaN', 'Off', '0'):
729729
pass # Placeholder for future use. Lowpass set in _empty_info
730730
else:
731731
info['lowpass'] = float(lowpass[0])
@@ -738,7 +738,7 @@ def _get_vhdr_info(vhdr_fname, eog, misc, scale):
738738
if lp_s:
739739
# We convert channels with disabled filters to having
740740
# infinitely relaxed / no filters
741-
lowpass = [float(filt) if filt not in ('NaN', 'Off')
741+
lowpass = [float(filt) if filt not in ('NaN', 'Off', '0')
742742
else 0.0 for filt in lowpass]
743743
info['lowpass'] = np.min(np.array(lowpass, dtype=np.float64))
744744
try:
@@ -760,7 +760,7 @@ def _get_vhdr_info(vhdr_fname, eog, misc, scale):
760760
else:
761761
# We convert channels with disabled filters to having
762762
# infinitely relaxed / no filters
763-
lowpass = [float(filt) if filt not in ('NaN', 'Off')
763+
lowpass = [float(filt) if filt not in ('NaN', 'Off', '0')
764764
else np.Inf for filt in lowpass]
765765
info['lowpass'] = np.max(np.array(lowpass, dtype=np.float64))
766766

0 commit comments

Comments
 (0)