Skip to content

Commit a6da011

Browse files
Merge branch 'master' into resize
2 parents 25c7d59 + 3fdd502 commit a6da011

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+569
-384
lines changed

doc/changes/latest.inc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Changelog
6767

6868
- Add "on_missing='raise'" to :meth:`mne.io.Raw.set_montage` and related functions to allow ignoring of missing electrode coordinates by `Adam Li`_
6969

70+
- Add better sanity checking of ``max_pca_components`` and ``n_components`` to provide more informative error messages for :class:`mne.preprocessing.ICA` by `Eric Larson`_
71+
7072
- Add ``plot`` option to :meth:`mne.viz.plot_filter` allowing selection of which filter properties are plotted and added option for user to supply ``axes`` by `Robert Luke`_
7173

7274
- Add estimation method legend to :func:`mne.viz.plot_snr_estimate` by `Eric Larson`_
@@ -77,6 +79,8 @@ Changelog
7779

7880
- Add ECoG misc EDF dataset to the :ref:`tut_working_with_ecog` tutorial to show snapshots of time-frequency activity by `Adam Li`_
7981

82+
- Add :func:`mne.viz.set_3d_options` and ``MNE_3D_OPTION_ANTIALIAS`` environment variable to control full-scene antialiasing (FXAA) in 3D functions like :ref:`mne coreg`, :func:`mne.viz.plot_alignment`, and :func:`mne.viz.plot_source_estimates`; this can be useful on systems where FXAA does not work well, such as some with MESA software rendering, by `Eric Larson`_
83+
8084
- Add better support for reading corrupted FIF files in :func:`mne.io.read_raw_fif` by `Eric Larson`_
8185

8286
- BIDS conformity: When saving FIF files to disk and the files are split into parts, the ``split_naming='bids'`` parameter now uses a "_split-%d" naming instead of the previous "_part-%d", by `Stefan Appelhoff`_
@@ -104,6 +108,10 @@ Bug
104108
105109
- Fix bug with :func:`mne.minimum_norm.apply_inverse` where the explained variance did not work for complex data by `Eric Larson`_
106110
111+
- Fix bug with :func:`mne.preprocessing.compute_current_source_density` where values were not properly computed; maps should now be more focal, by `Alex Rockhill`_ and `Eric Larson`_
112+
113+
- Fix bug with :func:`mne.combine_evoked` where equal-weighted averages were wrongly computed as equal-weighted sums, by `Daniel McCloy`_
114+
107115
- Fix to enable interactive plotting with no colorbar with :func:`mne.viz.plot_evoked_topomap` by `Daniel McCloy`_
108116
109117
- Fix plotting with :func:`mne.viz.plot_evoked_topomap` to pre-existing axes by `Daniel McCloy`_
@@ -176,6 +184,10 @@ Bug
176184
177185
- Fix bug with :func:`mne.bem.make_watershed_bem` where the RAS coordinates of watershed bem surfaces were not updated correctly from the volume file by `Yu-Han Luo`_
178186
187+
- Fix bug with :meth:`mne.io.Raw.get_channel_types` and related methods where the ordering of ``picks`` was not preserved, by `Eric Larson`_
188+
189+
- Fix bug with :meth:`mne.io.Raw.plot_psd` with ``average=False`` and multiple channel types where channel locations were not shown properly by `Eric Larson`_
190+
179191
- Fix bug in FieldTrip reader functions when channels are missing in the ``info`` object by `Thomas Hartmann`_
180192
181193
- Throw proper error when trying to import FieldTrip Epochs data with non-uniform time for trials by `Thomas Hartmann`_

doc/install/advanced.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,17 @@ to force MESA to use modern OpenGL by using this before executing
160160
Also, it's possible that different software rending backends might perform
161161
better than others, such as using the ``llvmpipe`` backend rather than ``swr``.
162162

