The analysis of simultaneous EEG and fMRI data is generally based on the extraction of regressors of interest from the EEG, which are correlated to the fMRI data in a general linear model setting. In more advanced approaches, the spatial information of EEG is also exploited by assuming underlying dipole models. In this study, we present a semi automatic and efficient method to determine electrode positions from electrode gel artifacts, facilitating the integration of EEG and fMRI in future EEG/fMRI data models. In order to visualize all electrode artifacts simultaneously in a single view, a surface rendering of the structural MRI is made using a skin triangular mesh model as reference surface, which is expanded to a "pancake view". Then the electrodes are determined with a simple mouse click for each electrode. Using the geometry of the skin surface and its transformation to the pancake view, the 3D coordinates of the electrodes are reconstructed in the MRI coordinate frame. The electrode labels are attached to the electrode positions by fitting a template grid of the electrode cap in which the labels are known. The correspondence problem between template and sample electrodes is solved by minimizing a cost function over rotations, shifts and scalings of the template grid. The crucial step here is to use the solution of the so-called "Hungarian algorithm" as a cost function, which makes it possible to identify the electrode artifacts in arbitrary order. The template electrode grid has to be constructed only once for each cap configuration. In our implementation of this method, the whole procedure can be performed within 15 min including import of MRI, surface reconstruction and transformation, electrode identification and fitting to template. The method is robust in the sense that an electrode template created for one subject can be used without identification errors for another subject for whom the same EEG cap was used. Furthermore, the method appears to be robust against spurious or missing artifacts. We therefore consider the proposed method as a useful and reliable tool within the larger toolbox required for the analysis of co-registered EEG/fMRI data. © 2011 Elsevier Inc.