Home / Science / Physics / Biophysics and medical physics / MRI physics simulatorTool #971

MRI physics simulator: Bloch equations, T1 and T2 curves, image contrast and k-space to image

Step the Bloch equations through spin echo, gradient echo and inversion recovery sequences, see how TR, TE, flip angle and TI set the brightness of each tissue, find the Ernst angle and the inversion time that nulls a tissue, and watch an image appear from k-space with a 2D Fourier transform.

Keep it one tap away for everyday use.

Bookmark MRI physics simulator?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Sequence
  2. Tissues
  3. Contrast
  4. k-space
Nothing is uploadedWorks offline once open

Pulse sequence

TR: time between excitations; short TR gives T1 contrast. TE: time from excitation to the echo; long TE gives T2 contrast. Flip angle: how far the gradient-echo pulse tips the magnetisation. TI: time from the 180° inversion to the 90° readout pulse.

Tissues

TissueT1 (ms)T2 (ms)PD (0–1)

Rounded, illustrative values of the kind quoted for 1.5 tesla (they change with field strength and from source to source); edit them freely. PD is the relative proton density, 0 to 1.

Signal and contrast

Bloch simulation, first repetitions

From k-space to image

A teaching model: hard pulses on resonance, perfect spoiling at the end of each TR, no diffusion, flow or field inhomogeneity (the gradient echo uses T2 in place of T2*). The head-like phantom is made up. For study, not for scan planning or diagnosis.

Download

What it does

An MRI scanner does not photograph tissue; it measures the radio signal from hydrogen nuclei whose magnetisation has been tipped by radio-frequency pulses. How bright each tissue looks depends on two relaxation times, T1 (how fast the magnetisation grows back along the main field) and T2 (how fast the signal in the transverse plane dies away), on its proton density, and on the timings the operator chooses.

This simulator works that out in two independent ways. It uses the closed-form signal equations for spin echo, spoiled gradient echo and inversion recovery, and it also steps the Bloch equations pulse by pulse (rotations for the pulses, exponential relaxation in between) until the signal settles. The two columns in the table agree, which is a good check that the formulas mean what they say. It then builds a made-up head-like image from those signals, takes its 2D Fourier transform to show the k-space the scanner really records, and rebuilds the image from all or part of it.

How to use it

  1. Pick a preset or choose a sequence and type your own TR and TE (and flip angle for gradient echo or TI for inversion recovery).
  2. Edit the tissues if you like: a name, T1 and T2 in milliseconds and a relative proton density from 0 to 1.
  3. Read the signal table, the T1 recovery and T2 decay curves with TR, TI and TE marked, and the Bloch simulation of the first few repetitions for any tissue.
  4. Under From k-space to image, keep all of k-space, only its centre, only its edges, or every other line, and compare the rebuilt image with the original.
  5. Download the signals or the simulation as CSV, or the whole report as an image, PDF or Word file.

What each option does

  • Spin echo: a 90° pulse, then a 180° pulse at TE/2 that refocuses the signal into an echo at TE. Signal = PD × (1 − 2e^(−(TR−TE/2)/T1) + e^(−TR/T1)) × e^(−TE/T2).
  • Spoiled gradient echo: one pulse of a chosen flip angle per TR. Signal = PD × sin α (1 − E1) / (1 − cos α E1) × e^(−TE/T2), with E1 = e^(−TR/T1). The Ernst angle, arccos E1, gives the most signal for each tissue.
  • Inversion recovery: a 180° pulse flips the magnetisation, and the readout comes TI later. Signal = PD × (1 − 2e^(−TI/T1) + e^(−TR/T1)) × e^(−TE/T2), shown signed. The null TI column is the TI at which a tissue gives no signal, which is how fluid-suppressed and fat-suppressed images are made.
  • Only the centre of k-space keeps the overall brightness and contrast but blurs the image; only the edges keeps outlines; every other line halves the scan time but folds the image over itself (aliasing).

Worked example

With the default T1-weighted spin echo (TR 500 ms, TE 15 ms) and the rounded tissues, the page shows signals of 0.6307 for the fat-like tissue, 0.2822 grey-matter-like, 0.2744 white-matter-like and 0.1133 fluid-like, so fat is brightest and fluid darkest, as on a real T1-weighted image. Brightness relative to fat is 100, 45, 44 and 18 %. The Bloch simulation of the white-matter-like tissue gives a first echo of 0.846 (it starts fully relaxed) and then 0.392 at every later repetition. Choose the T2-weighted preset (TR 4000, TE 100) and the order flips: the fluid-like tissue becomes brightest at 0.5925.

Tips

  • Short TR and short TE give T1 weighting; long TR and long TE give T2 weighting; long TR and short TE give proton density weighting.
  • Try the gradient echo preset and change the flip angle around the Ernst angle shown for each tissue: the signal peaks there.
  • Changing TI in steps around a tissue’s null TI shows its signal passing through zero and changing sign.

FAQ

Are these real tissue values? They are rounded, illustrative numbers of the kind quoted for 1.5 tesla. Real values depend on field strength, method and the person, so edit them.

Why does the first echo differ from the rest? The magnetisation starts fully relaxed; after the first repetition it reaches a steady state.

Is this a scanner protocol tool? No. It is a teaching model (hard pulses on resonance, perfect spoiling, no flow or diffusion) for study, not a substitute for professional judgement in scan planning or diagnosis.

Where the numbers come from

  • Bloch equations, spin echo, spoiled gradient echo (Ernst) and inversion recovery signal equations, k-space and the 2D Fourier transform: standard MRI physics, for example Haacke, E. M. et al. (1999), Magnetic Resonance Imaging: Physical Principles and Sequence Design, and Hargreaves' Bloch simulation notes (rotation and relaxation matrices).
  • Checked against an independent numpy steady-state solver (fixed point of the rotation and relaxation matrices) and numpy.fft, written for the tests.
  • Tissue T1, T2 and proton density values are rounded and illustrative, editable; the head-like phantom is made up.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Radioactive decay and specific activity calculator #99 Activity of F-18, Tc-99m, I-131, C-14, P-32 and 28 more nuclides (or any half-life) at any date and time, a printable decay table, when it falls to a given activity, carrier-free specific and molar activity, and the labelled fraction of your sample. Bq, MBq, GBq, µCi, mCi and Ci. CT reconstruction demo #972 See how a CT scanner turns X-ray projections into a slice: make the sinogram of a made-up object, rebuild it by filtered back-projection, and watch what too few angles, a limited angular range, noise and the choice of filter do to the image. Ultrasound calculator #973 Work out what happens to an ultrasound pulse: acoustic impedance, how much reflects and transmits at a boundary (also at an angle), attenuation and penetration depth, wavelength and axial resolution, near-field length and beam spread, echo timing, and the Doppler shift with its aliasing limit. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. Optical tweezers calibration #974 Paste a trapped bead's position record and get the trap stiffness two ways: from the corner frequency of a Lorentzian fitted to the power spectrum (with the aliasing correction for sampled data and Faxén's correction near a surface), and from equipartition. Works in volts too, giving the detector's nm per volt. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials.