Code for microstate analysis, in combination with MNE-Python.
Project description
Microstate analysis for use with MNE-Python
A small module that works with MNE-Python to perform microstate analysis in EEG
and MEG data.
To learn more about microstate analysis, read the paper:
Pascual-Marqui, R. D., Michel, C. M., & Lehmann, D. (1995). Segmentation of
brain electrical activity into microstates: model estimation and validation.
IEEE Transactions on Biomedical Engineering.
https://ieeexplore.ieee.org/document/391164
Usage
import mne
import microstates
# Load MNE sample dataset
from mne.datasets import sample
fname = sample.data_path() + '/MEG/sample/sample_audvis_filt.fif'
raw = mne.io.read_raw_fif(fname, preload=True)
# Always use an average EEG reference when doing microstate analysis
raw.set_eeg_reference('average')
# Highpass filter the data a little bit
raw.filter(0.2, None)
# Selecting the sensor types to use in the analysis. In this example, we
# use only EEG channels
raw.pick_types(meg=False, eeg=True)
# Segment the data into 6 microstates
maps, segmentation = microstates.segment(raw.get_data(), n_states=6)
# Plot the topographic maps of the found microstates
microstates.plot_maps(maps, raw.info)
# Plot the segmentation of the first 500 samples
microstates.plot_segmentation(segmentation[:500], raw.get_data()[:, :500], raw.times[:500])
Author
Marijn van Vliet w.m.vanvliet@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mne_microstates-0.2.tar.gz.
File metadata
- Download URL: mne_microstates-0.2.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.2.0 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dccfb86ebc07d8206bc815d2107204d52e720ca53df06fc448b5802b3d02f3f
|
|
| MD5 |
ebeff4b33f7ced72765c4090cf659f55
|
|
| BLAKE2b-256 |
18c9b1eaf5167100b443b7a03afc6bff64e342d06b4607d618faa77014911c6b
|
File details
Details for the file mne_microstates-0.2-py3-none-any.whl.
File metadata
- Download URL: mne_microstates-0.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.2.0 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1b62c8090b8e793e13815d79f328175a58786424b80ea182b0eaa5931078f6d
|
|
| MD5 |
226767a2ecf93a587c7ce1320655820c
|
|
| BLAKE2b-256 |
e14c73d3af9a7b9a07f8b268df4eda80c6768c1862c604ff0893f2f7fd782c75
|