Open Science · Diffusion MRI · Microstructure Imaging

Physics is
the specification.
Open code is how we check it.

Diffusion MRI can see inside living tissue without a scalpel — inferring axon diameters, membrane densities, soma permeability from the motion of water molecules. dmrai-lab is building open, validated, reproducible infrastructure for this work: two engines that keep each other honest, free for the whole field to use, extend, and check.

Brain dissolving into diffusion MRI microstructure geometry

Packages

Active
dmrai
The workspace that ties the two engines together: pinned, validated versions of dmipy-fit and dmipy-sim, the cross-engine benchmarks that check them against each other, and the provenance and figure-regression tooling that keep published findings reproducible. Install dmrai and you get a known-good combination of the whole stack.
meta-package pinned versions benchmarks observability reproducibility
Active
dmipy-fit
JAX-native model inference across the full landscape of compartment models. Amortized inference, Rician noise floor modeling, and explicit scope boundaries characterized against Monte Carlo ground truth.
JAX amortized inference Rician noise T1/T2 relaxation
Active
dmipy-sim
Monte Carlo diffusion MRI simulator validated against Disimpy and MISST. Substrate generation, gradient waveforms, and synthetic signal output for ground-truth benchmarking.
Monte Carlo substrates Disimpy validated MISST validated

Vision

The goal is not a faster fitting tool — it is an open, validated foundation the whole field can build on together.

The name is the thesis in miniature: dmrai is diffusion MRI + AI. Diffusion, because water diffusion is the mechanism beneath every quantity we estimate — relaxation, susceptibility, and exchange are all read out through how water moves; quantitative maps are what you get, water diffusion is how you get them. AI, because the work is built by and with AI agents.

dmrai-lab is the revival and extension of dmipy, originally published in Frontiers in Neuroinformatics (2019). We are rebuilding it in the open, around two engines that keep each other honest: a JAX fitting engine grounded in biophysical compartment models, and a Monte Carlo simulator that provides the ground truth to check it against.

Our north star: a scientist anywhere in the world should be able to describe a tissue model, simulate it, fit it, and reproduce the result — in a single afternoon, with the evidence open for anyone to check.

The bottleneck was never intelligence. It was shared infrastructure — and that is finally something we can build together.

Physics is the Specification  ·  A manifesto for machine-verifiable diffusion MRI science  ·  dmrai-lab  ·  May 2026  ·  v0.1

Diffusion MRI can see inside living tissue without a scalpel. It can infer the diameter of an axon, the density of cell membranes, the permeability of a soma wall — all from the way water molecules move. This is one of the most remarkable capabilities in modern medicine.

Like every fast-moving field, it has grown faster than the shared tooling that supports it. That isn't a flaw — it's the natural shape of a young, ambitious science, and it's a solvable, shared problem.

The scientists who built this field are rigorous, inventive, and deeply committed to getting it right. Validation happens constantly — but often bespoke, each group building its own simulation, its own ground truth, its own interpretation of what a model should recover. Excellent work, frequently done in isolation, with tools that were difficult to build and harder to share. What survives in the literature is the claim; what is hardest to carry alongside it is the chain of evidence behind it.

So the same model is often validated independently by several groups, each with its own simulator, producing subtly different answers — with no shared ground truth to reconcile them against. That independence reflects how seriously the community takes rigor. It also leaves scope boundaries living in the author's intuition rather than the publication, and lets a protocol validated for one tissue type quietly migrate to another. A shared, open reference is exactly the gap we'd love to help close.

None of this is a shortcoming of the people; the ideas are excellent. It's a gap in shared infrastructure — and infrastructure is exactly what has become possible to build.

Papers carry the ideas. Shared infrastructure can carry the evidence alongside them.

The specification is the physics.

Physics governs water diffusion in biological tissue. The Bloch-Torrey equation is not a hypothesis; Brownian motion in restricted geometries is not a conjecture. These are the specification — and every model, every protocol, every clinical claim is an implementation we can measure against it.

Monte Carlo simulation is how we generate that reference. Given a substrate geometry, a permeability, a relaxation time, and an acquisition waveform, it produces a signal with no approximation beyond the physical assumptions themselves — a neutral ground truth anyone can compare against.

So for any model we can ask: within its stated scope, does it match the physics? When it does, we can say so with confidence. When it doesn't, we've found exactly where its scope ends — which is just as useful to know.

dmrai-lab is building shared infrastructure for that comparison.

dmipy is two engines that keep each other honest: simulation — Monte Carlo substrate generation and signal synthesis, grounded in biologically cited parameter distributions; and fitting — JAX-native model inference with explicit scope boundaries, characterised against that ground truth.

It isn't two separate tools so much as one loop: the same substrate that generates a signal also validates the model that fits it.

Open, traceable evidence is the point.

Every result can carry its physical assumptions, its scope boundaries, and its evidence with it — open and reproducible, so a reader can follow any claim back to the physics that supports it, or see where that chain runs out.

