MEG measures the magnetic fields generated by electric currents in the brain. It has very high temporal resolution and good spatial resolution when combined with MRI. MEG is more sensitive than EEG to superficial cortical activity due to the way magnetic fields propagate. It is useful for localizing epileptic foci prior to epilepsy surgery and mapping eloquent cortex. Source analysis is performed to estimate the location of cortical generators. MEG provides better spatial resolution than EEG for localizing interictal epileptic discharges.