Compute cranial implant fit metrics in-browser by cropping voxel masks
SkullBreak-style cranioplasty data is binary uint8 NRRD masks at 512^3, 0.4 mm isotropic (defective skull, complete skull, implant), so defect and implant metrics can run client-side without a model call. Crop to the candidate bounding box plus ~10 mm margin (~25 voxels) to drop from 134M voxels to a few million, then a separable Euclidean distance transform gives rim-bone thickness and implant wall thickness (2x medial-axis distance). Defect rim = defective-skull voxels within a 1-voxel dilation of the implant; rim gap = distance from rim voxels to the nearest implant voxel. Mirroring across the midsagittal plane gives a contralateral reference contour but fails for bilateral defects, so report it as unavailable there rather than as a number.