Metadata-Version: 2.1
Name: pystorm3
Version: 0.1.10
Summary: Python implementation of some Brainstorm functions
Home-page: https://github.com/NeuroLife77/pystorm
Author: Dominic Boutet
Author-email: dominic.boutet@mail.mcgill.ca
Maintainer: Dominic Boutet
Maintainer-email: dominic.boutet@mail.mcgill.ca
License: GPL-3.0 license
Keywords: neuroscience,neuroimaging,neural oscillations,time series analysis,time frequency analysis
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.2.0
Requires-Dist: numpy>=1.26
Requires-Dist: scipy>=1.13.0
Requires-Dist: torchaudio>=2.2.0
Requires-Dist: numba>=0.59

![Pystorm logo](https://github.com/NeuroLife77/pystorm/blob/main/pystorm_logo.png?raw=true)
# Pystorm
Python implementation of various functions from the [Brainstorm](https://neuroimage.usc.edu/brainstorm/) [repository](https://github.com/brainstorm-tools/brainstorm3), 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

### Currently implemented
- Power spectral density estimation ([PSD Welch method](https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/timefreq/bst_psd.m), 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"](https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/math/bst_bandpass_hfilter.m))
- Hilbert transform
- Amplitude envelope correlation (equivalent to ["penv" and "oenv"](https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/connectivity/bst_henv.m)). Can only be applied on signal directly for now: does not work with (sensor, kernel) input.


### Coming (very) soon
- Sign flip for parcellated source signal
- [tPAC](https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/functions/process_pac_dynamic.m) (time-resolved Phase-Amplitude Coupling) with [surrogate data z-score](https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/functions/process_pac_dynamic_sur2.m)

### Currently not implemented
- Handling of unconstrained sources
