Soichi Hayashi · projects

Brain MRI Viewer

A little side project: my own T1-weighted anatomical brain scan, viewable right in the browser using FreeBrowse, the FreeSurfer project’s web viewer. No installs, no server-side processing — the NIfTI volume is fetched and rendered entirely client-side, with synchronized axial, sagittal, and coronal views.

It’s a fun way to poke around my own anatomy, and a nod to years spent building neuroimaging tools at brainlife.io — this time pointed at my own head instead of someone else’s dataset.

To make it more than gray levels to eyeball, I also ran FreeSurfer’s recon-all 8.2.0 on the scan (in Docker, on my home server) and turned the results into a full report page: the aparc+aseg parcellation — roughly a hundred labeled cortical and subcortical structures — as a toggleable overlay in the viewer, plus stat tiles, volume/thickness charts, and tables computed from the analysis.

The scan has been defaced (facial features removed) before publishing. It’s for personal curiosity, not clinical use.

What the numbers made me worry about

Attaching percentiles to your own brain turns out to be an effective way to lose an evening’s sleep. Once the report showed my cortical thickness in the low single-digit percentiles, I worked through a chain of worries — and then, since I had the data and the tools, tested each one. Here they are, in the order they occurred to me.

“Thin temporal lobe — does this mean dementia?” My temporal-region thicknesses sit at low percentiles (temporal pole ~2nd, entorhinal 7–15th centile, at age 41). But zooming out: the thinning is diffuse, not focal — mean cortical thickness overall is at the 4th centile, and occipital, frontal, and parietal regions are all low together. Neurodegenerative thinning (like early Alzheimer’s) is regionally selective — medial temporal lobe first, sparing the rest — and it does not uniformly thin the whole cortex. Meanwhile the structural markers that do track neurodegeneration are unremarkable for me: ventricles at the 46th centile, hippocampus 14th/58th, amygdala 69th/41st. And diagnosis never rests on one cross-sectional number anyway — it’s cognitive symptoms plus change over time, plus biomarkers, read by a clinician.

“Right frontal pole is at the 0.001st centile — is my executive function impaired?” Looking across the whole cortex table: essentially the entire right frontal/temporal surface sits at or below the 3rd centile (lateral orbitofrontal 0.002nd, frontal pole 0.001st, superior frontal 1.5th, …) while the same regions on the left sit at 3rd–54th. No disease selectively thins ten contiguous right-hemisphere regions while sparing their left twins — a systematic measurement offset does exactly that. On top of that, the frontal pole is FreeSurfer’s least trustworthy region: tiny, at the edge of the volume, right above the sinuses where susceptibility artifacts distort the signal, and famously mis-traced. And even a genuine thickness value couldn’t tell me this — regional cortical thickness explains only a tiny fraction of the variance in cognitive performance, and executive function is measurable directly (neuropsych testing), not from a segmentation.

“Did the defacing step corrupt the analysis?” This one I could test directly. I registered the un-defaced original scan (from my BIDS export) into the defaced volume’s space and compared them inside the brain mask: the intensities are identical — a scale factor of 1.0002, and exactly 2 voxels out of 1.49 million changed by more than a rounding error. Defacing only removed tissue outside the brain.

“Was the brain extraction wrong?” I re-ran FreeSurfer’s entire preprocessing stage (recon-all -autorecon1, FS 6.0) on the un-defaced original and compared the brain masks. They agree at Dice 0.935: the defaced-input run cut a uniformly tighter boundary — a 1–2 voxel shell around the whole brain — and the total tissue it removed that the original keeps is 0.9 cm³, with no focal deficit anywhere near the regions I was worried about.

“My brain looked tilted in the original scan — did the analysis run on a tilted volume?” This was the one worry I could only answer by brute force: re-running the entire pipeline (FS 6.0, ~8 hours) on a Talairach-upright resample of the same scan. First, the reassurance: recon-all re-orients and resamples every input into a canonical grid before it measures anything, so the tilt in the viewer never reached the segmentation — and the two runs I made on the original orientation (FS 6.0 and FS 8.2) agree with each other on raw volumes to within ~2%. But the experiment also showed something I didn’t expect: the upright rerun does not reproduce the original-orientation numbers. Same data, same FreeSurfer version, same 1 mm grids — yet surface area came out +10%, volumes +11–20%, thickness +2%, and eTIV +18% different. Re-scored against the population model, the rerun’s percentiles swing wildly — gray matter 17th→60th, white matter 51st→96th, surface area 71st→96th, head size 70th→1st — with one exception: thickness. Mean cortical thickness came out 2.49 vs 2.45 mm, percentile 1.9 → 4.5. The mechanism is mundane: nudging the registration’s starting point moves the watershed threshold and surface placement by about one voxel over the whole cortex, and a one-voxel boundary shift is worth ~15% of brain volume. The same instability shows up across versions: eTIV — FreeSurfer’s atlas-scaled skull estimate — swung from 1.08 L to 1.68 L between FS 6.0 and FS 8.2 on the identical input, while the segmentation barely moved. So my 70th-percentile head size is a property of FS 8.2 on this scan, not of my skull. And thickness — the one measure that stays put while everything else swings — is exactly the measure sitting in the bottom 5%, which is the strongest evidence yet that the low percentile isn’t a processing artifact. Which is one more entry in the “single-scan numbers are a baseline, not a diagnosis” column.

