A lack of sleep among people with anxiety and depression may make it harder for them to see things in a positive light, according to a new study published in the journal Depression and Anxiety.

Researchers at the University of Illinois at Chicago College of Medicine were interested in studying how poor sleep, which is common among people with anxiety or depression, affects the area of the brain that regulates negative emotional responses.

The scientists found the region of the brain called the dorsal anterior cingulate cortex may have to exert more energy to combat negative emotional responses in people with poor sleep who have mental health issues that already make it hard to see things optimistically.

Read: Sleep Deprivation: 5 Ways It Can Affect Your Mind And Body​

"Our research indicates sleep might play an important role in the ability to regulate negative emotions in people who suffer from anxiety or depression,” said lead researcher Heide Klumpp, in a news release.

The research team used functional MRI to assess which area of the brain reacted during emotion-regulation tasks. The 78 participants, 18 to 85 years old, were shown disturbing, violent images, such as war scenes, and were asked to not control their reaction to the photo or to “reappraise” what they viewed in a more positive light.

An example of reappraisal would be to see a photo of a woman with cuts, bruises, and scrapes on her face and visualize her as an actress in makeup doing her job, rather than as a survivor of assault, explained Klumpp.

“Reappraisal is something that requires significant mental energy,” said Klumpp. "In people with depression or anxiety, reappraisal can be even more difficult, because these disorders are characterized by chronic negativity or negative rumination, which makes seeing the good in things difficult."

All of the study subjects were diagnosed with an anxiety disorder, a major depressive disorder, or both. To assess the participant's sleep quality, they filled out a self-reported questionnaire and sleep efficiency was evaluated over the course of 6 days with a motion-sensing device.

See also: Sleep Loss Hurts Your Ability To Recognize Facial Expressions Such As Happiness Or Sadness

Get Better Sleep: Infographic Shows Why You Can’t Make Up For Hours Of Missed Sleep​