Skip to main content

Python implementation of some Brainstorm functions

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystorm3-0.1.19.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystorm3-0.1.19-py3-none-any.whl (54.0 kB view details)

Uploaded Python 3

File details

Details for the file pystorm3-0.1.19.tar.gz.

File metadata

  • Download URL: pystorm3-0.1.19.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.18

File hashes

Hashes for pystorm3-0.1.19.tar.gz
Algorithm Hash digest
SHA256 1fa027996760870c7172787b556ed6276973481d0c1f1b1d84d7f9a9a0594239
MD5 8cb32a10bed0a18d7f32029340e4bccc
BLAKE2b-256 29122e3b0eb583a9f4d7e2098a4e0814f0043e8c323d25e96354c674382b6879

See more details on using hashes here.

File details

Details for the file pystorm3-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: pystorm3-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 54.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.18

File hashes

Hashes for pystorm3-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 41c85826062f5d1d6498bcf529c2b3b0a3e3ade2ec7bc4795f84302e55be2594
MD5 17ecd967fdc833cc0be1db53454a6175
BLAKE2b-256 60c0ff95f8122033f68861278637bcf51c5b64d82a18664da7f4c3c60f6578e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page