A magnetoencephalogram (MEG) is the registration of the magnetic field in points near the head. Because MEG's are weak fields, they have to be measured by means of superconducting sensors. The electric active population of neurons can be computed from the distribution of the magnetic field at a certain instant of time. This is called the inverse problem. In order to solve this probem, both the generators and the head have to be modelled. Usually, a patch of active neurons is modelled as a current dipole. Commonly, the head is described by three compartments, representing the brain, the skull and the scalp. The compartments may have the shape of spheres or they may have a realistic shape. Integration of EEG and MEG with MRI leads to a technique for functional imaging of the brain with a time resolution of one millisecond and a spatial resolution of one centimetre. Clinical applications are the non-invasive localization of an epileptic focus or the presurgical mapping of the sensorimotor cortex.