Just as the volunteers started to fall asleep inside the scanners, they were woken up and asked to recount what they had seen.
Each image mentioned, from bronze statues to keys and ice picks, was noted, no matter how surreal.
This was repeated more than 200 times for each participant.
The researchers used the results to build a database, where they grouped together objects into similar visual categories. For example, hotel, house and building were grouped together as "structures".
The scientists then scanned the volunteers again, but this time, while they were awake and looking at images on a computer screen.
With this, they were able to see the specific patterns of brain activity that correlated with the visual imagery.
The researchers now want to look at deeper sleep, where the most vivid dreams are thought to occur, as well as see whether brain scans can help them to reveal the emotions, smells, colours and actions that people experience as they sleep.
Dr Mark Stokes, a cognitive neuroscientist from the University of Oxford, said it was an "exciting" piece of research that brought us closer to the concept of dream-reading machines.
"It's obviously a long way off, but there is no reason why not in principle. The difficult thing is to work out the systematic mapping between the brain activity and the phenomena," he explained.
The human volunteers wore electrode caps that monitored their brain activity using electroencephalography (EEG). Meanwhile, an anaesthetised rat was hooked up to a device that made the creature's neurons fire whenever it delivered an ultrasonic pulse to the rat's motor cortex.