Early on, just a few minutes after falling asleep, dreams started coming in bursts. The scientists woke the subjects up soon after and asked them what they saw. (For each participant, they actually did that 200 times, presumably turning them into the Grumpiest People In The Universe.) The researchers wrote down the 20 most common things the subjects saw: people, buildings, etc. They then found images on the internet that matched those common things, showed them to the subjects while they were awake but still in the fMRI, and took a reading. That information was fed into a learning algorithm. When the subjects slept again, the algorithm spit back this '80s music video-like representation of what the sleepers saw.