Brain-machine interface-based assistance and rehabilitation. Brain activity is analyzed