Neurostore Study Set Releases: sample notebook
A worked notebook for Neurostore Study Set Releases, with 6 code cells and the output each one printed. On Scigantic it opens in a hosted JupyterLab with the dataset already mounted, so nothing is downloaded first.
- Provider
- Neurostuff
- Format
- Parquet (in sampled files)
- Stored at
- Amazon S3, s3://neurostore-studyset (us-east-1)
- Access
- Free and public. No account with the data provider is needed.
The notebook
Neurostore Study Set — a NiMARE sandbox
This archive is the Neurostore NiMARE Studyset parquet bundle — 32,406 studies and 873,656 reported activation coordinates curated by the Neurostuff team and designed to drive NiMARE, the standard Python toolkit for coordinate-based meta-analysis (CBMA).
This notebook is a menu of things to play with: pick a topic, optionally narrow by demographics, run an Activation Likelihood Estimation (ALE) meta-analysis, plot the result. Mix and match. Run all cells once and after that swapping topics or filters re-runs near-instantly.
Three small mechanical notes so nothing surprises you:
- The bundle has no behavioral/task annotations — only participant demographics. We filter topics by text search on study descriptions; for properly curated Studysets see compose.neurosynth.org.
- NiMARE's default ALE kernel requires per-experiment sample sizes (not in this bundle), so we pass ALEKernel(fwhm=10) — the Eickhoff-2012 literature default.
- The four parquet files (studies, coordinates, analyses, annotations) are queried with DuckDB — one SQL pass with predicate pushdown reads only the columns and rows the query needs, which is what keeps topic-swap re-runs fast even though analyses.parquet alone holds 873k rows.
Load the data
%matplotlib inline
import duckdb
import matplotlib.pyplot as plt
from nimare.nimads import Studyset
from nimare.meta.cbma.ale import ALE
from nimare.meta.kernel import ALEKernel
from nilearn import plotting
BUNDLE = '/mnt/archive/2026-05'
ss = Studyset(BUNDLE)
print(ss)
Output:
Studyset: neurostore-studyset :: studies: 32406
Pick a topic
One DuckDB query joins studies × coordinates × analyses directly off the parquet files, filtering by topic text and MNI space in a single pass. Change TOPIC and re-run from here.
Try: 'working memory', 'pain', 'face perception', 'reward', 'n-back', 'decision making', 'meditation', …
TOPIC = 'working memory'
pattern = f'%{TOPIC.lower()}%'
# Match pandas (description + ' ' + name).str.contains — concat the two
# fields before LIKE so a topic split across the boundary still matches.
matching = duckdb.sql(f"""
WITH topic_studies AS (
SELECT DISTINCT study_id
FROM '{BUNDLE}/studies.parquet'
WHERE lower(coalesce(description, '') || ' ' || coalesce(name, '')) LIKE '{pattern}'
)
SELECT DISTINCT a.id, a.study_id, a.contrast_id
FROM '{BUNDLE}/analyses.parquet' a
JOIN topic_studies ts USING (study_id)
JOIN '{BUNDLE}/coordinates.parquet' c USING (study_id, contrast_id)
WHERE c.space = 'MNI'
""").df()
topic_study_count = duckdb.sql(f"""
SELECT COUNT(DISTINCT study_id)
FROM '{BUNDLE}/studies.parquet'
WHERE lower(coalesce(description, '') || ' ' || coalesce(name, '')) LIKE '{pattern}'
""").fetchone()[0]
print(f"{topic_study_count:,} studies match '{TOPIC}'")
print(f"{len(matching):,} MNI-aligned analyses available")
Output:
1,964 studies match 'working memory' 4,607 MNI-aligned analyses available
Optional: narrow by demographics
annotations.parquet ships with auto-extracted participant demographics — sample sizes, ages, sex breakdowns, and diagnoses per analysis group. Use it to make the slice more specific (e.g. only adult studies, only larger samples, only patient populations).
Inspect what's available:
duckdb.sql(f"DESCRIBE SELECT * FROM '{BUNDLE}/annotations.parquet' LIMIT 0").df()
…or look just at the primary-group columns:
cols = duckdb.sql(f"DESCRIBE SELECT * FROM '{BUNDLE}/annotations.parquet' LIMIT 0").df()['column_name']
[c for c in cols if 'groups[0]' in c]
The example below joins annotations onto the topic match set and keeps only analyses whose primary group reports ≥ 20 participants. Toggle USE_DEMOGRAPHIC_FILTER to skip this step.
USE_DEMOGRAPHIC_FILTER = True
if USE_DEMOGRAPHIC_FILTER:
matching = duckdb.sql(f"""
SELECT m.*
FROM matching m
JOIN '{BUNDLE}/annotations.parquet' n
ON n.id = m.id
WHERE coalesce(n."ParticipantDemographicsExtractor.groups[0].count", 0) >= 20
""").df()
print(f"{len(matching):,} analyses remain after demographic filter (n ≥ 20)")
else:
print(f"{len(matching):,} analyses (no demographic filter applied)")
Output:
2,374 analyses remain after demographic filter (n ≥ 20)
Slice and materialize
ALE on 30-60 analyses gives a clear, fast result and is typical for the literature. Bigger is more sensitive but slower; we cap at 60 for the first run.
Heads-up: the first to_dataset() call in a fresh kernel takes ~80 seconds while NiMARE builds its coordinate graph. Every subsequent call in the same kernel is ~5 seconds — so iterate freely afterwards.
N = 60
analysis_ids = matching['id'].head(N).tolist()
subset = ss.slice(analysis_ids)
ds = subset.to_dataset()
print(ds)
Output:
Dataset(60 experiments, space='mni152_2mm')
Run ALE
.fit() produces an *uncorrected* statistical map. For a publishable result follow with FWE correction (see "more to try" below).
ale = ALE(kernel_transformer=ALEKernel(fwhm=10))
result = ale.fit(ds)
print('Output maps:', list(result.maps.keys()))
Output:
Output maps: ['stat', 'p', 'z']
Plot
Glass-brain plot of the uncorrected z-statistic map, thresholded at z = 2.3 (one-tailed p ≈ 0.01).
z_map = result.get_map('z')
plotting.plot_glass_brain(
z_map,
threshold=2.3,
display_mode='lyrz',
colorbar=True,
title=f"ALE: '{TOPIC}' ({len(analysis_ids)} analyses, MNI, uncorrected z>2.3)",
)
plt.gcf()
More to try
- Different topic → change TOPIC in the topic cell, re-run from there (~1s for the SQL pass).
- Bigger slice → raise N in the slice cell. Time grows roughly linearly; 200 analyses ≈ 20s.
- Different demographic filter — rewrite the annotations SQL: WHERE n."ParticipantDemographicsExtractor.groups[0].age_mean" >= 18 for adults, < 18 for pediatric, n."ParticipantDemographicsExtractor.groups[0].diagnosis" IS NOT NULL for patient populations. Use the DESCRIBE trick above to discover other columns.
- Pure SQL exploration — duckdb.sql(f"SELECT space, count(*) FROM '{BUNDLE}/coordinates.parquet' GROUP BY 1 ORDER BY 2 DESC").df() and friends. DuckDB reads parquet directly off the FUSE mount; no warm-up, no in-memory copy.
- FWE correction for a publishable result:
from nimare.correct import FWECorrector
corrected = FWECorrector(method='montecarlo', n_iters=5000).transform(result)
plotting.plot_glass_brain(corrected.get_map('z_corr-FWE_method-montecarlo'), threshold=2.3)
Takes ~5-10 minutes — appropriate for a serious result, not for a smoke test.
- Different estimator — nimare.meta.cbma.mkda.MKDADensity and KDA are alternative CBMA estimators; same .fit(ds) interface.
For curated, shareable Studysets and the full Neurosynth Compose workflow, see compose.neurosynth.org. NiMARE's own worked examples: .
Run it
Open this notebook to run it, see the dataset page for the full description, or browse the full catalog.