Skip to content

Commit

Permalink
FIX: read_montage is deprecated in MNE>=0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Mar 29, 2020
1 parent a233e15 commit 31c4ab1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pyprep/noisy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module contains functions and classes for noisy EEG data detection."""
from distutils.version import LooseVersion

import mne
import numpy as np
Expand Down Expand Up @@ -144,9 +145,14 @@ def __init__(
# Set montage, pick data type, get data and transform to uVolts
# We also filter all data at `low_cut` Hz highpass and obtain some data
# bandpassed between `low_cut` and `high_cut` Hz.
montage = mne.channels.read_montage(
kind=montage_kind, ch_names=self.raw_copy.ch_names
)
if LooseVersion(mne.__version__) < LooseVersion('0.20'):
montage = mne.channels.read_montage(
kind=montage_kind, ch_names=self.raw_copy.ch_names
)
else:
montage = mne.channels.make_standard_montage(montage_kind)


self.raw_copy.set_montage(montage)
self.raw_copy.pick_types(eeg=True, stim=False)
self.raw_copy.filter(
Expand Down

0 comments on commit 31c4ab1

Please sign in to comment.