Getting started#
Install#
Python 3.12 or newer is required.
Install the base package and optional integrations with the package manager you use:
Base package:
pip install mne-denoise
MNE-Python integration:
pip install "mne-denoise[mne]"
Visualization:
pip install "mne-denoise[viz]"
Progress bars:
pip install "mne-denoise[progress]"
All optional integrations:
pip install "mne-denoise[mne,viz,progress]"
Base package:
uv pip install mne-denoise
MNE-Python integration:
uv pip install "mne-denoise[mne]"
Visualization:
uv pip install "mne-denoise[viz]"
Progress bars:
uv pip install "mne-denoise[progress]"
All optional integrations:
uv pip install "mne-denoise[mne,viz,progress]"
Install the base package from conda-forge:
conda install -c conda-forge mne-denoise
Optional integrations can be installed as conda packages alongside mne-denoise:
MNE-Python integration:
conda install -c conda-forge mne-denoise mne
Visualization:
conda install -c conda-forge mne-denoise matplotlib seaborn
Progress bars:
conda install -c conda-forge mne-denoise tqdm
These commands install the latest released version. To work from the current
main branch, see the Development setup.
First NumPy workflow#
Most estimators follow the scikit-learn pattern: configure, fit on data used to learn an operator, then transform compatible data. Use fit_transform when the method has a fixed fitted operator.
import numpy as np
from mne_denoise.dss import BandpassBias, DSS
data = np.random.default_rng(0).standard_normal((8, 2000))
bias = BandpassBias((8.0, 12.0), sfreq=250.0)
clean = DSS(bias=bias, n_components=3).fit_transform(data)
First MNE workflow#
Pass supported MNE objects directly; estimators preserve container metadata and return copies. For example, with a preloaded Raw object named raw:
from mne_denoise.spectrum_interpolation import SpectrumInterpolation
clean_raw = SpectrumInterpolation(line_freq=60.0).fit_transform(raw)
Main estimators use fit, transform, and fit_transform when those
operations match the method. Supported MNE objects are copied rather than
modified in place; exact container and array contracts are documented in the
API reference.