PORTLAND, Maine — Troy Ali, 17, plans to spend his first year out of high school fulfilling a passion that grew out of a childhood illness once expected to claim his life.

Before heading off to college, Ali, who graduates from Casco Bay High School Thursday, will travel from his home in North Deering to Nepal, where he will live for a year and document his journey. He became interested in travel documentaries during middle school, when he was bedridden with a rare autoimmune inflammatory muscle disease.

When Ali was 6 years old, he was diagnosed with dermatomyositis, a disease that most commonly affects the skin and muscles, causing a rash that spreads over the body and typically develops on muscles used to extend or straighten joints, including knuckles, elbows, knees and toes. The rash can spread to the lungs and, less commonly, the heart, which leads to even more serious health complications.

Ali’s condition went undiagnosed for over a year, and he says he was fairly sick between age 6 and 10. The disease went into remission, but it came back just two years later in full force.

“It was looking good, everything was happy,” said Ali, ”and then in late sixth grade, I relapsed so fast and so hard, I had no idea what was happening.”

Ali spent the majority of his time during those years in bed, getting around only by wheelchair or electric scooter. His entire body was covered in a rash that made it incredibly painful to move around, he said. The rash spread to his eyelids, permanently damaging his vision, and he must wear glasses at all times.

“I just spent most of my time in this state of horrible sickness, and it didn’t look like it was ever going to end,” said Ali.

The treatment became too much for Ali, who was having his blood drawn regularly and was prescribed a collection of medications, which carried negative side effects. He was unable to go to the bathroom on his own. Ali, with support from his family, decided to stop all treatment for his condition.

“I knew the meds were only a Band-Aid for the issue. At that point, my body was deteriorating so quickly that [my doctors] were like, ‘We can’t fix you, but we can help you break slower,’” said Ali. “That was essentially the motto, so I thought, if I’m going to go out, I’m just going to do it.”

Ali said his doctors fought him every step of the way, but that the medication was toxic to his system and had the potential to cause kidney and liver damage. His family’s insurance provider almost dropped them because he was such a liability, and a handful of doctors refused to work with him because he refused to take medication, he said. The family finally found a doctor who would assist him in recovering, and Ali started detoxing from the medication. During the year he stopped taking medication, his condition was the worst it had ever been, he said.

“I could not function as a human being,” said Ali. “I got this weird infection that scabbed over my entire skin, and it would break and fall. It was gross, it was awful, super painful.”

After that year, the disease, which is known to have spontaneous periods of remission, started to improve. Ali says he has been getting better ever since and only suffers from an occasional rash outbreak.

“The fact that it worked was a complete fluke, it was like a miracle,” said Ali. “It could have easily gone the other way. Remission and relapse is just a flip of a coin for me.”

Ali dedicates his time to photography and film, a passion he discovered while ill. While he was sick, he researched photography and watched a lot of films, with Netflix becoming “his best friend.”

“I couldn’t find anyone to relate to how I saw the world, how I experienced it because there was no one I knew who had what I had in the way that I had it,” said Ali. “I then found that there’s such amazing, expressive tools available, and that’s how I could, through photography and film, show other people how I saw things.”

As soon as he was able, Ali began taking photos, first on his phone, then with a point-and-shoot camera, and now with a semi-pro DSLR camera. He runs a Facebook page called “Humans of Portland,” which, like its more prominent predecessor, “Humans of New York,” is a collection of photos and personal stories from regular citizens found while walking around the city. His ultimate goal is to become a documentarian.

Ali will document his journey in Nepal through a blog and videos and photo collections he gathers during his travels. He hopes his work and story can inspire people with similar backgrounds around the world.

“I think that backpacking through a foreign country is the best way I can show other people, as well as prove to myself that I’ve progressed, that I’m something new and better, and that I’ve worked hard to recover,” said Ali. “I want to show people that they can follow their passions no matter their background.”