Memories and the feelings associated with them are not set in stone. You may have happy memories about your family’s annual ski vacation, but if you see a tragic accident on the slopes, those feelings may change. You might even be afraid to ski that mountain again.

Now, using a technique in which light is used to switch neurons on and off, neuroscientists at the Massachusetts Institute of Technology appear to have unlocked some secrets about how the brain attaches emotions to memories and how those emotions can be adjusted.

Their research, published Wednesday in the journal Nature, was conducted on mice, not humans, so the findings cannot immediately be translated to the treatment of patients. But experts said the experiments may eventually lead to more effective therapies for people with psychological problems such as depression, anxiety or post-traumatic stress disorder.

“Imagine you can go in and find a particular traumatic memory and turn it off or change it somehow,” said David Moorman, an assistant professor of psychological and brain sciences at the University of Massachusetts Amherst, who was not involved in the research. “That’s still science fiction, but with this we’re getting a lot closer to it.”