The filmmaker John Singleton experienced weakness in his legs following a long flight from Costa Rica in April. After going to the hospital, he suffered a stroke and died at age 51.

Physicians say one possible explanation is a risky condition called deep vein thrombosis: a blood clot that forms in a leg vein.

The chance of developing such clots increases with prolonged inactivity, which is why physicians recommend that airline passengers walk about the cabin if possible — or at the very least rotate their ankles.

If a piece of the clot breaks loose, it can travel to the heart and ultimately to the lungs, a dangerous condition called a pulmonary embolism. When the person also has a hole in the wall dividing the heart’s left atrium from the right, such a clot can migrate to the brain. That is the definition of an ischemic stroke — the type Singleton suffered, according to a death certificate obtained this week by TMZ.

Singleton’s representatives have not disclosed further details of his condition, but the general description of leg problems followed by a stroke is consistent with deep vein thrombosis, said José Trani, a vascular surgeon with Cooper University Health Care.

“That sequence fits,” Trani said. “That’s certainly within the realm of possibility.”

Airline travel is associated with an elevated risk of deep vein thrombosis because the cramped quarters lead to inactivity and, as a result, lower blood flow through the veins, said Michelle J. Smith, division chief for neurosurgery at Main Line Health. Lower blood flow in turn can cause blood to stagnate and form a clot.

Such clots can occur in people who are inactive for long periods for other reasons, such as long car rides or recovery after surgery. But air travel has the added complication that passengers tend to become dehydrated, meaning their blood can become thicker and more prone to clots, said Smith, a clinical associate professor at Thomas Jefferson University.

When such a clot develops in a leg vein, it can result in a throbbing or painful sensation — a symptom that develops suddenly, not gradually, said Cooper’s Trani.

While strokes are not common for people in their early 50s, this year already has seen two high-profile cases in that age bracket — Singleton and the actor Luke Perry, who died in March at age 52.

Among white men ages 45 to 54, the chance of a stroke in a given year is 2.4 out of 1,000, according to the American Heart Association. The risk for black men in that age group is four times as high. Singleton was African American, and also was said to have suffered from high blood pressure, another risk factor.

An ischemic stroke is often treated with a clot-busting drug called tissue plasminogen activator, abbreviated tPA. A surgeon also can use a catheter to extract the clot in a procedure called a thrombectomy.

Fast action is key for both treatments. Many hospitals are not equipped to perform thrombectomies, though the procedure is done at Cedars-Sinai Medical Center in Los Angeles, where Singleton died. His representatives have not said if he underwent the procedure.

The death certificate obtained by TMZ listed his date of death as April 28. In earlier accounts, he was said to have died a day later.

Singleton was the director, producer, and screenwriter of 1991′s Boyz N the Hood, and also was the co-creator of the TV series Snowfall.