By figuring out why we dream, researchers are hoping to nail down what the nightly cavalcade of images and events means.

Ever since Sigmund Freud published his controversial theories about the meaning of dreams in 1900, we have been fascinated with the jumble of experiences we seem to live through while we slumber. Freud was convinced that dreams represent some unfulfilled desires or hoped-for wishes, while later investigators saw a more pragmatic quality to them, as reflection of waking life. None of these theories, however, have had the benefit of much in the way of solid, objective data.

At least, until now. Two new developments in research — brain imaging and big data — may offer some stronger answers. More detailed and timely snapshots of the brain at work, combined with the information researchers amassed about dreams from experiments in sleep labs, is gradually peeling away the mystery of dreams, and revealing their meaning.

From a strictly biological standpoint, scientists have learned much about the physiological process of dreaming, which occurs primarily in REM sleep. “During dreaming,” says Patrick McNamara, a neurologist at Boston University School of Medicine and the graduate school of Northcentral University in Prescott Valley, Ariz., “the limbic part of the brain—the emotional part—gets highly activated while the dorsal lateral prefrontal cortex, the executive part of the brain, is under-activated. So the kind of cognitions we experience during dreams are highly emotional, visually vivid, but often illogical, disconnected and sometimes bizarre.” That suggests that our dreams may have some role in emotional stability.

MORE: What Do Your Dreams Mean? Here’s How You Can Decode Them

That does not necessarily mean, most dream researchers believe, that dreams are random expressions of emotion or devoid of some intellectual meaning. While some scientists maintain that dream patterns are strictly the result of how different neurons in the brain are firing, Deirdre Barrett, a psychologist and dream researcher at Harvard Medical School, believes they represent something more. “I think it’s a fallacy that knowing brain action negates a subjective, psychological meaning any more than it does for waking thought. I think dreams are thinking in a different biochemical state.”

Defining that state, not to mention understanding the rules under which that universe operates, however, is a challenge. It may represent a complex interplay between emotional and cognitive information, says McNamara, so that dreams serve to help our brains process emotional memories and integrate them into our long-term memories. And because traumatic events are associated with higher levels of the stress hormone cortisol, they can cause nightmares. Researchers believe that excessive amounts of cortisol can impair the interaction between the hippocampus and the amygdala, the two main brain systems that integrate memory. “The memories don’t get integrated,” he says, “but just sit around. In post traumatic stress disorder, they get re-experienced over and over.”

In fact, from sleep studies in which people were exposed to images, learning tasks or other experiences immediately before they dozed off and then examined when they awakened, many scientists believe that dreams can help us rehearse for challenges or threats we anticipate—emotionally, cognitively and even physiologically. In our dreams we may try out different scenarios to deal with what’s coming up. Although much of the evidence for this is anecdotal, McNamara says, someone practicing piano or playing video games in waking life may start to do the same while dreaming. People solving a puzzle or studying a foreign language, he adds, can have breakthroughs with dreams that go beyond the perceptions that simply taking a break from the problem can produce.

MORE: Wish Fulfillment? No. But Dreams Do Have Meaning

And now, Barrett says, brain imaging holds the promise of being able to help scientists “see” what until now could only be reported by subjective, possibly inaccurately recalled, dream accounts. For example, in research with rats trained to run through mazes to get rewards, investigators were able to record neuron activity in sleeping rats and determined that the rats were running the same mazes in their dreams.

In other experiments with humans, scientists monitored volunteers who slept inside an fMRI scanner while hooked up to EEG electrodes that measured brain wave activity. When the EEG indicated they were dreaming, the participants were awakened and asked what images they had seen in their dreams. The investigators were later able to match certain patterns of brain activity to certain images for each person. “There’s a crude correspondence between the brain scan and the image. “From the scan, you can guess it’s an animal with four legs,” says Barrett. Despite the primitive state of this dream decoding, the ability to actually glean content from a dream is getting closer.

Mining big data bases of reported dreams holds another kind of promise. Until now, researchers have been working on relatively small samples of dream accounts, usually fewer than 200 per study. But new dream websites and smartphone apps like DreamBoard and Dreamscloud are encouraging thousands of people to report their dreams into larger repositories so researchers can finally answer their most urgent questions. McNamara, for example, is excited to study dreams from different countries to see whether there are cultural differences in what people’s brains do when they aren’t awake.

The data bases also provide an opportunity to investigate the intriguing but under-studied realm of sex dreams. Until recently, says McNamara, they represented only 10% of reported dreams, likely because people are not eager to share this type of content with researchers in white lab coats. But self-reporting via the apps and websites, despite its potential biases, may provide more information on these types of dreams. “This is a wide open area crying for investigation,” he says.

MORE: When My Baby Dreams: Imagining a Newborn’s Fantasy World

McNamara is also eager to study individuals’ dreams over time to observe differences and changes in emotional tone, colors, words and other significant patterns and connect these to events in their lives. That would bring him closer to answering whether dreams are, in fact, prophetic — it might be possible, for example, that certain kinds of dreams precede getting the flu, or that other other dreams are more associated with happier events.

Such investigations could also reveal more about less welcome dreams, such as nightmares, and potentially lead to ways to control or avoid them. Barrett plans to mine the new database to study how often nightmares occur, and how they relate to an individual’s trauma or a family history of anxiety disorder. One of her first projects will involve the dream data from DreamBoard.com, which has accumulated 165,000 dreams over the last two years. Because Dreamboard has coded the dreams by the gender, colors, emotions (joy, anxiety, anger) and the number and categories of people in a dream, Barrett says she can identify basic patterns.

We already know, she says, that women dream equally about men and women while men’s dreams are two-thirds populated by men. Research so far also shows that men’s dreams may show slightly more anger and physical aggression while women’s display a bit more sadness and verbal hostility. Interpreting what these differences mean, however, will require deeper studies.

What’s been discovered so far, however, suggests that such studies could reveal an enormous amount about what role dreams play in our lives, and how important they are for biological, psychological or social reasons. With this research, McNamara believes, scientists can find out if what shrinks have been saying for years is true — that reflecting on our dreams is useful and can give us insight into ourselves. Psychologists say so, and many people think so. But this research, he says, gives us the potential to know.

Get our Health Newsletter. Sign up to receive the latest health and science news, plus answers to wellness questions and expert tips. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.