Magnetoencephalography (MEG), a noninvasive functional brain mapping technique, was used for preoperative localization of the sensorimotor cortex in patients harboring lesions involving these eloquent regions. Prior to surgery, MEG source locations were transferred onto high-resolution MRI pictures which were then used for preoperative evaluation, risk analysis, and planning. We have developed a process to transform the MEG-derived sensorimotor localization coordinates into the COMPASS stereotactic coordinate system. Thus the MEG-derived functional information is incorporated into the stereotactic database, enabling the simultaneous visualization of functional and anatomical data. This information can be used for the selection of cases and in planning safe approaches for computer-assisted volumetric resections. The integration of MEG and stereotactic neurosurgery also allows a more precise comparison between MEG and intraoperative direct electrocorticographic mapping (ECoG). Seven patients were studied with good correlation between MEG and intraoperative mapping. In 4, the correlation was only based on gross visual comparison between intraoperative identification of the gyrus pattern and MEG photographs. The availability of the MEG coordinates in the stereotactic system, however, allows a more precise correlation between MEG and ECoG. In all 3 patients studied in this manner, the MEG coordinates (pinpointed to a precise cortical representation of a few millimeters) overlapped with ECoG results. In summary, we compared functional MEG data to intraoperative ECoG and conclude that the introduction of MEG into stereotactic neurosurgery can provide precise functional and anatomic information for image-guided surgical planning and resection.