Brain-machine interfaces: from basic science to neurological rehabilitation