Scientists and engineers are trying to understand how the brain works in order to tackle mental disorders and improve quality of life.