concept-collection / mri-spins
mri-spins
Go to fileHistoryFork
Jeremy Magland MRI spin physics demo 158a716 1 Commits
index.htmlMRI spin physics demo
README.mdMRI spin physics demo

mri-spins#

Interactive 3D demonstration of MRI spin physics.

Live: https://concept-collection.github.io/mri-spins/

A sample of isochromats (sphere or cube) evolves under the Bloch equations in the rotating frame. Apply RF pulses, gradients, and a Larmor frequency offset; adjust T1/T2 relaxation; and view the magnetization as vector arrows or colored balls. A live trace shows the signal (real and imaginary parts of the net transverse magnetization).

A built-in spoiled gradient echo sequence plays out 16 phase-encoded TRs, driving the controls automatically and acquiring signal during the readout windows. Optional gradient sounds click like a real scanner.

Things to try#

  • Apply a 90° pulse: the spins precess at Δf₀ while T2 attenuates the signal and Mz recovers with T1.
  • Turn up Gx to dephase the spins, then apply a 180° pulse to refocus them into a spin echo.
  • Turn on sound and run the spoiled gradient echo.

Single static page, no build step — three.js is loaded from a CDN. Serve locally with any static file server, e.g. npx serve .