Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

fNIRSAtlas logo

fNIRSAtlas

PyPI arXiv

fNIRSAtlas is a Python package for parsing, preprocessing, and classifying fNIRS datasets with a unified structure. It provides the largest fNIRS classification benchmark, and the largest resource for easily accessible fNIRS datasets.

Features

  • 25+ public fNIRS datasets
  • Mental arithmetic, motor, n-back, and emotion classification paradigms
  • Within-session, cross-session, and cross-subject evaluation
  • YAML and Python pipelines for scikit-learn, PyTorch, and Braindecode
  • Dataset caching, result persistence, statistics, and plots
  • Export of fNIRS data in a consistent format

Usage

Installation

Requires Python 3.11 or later. Install the pre-release from PyPI:

pip install --pre fnirsatlas
pip install --pre "fnirsatlas[dl]"            # native PyTorch models

For development, install from source with uv.

git clone -b v2 https://github.com/kalomak/fNIRSAtlas.git
cd fNIRSAtlas
uv sync --all-extras

Run a benchmark

from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler

from fnirsatlas import (
    Bnci2014FnirsMA,
    CrossSubjectEvaluation,
    FNIRSClassification,
    WindowedFeatureExtractor,
)

evaluation = CrossSubjectEvaluation(
    paradigm=FNIRSClassification(), datasets=[Bnci2014FnirsMA()]
)
pipeline = make_pipeline(
    WindowedFeatureExtractor(),
    StandardScaler(),
    LinearDiscriminantAnalysis(shrinkage="auto", solver="lsqr"),
)
results = evaluation.process({"LDA": pipeline})

Evaluations accept scikit-learn-compatible pipelines. Data is downloaded and cached on first use. Raw results are stored in results/ and summaries in benchmark/. Existing runs are resumed unless overwrite=True is passed to the evaluation. See Benchmarking for more options.

Access data

import fnirsatlas

fnirsatlas.list_datasets()  # available dataset names
dataset = fnirsatlas.get_dataset("Bnci2014FnirsMA")
X, labels, metadata = fnirsatlas.FNIRSClassification().get_data(dataset, subjects=[1])

See Data access for continuous and epoched output options.

Examples

See the runnable examples.

Documentation

See the documentation.

Contributing

See Contributing for the development setup, tests, and checks. In short:

Citation

@inproceedings{makela2026fnirsatlas,
  title     = {{fNIRSAtlas}: A Large-Scale Benchmark for Functional Near-Infrared Spectroscopy Classification},
  author    = {M{\"a}kel{\"a}, Kalle and Ruotsalo, Tuukka},
  booktitle = {Advances in Neural Information Processing Systems},
  year      = {2026},
  eprint    = {2611.10082},
  archivePrefix = {arXiv}
}

Metadata

Release files for fnirsatlas 2.0.0a2

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

Source distribution (sdist)

Source distribution for fnirsatlas 2.0.0a2
File Size Uploaded Provenance Actions
fnirsatlas-2.0.0a2.tar.gz 445.0 kB Without provenance Details for fnirsatlas-2.0.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fnirsatlas 2.0.0a2
File Interpreter ABI Platform Actions
fnirsatlas-2.0.0a2-py3-none-any.whl Python 3 none any Details for fnirsatlas-2.0.0a2-py3-none-any.whl

Total release size: 617.9 kB

Release files / fnirsatlas-2.0.0a2.tar.gz

Download URL fnirsatlas-2.0.0a2.tar.gz
Size 445.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8ee6e6f009ee2198d8c776e5ed895db0c8bf149b0cf68f572993d97404e1561f
BLAKE2b-256 checksum
How to use checksums
a7b858dcbbb1ce7b1c1186cfe3ccfa6c5ea6afefd5635014797ef36e183c9d00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / fnirsatlas-2.0.0a2-py3-none-any.whl

Download URL fnirsatlas-2.0.0a2-py3-none-any.whl
Size 172.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6082317b7d4ccf4dd4cc978e2e07f776063e6b729965e984953a7403de546fa
BLAKE2b-256 checksum
How to use checksums
dc4e6c8d75cc8bc9bd45bf2635c16d47ad9656e3d058deceb9d357bfaf21f4ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for fnirsatlas 2.0.0a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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