Magnetoencephalograpy, or MEG, is used to measure the magnetic fields produced by electrical activity in the brain. Its uses include assisting surgeons in localizing the source of epilepsy, and sensory mapping.