Version 1.7.1 (2024-06-14)#
Bugfixes#
Fix bug where
mne.time_frequency.csd_multitaper()
,mne.time_frequency.csd_fourier()
,mne.time_frequency.csd_array_multitaper()
, andmne.time_frequency.csd_array_fourier()
would return cross-spectral densities with thefmin
andfmax
frequencies missing, by Thomas Binns (#12633)Fix incorrect RuntimeWarning (different channel filter settings) in EDF/BDF import, by Clemens Brunner. (#12661)
Version 1.7.0 (2024-04-19)#
Notable changes#
In this version, we started adding type hints (also known as “type annotations”) to select parts of the codebase. This meta information will be used by development environments (IDEs) like VS Code and PyCharm automatically to provide better assistance such as tab completion or error detection even before running your code.
So far, we’ve only added return type hints to
mne.io.read_raw()
,mne.read_epochs()
,mne.read_evokeds()
and all format-specificread_raw_*()
andread_epochs_*()
functions. Now your editors will know: these functions return evoked and raw data, respectively. We are planning add type hints to more functions after careful evaluation in the future.You don’t need to do anything to benefit from these changes – your editor will pick them up automatically and provide the enhanced experience if it supports it! (#12250)
Dependencies#
defusedxml
is now an optional (rather than required) dependency and needed when reading EGI-MFF data, NEDF data, and BrainVision montages, by Eric Larson. (#12264)For developers,
pytest>=8.0
is now required for running unit tests, by Eric Larson. (#12376)pytest-harvest
is no longer used as a test dependency, by Eric Larson. (#12451)The minimum supported version of Qt bindings is 5.15, by Eric Larson. (#12491)
Bugfixes#
Fix bug where section parameter in
mne.Report.add_html()
was not being utilized resulting in improper formatting, by new contributor Martin Oberg. (#12319)Fix bug in
mne.preprocessing.maxwell_filter()
where calibration was incorrectly applied during virtual sensor reconstruction, by Eric Larson and new contributor Motofumi Fushimi. (#12348)Reformats channel and detector lookup in
mne.io.read_raw_snirf()
from array based to dictionary based. Removes incorrect assertions that every detector and source must have data associated with every registered optode position, by new contributor Alex Kiefer. (#12430)Remove FDT file format check for strings in EEGLAB’s EEG.data in
mne.io.read_raw_eeglab()
and related functions by new contributor Seyed Yahya Shirazi (#12523)Fixes to interactivity in time-frequency objects: the rectangle selector now works on TFR image plots of gradiometer data; and in
TFR.plot_joint()
plots, the colormap limits of interactively-generated topomaps match the colormap limits of the main plot. By Daniel McCloy. (#11282)Allow
mne.viz.plot_compare_evokeds()
to plot eyetracking channels, and improve error handling, y Scott Huberty. (#12190)Fix bug in
mne.Epochs.apply_function()
where data was handed down incorrectly in parallel processing, by Dominik Welke. (#12206)Remove incorrect type hints in
mne.io.read_raw_neuralynx()
, by Richard Höchenberger. (#12236)Fix bug with accessing the last data sample using
raw[:, -1]
where an empty array was returned, by Eric Larson. (#12248)Correctly handle temporal gaps in Neuralynx .ncs files via
mne.io.read_raw_neuralynx()
, by Kristijan Armeni and Eric Larson. (#12279)Fix bug where parent directory existence was not checked properly in
mne.io.Raw.save()
, by Eric Larson. (#12282)Add
tol
parameter tomne.events_from_annotations()
so that the user can specify the tolerance to ignore rounding errors of event onsets when usingchunk_duration
is not None (default is 1e-8), by Michiru Kaneda (#12324)Allow
mne.io.Raw.interpolate_bads()
andmne.Epochs.interpolate_bads()
to work onecog
andseeg
data; forseeg
data a spline is fit to neighboring electrode contacts on the same shaft, by Alex Rockhill (#12336)Fix clicking on an axis of
mne.viz.plot_evoked_topo()
when multiple vertical linesvlines
are used, by Mathieu Scheltienne. (#12345)Fix bug in
mne.viz.EvokedField.set_vmax()
that prevented setting the color limits of the MEG magnetic field density, by Marijn van Vliet (#12354)Fix faulty indexing in
mne.io.read_raw_neuralynx()
when picking a single channel, by Kristijan Armeni. (#12357)Fix bug where
mne.preprocessing.compute_proj_ecg()
andmne.preprocessing.compute_proj_eog()
could modify the defaultreject
andflat
arguments on multiple calls based on channel types present, by Eric Larson. (#12380)Fix bad channels not handled properly in
mne.stc_near_sensors()
by Alex Rockhill. (#12382)Fix bug where
mne.preprocessing.regress_artifact()
projection check was not specific to the channels being processed, by Eric Larson. (#12389)Change how samples are read when using
data_format='auto'
inmne.io.read_raw_cnt()
, by Jacob Woessner. (#12393)Fix bugs with
mne.Report
CSS where TOC items could disappear at the bottom of the page, by Eric Larson. (#12399)In
plot_compare_evokeds()
, actually plot GFP (not RMS amplitude) for EEG channels when global field power is requested by Daniel McCloy. (#12410)Fix Working with sEEG data use of
mne.stc_near_sensors()
to use themne.VolSourceEstimate
positions and not the pial surface, by Alex Rockhill (#12436)Fix prefiltering information management for EDF/BDF, by Michiru Kaneda (#12441)
Fix validation of
ch_type
inmne.preprocessing.annotate_muscle_zscore()
, by Mathieu Scheltienne. (#12444)Fix errant redundant use of
BIDSPath.split
when writing split raw and epochs data, by Eric Larson. (#12451)Disable config parser interpolation when reading BrainVision files, which allows using the percent sign as a regular character in channel units, by Clemens Brunner. (#12456)
Fix the default color of
mne.viz.Brain.add_text()
to properly contrast with the figure background color, by Marijn van Vliet. (#12470)
Changed default ECoG and sEEG electrode sizes in brain plots to better reflect real world sizes, by Liberty Hamilton (#12474)
Fixed bugs with handling of rank in
mne.decoding.CSP
, by Eric Larson. (#12476)Fix reading segmented recordings with
mne.io.read_raw_eyelink()
by Dominik Welke. (#12481)
Improve compatibility with other Qt-based GUIs by handling theme icons better, by Eric Larson. (#12483)
Fix problem caused by onsets with NaN values using
mne.io.read_raw_eeglab()
by Jacob Woessner (#12484)
Fix cleaning of channel names for non vectorview or CTF dataset including whitespaces or dash in their channel names, by Mathieu Scheltienne. (#12489)
Fix bug with
mne.preprocessing.ICA.plot_sources()
forevoked
data where the legend contained too many entries, by Eric Larson. (#12498)Fix bug where using
phase="minimum"
in filtering functions likemne.io.Raw.filter()
constructed a filter half the desired length with compromised attenuation. Nowphase="minimum"
has the same length and comparable suppression asphase="zero"
, and the old (incorrect) behavior can be achieved withphase="minimum-half"
, by Eric Larson. (#12507)Correct reading of
info["subject_info"]["his_id"]
inmne.io.read_raw_snirf()
, by Eric Larson. (#12526)Calling
compute_psd()
withmethod="multitaper"
is now expressly disallowed whenreject_by_annotation=True
andbad_*
annotations are present (previously this was nominally allowed but resulted innan
values in the PSD). By Daniel McCloy. (#12535)compute_psd()
andpsd_array_welch()
will now use FFT windows aligned to the onsets of good data spans whenbad_*
annotations are present. By Daniel McCloy. (#12536)Fix bug in loading of complex/phase TFRs. By Daniel McCloy. (#12537)
Fix bug with
mne.SourceSpaces.export_volume()
where theimg.affine
was not set properly, by Eric Larson. (#12544)
API changes by deprecation#
The default value of the
zero_mean
parameter ofmne.time_frequency.tfr_array_morlet()
will change fromFalse
toTrue
in version 1.8, for consistency with related functions. By Daniel McCloy. (#11282)The parameter for providing data to
mne.time_frequency.tfr_array_morlet()
andmne.time_frequency.tfr_array_multitaper()
has been switched fromepoch_data
todata
. Only use thedata
parameter to avoid a warning. Changes by Thomas Binns. (#12308)Change
mne.stc_near_sensors()
surface
default from the'pial'
surface to the surface insrc
ifsrc
is notNone
in version 1.8, by Alex Rockhill. (#12382)
New features#
Detecting Bad EEG/MEG channels using the local outlier factor (LOF) algorithm in
mne.preprocessing.find_bad_channels_lof()
, by new contributor Velu Prabhakar Kumaravel. (#11234)Inform the user about channel discrepancy between provided info, forward operator, and/or covariance matrices in
mne.beamformer.make_lcmv()
, by new contributor Nikolai Kapralov. (#12238)Support partial pathlength factors for each wavelength in
mne.preprocessing.nirs.beer_lambert_law()
, by new contributor Richard Scholz. (#12446)Add
picks
parameter tomne.io.Raw.plot()
, allowing users to select which channels to plot. This makes makes the raw data plotting API consistent withmne.Epochs.plot()
andmne.Evoked.plot()
, by new contributor Ivo de Jong. (#12467)New class
mne.time_frequency.RawTFR
and new methodsmne.io.Raw.compute_tfr()
,mne.Epochs.compute_tfr()
, andmne.Evoked.compute_tfr()
. These new methods supersede functionsmne.time_frequency.tfr_morlet()
, andmne.time_frequency.tfr_multitaper()
, andmne.time_frequency.tfr_stockwell()
, which are now considered “legacy” functions. By Daniel McCloy. (#11282)Add ability reject
mne.Epochs
using callables, by Jacob Woessner. (#12195)Custom functions applied via
mne.io.Raw.apply_function()
,mne.Epochs.apply_function()
ormne.Evoked.apply_function()
can now usech_idx
orch_name
to get access to the currently processed channel during channel wise processing.mne.Evoked.apply_function()
can now also work on full data array instead of just channel wise, analogous tomne.io.Raw.apply_function()
andmne.Epochs.apply_function()
, by Dominik Welke. (#12206)Allow
mne.time_frequency.EpochsTFR
as input tomne.epochs.equalize_epoch_counts()
, by Carina Forster. (#12207)Speed up export to .edf in
mne.export.export_raw()
by usingedfio
instead ofEDFlib-Python
. (#12218)Added a helper function
mne.preprocessing.eyetracking.convert_units()
to convert eyegaze data from pixel-on-screen values to radians of visual angle. Also added a helper functionmne.preprocessing.eyetracking.get_screen_visual_angle()
to get the visual angle that the participant screen subtends, by Scott Huberty. (#12237)We added type hints for the return values of
mne.read_evokeds()
andmne.io.read_raw()
. Development environments like VS Code or PyCharm will now provide more help when using these functions in your code. By Richard Höchenberger and Eric Larson. (#12297) (#12250)Add
method="polyphase"
tomne.io.Raw.resample()
and related functions to allow resampling usingscipy.signal.upfirdn()
, by Eric Larson. (#12268)The package build backend was switched from
setuptools
tohatchling
. This will only affect users who build and install MNE-Python from source. By Richard Höchenberger. (#12281) (#12269)mne.Annotations.to_data_frame()
can now output different formats for theonset
column: seconds, milliseconds, datetime objects, and timedelta objects. By Daniel McCloy. (#12289)Add method
mne.SourceEstimate.save_as_surface()
to allow saving GIFTI files from surface source estimates, by Peter Molfese. (#12309)mne.Epochs
can now be constructed usingmne.Annotations
stored in theraw
object, by specifyingevents=None
. By Alex Rockhill. (#12311)Add
savgol_filter()
,filter()
,apply_hilbert()
, andapply_function()
methods tomne.SourceEstimate
and related classes, by Hamza Abdelhedi. (#12323)Add ability to export STIM channels to EDF in
mne.io.Raw.export()
, by Clemens Brunner. (#12332)Speed up raw FIF reading when using small buffer sizes by Eric Larson. (#12343)
Speed up
mne.io.read_raw_neuralynx()
on large datasets with many gaps, by Kristijan Armeni. (#12371)Add ability to detect minima peaks found in
mne.Evoked
if data is all positive and maxima if data is all negative. (#12383)Add ability to remove bad marker coils in
mne.io.read_raw_kit()
, by Judy D Zhu. (#12394)Add option to pass
image_kwargs
tomne.Report.add_epochs
to allow adjusting e.g.vmin
andvmax
of the epochs image in the report, by Sophie Herbst. (#12443)Add support for multiple raw instances in
mne.preprocessing.compute_average_dev_head_t()
by Eric Larson. (#12445)Completing PR 12453. Add option to pass
image_kwargs
per channel type tomne.Report.add_epochs
. (#12454)mne.epochs.make_metadata()
now accepts strings astmin
andtmax
parameter values, simplifying metadata creation based on time-varying events such as responses to a stimulus, by Richard Höchenberger. (#12462)Include date of acquisition and filter parameters in
raw.info
formne.io.read_raw_neuralynx()
by Kristijan Armeni. (#12463)Add
physical_range="channelwise"
tomne.io.Raw.export()
for exporting to EDF, which can improve amplitude resolution if individual channels vary greatly in their offsets, by Clemens Brunner. (#12510)Added the ability to reorder report contents via
mne.Report.reorder()
(with helper to get contents withmne.Report.get_contents()
), by Eric Larson. (#12513)Add
exclude_after_unique
option tomne.io.read_raw_edf()
andmne.io.read_raw_edf()
to search for exclude channels after making channels names unique, by Michiru Kaneda (#12518)
Other changes#
Updated the text in the preprocessing tutorial to use
mne.io.Raw.pick()
instead of the legacymne.io.Raw.pick_types()
, by new contributor btkcodedev. (#12326)Clarify in the EEG referencing tutorial that an average reference projector ready is required for inverse modeling, by new contributor Nabil Alibou (#12420)
Fix dead links in
README.rst
documentation by new contributor Will Turner. (#12461)Replacing percent format with f-strings format specifiers , by new contributor Hasrat Ali Arzoo. (#12464)
Adopted towncrier for changelog entries, by Eric Larson. (#12299)
Automate adding of PR number to towncrier stubs, by Eric Larson. (#12318)
Refresh code base to use Python 3.9 syntax using Ruff UP rules (pyupgrade), by Clemens Brunner. (#12358)
Move private data preparation functions for BrainVision export from
pybv
tomne
, by Clemens Brunner. (#12450)Update the list of sensor types in docstrings, tutorials and the glossary by Nabil Alibou. (#12509)
Authors#
Alex Rockhill
Alexander Kiefer+
Alexandre Gramfort
Britta Westner
Carina Forster
Clemens Brunner
Daniel McCloy
Dominik Welke
Eric Larson
Erkka Heinila
Florian Hofer
Hamza Abdelhedi
Hasrat Ali Arzoo+
Ivo de Jong+
Jacob Woessner
Judy D Zhu
Kristijan Armeni
Liberty Hamilton
Marijn van Vliet
Martin Oberg+
Mathieu Scheltienne
Michiru Kaneda
Motofumi Fushimi+
Nabil Alibou+
Nikolai Kapralov+
Peter J. Molfese
Richard Höchenberger
Richard Scholz+
Scott Huberty
Seyed (Yahya) Shirazi+
Sophie Herbst
Stefan Appelhoff
Thomas Donoghue
Thomas Samuel Binns
Tristan Stenner
Velu Prabhakar Kumaravel+
Will Turner+
btkcodedev+