Python framework for uncertainty estimation and calibration in EEG/MEG inverse source imaging
Project description
A Python framework for uncertainty estimation and calibration in EEG/MEG inverse source imaging. Overview ——–
CaliBrain addresses a specific reliability problem in EEG/MEG inverse source imaging: a posterior estimate is only useful if its uncertainty is well-calibrated. The package provides a simulation-based workflow for generating source activity, propagating it through forward models, reconstructing posterior source estimates, quantifying empirical coverage, and learning recalibration maps from controlled experiments.
Documentation
The documentation is hosted on Read the Docs: https://calibrain.readthedocs.io/
For runnable end-to-end examples, see the tutorials and workflow documentation on Read the Docs.
Citation
If you use CaliBrain in academic work, please cite the software archive:
Orabe, Mohammad, Huseynov, Ismail T., Nagarajan, Srikantan, & Haufe, Stefan. (2026). CaliBrain: Python framework for uncertainty estimation and calibration in EEG/MEG inverse source imaging (v1.0.2). Zenodo. https://doi.org/10.5281/zenodo.20703249
Workflow
The package follows this workflow:
generate source-level ground truth under controlled sparsity and amplitude assumptions;
project sources to sensors through a leadfield and add noise at defined SNR;
reconstruct posterior means and uncertainty summaries with inverse solvers;
convert uncertainty summaries into intervals, ellipses, or ellipsoids;
compare empirical against nominal coverage;
fit isotonic recalibration functions on training splits and evaluate them on held-out splits.
CaliBrain currently supports fixed and free-orientation source models for inverse source imaging methods: * gamma_map_sflex for Gamma-MAP reconstruction with sparse basis field expansions; * gamma_lambda_map_sflex for the S-FLEX Gamma-MAP variant with joint sparsity and lambda regularization; * BMN as a Bayesian minimum norm baseline; * BMN_joint as a Bayesian minimum norm variant with joint gamma/lambda learning.
Installation
From PyPI:
python -m pip install calibrain
From a local checkout:
git clone https://github.com/braindatalab/CaliBrain.git
cd CaliBrain
python -m pip install -e .
License
CaliBrain is distributed under the BSD 3-Clause License. See LICENSE.
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 calibrain-1.0.2.tar.gz.
File metadata
- Download URL: calibrain-1.0.2.tar.gz
- Upload date:
- Size: 121.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9775430967fb71ab541dde3387fcec90d7d0c4991d9f2d6d12642ba2761f145c
|
|
| MD5 |
f96f5469775c538f30615c9a8bc4a3e1
|
|
| BLAKE2b-256 |
82565df5ba9d9a57200a00a489b53a12ad16507716e0065a0107e85a6473a5f1
|
Provenance
The following attestation bundles were made for calibrain-1.0.2.tar.gz:
Publisher:
publish-pypi.yml on braindatalab/CaliBrain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calibrain-1.0.2.tar.gz -
Subject digest:
9775430967fb71ab541dde3387fcec90d7d0c4991d9f2d6d12642ba2761f145c - Sigstore transparency entry: 1840345938
- Sigstore integration time:
-
Permalink:
braindatalab/CaliBrain@af43b9eb491aa9cddb1e7711db3e60aec9304337 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/braindatalab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@af43b9eb491aa9cddb1e7711db3e60aec9304337 -
Trigger Event:
release
-
Statement type:
File details
Details for the file calibrain-1.0.2-py3-none-any.whl.
File metadata
- Download URL: calibrain-1.0.2-py3-none-any.whl
- Upload date:
- Size: 129.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2437ef6e64e31bc46dbeb5d53441a8c1cf66ae3f9d95c2321cbea7f98830db1c
|
|
| MD5 |
77f8beba0ef95e82c45b2795de93f0f0
|
|
| BLAKE2b-256 |
553fece02f30f519d6f2bd767097497d6a50398b3bf3840e0cf4c356f690ccd0
|
Provenance
The following attestation bundles were made for calibrain-1.0.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on braindatalab/CaliBrain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calibrain-1.0.2-py3-none-any.whl -
Subject digest:
2437ef6e64e31bc46dbeb5d53441a8c1cf66ae3f9d95c2321cbea7f98830db1c - Sigstore transparency entry: 1840346073
- Sigstore integration time:
-
Permalink:
braindatalab/CaliBrain@af43b9eb491aa9cddb1e7711db3e60aec9304337 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/braindatalab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@af43b9eb491aa9cddb1e7711db3e60aec9304337 -
Trigger Event:
release
-
Statement type: