An MRI does not take a photograph. It measures a number for every little box of tissue across a thin slice of you, moves over a few millimeters, and measures the next one. A scan is a stack of those cross-sections. Mine came home as a silver disc holding three stacks, my brain, my neck, and my lower back, each shot several times over with different settings that make different tissue light up.
The viewer below is those raw slices, straight off the scanner. Pick a region, pick a sequence, and scroll. Spin the mouse wheel, drag up and down, or drag the slider. The little play button runs the stack like a flipbook.
What you are looking at
Each region was scanned with a handful of sequences, the same anatomy re-weighted. On a T1 image fat is bright and fluid is dark; on a T2 it flips, so the spinal fluid glows white and the cord stands out as a dark ribbon inside it. FLAIR nulls the fluid to show the brain tissue; STIR nulls fat to make swelling obvious; SWI picks up the faintest trace of blood and iron. Radiologists read the same slice across all of them at once, because a thing that is bright on one and dark on another is telling you what it is made of.
All three got scanned in one sitting because the question was neurological, numbness down one side, and the nerves run the whole length: brain, then the cord through the neck, then the roots in the lower back. So the disc holds one head study and two spine studies, with and without a contrast injection.
From a stack of photos to a head
If every slice is a cross-section at a known position, you can stack them back into a solid block of data and view it from any angle. The catch: clinical slices are razor-sharp within the slice but spaced millimeters apart. Crisp like a page, with big gaps between the pages. Stack them naively and you get venetian blinds.
Turning thin, sharp slices into a solid you can rotate is the whole trick, and it gets its own section just below. First, the result: the skull-stripped brain surface, rebuilt from the slices. Drag to rotate, scroll to zoom, and switch between the brain and the spine/torso.
From a disc to this, step by step
- The disc.
The hospital handed me a CD holding 1,189 raw
DICOMfiles, the universal medical-imaging format. Each file is a single 2D image wrapped in a long header that records, among much else, exactly where in space that slice was taken and how thick it is. - Read and sort.
Python (
pydicom) parsed all of them and grouped them into 42 series, one imaging sequence through one body region. The make-or-break step: sort each stack by its real-world position from the header, not by filename or image number. Sort by filename and the body comes out shuffled. - The 2D viewer.
Each diagnostic series was contrast-windowed and packed into a single image "sprite sheet"; the viewer up top just crops the current slice out of it. Light, and no server.
- The catch with 3D.
A clinical scan is built for a radiologist scrolling slices, so they're razor-sharp within the plane (~0.4 mm here) but 5–6 mm apart. A real 3D object needs cube-shaped voxels, equal in all three directions, or the stack looks like venetian blinds.
- Fill the gaps with a neural net.
I trained a small network on the scan's own sharp slices, degrading them to imitate the thick direction so it learned to invert that blur, then turned it loose on the through-plane to super-resolve it to roughly 0.9 mm cubes. It trained on this laptop's GPU in about six minutes.
- Carve out a solid brain.
A second network (HD-BET) erased the skull and scalp. Then I filled the ventricles and sealed the deep grooves so the brain became a closed solid rather than a see-through web, and marching cubes wrapped a surface around it, smoothed and simplified to about 120,000 triangles for the web.
- Into your browser.
NiiVue (WebGL2) draws the mesh in 3D, entirely client-side from static files.
Why the spine looks like a ghost
Because MRI is a map of water, it barely sees bone. Dense cortical bone reads as black, the same as empty air. So the brain reconstructs beautifully, but you cannot pull a crisp skull or a clean stack of vertebrae out of these images the way you can from a CT scan. The spine model here is an honest stylized envelope of the torso, not an anatomical skeleton. The brain is the real prize.
The machine, and how good these pictures are
This was a Siemens MAGNETOM Sola, a 1.5-tesla scanner from 2018, a current-generation example of the most common kind of MRI on earth. The "tesla" number is the magnet's field strength, and it is the biggest single lever on image quality: more field means more signal, which means a cleaner picture for the same time in the bore. The rough ladder:
- 0.2–0.55 T, low field. Open and accessibility scanners; historically noisy and soft, though modern 0.55 T units with AI reconstruction are catching up fast.
- 1.5 T, the workhorse. The large majority of clinical scans on earth. This is mine.
- 3 T, high field. Roughly double the signal: sharper images, or the same image faster. Common in academic and newer centers.
- 7 T and up, ultra-high. Cleared for clinical head and limb scans only in 2017, and still rare, mostly research. It resolves fine cortical and vascular detail you simply cannot see at 1.5 T. The research frontier runs to 10.5 T, and an 11.7 T scanner in France has now imaged a living human brain.
So mine sits in the middle, but it is a good example of the middle. The slices are genuinely sharp, down to about 0.3 mm within the plane, which for 2D brain and spine rivals what a 3 T machine produces. Against a 3 T or 7 T the real gap is high-resolution 3D; against old or low-field units it is far ahead. And the honest part: the machine was never the reason the 3D took work, the protocol was. A diagnostic scan deliberately trades 3D for thin, sharp 2D slices, because that is what a radiologist reads. The Sola could have shot a high-resolution 3D sequence in one pass. Nobody ordered one, because nobody needed a 3D model of my head that day. I did.
Built from the raw DICOM with Python (pydicom, NumPy, SciPy, scikit-image, nibabel, a neural-net skull-strip, and trimesh for the meshes) and rendered in your browser with NiiVue and a hand-written slice viewer. No server, no plugins.