Brain Computer Interfaces are a new type of device, allowing direct communication between a user's brain and a machine. Such devices have been proposed based on non-invasive brain activity measurements using electroencephalography (EEG). One of the challenges in this domain is to extract in real time a sufficiently complex and robust signal from a very limited and noisy source of information, in order to control a program or an assistive device. This thesis explores three aspects of Brain Computer Interfaces. The first goal is to enhance the spatial resolution of EEG using source localization methods. These methods can reconstruct detailed cortical activity based on non-invasive scalp measurements. The second aspect is inspired by a BCI that uses foot motor imagination to send a unique command. This started with the study of short movement imaginations and led to a new type of BCI called brain-controlled buttons. The BCI we created enables the user to send commands, in a self paced manner, by imagining different movements. Finally, we develop a method, based on stochastic bandits theory, to automatically and efficiently select between different types of imagined movements those that are the most detectable from a resting state and thus the most appropriate to control a BCI. In parallel, we developed a Matlab toolbox that automates, via off-line analysis, the comparison of different methods and the selection of all the parameters used in a BCI.