163+
MESA also can have trouble with full-screen antialiasing, which you can
164+
disable with:
165+
166+
.. code-block:: console
167+
168+
$ export MNE_3D_OPTION_ANTIALIAS=false
169+
170+
or by doing
171+
:func:`mne.viz.set_3d_options(antialias=False) <mne.viz.set_3d_options>` within
172+
a given Python session.
173+
163174
.. _troubleshoot_3d:
164175

165176
Troubleshooting 3D plots in MNE-Python

doc/python_reference.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ Visualization
278278
set_3d_backend
279279
get_3d_backend
280280
use_3d_backend
281+
set_3d_options
281282
set_3d_view
282283
set_3d_title
283284
create_3d_figure

doc/references.bib

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ @article{CichyEtAl2014
187187
year = {2014}
188188
}
189189

190+
@book{Cohen2014,
191+
place={Cambridge, MA},
192+
title={Analyzing Neural Time Series Data: Theory and Practice},
193+
publisher={MIT Press},
194+
author={Cohen, Mike X.},
195+
year={2014}
196+
}
197+
190198
@article{CohenHosaka1976,
191199
author = {Cohen, David and Hosaka, Hidehiro},
192200
doi = {10.1016/S0022-0736(76)80041-6},
@@ -382,7 +390,17 @@ @article{GlasserEtAl2016
382390
journal = {Nature},
383391
number = {7615},
384392
pages = {171-178},
385-
title = {A Multi-Modal Parcellation of Human Cerebral Cortex},
393+
title = {A multi-modal parcellation of human cerebral cortex},
394+
volume = {536},
395+
year = {2016}
396+
}
397+
398+
@article{GlasserEtAl2016supp,
399+
author = {Glasser, Matthew F. and Coalson, Timothy S. and Robinson, Emma C. and Hacker, Carl D. and Harwell, John and Yacoub, Essa and Ugurbil, Kamil and Andersson, Jesper and Beckmann, Christian F. and Jenkinson, Mark and Smith, Stephen M. and Van Essen, David C.},
400+
url = {https://static-content.springer.com/esm/art%3A10.1038%2Fnature18933/MediaObjects/41586_2016_BFnature18933_MOESM330_ESM.pdf#page=2},
401+
journal = {Nature},
402+
number = {7615},
403+
title = {Supplementary neuroanatomical results for “{A} multi-modal parcellation of human cerebral cortex”},
386404
volume = {536},
387405
year = {2016}
388406
}
@@ -1154,16 +1172,16 @@ @article{Pascual-Marqui2002
11541172
}
11551173

11561174
@article{Pascual-Marqui2011,
1157-
title = {Assessing interactions in the brain with exact low-resolution electromagnetic tomography},
1158-
volume = {369},
1159-
url = {https://royalsocietypublishing.org/doi/full/10.1098/rsta.2011.0081},
1160-
doi = {10.1098/rsta.2011.0081},
1161-
number = {1952},
1162-
journal = {Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences},
1163-
author = {Pascual-Marqui, Roberto D. and Lehmann, Dietrich and Koukkou, Martha and Kochi, Kieko and Anderer, Peter and Saletu, Bernd and Tanaka, Hideaki and Hirata, Koichi and John, E. Roy and Prichep, Leslie and Biscay-Lirio, Rolando and Kinoshita, Toshihiko},
1164-
month = oct,
1165-
year = {2011},
1166-
pages = {3768--3784}
1175+
title = {Assessing interactions in the brain with exact low-resolution electromagnetic tomography},
1176+
volume = {369},
1177+
url = {https://royalsocietypublishing.org/doi/full/10.1098/rsta.2011.0081},
1178+
doi = {10.1098/rsta.2011.0081},
1179+
number = {1952},
1180+
journal = {Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences},
1181+
author = {Pascual-Marqui, Roberto D. and Lehmann, Dietrich and Koukkou, Martha and Kochi, Kieko and Anderer, Peter and Saletu, Bernd and Tanaka, Hideaki and Hirata, Koichi and John, E. Roy and Prichep, Leslie and Biscay-Lirio, Rolando and Kinoshita, Toshihiko},
1182+
month = oct,
1183+
year = {2011},
1184+
pages = {3768--3784}
11671185
}
11681186

11691187
@book{PercivalWalden1993,
@@ -1177,6 +1195,20 @@ @book{PercivalWalden1993
11771195
year = {1993}
11781196
}
11791197

1198+
@article{PerrinEtAl1987,
1199+
title = {Scalp {Current} {Density} {Mapping}: {Value} and {Estimation} from {Potential} {Data}},
1200+
volume = {BME-34},
1201+
issn = {1558-2531},
1202+
shorttitle = {Scalp {Current} {Density} {Mapping}},
1203+
doi = {10.1109/TBME.1987.326089},
1204+
number = {4},
1205+
journal = {IEEE Transactions on Biomedical Engineering},
1206+
author = {Perrin, F. and Bertrand, O. and Pernier, J.},
1207+
month = apr,
1208+
year = {1987},
1209+
pages = {283--288}
1210+
}
1211+
11801212
@article{PerrinEtAl1989,
11811213
author = {Perrin, François M. and Pernier, Jacques and Bertrand, Olivier M. and Echallier, Jean Franćois},
11821214
doi = {10.1016/0013-4694(89)90180-6},
@@ -1710,3 +1742,18 @@ @article{Zhang1995
17101742
volume = {40},
17111743
year = {1995}
17121744
}
1745+
1746+
@article{KayserTenke2015,
1747+
title = {On the benefits of using surface {Laplacian} ({Current} {Source} {Density}) methodology in electrophysiology},
1748+
volume = {97},
1749+
issn = {0167-8760},
1750+
doi = {10.1016/j.ijpsycho.2015.06.001},
1751+
number = {3},
1752+
journal = {International journal of psychophysiology : official journal of the International Organization of Psychophysiology},
1753+
author = {Kayser, Jürgen and Tenke, Craig E.},
1754+
month = sep,
1755+
year = {2015},
1756+
pmid = {26071227},
1757+
pmcid = {PMC4610715},
1758+
pages = {171--173}
1759+
}

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies:
3737
- https://github.com/numpy/numpydoc/archive/master.zip
3838
- imageio-ffmpeg>=0.4.1
3939
- vtk
40-
- pyvista>=0.24
40+
- pyvista==0.24
4141
- https://github.com/enthought/mayavi/archive/master.zip
4242
- PySurfer[save_movie]
4343
- dipy --only-binary dipy

examples/datasets/plot_limo_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@
161161

162162
# Face A minus Face B
163163
difference_wave = combine_evoked([limo_epochs['Face/A'].average(),
164-
-limo_epochs['Face/B'].average()],
165-
weights='equal')
164+
limo_epochs['Face/B'].average()],
165+
weights=[1, -1])
166166

167167
# plot difference wave
168168
difference_wave.plot_joint(times=[0.15], title='Difference Face A - Face B')

examples/preprocessing/plot_eeg_csd.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
Transform EEG data using current source density (CSD)
44
=====================================================
55
6-
This script shows an example of how to use CSD [1]_ [2]_ [3]_.
6+
This script shows an example of how to use CSD
7+
:footcite`PerrinEtAl1987,PerrinEtAl1989,Cohen2014,KayserTenke2015`.
78
CSD takes the spatial Laplacian of the sensor signal (derivative in both
89
x and y). It does what a planar gradiometer does in MEG. Computing these
910
spatial derivatives reduces point spread. CSD transformed data have a sharper
1011
or more distinct topography, reducing the negative impact of volume conduction.
1112
"""
12-
# Authors: Alex Rockhill <[email protected]>
13+
# Authors: Alex Rockhill <[email protected]>
1314
#
1415
# License: BSD (3-clause)
1516

@@ -83,13 +84,4 @@
8384
###############################################################################
8485
# References
8586
# ----------
86-
# .. [1] Perrin F, Bertrand O, Pernier J. "Scalp current density mapping:
87-
# Value and estimation from potential data." IEEE Trans Biomed Eng.
88-
# 1987;34(4):283–288.
89-
# .. [2] Perrin F, Pernier J, Bertrand O, Echallier JF. "Spherical splines
90-
# for scalp potential and current density mapping."
91-
# [Corrigenda EEG 02274, EEG Clin. Neurophysiol., 1990, 76, 565]
92-
# Electroenceph Clin Neurophysiol. 1989;72(2):184–187.
93-
# .. [3] Kayser J, Tenke CE. "On the benefits of using surface Laplacian
94-
# (Current Source Density) methodology in electrophysiology.
95-
# Int J Psychophysiol. 2015 Sep; 97(3): 171–173.
87+
# .. footbibliography::

examples/stats/plot_linear_regression_raw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
time_unit='s')
5858
epochs[cond].average().plot(axes=ax1, **params)
5959
evokeds[cond].plot(axes=ax2, **params)
60-
contrast = mne.combine_evoked([evokeds[cond], -epochs[cond].average()],
61-
weights='equal')
60+
contrast = mne.combine_evoked([evokeds[cond], epochs[cond].average()],
61+
weights=[1, -1])
6262
contrast.plot(axes=ax3, **params)
6363
ax1.set_title("Traditional averaging")
6464
ax2.set_title("rERF")

mne/beamformer/tests/test_external.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from mne.datasets import testing
1313
from mne.beamformer import make_lcmv, apply_lcmv, apply_lcmv_cov
1414
from mne.beamformer.tests.test_lcmv import _get_data
15+
from mne.externals.pymatreader import read_mat
1516
from mne.utils import run_tests_if_main
1617

1718

@@ -88,11 +89,15 @@ def test_lcmv_fieldtrip(_get_bf_data, bf_type, weight_norm, pick_ori, pwr):
8889
stc_mne.data[:, :] = np.abs(stc_mne.data)
8990

9091
# load the FieldTrip output
91-
ft_fname = op.join(ft_data_path, 'ft_source_' + bf_type + '-vol.stc')
92-
stc_ft = mne.read_source_estimate(ft_fname)
92+
ft_fname = op.join(ft_data_path, 'ft_source_' + bf_type + '-vol.mat')
93+
stc_ft_data = read_mat(ft_fname)['stc']
94+
if stc_ft_data.ndim == 3:
95+
stc_ft_data = np.linalg.norm(stc_ft_data, axis=1)
96+
else:
97+
stc_ft_data = np.abs(stc_ft_data)
9398

9499
# calculate the Pearson correlation between the source solutions:
95-
pearson = np.corrcoef(stc_mne.data.ravel(), stc_ft.data.ravel())[0, 1]
100+
pearson = np.corrcoef(stc_mne.data.ravel(), stc_ft_data.ravel())[0, 1]
96101
assert pearson >= 0.99
97102

98103

mne/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def pytest_configure(config):
8585
ignore:scipy\.gradient is deprecated.*:DeprecationWarning
8686
ignore:sklearn\.externals\.joblib is deprecated.*:FutureWarning
8787
ignore:The sklearn.*module.*deprecated.*:FutureWarning
88-
ignore:.*TraitTuple.*trait.*handler.*deprecated.*:DeprecationWarning
88+
ignore:.*trait.*handler.*deprecated.*:DeprecationWarning
8989
ignore:.*rich_compare.*metadata.*deprecated.*:DeprecationWarning
9090
ignore:.*In future, it will be an error for 'np.bool_'.*:DeprecationWarning
9191
ignore:.*Converting `np\.character` to a dtype is deprecated.*:DeprecationWarning

0 commit comments

Comments
 (0)