What promises to be the ultimate X-ray machine, one that could find tiny cancers or heart defects long before they cause trouble, is now being built at the giant Mayo Clinic here.

The machine, a $5 million, 17-ton, doughnut-like device, will whirl 28 X-ray machines around a patient to make thousands of images a second. The images will be fed to a computer to reconstruct any part of the body. In a period of a few seconds, with no more X-ray exposure than a few chest X-rays, the machine will electronically slice open any part of the body or any organ in any direction, transfer a series of images to magnetic tape and display them on a TV-like screen for immediate or leisurely examination.

The picture will show the organ in three dimensions, almost as if a surgeon had removed it. The machine can also display the organ's interior, as if the surgeon had then cut it open.

Such organs as the heart, blood vessels and lungs will be seen at work, with blood and oxygen flowing through them.

Officials of the National Institutes of Health will join Mayo scientists today to explain progress so far on this wondrous tool that NIH has already called "revolutionary" in its potential impact. NIH's Division of Research Resources and National Heart, Lung and Blood Institute have provided $3 million so far to supply 14 "X-ray machines -- the Mayo scientists call them "X-ray guns" -- that let the device's designers start tests this year on animals and a few human beings.

Clinic scientists, led by Dr. Earl Wood, have already described the machine in several interviews and medical speeches and articles.

In medical engineering jargon, the 20-foot-long device is called the Dynamic Spatial Reconstructor, or DSR. It resembles not an ordinary X-ray machine but a big electric turbine or perhaps some sort of science-fiction creature-freezing machine.

The patient, or, in current tests, an animal subject, is wheeled inside the machine. The principle then used, one to convert X-ray images into electronic bits and have a computer reassemble them, is the same one that last year won Nobel prizes for the scientists who developed "CT" or "CAT" scanning.

CAT (for "computer-assisted tomographic") scanners are already in use in hospitals. With only one X-ray machine, they can examine the body only in horizontal, salami-like slices.

The DSR in contrast dices up the body like a cook dicing a chicken, then puts the cubes together mathematically and electronically so doctors may "call up" any view.

"A portion of the body will be just sitting there in space," Dr. Lowell Harris explained recently. "You will be able to 'walk around it,' look at it, see the organs life-size and in motion [and] manipulate them."

CAT scanners have aroused charges of overuse and unnecessary cost escalation because they cost up to $1 million each and have put pressure on hospitals to acquire them to be "up to date."

Will a new $5 million machine, which might cost $3 million even in mass production, cause similar problems?

At this point, said an NIH official, "we don't know whether this will be primarily a research tool or a necessary one in major medical centers." But Wood says, "I'd be very surprised if a more compact version didn't become commonplace. It may even be a device someday for mass-screening healthy people to look for disease."

If research considered only cost, medicine would still be limited to the stethoscope, one electronic industry executive commented.

Whether this new body reconstructor becomes a standard tool or not, it is certain to yield new knowledge of heart and blood vessel and other physiological action. But Mayo scientists see many everyday diagnostic possibilities, such as providing far more accurate information on heart muscle damage after a heart attack.

They think they will be able to follow every twist and turn of the coronary arteries that nourish the heart to detect blockages after an attack, spotting any narrowing that could lead to a future attack. They think they should be able to see many small cancers or other pathological changes in their earliest statges -- for example, tiny lung cancers that today do not reveal themselves until it is too late for cure.

"Because it can look inside the body from any angle," Wood adds, the machine should "find a small lung tumor which otherwise would be hidden behind a rib in a conventional X-ray."

Several other sophisticated new ways of seeing or "imaging" the body are also being developed. The DSR, Wood says, will have three special advantages -- recording images in a mere hundredth of a second for stop-action, taking as many as 240 cross-sections simultaneously to "see" whole organs and doing all this 60 times a second so "we can follow an entire physiological cycle, like reproducing a whole heartbeat."

"This," he added, "is the most sophisticated, technical, complicated and exciting research project I've ever worked on."

Now 68, he has been at the cutting edge of human physiology for four decades. In World War II he was a leader of a group that built a huge human centrifuge to whirl human subjects at high speeds like lab samples. With the aid of that and other machines, Mayo scientists developed G-suits and high-altitude oxygen masks that enabled American fighter pilots to avoid or minimize blackouts in steep dives and pullouts, giving them an edge in air battles.