Load a brain scan to reconstruct its cortical surfaces.
Load a brain scan to reconstruct its cortical surfaces.
TopoFit estimates left and right white, mid, pial, and spherical-registration surfaces from one brain MRI. This browser implementation runs the pinned BrainNet model locally from verified ONNX artifacts.
Optional surface analysis exports area-weighted mid-surface normals and finds connected cortical patches. Patch selection follows OpenRecon's atlas exclusion, geodesic radius, plane-fit error, area and normal-coherence criteria. The input must be a T1-weighted scan.
Patches that pass every criterion are ranked by flatness: plane-fit RMS plus radius × (1 − normal coherence), lowest first. Area is only an acceptance threshold. Each hemisphere keeps the best-ranked patches that share no vertices with a higher-ranked patch, so Left flat patch 1 is the flattest left patch.
A search region can limit patches to a named cortical area. Visual areas come from the Wang et al. 2015 maximum-probability atlas, lobes and gyral regions from the Desikan-Killiany atlas, both mapped from fsaverage through TopoFit's registration spheres. They are atlas estimates, not individual retinotopy. The mapped parcellation of each searched hemisphere is saved as a FreeSurfer annotation for the output surfaces.
A region search offers two views of the region. View on a parcellation draws the atlas on that hemisphere's mid-surface: the search region in full colour, the other areas faded, found patches white, turned to face the region. View on the region mask overlays the region on the slices of the original image, filled between the white and pial surfaces on the source grid (left 1, right 2), which is also saved as a NIfTI label image.
All output surfaces load into FreeBrowse, initially hidden. In Output, View shows a surface without unloading others or changing your layout. FreeBrowse and checkboxes control visibility. Slices show surface boundaries; Render shows surfaces in 3D. Checkboxes also select surfaces for STL export.
Patch QC shows white and pial boundaries, the mid-surface and a normal glyph. Its line is the true in-plane component at physical scale. A center dot points toward increasing source slice positions; a cross points toward decreasing positions. Select a patch row to center the viewer on that patch and inspect its mid-surface point and outward fitted-plane normal in scanner RAS. Copy preserves full precision; the patch coordinates CSV exports all detected patches.
FreeSurfer surfaces are not a 3D-printing format. niimath simplifies and smooths each surface, then TopoFit writes a binary STL in millimetres.
Exporting: . Tick surfaces in Output to export only those.
Your scan and reconstructed surfaces stay in this browser. Pretrained models are downloaded from Hugging Face; the optional example is downloaded from OpenNeuro.