@@ -29,7 +29,8 @@ class NoisyChannels:
29
29
Parameters
30
30
----------
31
31
raw : mne.io.Raw
32
- An MNE Raw object to check for bad EEG channels.
32
+ An MNE Raw object to check for bad EEG channels. Channels set to bad
33
+ in ``raw.info["bads"]`` will not be used to find additional bad channels.
33
34
do_detrend : bool, optional
34
35
Whether or not low-frequency (<1.0 Hz) trends should be removed from the
35
36
EEG signal prior to bad channel detection. This should always be set to
@@ -49,6 +50,10 @@ class NoisyChannels:
49
50
to other methods. RANSAC can detect bad channels that other
50
51
methods are unable to catch, but also slows down noisy channel
51
52
detection considerably. Defaults to ``True``.
53
+ bad_by_manual : list of str
54
+ List of channels that are bad. These channels will be excluded when
55
+ trying to find additional bad channels. Note that the union of these channels
56
+ and those declared in ``raw.info["bads"]`` will be used.
52
57
53
58
References
54
59
----------
@@ -66,13 +71,15 @@ def __init__(
66
71
matlab_strict = False ,
67
72
* ,
68
73
ransac = True ,
74
+ bad_by_manual = None ,
69
75
):
70
76
# Make sure that we got an MNE object
71
77
assert isinstance (raw , mne .io .BaseRaw )
72
78
73
79
raw .load_data ()
74
80
self .raw_mne = raw .copy ()
75
- self .bad_by_manual = raw .info ["bads" ]
81
+ bad_by_manual = bad_by_manual if bad_by_manual else []
82
+ self .bad_by_manual = list (set (bad_by_manual + raw .info ["bads" ]))
76
83
self .raw_mne .pick ("eeg" ) # excludes bads
77
84
self .sample_rate = raw .info ["sfreq" ]
78
85
if do_detrend :
0 commit comments