NeuroLang NeuroLang

Probabilistic Logic Programming for Neuroimaging Analysis

NeuroLang is a probabilistic logic programming system for the analysis of neuroimaging data. It lets you express complex queries over brain images, ontologies, and tabular databases in a declarative style — and reason about them probabilistically.


🧠 Language

A declarative language built on Datalog — a logic rule-based query language for relational data. Write what you want, not how to compute it.

🎲 Probabilistic Solver

Supports discrete, probabilistic, and open-world reasoning. Query over uncertain data with sound probabilistic semantics.

⌨️ Interactive

Type queries in a REPL, in the browser or in a terminal, on engines of ready-made data: Neurosynth, NeuroStore, atlases, ontologies, tracts. Or embed NeuroLang in Python (NeuroLang in Python).


Quick Start#

Open the REPL in the browser, or install NeuroLang and start it in a terminal:

pip install "neurolang[apps]"
neurolang-query -i --engine neurosynth

Then ask which studies of Neurosynth mention pain:

ans(s) :- mentions(s, "pain")

Run in the browser REPL

and which brain regions their peaks fall in most often, in the Destrieux atlas:

pain_region(l, count(s)) :- destrieux_activated(l, s) & mentions(s, "pain")
ans(l, n) :- pain_region(l, n)

Run in the browser REPL

See Using the REPL for the REPL, Get Started with NeuroLang for a first walkthrough, and Datalog: A Rule-Based Query Language for NeuroLang for the language.