Version 0.24.0 (2021-11-03)#
Enhancements#
Add
poochto system information reports (#9801 by new contributor Joshua Teves)Get annotation descriptions from the name field of SNIRF stimulus groups when reading SNIRF files via
mne.io.read_raw_snirf(#9575 by new contributor Darin Erat Sleiter)Add support for NIRSport and NIRSport2 devices to
mne.io.read_raw_nirx(#9348 and #9401 by new contributor David Julien, new contributor Romain Derollepot, Robert Luke, and Eric Larson)New function
mne.Dipole.to_volume_labels()to get atlas label for MRI coordinates. (#9376 by new contributor Marian Dovgialo)Add support for SURE parameter selection in
mne.inverse_sparse.mixed_norm()and makealphaparameter now default to'sure'(#9430 by new contributor Pierre-Antoine Bannier and Alex Gramfort)Speed up BCD solver in
mne.inverse_sparse.mixed_norm()by adding Anderson acceleration (#9481 by new contributor Pierre-Antoine Bannier and Alex Gramfort)Add support for list of channel types for EEG/sEEG/ECoG/DBS referencing (#9637 by new contributor Mathieu Scheltienne)
Add the ability to set point size and line width in
mne.viz.plot_sensors()and related functions (#9872 by new contributor Dominique Makowski)Add support for changing the default event id used by
mne.make_fixed_length_epochs()(#9782 by new contributor Mathieu Scheltienne)Improve documentation for arguments
threshold,methodandmeasureof ICA methodsfind_bads_ecg,find_bads_refandfind_bads_eog(#9858 by new contributor Mathieu Scheltienne)Add support for more than 3 source estimates in
mne.viz.plot_sparse_source_estimates()(#9640 by new contributor Pierre-Antoine Bannier and Alex Gramfort)Add cortical signal suppression (CSS)
mne.preprocessing.cortical_signal_suppression()(#6888, #9892 by new contributor John Samuelsson and Eric Larson)Show all good channel types and counts when printing a
mne.Infoin the notebook (#9725 by Valerii Chirkov and Eric Larson)Speed up point decimation in
mne.io.read_raw_kit()by vectorization and use ofscipy.spatial.cKDTree(#9568 by Jean-Rémi King and Eric Larson)Add ability to export EDF+ files using
mne.export.export_raw()(#9643 by Adam Li)New function
mne.chpi.get_chpi_info()to retrieve basic information about the cHPI system used when recording MEG data (#9369 by Richard Höchenberger)New namespace
mne.exportcreated to contain functions (such asmne.export.export_rawandmne.export.export_epochs) for exporting data to non-FIF formats (#9427 by Eric Larson)Add support for Hitachi fNIRS devices in
mne.io.read_raw_hitachi(#9391 by Eric Larson)Add support for
picksinmne.stc_near_sensors()(#9396 by Eric Larson)Add label methods
mne.Label.compute_areaandmne.Label.distances_to_outside(#9424 by Eric Larson)Add projections when printing a
mne.Infoin the notebook (#9403 by Alex Gramfort)Add new function
mne.bem.make_scalp_surfaces()to compute scalp surfaces for coregistration (#9463 by Alex Gramfort)Add support for interpolating oxy and deoxyhaemoglobin data types (#9431 by Robert Luke)
Add support for SNIRF files in
mne.Report(#9443 by Robert Luke)Add support for exporting MFF evoked files using
mne.export.export_evokedsandmne.export.export_evokeds_mff(#9406 by Evan Hathaway)mne.concatenate_raws(),mne.concatenate_epochs(), andmne.write_evokeds()gained a new parameteron_mismatch, which controls behavior in case not all of the supplied instances share the same device-to-head transformation (#9438 by Richard Höchenberger)Add support for multiple datablocks (acquisitions with pauses) in
mne.io.read_raw_nihon()(#9437 by Federico Raimondo)Add new function
mne.preprocessing.annotate_break()to automatically detect and mark “break” periods without any marked experimental events in the continuous data (#9445 by Richard Höchenberger)Add “time_format” to
mne.io.Raw.plot()andmne.preprocessing.ICA.plot_sources()to display acquisition time on x-axis (#9419 by Martin Schulz)Speed up
mne.decoding.TimeDelayingRidge.predict()by switching to FFT-based convolution (#9458 by Ross Maddox)Show multiple colors and linestyles for excluded components with
mne.Evokedinmne.preprocessing.ICA.plot_sources()(#9444 by Martin Schulz)Add functions for aligning MRI and CT data
mne.transforms.compute_volume_registrationandmne.transforms.apply_volume_registration(#9503 by Alex Rockhill and Eric Larson)Add tutorial for how to processes image (CT and MR) files in order to localize electrode contacts for intracranial recordings Locating intracranial electrode contacts (#9484 by Alex Rockhill)
Add vertex number in source space for
mne.VolSourceEstimate.plot()andmne.viz.plot_volume_source_estimates()(#9697 by Eric Larson)Add support for colormap normalization in
mne.viz.plot_topomap()(#9468 by Clemens Brunner)Update
mne.preprocessing.realign_raw()with Numpy-recommended polynomial fitting method (#9514 by Erica Peterson)Add a warning to
mne.preprocessing.nirs.beer_lambert_lawwhen source-detector distances are zero (#9541 by Eric Larson)Add
excludeparameter tomne.io.Raw.plot_psd()andmne.Epochs.plot_psd()(#9519 by Clemens Brunner)Add
mne.Annotations.renameto rename annotation descriptions (#9525 by Robert Luke)Add
mne.Annotations.set_durationsto set annotation durations (#9529 by Robert Luke)The
excludeparameter inmne.io.read_raw_edf,mne.io.read_raw_bdf, andmne.io.read_raw_gdfnow also accepts a regular expression (#9558 by Clemens Brunner)Add
mne.Evoked.get_data()method tomne.Evoked(#9555 by Stefan Appelhoff)The
mne.Epochs.get_data()method now has aunitsparameter (#9553 by Stefan Appelhoff)Add
mne.warp_montage_volumeto use an anatomical volume with channel locations at high or low insensities to apply a symmetric diffeomorphic registration to a template (e.g. fsaverage) space (#9544 by Alex Rockhill)mne.io.Raw.get_data(),mne.Epochs.get_data(), andmne.Evoked.get_data()methods now havetminandtmaxparameters to specify data window in seconds to get (#9556 by Stefan Appelhoff)The
mne.Evoked.get_data()method now has aunitsparameter (#9578 by Stefan Appelhoff)Add
mne.chpi.compute_chpi_snrandmne.viz.plot_chpi_snrfor computing and plotting the time-varying SNR of continuously-active HPI coils (#9570 by Daniel McCloy and Jussi Nurminen)Add
mne.get_montage_volume_labels()to find the regions of interest in a Freesurfer atlas anatomical segmentation for an intracranial electrode montage andmne.viz.plot_channel_labels_circle()to plot them (#9545 by Alex Rockhill)Add
mne.viz.Brain.add_volume_labels()to plot subcortical surfaces and other regions of interest (#9540 by Alex Rockhill and Eric Larson)Add custom cortex curvature colors in
mne.viz.Brainvia thecortexargument (#9750 by Eric Larson)Add
mne.channels.DigMontage.apply_trans()to apply a transform directly to a montage (#9601 by Alex Rockhill)mne.preprocessing.ICA.fit()now emits a warning if any of thestart,stop,reject, andflatparameters are passed when performing ICA onEpochs. These parameters only have an effect onRawdata and were previously silently ignored in the case ofEpochs(#9605 by Richard Höchenberger)mne.viz.plot_alignment()now emits a warning (instead of aborting with an exception) if the surfaces contain topological defects (#9614 by Richard Höchenberger)The coregistration GUI can now display the head surface even if there are topological defects. Previously, a low-resolution standard head unsuitable for individualized coregistration was displayed (#9614 by Richard Höchenberger)
New
mne.coreg.Coregistrationobject to allow coregistration scripting without a dependency on mayavi (#9516 by Guillaume Favelier).Add
mne.viz.Brain.add_head()to plot the head surface (#9618 by Alex Rockhill)Add
mne.channels.read_dig_localite()to read Localite electrode location files (#9658 by Clemens Brunner)Add
mne.viz.Brain.add_sensors()to plot sensor locations (#9585 by Alex Rockhill)Add
mne.coreg.estimate_head_mri_t()to estimate the head->mri transform from fsaverage fiducials (#9585 by Alex Rockhill)Add
mne.channels.DigMontage.add_mni_fiducials()to add fiducials to a montage in MNI coordinates (#9682 by Alex Rockhill)Add
mne.channels.DigMontage.remove_fiducials()to remove fiducials under rare circumstances when the coordinate frame should not be set to “head” (#9684 by Alex Rockhill)Add remove methods for mesh objects in
mne.viz.Brain(#9688 by Alex Rockhill)Add
--show-pathsand--developeroptions to mne sys_info (#9789 by Eric Larson)Add ability to export EDF+ files using
mne.export.export_raw()(#9643 by Adam Li)Reading EDF files via
mne.io.read_raw_edf()now can infer channel type from the signal label in the EDF header (#9694 by Adam Li)Add
mne.gui.locate_ieegto locate intracranial electrode contacts from a CT, an MRI (with Freesurferrecon-all) and the channel names from anmne.Infoobject (#9586 by Alex Rockhill)All data fetching code now relies on
pooch, which is an added optional requirement for dataset fetchers (#9742 by Adam Li and Daniel McCloy)Add phantom FreeSurfer subject fetcher
mne.datasets.fetch_phantom()to allow fetching the Otaniemi phantom (#9796 by Eric Larson)Add
mne.datasets.fetch_dataset()to allow packages to fetch datasets in a similar fashion to MNE (#9763 by Adam Li)Add full ECoG dataset to MNE-misc-data and demonstrate its use in How to convert 3D electrode positions to a 2D image and Locating intracranial electrode contacts (#9784 by Alex Rockhill)
Add options
tolandaccuracytomne.fit_dipole()to control optimization (#9810 by Eric Larson)Completely revamp the
Reportexperience: new HTML layout, many new methods, more flexibility; the functionality is demonstrated in Getting started with mne.Report (#9754, #9828, #9847, #9860, #9861, #9862, #9863, #9871, #9881, #9891, #9901 by Richard Höchenberger, Eric Larson, and Alex Gramfort)Add basic HTML representations of
ForwardandInverseOperatorinstances for a nicer Jupyter experience (#9754 by Richard Höchenberger)mne.io.read_raw_brainvisionnow handles ASCII data with comma-separated values, as may be exported from BrainVision Analyzer (#9795 by Richard Höchenberger)Add
mne.preprocessing.ieeg.project_sensors_onto_brain()to project ECoG sensors onto the pial surface to compensate for brain shift (#9800 by Alex Rockhill)Add support for data acquired with NIRx devices using Aurora software version 2021.9 (#9800 by Robert Luke, and Eric Larson)
All functions for reading and writing files should now automatically handle
~(the tilde character) and expand it to the user’s home directory. Should you come across any function that doesn’t do it, please do let us know! (#9613, #9845 by Richard Höchenberger)All functions accepting a FreeSurfer subjects directory via a
subjects_dirparameter can now consumepathlib.Pathobjects too (used to be only strings) (#9613 by Richard Höchenberger)Add support for colormap normalization in
mne.time_frequency.AverageTFR.plot()(#9851 by Clemens Brunner)Add support for BIDS-compatible filenames when splitting big epochs files via the new
split_namingparameter inmne.Epochs.save()(#9869 by Denis Engemann)Add
by_event_typeparameter tomne.Epochs.average()to create a list containing anmne.Evokedobject for each event type (#9859 by Marijn van Vliet)Add pyqtgraph as a new backend for
mne.io.Raw.plot()(#9687 by Martin Schulz)Add
mne.viz.set_browser_backend(),mne.viz.use_browser_backend()andmne.viz.get_browser_backend()to set matplotlib or pyqtgraph as backend formne.io.Raw.plot()(#9687 by Martin Schulz)
Bugs#
Fix bug in
mne.io.Raw.pick()and related functions when parameter list contains channels which are not in info instance (#9708 by new contributor Evgeny Goldstein)Fix a few typos (#9706 by new contributor Timothy Gates)
Fix bug with
mne.Epochs.crop()andmne.Evoked.crop()wheninclude_tmax=False, where the last sample was always cut off, even whentmax > epo.times[-1](#9378 by new contributor Jan Sosulski)Fix bug with
mne.io.read_raw_curryto allow reading Curry 7 and 8 event files with ‘.ceo’ and ‘.cdt.ceo’ extensions (#9381, #9712 by new contributor Xiaokai Xia, Daniel McCloy, and by new contributor Reza Shoorangiz)Fix bug with
mne.compute_rank,mne.cov.compute_whitenerandmne.preprocessing.ICA.fitwhen explicit picks including bad channels are provided (#9719 by new contributor Mathieu Scheltienne)Fix bug with
mne.concatenate_epochs()where the concatenated events could end up in non-chronological order. (#9765 by new contributor Jan Sosulski)Fix bug where
mne.time_frequency.psd_array_welch()andmne.time_frequency.psd_array_multitaper()failed to handle negative integer forn_jobsargument (#9849 by new contributor Riessarius Stargardsky)Fix bug where resampling returns empty instances (#9897 by new contributor Mathieu Scheltienne and Eric Larson)
Fix bug with
mne.io.Raw.get_montagenow returning both good and bad channels in the montage. (#9920 by new contributor Mathieu Scheltienne)Fix bug with
mne.io.read_raw_nihon()where latin-1 annotations could not be read (#9384 by Alex Gramfort)Fix bug when printing a
mne.io.RawArrayin the notebook (#9404 by Alex Gramfort)Fix bug when computing rank from info for SSS data with only gradiometers or magnetometers (#9435 by Alex Gramfort)
Fix bug with
mne.preprocessing.find_bad_channels_maxwellwhere all-flat segments could lead to an error (#9531 by Eric Larson)Fix bug with
mne.io.Raw.set_montageand related functions where the channel coordinate frame was not properly set to head (#9447 by Eric Larson)Fix bug with
mne.io.read_raw_fieldtripandmne.read_epochs_fieldtripwhere channel positions were not set properly (#9447 by Eric Larson)Fix bug with
mne.io.read_raw_kit()where omitting HPI coils could lead to anAssertionErroron reading (#9612 by Eric Larson)Fix bug with
mne.io.read_raw_edf()where reading only stimulus channels would lead to an error (#9831 by Eric Larson)Fix bug with
mne.preprocessing.nirs.optical_densitywhere protection against zero values was not guaranteed (#9522 by Eric Larson)mne.concatenate_raws()now raises an exception ifraw.info['dev_head_t']differs between files. This behavior can be controlled using the newon_mismatchparameter (#9438 by Richard Höchenberger)Fixed bug in
mne.Epochs.drop_bad()where subsequent rejections failed if they only specified thresholds for a subset of the channel types used in a previous rejection (#9485 by Richard Höchenberger).Fix bug with
mne.simulation.simulate_evoked,mne.apply_forward, andmne.apply_forward_rawwhere systems with EEG channels that come before MEG channels would have them mixed up in the output evoked or raw object (##9513 by Eric Larson)In
mne.viz.plot_ica_scores()andmne.preprocessing.ICA.plot_scores(), the figure and axis titles no longer overlap when plotting only a single EOG or ECG channel (#9489 by Richard Höchenberger).Ensure
mne.io.Raw.get_montageworks with SNIRF data (#9524 by Robert Luke)Fix bug in
mne.setup_volume_source_space()where non-finite positions could be used in a discrete source space (#9603 by Eric Larson)Fix bug in
mne.viz.plot_topomap()(and related methods likemne.Evoked.plot_topomap()) where large distances between electrodes (higher than head radius) would lead to an error (#9528 by Mikołaj Magnuski).Fix bug in
mne.viz.plot_topomap(and related methods) where passingaxesthat are part of a matplotlib figure that uses a constrained layout would emit warnings (#9558 by Eric Larson)Fix bug in
mne.make_forward_solution()where impossible sensor-BEM geometries were not checked (#9893 by Eric Larson)Fix bug in
mne.concatenate_epochs()when concatenatingmne.Epochsobjects with 0 events (#9535 by Marijn van Vliet)Fix bug in
mne.viz.Brain.screenshot()where the RGBA mode was not supported (#9564 by Guillaume Favelier).Fix bug in
mne.io.read_raw_egi()where reading data from a data segment that is part of an acquisition skip would lead to an error (#9565 by Eric Larson)Prevent
mne.io.Raw.plot()windows from spawning at sizes too small to properly render (#9629 by Daniel McCloy)Fix bug where
mne.io.Raw.plot()raised an error when plotting raw dipole data (#9771 by Eric Larson)Fix bug in :
mne.preprocessing.ICA.find_bads_ecg()where passingstartandstoplead to erroneous data windows depending on the combination of Raw, Epochs, Evoked, and the type (int, float, None) ofstartandstop(#9556 by Stefan Appelhoff)Fix bug in
mne.viz.set_3d_backend()andmne.viz.get_3d_backend()where the PyVistaQt-based backend was ambiguously named'pyvista'instead of'pyvistaqt'; useset_3d_backend('pyvistaqt')and expect'pyvistaqt'as the output ofmne.viz.get_3d_backend()instead of'pyvista', and consider usingget_3d_backend().startswith('pyvista')for example for backward-compatible conditionals (#9607 by Guillaume Favelier)Fix bug in
mne.viz.plot_compare_evokeds()where confidence bands were not drawn if only one condition was plotted (#9663 by Daniel McCloy)Fix bug where setting of a montage with fNIRS data got set to “unknown” coordinate frame when it should have been in “head” (#9630 by Alex Rockhill)
Fix bug where “seeg”, “ecog”, “dbs” and “fnirs” data had coordinate frame unknown upon loading from a file when it should have been in “head” (#9580 by Alex Rockhill)
Raise error when no
transis provided tomne.viz.plot_alignment()when required instead of assuming identity head->mri transform (#9585 by Alex Rockhill)Fix bug where
mne.Epochs.equalize_event_counts()failed when only one good epoch existed for one of the event types (#9758 by Daniel McCloy)Fix bug where channels with a dollar sign ($) were not being labeled “misc” in
mne.io.read_raw_nihon()(#9695 by Adam Li)Fix bug where
mne.io.read_raw_persyst()was lower-casing events it found in the.layfile (#9746 by Adam Li)Fix bug with Qhull when plotting OPM sensors in
mne.viz.plot_alignment()(#9799 and #9804 by Eric Larson)Fix bug where
mne.io.read_raw_snirf()was including the landmark index as a spatial coordinate (#9777 by Robert luke)Fix bug where
mne.Annotationswere not appending channel names when being added together (#9780 by Adam Li)mne.viz.plot_evoked_jointnow correctly handles atimes='peaks'parameter value (#9754 by Richard Höchenberger)In
mne.viz.plot_compare_evokeds, slightly adjust the x-axis limit calculation to avoid drawing an axis that is too short (#9754 by Richard Höchenberger)Fix a bug with
mne.viz.snapshot_brain_montage()with the Mayavi backend where electrodes were shown in the wrong positions, and with the PyVista backend where the snapshot always contained the electrodes but could be missing a hemisphere (#9933 by Eric Larson)In
mne.io.Raw.plot_psd()andmne.Epochs.plot_psd(), avoid overlap between subplot titles and x-axis tick labels (#9864 by Richard Höchenberger)In
mne.Epochs.plot_psd_topomap(), the data is now scaled to match the output ofmne.Epochs.plot_psd()(#9873 by Richard Höchenberger)Fix channel locations with
NaNvalues causing all channel locations not to be plotted inmne.viz.Brain.add_sensors()(#9911 by Alex Rockhill)Fix infinite loop bug in
mne.get_montage_volume_labels()(#9940 by Alex Rockhill)
API changes#
The
mne.Infoclass is now more strictly checked when attributes are set. Setting most attributes directly will lead to an error in the next release. See the docstring ofmne.Infofor more information (#9867 by new contributor Mathieu Scheltienne)The Mayavi 3D backend has been deprecated (#9904 by Eric Larson):
In 3D plotting functions, use PyVista-based backends (
'pyvistaqt'and'notebook') as PySurfer/Mayavi will be removed in the next versionTo use the mne kit2fiff command-line GUI for fiducial markers, install the separate
mne-kit-guimodule, which can still be launched via$ mne kit2fiffThe
mne.gui.fiducialsGUI has been deprecated, use mne coreg ormne_kit_gui.fiducials()to set MRI fiducials instead
In
mne.compute_source_morph, theniter_affineandniter_sdrparameters have been replaced byniterandpipelineparameters for more consistent and finer-grained control of registration/warping steps and iteration (#9505 by Alex Rockhill and Eric Larson)Split
mne.viz.Brain.show_view()argumentviewintoazimuth,elevationandfocalpointfor clearer view setting and make the default forrowandcolapply to all rows and columns (#9596 by Alex Rockhill)Deprecate
solver='prox'inmne.inverse_sparse.mixed_norm()in favor ofsolver='cd'andsolver='bcd'as coordinate descent solvers consistently outperform proximal gradient descent (#9608 by Pierre-Antoine Bannier)All
mne.connectivityfunctions have moved to themne-connectivitypackage; they are deprecated in MNE-Python and will be removed in version 0.25 (#9493 by Adam Li).mne.inverse_sparse.mixed_norm()now simply warns when source estimates contain no dipole, e.g. if data are too noisy and alpha is based on SURE (#9685 by Alex Gramfort)Deprecate functions
mne.datasets.DATASET_NAME.has_DATASET_NAME_data()for these datasets:epilepsy_ecog,fnirs_motor,multimodal,opm,phantom_4dbti,refmeg_noise,sample,somato, andssvep. Use the genericmne.datasets.has_dataset()instead (#9781 by Daniel McCloy and Adam Li)mne.Reportmodernization has led to multiple deprecations (#9754 by Richard Höchenberger):mne.Report.add_figs_to_sectionandmne.Report.add_slider_to_sectionhave been deprecated in favor ofmne.Report.add_figure()mne.Report.add_images_to_sectionhas been deprecated in favor ofmne.Report.add_image()mne.Report.add_bem_to_sectionhas been deprecated in favor ofmne.Report.add_bem()mne.Report.add_htmls_to_sectionhas been deprecated in favor ofmne.Report.add_html()In
mne.Report.parse_folder(), thesort_sectionsparameter has been deprecated in favor ofsort_contentIn
mne.Report.remove(), thecaptionandsectionparameters have been deprecated in favor oftitleandtags, respectivelyThe
mne.Report.sectionsattribute has been deprecated in favor ofmne.Report.tagsThe
mne.Report.fnamesattribute has been deprecated without replacement
mne.Epochs.plot()andmne.viz.plot_epochs()gained parametershow_scalebarsanalogous tomne.viz.plot_raw()(#9815 by Daniel McCloy)The output folder name for HF_SEF datasets is now
hf_sefinstead ofHF_SEF(#9763 by Adam Li)Deprecate
mne.viz.utils.center_cmap(#9851 by Clemens Brunner)The default partial pathlength factor of
mne.preprocessing.nirs.beer_lambert_law()will change from 0.1 in 0.24 to 6.0 in the next release (#9843 by Robert Luke)mne.preprocessing.ICA.detect_artifactshas been deprecated. Please usefind_bads_eogandfind_bads_ecginstead (#9909 by Richard Höchenberger)