Detecting patients’ pain levels via their brain signals