Dr. Stuart Meloy never set out to study orgasms. It was an accident.

He was in the operating room one day in 1998, implanting electrodes into a patient’s spine to treat her chronic leg pain. (The electrodes are connected to a device that fires impulses to the brain to block pain signals.) But when he turned on the power, “the patient suddenly let out something between a shriek and moan,” says Meloy, an anesthesiologist and pain specialist in North Carolina.

Asked what was wrong, she replied, “You’ll have to teach my husband how to do that.”

Meloy moved the electrodes until he found the correct, pain-numbing position on the spine. “I went home, had a funny story to tell my wife,” he says.

He almost left it at that.

But the next day, he told the story to some colleagues, and a gynecologist commented that one-third of his patients complain of orgasm dysfunction.

Might this, Meloy mused, potentially help such people?

He started a formal pilot study of the device, which is approved for use in treating bladder and pain problems, implanting it in the spines of 11 women, some of whom had never had an orgasm. The women, who were instructed to keep a record of all their sexual experiences, were allowed to use the device for nine days adlibitum.

Meloy’s study, published in 2006 in the journal Neuromodulation, reported that 10 out of 11 of the patients felt pleasurable stimulation from the device, including increased vaginal lubrication. Five of the women had previously lost their ability to have orgasms; four regained it with the device. (The fifth never used her device during the nine-day trial because of work stress, she said.)

None of the five women who had never had an orgasm was able to experience one with the device, however. “They said it was pleasurable, but it wasn’t sending them over the edge,” Meloy says.

The experimental implant -- now trademarked by Meloy as the Orgasmatron after the orgasm-inducing cylinder in Woody Allen’s 1973 movie “Sleeper” -- rests on the skin just above the belt line. Two electrodes snake into the space between the vertebrae and the spinal cord. A video-game-like remote control allows women (or their partners) to turn electrical pulses on and off and fiddle with timing and intensity.

Electrodes in the right place (determined partly by trial and error) seem to interact with various nerve networks, Meloy says, including nerves from the pelvis that enter the spinal highway near the tailbone. Stimulating those nerves shoots pleasure signals straight up to the part of the brain that processes information coming from the genitalia.

Women who have used the device say they feel as if their clitoris and vagina are actually being stimulated, to quite realistic effect. (“One woman asked me, ‘Would it be considered adultery if I gave the remote control to someone other than my husband?’ ” Meloy says.)

Some volunteers also report fleeting episodes of clenched foot muscles, Meloy says, probably a result of electrical pulses leaving the spine and stimulating nearby motor nerves. (He wonders if the phenomenon might somehow be related to a common orgasm description: “My toes curled.”)

And when the device’s pulse intensity is cranked up to maximum, Meloy says, some women find their vaginal and rectal muscles squeezing rhythmically in time with the pulses, even before the orgasmic finale.

Meloy thinks that practice, or at least past experience, is key to success with the device. Without prior orgasm experiences, crucial neural pathways may never have been laid down, possibly explaining why women who’d never had orgasms did not experience one during the nine-day trial. Even with extra stimulation from the device, Meloy says, nine days may not have been enough time to build pathways up to full orgasmic strength.

And even the successful women in the trial lost their recovered orgasmic ability when the devices were removed. Meloy hopes that longer access to the device would let women practice their newfound skills and fortify neural pathways -- a sort of orgasmic neural rehabilitation.

Meloy says he has also implanted two impotent men with the device. Both volunteers were able to achieve an erection, he says, and reportedly had powerful ejaculations.

Meloy sees two potential male markets for the device. One includes men with erectile dysfunction who take nitrates for heart disease and therefore cannot take Viagra or similar medications, like Jack Nicholson’s character in the film “Something’s Gotta Give.” The other might be recreational users, men interested in boosting their existing erections and ejaculations -- and willing to pay for elective surgery.

Design work is underway to get the cost of the procedure down to about $12,000 -- roughly the price of breast implants, Meloy says.

He plans to shrink the size of the internal processor to the size of two sticks of gum and the external processor to roughly the size of a belt pager, all while ensuring that the system is durable enough to withstand shear forces of typical use.

Before Food and Drug Administration approval could be granted and the device sent to market -- Meloy estimates that’s probably still two or three years away -- the new design will need to be tested in another study, he says. But there will be no animal testing phase. “I don’t know how to ask animals, ‘Where do you feel the tingling?’ or ‘Do you want a cigarette?’ ”

health@latimes.com