After Keith Beck died of bile duct cancer last year, family members said more than 900 people showed up to pay respects to the popular athletic director at the University of Findlay in northwestern Ohio.

Many were former students who recalled acts of kindness during Beck’s nearly 30-year career: $20 given to a kid who was broke, textbooks bought for a student whose parents were going through bankruptcy, a spot cleared to sleep on Beck’s living room floor.

But few knew about Beck’s final gesture of generosity. The 59-year-old had agreed to a “rapid autopsy,” a procedure conducted within hours of his death on March 28, 2017, so that scientists could learn as much as possible from the cancer that killed him.

“He was 100 percent for it,” recalled his ex-wife, Nancy Beck, 63, who cared for Beck at the end of his life. “It wasn’t the easiest thing to do, but it was important.”

Beck donated his body to a rapid-autopsy research study at the Ohio State University, part of a growing effort by more than a dozen medical centers nationwide. The idea is to obtain tumor tissue immediately after death — before it has a chance to degrade. Scientists say such samples are the key to understanding the genetics of cancers that spread through the body, thwarting efforts to cure them.

“People are recognizing that cancer is more heterogeneous than we realize,” said Dr. Sameek Roychowdhury, a medical scientist at OSU’s Comprehensive Cancer Center. “Different parts of your body may have different cancer cells, even though they originated from the same cancer.”

In Beck’s case, results from the rapid autopsy showed he had developed a mutation that caused the experimental drug he was taking, known as an FGFR inhibitor, to stop working. “This is helping us shape how we develop this new drug,” Roychowdhury said. “How can we make a better drug? Or can we make a better drug combination?”

Rapid-autopsy technology has been available for decades. Researchers at the University of Washington in Seattle have been using the technique to study prostate cancer since 1991. But only in recent years have more hospitals been launching and expanding programs, said Dr. Jody Hooper, director of the Legacy Gift Rapid Autopsy Program at Johns Hopkins Medicine in Baltimore. At last count, there were 14 similar programs in the U.S.

Scientists recognize the value of examining tissue from multiple sites soon after death and obtaining larger samples than they could while a patient was living. Cancer cells can be retrieved during such autopsies and kept alive, allowing researchers to experiment with ways to treat — or kill — them.

“It’s the power of sampling over the entire body at the same time,” said Hooper.