laion_fmri

A data downloader and wrangler for the LAION-fMRI dataset. The package mirrors the bucket layout to your local disk via the official AWS CLI, keeps every accessor as a one-to-one map onto a single file in S3, and applies BIDS-entity filters so you only fetch what you need.

A typical session looks like:

from laion_fmri.config import dataset_initialize
from laion_fmri.download import download
from laion_fmri.subject import load_subject

dataset_initialize("./laion_fmri_data")

download(subject="sub-03", ses="ses-01", n_jobs=4)

sub = load_subject("sub-03")
betas = sub.get_betas(session="ses-01")     # (n_trials, n_voxels), float32

The same three workflow steps – configure, inspect, download – are also exposed as a laion-fmri shell command, installed automatically by pip/uv:

laion-fmri config   --data-dir ./laion_fmri_data
laion-fmri info
laion-fmri download --subject sub-03

Loading still happens from Python; the CLI covers configure, inspect, and download. See Download for full laion-fmri download semantics.

The cards below walk through each step in detail.

Initialize

Pick a local data directory and persist the choice across sessions.

Initialize the data directory
Licenses

Review and accept the dataset and stimulus licenses up front, or let download(...) prompt on first use.

License acceptance
Discover

List subjects, ROIs, and bucket structure – every query reads S3 directly, no local download needed.

Discover what’s in the bucket
Download

BIDS-entity filters, strict ses semantic with the "averages" keyword, idempotent re-runs, and n_jobs parallelism.

Download
Load

Single-trial betas, noise-ceiling maps, ROI masks, brain-space mapping, multi-subject groups, and PyTorch.

Load
Examples gallery

Four hands-on, narrated walkthroughs covering the full workflow.

Examples gallery
API reference

Auto-generated reference for every public module, class, and function.

API Reference