Lying inside a scanner, the patient watched as pictures appeared one by one: A bicycle. A cupcake. Heroin. Outside, researchers tracked her brain's reactions to the surprise sight of the drug she'd fought to kick.

Government scientists are starting to peek into the brains of people caught in the nation's opioid epidemic, to see if medicines proven to treat addiction, like methadone, do more than ease the cravings and withdrawal. Do they also heal a brain damaged by addiction? And which one works best for which patient?

They're fundamental questions considering that far too few of the 2 million opioid users who need anti-addiction medicine actually receive it.

One reason: "People say you're just changing one drug for another," said Dr. Nora Volkow, director of the National Institute on Drug Abuse, who is leading that first-of-its-kind study. "The brain responds differently to these medications than to heroin. It's not the same."

Science has made clear that three medicines — methadone, buprenorphine and extended-release naltrexone — can effectively treat what specialists prefer to call opioid use disorder. Patients who stick with methadone or buprenorphine in particular cut their chances of death in half, according to a report by the National Academies of Sciences, Engineering and Medicine that explored how to overcome barriers to that care.

Opioid addiction changes the brain in ways that even when people quit can leave them vulnerable to relapse, changes that researchers believe lessen with long-term abstinence.

Volkow's theory: Medication-based treatment will help those damaged neural networks start getting back to normal faster than going it alone. To prove it, she'll need to compare brain scans from study participants like the woman who quit heroin thanks to methadone with active heroin users and people who are in earlier stages of treatment.

"Can we completely recover? I do not know that," Volkow said. But with the medications, "you're creating stability" in the brain, she said. And that helps recondition it to respond to everyday pleasures again.

The challenge now is finding enough people willing, and healthy enough, to have their brains scanned for science at the same time they're struggling to quit.

Addiction is a brain disease, "not a choice, not a personality flaw, not a moral failing," said Dr. Jody Glance, an addiction specialist at the University of Pittsburgh Medical Center, who hopes NIDA's brain scans will help overcome some of the barriers and improve the public health response to the opioid crisis.

Not offering the medicines to someone who needs them "is like not offering insulin to someone with diabetes," she said.

How opioids change the brain

When you sense something pleasurable — a special song, the touch of a loved one, a food like Volkow's favorite chocolate — the brain releases a natural chemical called dopamine that essentially trains the body to remember, "I liked that, let's do it again."

That's the brain's reward system, and opioids can hijack it by triggering a surge of dopamine larger than nature ever could. Repeated opioid use overloads circuits in multiple brain regions, including those involved with learning and memory, emotion, judgment and self-control. At the same time, the brain gradually releases less dopamine in response to other things the person once found pleasurable. Eventually they seek more of the drug not to get high, but to avoid constantly feeling low.

Testing how addiction medicine helps

Volkow aims to test 80 people, a mix of untreated heroin users and patients using different medication-based treatments, inside brain scanners at the National Institutes of Health's research hospital. Her team is measuring differences in the brain's ability to release dopamine as treatment progresses, and how the functioning of other neural networks changes in response as study participants do various tasks.

For example, does a patient's brain remain fixated on "cues" related to drug use — like seeing a picture of heroin — or start reacting again to normal stimuli like the sight of a cupcake?

Another test: Ask if a patient would take an offer of $50 now, or $100 if they could wait a week, checking how much motivation and self-control they can muster.

"You need to be able to inhibit the urge to get something" to recover, Volkow noted. "We take for granted that people think about the future. Not when you're addicted."

Like in any disease, each medication may work better in certain people — because not everyone's brain circuitry reacts exactly the same way to opioid abuse — but that hasn't been studied. Volkow suspects buprenorphine will improve mood and emotional responses to addiction better than methadone, for instance, because of subtle differences in how each medicine works. She especially wants to test people who relapse, to try to spot any treatment differences.

Methadone and buprenorphine are weak opioids, the reason for the misperception that they substitute one addiction for another. In slightly different ways, they stimulate the dopamine system more mildly than other opioids, leveling out the jolts so there's no high and less craving. People may use them for years. Naltrexone, in contrast, blocks any opioid effects.

It's a tough sell

Volkow's team has screened more than 400 people who expressed interest in the study, but have found only about three dozen potential candidates who qualify, seven of whom have enrolled so far.

The main problem: Study participants must have no other health problem that might affect the brain's chemistry or functioning. That rules out people who use medicines such as antidepressants, and those with a range of health conditions such as high blood pressure or diabetes.

Volkow said it's worth the struggle to find such rare volunteers if before-and-after scans wind up showing truly different looking brains as people get treated.

"You should be able to see it with your eyes, without having to be an expert," she said.

FOLLOW NBC HEALTH ON TWITTER & FACEBOOK