Research use only
This is a research demonstration, not a medical device. It has not been validated or approved for clinical use and must not be used for diagnosis, treatment or any other clinical decision. Segmentations can be wrong; always review them against the images.
Your images stay on this computer
Files are read and processed inside this browser tab on your GPU or CPU. No image data or results are uploaded. The only downloads are this page and the model (about 26 MB), which is cached, so later visits also work offline.
What you need
- A recent desktop Chrome or Edge (Firefox and Safari may work on the CPU).
- 8 GB RAM or more. WebGPU is fastest; on the CPU a scan takes one to a few minutes depending on the number of cores.
- A non-contrast axial head CT. Thin slices are averaged to 5 mm, the thickness the model was trained on.
Drop a head CT here
A zip of a DICOM study, a DICOM folder, loose DICOM files, a .nii / .nii.gz volume or a .nrrd volume. From a study, the axial non-contrast head series nearest 5 mm is used (bone-kernel, contrast and reformatted series are skipped).
Scroll over the image or use ↑/↓ to change slice. Click the chart to jump.
Log
How it works
- Read and resample. The series is reoriented to standard axial order and resampled to 0.5 × 0.5 mm in plane and 5 mm slices, the geometry used to train the model (native spacing within 0.45–0.55 mm and 4.5–5.5 mm is kept).
- Brain extraction. Soft tissue enclosed by the skull is found slice by slice and joined in 3D, then cleaned as in the original code (−20 to 100 HU, small holes filled, calcification removed). Tick Brain outline to check it.
- Alignment and input. The head is rotated to the midline, cropped to the brain, resized to 352 × 288 and split into five HU windows (0–100, 10–90, 20–80, 30–80, 40–80). The model sees 18 slices at a time; longer brains get a second, overlapping window.
- Hybrid 2D/3D UNet. Parallel 2D and 3D encoders with spatial attention feed a 3D decoder that labels each voxel as SAH, IPH, IVH or background. The network is converted to ONNX and run with ONNX Runtime Web (WebGPU or WebAssembly), split into parts so the full-resolution layers run a few slices at a time and fit in a browser tab's memory.
- Post-processing and volumes. Labels are mapped back to the scan, small gaps closed, fragments under 100 pixels removed and mixed regions reconciled as in the original code; volumes are voxel counts × voxel size.
On the BrainHemoAI demo case this browser port reproduces the original PyTorch pipeline to within 6 voxels (SAH Dice 1.000, IVH 0.9998) when given the same brain mask and rotation.