Skip to content

Commit

Permalink
updated the minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fmamashli committed Oct 8, 2019
1 parent 3ef716e commit ec2422c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Changelog

- :meth:`mne.Epochs.plot` now takes a ``epochs_colors`` parameter to color specific epoch segments by `Mainak Jas`_

- Add option to :func:`mne.preprocessing.fix_stim_artifact` to use baseline average to flatten TMS pulse artifact by `Fahimeh Mamashli`_ and `Padma Sundaram`_ and `Mohammad Daneshzand`_

Bug
~~~

Expand Down
1 change: 1 addition & 0 deletions mne/preprocessing/stim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Authors: Daniel Strohmeier <[email protected]>
# Fahimeh Mamashli <[email protected]>
# Padma Sundaram <[email protected]>
# Mohammad Daneshzand <[email protected]>
#
# License: BSD (3-clause)

Expand Down
9 changes: 6 additions & 3 deletions mne/preprocessing/tests/test_stim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Authors: Daniel Strohmeier <[email protected]>
# Fahimeh Mamashli <[email protected]>
# Padma Sundaram <[email protected]>
# Mohammad Daneshzand <[email protected]>
#
# License: BSD (3-clause)

Expand Down Expand Up @@ -59,7 +62,7 @@ def test_fix_stim_artifact():
base_t2 = b_end - e_start
baseline_mean = epochs.get_data()[:, :, base_t1:base_t2].mean(axis=2)[0][0]
data = epochs.get_data()[:, :, tmin_samp:tmax_samp]
assert data[0][0][0] == base_data
assert data[0][0][0] == baseline_mean

# use window before stimulus in raw
event_idx = np.where(events[:, 2] == 1)[0][0]
Expand All @@ -86,7 +89,7 @@ def test_fix_stim_artifact():
baseline=baseline, mode='constant')
data, times = raw[:, (tidx + tmin_samp):(tidx + tmax_samp)]
baseline_mean, _ = raw[:, (tidx + b_start):(tidx + b_end)]
assert data_base.mean(axis=1)[0] == data[0][0]
assert baseline_mean.mean(axis=1)[0] == data[0][0]

# get epochs from raw with fixed data
tmin, tmax, event_id = -0.2, 0.5, 1
Expand Down Expand Up @@ -120,4 +123,4 @@ def test_fix_stim_artifact():
base_t2 = int(baseline[1] * evoked.info['sfreq']) - evoked.first
data = evoked.data[:, tmin_samp:tmax_samp]
baseline_mean = evoked.data[:, base_t1:base_t2].mean(axis=1)[0]
assert data[0][0] == data_base
assert data[0][0] == baseline_mean

0 comments on commit ec2422c

Please sign in to comment.