Version 0.23.0 (2021-04-27)#
Enhancements#
Add support for exporting to EEGLAB’s set format with
eeglabiowith new methodsmne.io.Raw.export()andmne.Epochs.export(). (#9192 by new contributor Jack Zhang)mne.viz.plot_evoked_topo()now uses a Minimum/Maximum of peaks for each channel type to calculate ylim when input param is None (#9285 by new contributor Ram Pari)Add exclude parameter to
mne.viz.plot_evoked_topo()(#9278 by new contributor Ram Pari)Add
mne.time_frequency.EpochsTFR.to_data_frame()andmne.time_frequency.AverageTFR.to_data_frame()methods (#9124 by new contributor Felix Klotzsche)Add
selectionanddrop_logtomne.time_frequency.EpochsTFR(#9124 by new contributor Felix Klotzsche)Add CSV, TSV, and XYZ support to
mne.channels.read_custom_montage()(#9203 by new contributor Jack Zhang)Add HTML representation for
Epochsin Jupyter Notebooks (#9174 by new contributor Valerii Chirkov)Speed up
mne.viz.plot_ica_properties()by refactoring (#9174 by new contributor Valerii Chirkov)Add
apply_functionmethod to epochs and evoked objects (#9088 by new contributor Erica Peterson and Victoria Peterson)New tutorial for function
mne.make_fixed_length_epochs()(#9156 by new contributor Erica Peterson)Add different colors for each volume source space in
mne.viz.plot_alignment()(#9043 by new contributor Valerii Chirkov)Add
overlapparameter tomne.make_fixed_length_epochs()to allow creating overlapping fixed length epochs (#9096 by new contributor Silvia Cotroneo)Add
mne.Dipole.to_mni()for more convenient dipole.pos to MNI conversion (#9043 by new contributor Valerii Chirkov)Update citations in maxwell.py (#9043 by new contributor Valerii Chirkov)
New Tutorial for analyzing frequency-tagging data (#8867 by new contributor Dominik Welke and Evgenii Kalenkovich)
Add dbs as new channel type for deep brain stimulation (DBS) recordings (#8739 by new contributor Richard Koehler)
Add some preprocessing functions to the EEGLAB migration guide (#9169 by new contributor Apoorva Karekal)
Add
mne.chpi.extract_chpi_locs_kit()to read cHPI coil locations from KIT/Yokogawa data (#8813 by new contributor Matt Sanderson, Robert Seymour, and Eric Larson)Add
match_aliasparameter tomne.io.Raw.set_montage()and related functions to match unrecognized channel location names to known aliases (#8799 by new contributor Zhi Zhang)Update the
notebook3d backend to useipyvtk_simplefor a better integration withinJupyter(#8503 by Guillaume Favelier)Remove the 15-character limitation for channel names when writing to FIF format. If you need the old 15-character names, you can use something like
raw.rename_channels({n: n[:13] for n in raw.ch_names}, allow_duplicates=True), by Eric Larson (#8346)Add channel-specific annotation support to
mne.Annotationsviach_namesparameter (#8896 by Eric Larson)Add toggle-all button to
mne.ReportHTML andwidthargument tomne.Report.add_bem_to_section(#8723 by Eric Larson)Add infant template MRI dataset downloader
mne.datasets.fetch_infant_template()(#8738 by Eric Larson and Christian O’Reilly)Add digitizer information to
mne.io.read_raw_egi()(#8789 by Christian Brodbeck)Add support for reading some incomplete raw FIF files in
mne.io.read_raw_fif()(#9268 by Eric Larson)Allow reading digitization from files other than
*.fifin the coregistration GUI (#8790 by Christian Brodbeck)Speed up
mne.inverse_sparse.tf_mixed_norm()using STFT/ISTFT linearity (#8697 by Eric Larson)Reduce memory consumption of
mne.io.Rawand speed up epoching when thousands of events are present formne.Epochs(#8801 by Eric Larson)Speed up
import mneby reducing function creation overhead (#8829 by Eric Larson)mne.Report.parse_foldernow processes supported non-FIFF files by default, too (#8744 by Richard Höchenberger)mne.Reporthas gained the new methodsadd_custom_jsandadd_custom_cssfor adding user-defined JavaScript and styles (#8762, #9037 by Richard Höchenberger)Add option to control appearance of opaque inside surface of the head to mne coreg (#8793 by Eric Larson)
Add option to disable projection using
--projoffin mne browse_raw (#9262 by Eric Larson)Add keypress to toggle projection using
shift+jinmne.io.Raw.plot()and mne browse_raw (#9262 by Eric Larson)Add support for non-FIF files in mne browse_raw using
mne.io.read_raw()(#8806 by Eric Larson)Add
mne.io.read_raw_nedf()for reading StarStim / enobio NEDF files (#8734 by Tristan Stenner)Add
raw.describe()to display (or return) descriptive statistics for each channel (#8760 by Clemens Brunner)Add
annotations.to_data_frame()to return annotations as a pandas dataframe (#8783 by Robert Luke)Add
mne.preprocessing.compute_maxwell_basis()to compute the SSS basis function (#8822 by Eric Larson)Add the
silhouetteparameter tomne.viz.Brainto display sharp edges and improve perception (#8771 by Guillaume Favelier)Add warning to
mne.cov.compute_whitener()when an explicitrankparameter leads to a large increase in condition number (#8805 by Eric Larson)Add parameter
align=Truetomne.viz.Brain.show_viewto make views relative to the closest canonical (MNI) axes rather than the native MRI surface RAS coordinates (#8794 by Eric Larson)Add
auto_closetomne.Report.add_figs_to_sectionandmne.Report.add_slider_to_sectionto manage closing figures (#8730 by Guillaume Favelier)Add
mne.write_head_bem()to support writing head surface files (#8841 by Yu-Han Luo)The signal of
resp(respiratory) channels is now assumed to be in the unit Volt (#8858 by Richard Höchenberger)Static type checkers like Pylance (comes with VS Code) now display the parameters of many more functions correctly, largely improving overall usability for VS Code users (#8862 by Richard Höchenberger)
Support new EEGLAB file format (#8874 by Clemens Brunner)
Reading and writing FIFF files whose filenames end with
_meg.fif.gz,_eeg.fif(.gz), and_ieeg.fif(.gz)doesn’t emit a warning anymore; this improves interobaility with BIDS-formatted datasets (#8868 by Richard Höchenberger)On macOS, we now set the environment variable
QT_MAC_WANTS_LAYERto"1"if it hasn’t been set explicitly by the user, in order to ensure thatSourceEstimateplots work on macOS 11 with older versions of Qt and PyQt (#8959 by Richard Höchenberger)mne.time_frequency.EpochsTFR.average()now allows different ways of averaging, such as “median”, or callable functions (#8879 by Adam Li)Epochsmetadata can now be generated automatically from events usingmne.epochs.make_metadata(#8834 by Richard Höchenberger)Interactions with sliders in
mne.Reportwill now continuously update the linked content (it was updated only on mouse button release before) (#9023 by Richard Höchenberger)mne.viz.plot_drop_logandmne.Epochs.plot_drop_log()now omit displaying the subject name in the title ifsubject=Noneis passed (#9015 by Richard Höchenberger)Plot ECoG tutorial now uses a real epilepsy seizure dataset and visualizes the seizure onset (#9087 by Eric Larson, Adam Li, Alex Rockhill and Liberty Hamilton)
Improve documentation of Report-Class (#9113 by Martin Schulz)
Add
mne.channels.DigMontage.add_estimated_fiducials()which will add LPA, RPA and Nasion fiducial points to theDigMontageobject inmricoordinate frame (#9118 by Adam Li)mne.io.anonymize_info()now anonymizes also sex and hand fields whenkeep_hisisFalse(#9103, #9175 by new contributor Rotem Falach and Richard Höchenberger)Add parameter
themetomne.viz.Brainfor optional Dark-Mode (#9149 by Martin Schulz, Guillaume Favelier)Add first_samp support for raw simulations with
mne.simulation.simulate_rawandmne.simulation.SourceSimulator(#9166 by Steven Bierer)Evokedgained abaselineattribute that is automatically assembled based on the baseline of the averagedEpochs(#9210 by Richard Höchenberger)Add
unitsparameter tomne.io.Raw.get_data()to return data in the desired unit (#9136 by Johann Benerradi and Stefan Appelhoff)Add
mne.preprocessing.equalize_bads()to interpolate bad channels in a list ofEvoked,EpochsorRawhaving different sets of bad channels (#9241 by Alex Gramfort)mne.Epochs.equalize_event_counts()can now be called without providing a list of event names, and will equalize the counts of all event types present in theEpochs(#9261 by Richard Höchenberger)mne.preprocessing.find_eog_events()andmne.preprocessing.create_eog_epochs()now accept a list of channel names, allowing you to specify multiple EOG channels at once (#9269 by Richard Höchenberger)Improve performance of
mne.set_bipolar_reference()(#9270 by Martin Schulz)Add support for setting montages on fNIRS data, with built in standard montages for Artinis OctaMon and Artinis Brite23 devices (#9141 by Johann Benerradi, Robert Luke and Eric Larson)
Enable support for reading SNIRF files with 2D optode positions (#9347 Robert Luke)
Bugs#
Fix bug with
mne.time_frequency.tfr()where plot misbehaved. Plot now always returns a list of figures instead of a single figure handle (#8013 by new contributor Eduard Ort)Fix bug with
mne.viz.plot_evoked_topo()where set ylim parameters gets swapped across channel types. (#9207 by new contributor Ram Pari)Fix bug with
mne.io.read_raw_edf()where µV was not correctly recognized (#9187 by new contributor Sumalyo Datta)Fix bug with
mne.viz.plot_compare_evokeds()did not check type of combine. (#9151 by new contributor Matteo Anelli)Fix bug with
mne.viz.plot_evoked_topo()whereylimwas only being applied to the first channel in the dataset (#9162 by new contributor Ram Pari )Fix bug with
mne.Epochs.plot_image()allowing interactive zoom to work properly (#9152 by by new contributor Maggie Clarke and Daniel McCloy)Fix bug with
mne.Epochs.plot_image()where thex_labelwas different depending on the evoked parameter (#9115 by new contributor Matteo Anelli)Fix bug with restricting
mne.io.Raw.save()saving options to .fif and .fif.gz extensions (#9062 by new contributor Valerii Chirkov)Fix bug with
mne.io.read_raw_kit()where missing marker coils were not handled (#8989 by new contributor Judy D Zhu)Fix bug with
mne.connectivity.spectral_connectivitywhere time axis in Epochs data object was dropped. (#8839 by new contributor Anna Padee)Fix bug with
mne.io.Raw.resampleto allow passingstim_picks='misc'(#8844 by new contributor Enrico Varano and Eric Larson)Fix bugs with
mne.io.read_raw_persystwhere multipleCommentswith the same name are allowed, andCommentswith a “,” character are now allowed (#8311 and #8806 by new contributor Andres Rodriguez and Adam Li)Fix zen mode and scalebar toggling for
raw.plot()when using themacosxmatplotlib backend (#8688 by Daniel McCloy)Fix bug with
mne.viz.snapshot_brain_montage()where the positions were incorrect (#8983 by Eric Larson)Fix bug with
mne.preprocessing.maxwell_filter()where the eSSS basis had to exactly match the good channels instead of being a superset (#8675 by Eric Larson)Fix bug with
mne.Report.add_bem_to_sectionwheren_jobs != 1would causen_jobssubsets of MRI images in some orientations to be flipped (#8713 by Eric Larson)Fix bug with
raw.plot()where annotations didn’t immediately appear when changing window duration (#8689 by Daniel McCloy)Fix bug with
raw.plot()wherescalings='auto'did not compute scalings using the full range of data (#8806 by Eric Larson)Fix bug with
raw.plot()where setting alowpasscould lead to non-data-channels not plotting (#8954 by Eric Larson)Fix bug with
mne.io.Raw.load_data()andmne.Epochs.drop_bad()whereverboselogging was not handled properly (#8884 by Eric Larson)Fix bug with
mne.io.read_raw_nicolet()where header type values such as num_sample and duration_in_sec where not parsed properly (#8712 by Alex Gramfort)Fix bug with
mne.preprocessing.read_ica_eeglab()when reading decompositions using PCA dimensionality reduction (#8780 by Alex Gramfort and Eric Larson)Fix bug with
mne.minimum_norm.make_inverse_operator()wheredepthwas errantly restricted to be less than or equal to 1. (#8804 by Eric Larson)Fix bug with
mne.stats.permutation_cluster_1samp_test()and related clustering functions whenadjacency=Noneandout_type='indices'(##8842 by Eric Larson)Fix bug with
mne.viz.plot_alignment()where plotting a sphere model could ignore thebrainargument (#8857 by Eric Larson)Fix bug with
mne.SourceEstimate.plot()where flatmaps were not positioned properly when usinghemi='both'(#9315 by Eric Larson)Fix bug with
mne.Annotations.save()where files could be overwritten accidentally, it can now be controlled via theoverwriteargument (#8896 by Eric Larson)Fix bug with
replaceargument ofmne.Report.add_bem_to_sectionandmne.Report.add_slider_to_section(#8723 by Eric Larson)Fix bug with
mne.chpi.compute_chpi_locs()where all cHPI coils being off would lead to an empty array of the wrong dimensionality (#8956 by Eric Larson)Fix bug with
mne.extract_label_time_course()where labels, STCs, and the source space were not checked for compatiblesubjectattributes (#9284 by Eric Larson)Fix bug with
mne.grow_labels()whereoverlap=Falsecould run forever or raise an error (#9317 by Eric Larson)Fix compatibility bugs with
mne_realtime(#8845 by Eric Larson)Fix bug with
mne.viz.Brainwhere non-inflated surfaces had an X-offset imposed by default (#8794 by Eric Larson)Fix bug with mne coreg where nasion values were not updated when clicking (#8793 by Eric Larson)
Fix bug with matplotlib-based 3D plotting where
Axes3Dwere not properly initialized inmne.viz.plot_source_estimates()(#8811 by Chris Bailey)Allow sEEG channel types in
mne.Evoked.plot_joint()(#8736 by Daniel McCloy)Fix bug where hidden annotations could be deleted interactively in
mne.io.Raw.plot()windows (#8831 by Daniel McCloy)Function
mne.set_bipolar_reference()was not working when passingEpochsconstructed with somepicks(#8728 by Alex Gramfort)Fix anonymization issue of FIF files after IO round trip (#8731 by Alex Gramfort)
Fix bug in
mne.preprocessing.ICA.plot_sourceswhere right-clicking component names could yieldplot_propertieswindows for the wrong component ifpickshad been specified (#8996 by Daniel McCloy)Fix title not shown in
mne.viz.plot_montage()(#8752 by Clemens Brunner)mne.io.read_raw_eginow correctly handlespathlib.Pathfilenames (#8759 by Richard Höchenberger)mne.viz.plot_evokedandmne.Evoked.plotnow correctly plot global field power (GFP) for EEG data whengfp=Trueorgfp='only'is passed (used to plot RMS). For MEG data, we continue to plot the RMS, but now label it correctly as such (#8775 by Richard Höchenberger)Fix bug with mne make_scalp_surfaces where
--overwritewas not functional (#8800 by Yu-Han Luo)Fix bug with
mne.viz.plot_topomap()when plotting gradiometers with a missing channel in a pair (#8817 by Alex Gramfort)epochs.crop()now also adjusts thereject_tminandreject_tmaxattributes if necessary (#8821 by Richard Höchenberger)When creating
Epochs, we now ensure thatreject_tminandreject_tmaxcannot fall outside of the epochs’ time interval anymore (#8821 by Richard Höchenberger)read_raw_btierroneously treated response channels as respiratory channels (#8856 by Richard Höchenberger)The RMS trace shown in the time viewer of
SourceEstimateplots is now correctly labeled asRMS(wasGFPbefore) (#8965 by Richard Höchenberger)Fix bug with
mne.SourceEstimate.plot()and related functions where the scalars were not interactively updated properly (#8985 by Eric Larson)Fix bug with mne.channels.find_ch_adjacency() returning wrong adjacency for Neuromag122-Data (#8891 by Martin Schulz)
Fix
mne.read_dipole()yieldingmne.Dipoleobjects that could not be indexed (#8963 by Marijn van Vliet)Fix bug when setting n_jobs > 1 in
mne.Report.parse_folder()(#9109 by Martin Schulz)Fix bug with
mne.Evoked.plot_image()where an incorrect clim parameter did not raise any error (#9115 by new contributor Matteo Anelli)Fix bug with
mne.io.Raw.pickwhere incorrect fnirs types were returned (#9178 by Robert Luke)Fix bug when passing both axes and picks to
mne.viz.plot_compare_evokeds(#9252 by Daniel McCloy)Improved string representation of
Epochscontaining multiple event types; improved (and more mathematically correct)evoked.commentin themne.combine_evokedoutput; and better (and often more concise) legend labels in the figures created viaplot_compare_evokeds(#9027 by Richard Höchenberger)mne.preprocessing.find_ecg_events()now correctly handles situation where no ECG activity could be detected, and correctly returns an empty array of ECG events (#9236 by Richard Höchenberger)Fix bug with
picksattribute forEpochsafter callingmne.Epochs.add_channels()(#9246 by Alex Gramfort)Fix bug where
backend='notebook'could not be used inmne.SourceEstimate.plot()(#9305 by Jean-Rémi King)mne.preprocessing.compute_proj_eogandmne.preprocessing.compute_proj_ecgnow return empty lists if no EOG or ECG events, respectively, could be found. Previously, we’d returnNonein these situations, which does not match the documented behavior of returning a list of projectors (#9277 by Richard Höchenberger)
API changes#
Introduced new
'auto'settings forICA.max_iter. The old defaultmax_iter=200will be removed in MNE-Python 0.24 (#9099 by new contributor Cora Kim)mne.viz.plot_sensors_connectivitynow allows setting the colorbar label via thecbar_labelparameter (#9248 by Daniel McCloy)mne.read_selectionhas been deprecated in favor ofmne.read_vectorview_selection.mne.read_selectionwill be removed in MNE-Python 0.24 (#8870 by Richard Höchenberger)mne.beamformer.tf_dicshas been deprecated and will be removed in MNE-Python 0.24 (#9122 by Britta Westner)Fitting
ICAon baseline-correctedEpochs, and / or applying it on baseline-correctedEpochsorEvokeddata will now display a warning. Users are advised to only baseline correct their data after cleaning is completed (#9033 by Richard Höchenberger)Supplying multiple channel names to
mne.preprocessing.find_eog_eventsormne.preprocessing.compute_proj_eogas a string of comma-separated channel names has been deprecated; please pass a list of channel names instead. Support for comma-separated strings will be removed in MNE-Python 0.24 (#9269 by Richard Höchenberger)The default in
mne.beamformer.make_dics()ofreal_filter=Falsewill change toreal_filter=Truein 0.24 (#9340 by Britta Westner)