The paper examines sources of brain activity, contributing to EEG patterns which correspond to motor imagery during training to control brain-computer interface. To identify individual source contribution into electroencephalogram recorded during the training Independent Component Analysis was used. Then those independent components for which the BCI system classification accuracy was at maximum were treated as relevant to performing the motor imagery tasks, since they demonstrated well exposed event related de-synchronization and event related synchronization of the sensorimotor μ-rhythm during imagining of contra- and ipsilateral hand movements. To reveal neurophysiological nature of these components we have solved the inverse EEG problem to locate the sources of brain activity causing these components to appear in EEG. The sources were located in hand representation areas of the primary sensorimotor cortex. Their positions practically coincide with the regions of brain activity during the motor imagination obtained in fMRI study. Individual geometry of brain and its covers provided by anatomical MR images was taken into account when localizing the sources.