Metadata-Version: 2.4
Name: mnextend
Version: 0.2.0
Summary: Additional functionality for MNE-Python
Keywords: EEG,MEG,MNE-Python,XDF,electrophysiology
Author: Clemens Brunner
Author-email: Clemens Brunner <clemens.brunner@gmail.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: edfio>=0.4.13
Requires-Dist: matplotlib>=3.8
Requires-Dist: mne>=1.12.1
Requires-Dist: numpy>=2.2.6
Requires-Dist: onnx>=1.21.0
Requires-Dist: pybv>=0.8.1
Requires-Dist: pybvrf>=0.1.3
Requires-Dist: pyxdf>=1.17.5
Requires-Dist: scipy>=1.15.3
Requires-Python: >=3.12
Project-URL: homepage, https://github.com/cbrnr/mnextend
Project-URL: documentation, https://github.com/cbrnr/mnextend/blob/main/README.md
Project-URL: repository, https://github.com/cbrnr/mnextend
Project-URL: changelog, https://github.com/cbrnr/mnextend/blob/main/CHANGELOG.md
Description-Content-Type: text/markdown

# MNExtend

This package provides additional functionality for working with [MNE-Python](https://mne.tools/), the most popular Python package for processing electrophysiological data (EEG, MEG, ...).

## Features

### Reading additional file formats

MNExtend provides readers for the following file formats that are not natively supported by MNE-Python:

- [XDF](https://github.com/sccn/xdf/wiki/Specifications) (Extensible Data Format)
- [MAT](https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html) (MATLAB)
- [NPY](https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html) (NumPy)

In addition, MNExtend adds the following readers from third-party packages:

- [BVRF](https://www.brainproducts.com/support-resources/brainvision-recording-format/) (via [PyBVRF](https://github.com/cbrnr/pybvrf))

Together with the native MNE-Python readers, `read_raw()` and `read_epochs()` provide a unified interface for reading electrophysiological data from a wide range of file formats, so all you have to do is:

```python
from mnextend import read_raw, read_epochs

raw = read_raw("my_data-raw.xdf", stream_ids=[1, 2, 3])
epochs = read_epochs("my_data-epochs.fif.gz")
```

### Writing raw data

Writing raw data is supported via `write_raw()`, which does not implement any new file formats, but provides a unified interface for writing raw data to the file formats that are natively supported by MNE-Python:

```python
from mnextend import write_raw

write_raw("my_data-raw.fif.gz", raw)
```

### ICLabel classification

MNExtend includes [ICLabel](https://labeling.ucsd.edu/tutorial/overview), a pre-trained classifier that labels ICA components as one of seven types: brain, muscle, eye, heart, line noise, channel noise, or other. In contrast to [MNE-ICALabel](https://mne.tools/mne-icalabel/stable/index.html), the classifier is implemented in pure NumPy and does not depend on [ONNX Runtime](https://onnxruntime.ai).

`run_iclabel()` takes a fitted `ICA` object and the corresponding `Raw` or `Epochs` instance (which must have a montage set), and returns an array of class probabilities:

```python
from mnextend import plot_ica_components, run_iclabel

probs = run_iclabel(raw, ica)
figs = plot_ica_components(raw, ica, probs)
```
