Skip to main content

Python framework for uncertainty estimation and calibration in EEG/MEG inverse source imaging

Project description

PyPI version Supported Python versions License Latest GitHub release DOI

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:

  1. generate source-level ground truth under controlled sparsity and amplitude assumptions;

  2. project sources to sensors through a leadfield and add noise at defined SNR;

  3. reconstruct posterior means and uncertainty summaries with inverse solvers;

  4. convert uncertainty summaries into intervals, ellipses, or ellipsoids;

  5. compare empirical against nominal coverage;

  6. 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


Download files

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

Source Distribution

calibrain-1.0.2.tar.gz (121.6 kB view details)

Uploaded Source

Built Distribution

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

calibrain-1.0.2-py3-none-any.whl (129.4 kB view details)

Uploaded Python 3

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

Hashes for calibrain-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9775430967fb71ab541dde3387fcec90d7d0c4991d9f2d6d12642ba2761f145c
MD5 f96f5469775c538f30615c9a8bc4a3e1
BLAKE2b-256 82565df5ba9d9a57200a00a489b53a12ad16507716e0065a0107e85a6473a5f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for calibrain-1.0.2.tar.gz:

Publisher: publish-pypi.yml on braindatalab/CaliBrain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for calibrain-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2437ef6e64e31bc46dbeb5d53441a8c1cf66ae3f9d95c2321cbea7f98830db1c
MD5 77f8beba0ef95e82c45b2795de93f0f0
BLAKE2b-256 553fece02f30f519d6f2bd767097497d6a50398b3bf3840e0cf4c356f690ccd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for calibrain-1.0.2-py3-none-any.whl:

Publisher: publish-pypi.yml on braindatalab/CaliBrain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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