AI and Brain Scans: The Technology Behind Recording Dreams