Treating depression is guesswork. Psychiatrists are beginning to crack the code.

Here’s a frustrating fact for anyone who has been prescribed medication or therapy for depression: Your doctor doesn’t know what treatment will work for you.

Depression means being stuck in a chronic state of sad mood or lack of enjoyment in life, to a degree where it starts to degrade quality of life. The two main treatments are cognitive behavioral therapy (CBT), a talk-centered approach that gets patients to readjust their habits, and antidepressant medications.

Both are about equally effective. Around 40 percent of patients will get better on either.

But no one treatment reliably works for everyone.

With depression, it’s important to get treatment right the first time. When a treatment fails, “it’s demoralizing to someone who is already depressed,” says W. Edward Craighead, a psychologist at Emory University. Recently Craighead, along with Emory’s Helen Mayberg and colleagues, published results of an experiment that shows brain scans can help differentiate between patients who will respond better to talk therapy or to drug therapy. Dr. Mayberg is an NS faculty member.

If you can diagnose depression with a brain scan, you can tailor treatment.

Click here to view the full story in Vox. Related stories can also be found on WAGA-TV (Fox 5 Atlanta) and in IEEE Spectrum.