“I’m Japanese — the reference population is ~95% white British. Is this comparison even valid for me?” Partly a fair worry, and one the reference’s own authors raise. Two different things carry ancestry here. The atlas FreeSurfer segments my scan with is not from UK Biobank — it’s the standard MGH adult template, and it guides classification, not measurement. The bigger issue is the reference band: Bethlehem et al.’s chart is dominated by UK Biobank (~94–95% white European ancestry), and the authors state plainly that the data are “biased towards European and North American populations” — an inequity they explicitly call on the field to fix. And East Asian brains do measure differently: with the same FreeSurfer pipeline, East Asian cohorts come out thicker in frontal/temporal/parietal regions while Caucasian cohorts come out thicker in occipital/sensory regions (Kang et al. 2020, Tang et al. 2018). Notably, several of my lowest-centile regions — lingual, cuneus, pericalcarine, lateral occipital — are exactly where the Caucasian group measured thicker. So some share of those particular low numbers could plausibly be reference mismatch rather than anatomy. But the caveat cuts both ways: those studies are small (~45–350 per group), the differences are regional rather than a uniform whole-cortex shift like mine, and a large multi-ancestry normative study (CentileBrain, PNAS) finds ancestry mismatch degrades thickness centile accuracy by only a few percent. So this joins the scanner-offset bucket — a real contributor pointing the same direction, but unlikely to be the whole story for a cortex that’s thin everywhere.

“Should I have run ACPC alignment before recon-all?” I had this thought after noticing the tilt (next entry): real pipelines sometimes ACPC-align their scans first, and I hadn’t. But for recon-all this isn’t a missing step — the pipeline is designed to take the raw scanner output, however oblique, and does its own re-orientation (--conform) and atlas alignment internally. ACPC pre-alignment matters for pipelines that need a predefined coordinate frame (fMRI, tractography), not here. And the tilt experiment doubles as the empirical test: the re-oriented rerun was fed more than ACPC alignment (full Talairach), and it didn’t produce better numbers — its atlas calibration came out visibly broken (eTIV smaller than the brain it segmented) while the raw-output run’s was sensible. The published numbers, from the un-aligned input, stand.

So why is my cortical thickness low?

Probably some combination of:

  • Anatomy trade-off. Cortical thickness trades off against surface area. I’m at the 76th centile for total surface area and 70th for intracranial volume — bigger, more folded cortices tend to run thinner. High-surface-area/thin-cortex is a known normal constitutional combination.
  • Scanner and processing offset. The reference curves (Bethlehem et al. 2022, ~124k scans) are harmonized to UK Biobank scanners. A single Siemens Prisma scan processed by a different FreeSurfer version carries residual offset that nobody corrects for — and a whole-cortex downward shift is what that looks like.
  • FreeSurfer’s least reliable regions. Temporal pole, entorhinal, and orbitofrontal measures are commonly discarded in research QA for exactly the artifacts described above.
  • Reference-population mismatch. I’m being scored against a band built ~94% from white European-ancestry cohorts. Documented East Asian–Caucasian morphometric differences run in the right direction to deepen my low centiles, especially in occipital/sensory regions where Caucasian cohorts measure thicker.
  • Wide tails. At the 1st or 99th centile, the population model’s uncertainty is largest; a single noisy estimate lands in the tail more often than intuition suggests.

Do these numbers mean anything?

Honestly: I don’t really know how useful these segmentation results are if we can’t draw scientific conclusions out of these measures. What I can say after all this: they’re wonderful for looking at my own anatomy, and they’d be genuinely informative as a baseline — the scientifically meaningful quantity is change over time on the same scanner and pipeline, not any single percentile. But as evidence about my present or future cognition, one scan’s regional percentiles against a harmonized population band are close to uninterpretable. The right instrument for “is anything wrong with me” is a clinician, not recon-all. I’ve kept the report up anyway — it’s an honest record of what the pipeline measured, worries included.