PyZapline_plus

MNE Integration

PyZaplinePlus provides an optional adapter to clean mne.io.Raw objects directly, preserving channel metadata and annotations.

Basic usage

import mne
from pyzaplineplus import apply_zapline_to_raw

raw = mne.io.read_raw_fif("my_raw.fif", preload=True)
raw_clean, config, analytics, figs = apply_zapline_to_raw(
    raw,
    picks=None,           # default: EEG-only
    copy=True,            # return a modified copy
    line_freqs="line",   # auto-detect 50/60 Hz
    plotResults=False,    # optional plotting
    adaptiveNremove=True, # MATLAB parity default
)

# Save if desired
raw_clean.save("my_raw_cleaned.fif", overwrite=True)

Key options

Troubleshooting