I did mean electrodes in the brain (or spine) and mentioned that for completeness, to make it clear there's another method besides fMRI and EEG. Which indeed has the obvious disadvantage it involves some surgery, but does the type of signal recorded with it does have advantges over the other methods.