Both scientists had developed techniques for turning N.M.R. data into images — Dr. Lauterbur while he was at the State University of New York at Stony Brook.

When N.M.R. imaging became common for medical use, the name was changed to magnetic resonance imaging; the word “nuclear” was dropped for fear that patients might think radioactive elements were being used.

Dr. Mansfield built a prototype of a magnetic resonance imaging machine in 1978, and he volunteered to be the first person to be enclosed in it and scanned, even though some scientists worried that its nonuniform magnetic field could induce cardiac fibrillation.

“He was the guinea pig,” said Richard Bowtell, a professor at Nottingham, who had been one of Dr. Mansfield’s graduate students. “He went into the scanner. There was the worry it would knock him dead.”

Dr. Mansfield’s own calculations indicated no danger.

“In fact, the scan went well, and after fifty minutes and sweltering heat, I got out of the machine dripping like a wet rag,” he wrote in his 2013 autobiography, “The Long Road to Stockholm: The Story of M.R.I.”

Dr. Mansfield went on to seek faster scans that could capture the beating of a heart. He developed a technique called echo-planar imaging, which could assemble an image in less than a second instead of minutes or hours.

His techniques enabled scientists to take a rapid-fire succession of images that tracked the movement of internal organs. That led to another advance called functional M.R.I., which depicts activity in the brain.