We've all heard the phrase "trapped inside our own head," but for most of us, that's a figurative term we use when we can't stop thinking about something.

Martin Pistorius, however, had that experience in the most real and terrifying way imaginable.

For 12 years.

This crazy story, which we first heard on "Invisibilia," a new NPR podcast, is not only a terrifying tale of what it's like to try to mentally survive while you have no ability to communicate with the outside world — a state of being essentially invisible — it's also the story of how Pistorius broke free.

The first 12 years of Martin's life were essentially normal. As a kid his obsession was electronics. He was always asking his parents to buy him transistors and other parts, and he told his mom he wanted to be an "electric man."

Then he got sick.

No one knew exactly what it was — his doctor's best guess was a type of meningitis.

Over two years, he deteriorated. Sometime during the second year of being sick, his parents said Martin was sleeping constantly in the fetal position unless he was actively woken up. He lost the ability to move, make eye contact, or sleep.

His mother says Martin's last words as a child were spoken in the hospital: "when home?"

Doctors said he failed every test for mental awareness, that he was a vegetable and should be kept comfortable until he died.

But a year passed, and then another.

His parents dressed him every day and took him to a care center during they day where he could be looked after. At night, his father says he set his alarm so they could turn him every two hours and prevent bedsores.

"Load him in the car, drop him off, pick him up," his father told NPR's Lulu Miller. "Bathe him, feed him, put him in bed." That was their life.

They did this for eight years.

Martin's mother remembers looking at him and saying "I hope you die."

It was too painful to see what her son had become. At one point she even tried to take her own life.

But something else was happening behind the scenes.

Martin was coming back.

About two years after doctors had declared that he had no signs of mental awareness, Martin started to wake up — but only in his head.

"I was aware of everything, just like any normal person," he told Miller — he has since regained the ability to talk, using a computer interface. Martin can't speak with his vocal cords, but he can operate a wheelchair. He thinks he was about 14 or 15 when things started coming back, fuzzy at first but later as clear as they are for any of us.

In 2011, he described what it was like in an article he wrote for the Daily Mail.

Have you ever seen one of those movies in which someone wakes up as a ghost but they don't know that they've died? That's how it was, as I realized people were looking through and around me.

However much I tried to beg and plead, shout and scream, I couldn't make them notice me.

Now, Miller says he almost looks like a former athlete in his chair, with a strong upper body from moving himself around, salt-and-pepper hair, and a big smile.

But at that time, things were terrifying. He couldn't tell anyone he was there. "Everyone was so used to me not being there that they didn't notice when I began to be present again."

He thought he would spend the rest of his life trapped in his own head, alone forever, trapped.

So he taught himself to disengage from his thoughts, to simply exist, to not let himself be aware.

It isn't something he describes as peaceful. "It's a very dark place to find yourself, because in a way, you are allowing yourself to vanish."

But there were certain things he couldn't ignore. One of the worst tormentors?

Barney, the purple dinosaur.

At the care center, where no one knew he had any awareness of the world, he'd usually be placed in front of a TV that played Barney re-runs for hours upon end, day after day.

"I cannot even express to you how much I hated Barney," Martin says.

This pushed him over the edge.

He had to know when it would stop.

So he taught himself to tell time by how shadows moved across the room and matching that with the times he caught a glimpse of a clock or overheard someone say the time. He learned how to keep track of the day, and even now, can tell what time it is by looking at shadows.

He knew when he wouldn't have to hear Barney anymore.

He developed a way to interact and co-exist with the world around him in his mind — this must be one of the greatest examples out there of what psychologists call "resilience," a sort of mental toughness or ability to cope.

But when he heard his mother say "I hope you die," that put his resilience to the test.

Eventually he understood even that. "Every time [my mother] looked at me she could see only a cruel parody of the once healthy child she had loved so much," he told NPR.

And at some point, something in his brain began to change and he started to regain control over his body. Eventually, one of his caretakers noticed that he was gaining the ability to move in certain ways, and she encouraged his doctors and parents to have him tested again.

At age 26, he passed a test by pointing at objects with his eyes.

He learned to use a computer, got a job, went to college and studied computer science, and wrote a book, titled "Ghost Boy: The Miraculous Escape of a Misdiagnosed Boy Trapped Inside His Own Body."

He's even learning to drive.

Pistorius is married now — his wife says he fell in love with his sense of humor, particularly his perspective on the human condition.

Go ahead and listen to the podcast. It's worth hearing the voices of Martin and his family. Just be aware that you might tear up on the subway or wherever you are when you listen.

You can also watch a trailer for Pistorius's book below.