More than a database: a way to keep findings and the evidence behind them together, in the open.

A different layer of open.

Diffusion MRI already has a generous open-source tradition — DIPY, MRtrix, FSL, the original dmipy, and more — and dmrai-lab stands on it. What's different here isn't that the code is open. It's that the work is built by and with AI agents, and that changes what "open" has to carry.

Agents collapse the cost of producing output toward zero — and raise the cost of trusting it just as sharply. An agent can produce something plausible, internally consistent, and confidently wrong faster than anyone can review it.

So the scarce thing flips. When making the artifact was expensive, sharing it was the contribution. When the artifact is cheap, the contribution is the verification: two independent engines that cross-check each other, findings pinned to exact versions and regression-tested so they can't quietly rot, and a human who stays the final arbiter. We don't just open the code — we open the means to trust it.

Physics-Grounded Agent Development  ·  How dmipy is built  ·  dmrai-lab

The hallucination problem has a physical solution.

dmipy is built agent-first: the majority of implementation work is done by AI agents operating autonomously across simulation, fitting, and design. This makes extraordinary velocity possible — but it introduces a failure mode that cannot be ignored. An agent can write code that is internally consistent, passes its own tests, and is completely wrong. The fix is not better prompts. The fix is physics.

Every feature in the dmipy ecosystem must satisfy success conditions stated entirely in physical terms — conditions that can be checked from two independent directions. Agreement between those directions is far stronger than a unit test; as below, we treat it as strong evidence rather than the last word.

Two paths to the same answer, from different first principles. If they agree, that's strong evidence the implementation is right. If they disagree, the physics shows you where to look.

Direction one: the analytical equation.

For every physical phenomenon modelled in dmipy, the field has derived closed-form solutions under well-defined assumptions. The Kärger model gives the exchange signal for permeable membranes as a function of permeability κ and diffusion time. The van Gelderen / Neuman solutions give the restricted diffusion signal inside cylinders and spheres as a function of radius, intrinsic diffusivity, and the acquisition parameters δ, Δ, and q derived from the gradient waveform. These equations encode decades of physical intuition. They are exact — within the regime for which they were derived.

An agent implementing, say, the cylinder restriction model receives the analytical signal equation as its specification. The implementation must reproduce it. If it does not, the agent has hallucinated something — regardless of how plausible the code looks.

Direction two: Monte Carlo from G(t).

The second direction makes no approximations beyond the physical substrate itself. Given a geometry — a packed array of cylinders, a sphere, a permeable membrane — and a free gradient waveform G(t), Monte Carlo simulation propagates thousands of spins through that geometry via Brownian motion, accumulates their phase under the applied field, and reads out the echo signal. No analytical shortcuts. No assumption about pulse shape. G(t) is the input in full.

This is a completely different computational path. It does not know the analytical equation exists. It does not care whether δ and Δ are well-defined for the waveform being tested. It just runs the physics.

Agreement is strong evidence. Divergence is knowledge.

When the analytical equation and Monte Carlo agree — across substrate geometries, diffusion times, b-values, and waveform shapes — that is strong evidence the implementation is right: an AI-introduced error that survives one direction is unlikely to survive both. It isn't the final word, though. Both paths can share a blind spot, and the substrate itself is still a simplification of real tissue — so the researcher always has the last call.

When they diverge, something more valuable than a passing test emerges: a precise characterisation of the analytical equation's scope boundary. The Kärger model breaks down at short exchange times. The Neuman cylinder solution breaks down at high b-values and non-PGSE waveforms. Monte Carlo does not break down — it simply reflects the physics of that regime. Mapping where the analytical solution departs from Monte Carlo ground truth is not a validation failure. It is a scientific result: the exact envelope within which a published model is trustworthy, recorded openly alongside the benchmark.

This is the architecture that makes agent development trustworthy.

Each feature ships with a physics-grounded benchmark: a set of parameter regimes where analytical and Monte Carlo must agree to within a stated tolerance, and a set of departure curves that characterise the boundary beyond it. An agent that hallucinates an implementation will fail the benchmark. An agent that ships a correct implementation extends what's been verified. The physics sets the standard; the agents do the work.

In practice, much of the work across dmipy's two engines — the Monte Carlo simulator and the fitting framework — has been done by agent teams running Anthropic's Claude. The role of the human researcher is to set direction, state the physics, and hold the work accountable to it. This is not a workflow where AI merely assists: AI builds, physics audits, and the researcher decides.


About

Dr. Rutger Fick

dmrai-lab is a one-person project. The researcher behind it has spent a decade publishing in diffusion MRI microstructure imaging — acquisition design, compartment modelling, Monte Carlo validation — and a parallel decade building AI products. dmrai-lab is where those two trajectories converge: the domain knowledge to know what the physics requires, and the engineering background to build the infrastructure that enforces it.


Collaborators

Technical University of Denmark · Copenhagen