Skip to main content

Pystorm logo

Pystorm

Python implementation of various functions from the Brainstorm repository, often written for GPU compatibility and/or jit compilation.

Note on the current scope of Pystorm

Pystorm does not handle interactions with Brainstorm or matlab and, in its current state, does not handle loading of data files.

It mainly operates as a library of functions to perform operations on data directly (e.g., numpy array of sensor signals and imaging kernel).

It aims to be lightweight, fast, and hopefully easily scalable to parallel computing and high performance computing.

It can be installed using pip through pypi where it is named pystorm3:

python -m pip install pystorm3

or

pip install pystorm3.

Pystorm functions

Note:

Currently experiencing issues with the scipy backend, so most new functions are only implemented with the pytorch backend and some functions (like band_pass) will default to the pytorch backend on cpu device if called from within another pystorm function that was set to the scipy backend.

Currently implemented

  • Power spectral density estimation (PSD Welch method, physical units only) in source and sensor space (can operate on GPU)
  • Time-resolved PSD (same as above function, but returns all windows instead of the average)
  • FFT (only implemented with pytorch backend) that returns either the complex values or the power and phase values.
  • Band-pass filtering (equivalent to "bst-hfilter-2019")
  • Hilbert transform
  • Amplitude envelope correlation (equivalent to "penv" and "oenv"). Also includes an option to apply it on source data directly or parcellated data (see extract parcel time series section for details)
  • Extract parcel time series from the sensor data and the imaging kernel: requires the imaging kernel to be separated per parcel as a list of N matrices (1 per parcel) that only contain the rows of the sources within the parcels. It can be applied on either the mean of the sources time course within each parcel or on a PCA-based dimensionality reduction of the signal.
  • Sign flip based on cortical surface orientations for parcellated source signal
  • PAC and tPAC (time-resolved Phase-Amplitude Coupling) with surrogate data z-score
  • Morlet wavelet coefficients. Only implemented with pytorch backend and does not speed up the convolution with FFT.
  • Phase lag index (including PLI,wPLI,dwPLI). Works both in source space and sensor space.

Coming soon

  • TBD

Currently not implemented

  • Handling of unconstrained sources

Metadata

Release files for pystorm3 0.1.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pystorm3 0.1.20
File Size Uploaded
pystorm3-0.1.20.tar.gz 47.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pystorm3 0.1.20
File Interpreter ABI Platform
pystorm3-0.1.20-py3-none-any.whl Python 3 none any Details

Total release size: 101.5 kB

Release files / pystorm3-0.1.20.tar.gz

Download URL pystorm3-0.1.20.tar.gz
Size 47.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d48186ab633d5f75faf5c0f0881c3bac93eb63d95d68e370602f94188c6c4341
BLAKE2b-256 checksum
How to use checksums
f6c40f71adcf29a75a451d24c4d0004d5aec1fd8cc89dd8915a8bce4062a27db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.18

Release files / pystorm3-0.1.20-py3-none-any.whl

Download URL pystorm3-0.1.20-py3-none-any.whl
Size 54.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0db2828348066d9e6b2570d7e69378768cca0bba20347fe202edcae8750028bd
BLAKE2b-256 checksum
How to use checksums
6abe65ef4af84363a1c67b96716423f051efc2afd236b4f7607fea4445da77e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.1.20 This release

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page