Neuroscientist Ben Barres died Dec. 27 at age 63. (Stanford University School of Medicine /Stanford University School of Medicine )

Ben Barres, a neurobiologist who made groundbreaking discoveries regarding the structure and function of the brain that may have implications for understanding Alzheimer's disease and other degenerative disorders and who, as a transgender man, became an outspoken opponent of gender bias in science, died Dec. 27 at his home in Palo Alto, Calif. He was 63.

His death was announced by Stanford University, where he was a professor of neurobiology in the medical school. The cause was pancreatic cancer.

Dr. Barres was one of the world's leading researchers on glial cells, which are the most numerous structures in the brain but whose purpose was almost a complete mystery.

"Until Ben grabbed hold of this, there was very little known about what they did in the brain," Beth Stevens, a Harvard University professor and MacArthur "genius grant" recipient who studied with Dr. Barres, said in an interview. "He made a remarkable number of discoveries and launched many avenues of research. He started a whole new field."

There are three primary types of glial cells, or glia — microglia, oligodendrocytes and astrocytes — but before Dr. Barres began to look at glia, their functions were poorly understood. Most researchers concentrated on the brain's neurons, which send electrical impulses.

Trained as a physician, Dr. Barres had an early interest in diseases of the brain. Other scientists had noticed that irregularly shaped glial cells were often found near damaged brain tissue, and Dr. Barres began to study whether the glia affected other structures in the brain.

"He has made one shocking, revolutionary discovery after another," Martin Raff, a biologist at University College London who once trained Dr. Barres, told Discover magazine in August.

Dr. Barres sought to understand the normal functions of glial cells to understand what happened when things went awry. Among other things, the glia appeared to help neurons form synapse connections to transmit electrical signals throughout the brain. Some glial cells (oligodendrocytes) wrapped around neurons like insulation, making them work more efficiently.

Dr. Barres also discovered that some glial cells — the astrocytes, in particular — could have harmful effects. In what he described as "the most important discovery my lab has ever made," he showed in a 2017 article published in the journal Nature that the glia could undergo changes or secrete substances that could damage neurons and other cells in the brain.

In other words, glial cells might contribute to the degeneration of brain tissue that is a hallmark of Alzheimer's and Parkinson's diseases, as well as multiple sclerosis, amyotrophic lateral sclerosis (Lou Gehrig's disease), glaucoma and other conditions. Dr. Barres's work holds promise for other researchers to explore ways to treat or prevent such debilitating illnesses.

"He laid the groundwork for many other scientists," Stevens said. "He's really cracked open a whole new phenomenon."

Dr. Barres began his scientific career when he was known as Barbara Barres. After undergoing hormone treatments and surgery, Dr. Barres became known as Ben Barres in 1997. His experience led him to become a powerful advocate for women and other marginalized people he believed were denied opportunities in a scientific world dominated by men.

"I have this perspective," he told the Associated Press in 2006. "I've lived in the shoes of a woman, and I've lived in the shoes of a man. It's caused me to reflect on the barriers women face."

In 2005, Harvard President Lawrence H. Summers attributed the relative dearth of female scientists to the "intrinsic aptitude" of women. The next year, Dr. Barres published a scathing essay in Nature, in which he wrote that the ad feminam statements by Summers and other scholars were "nothing more than blaming the victim."

"The comments," he wrote, "about women's lesser innate abilities are all wrongful and personal attacks on my character and capabilities, as well as on my colleagues' and students' abilities and self-esteem. I will certainly not sit around silently and endure them."

Dr. Barres cited studies showing that boys and girls had comparable test scores in mathematics and science but that the college science departments, tenure committees and grant-awarding panels were overwhelmingly controlled by men.

Two Harvard professors jumped into the fray, with one, political scientist Harvey C. Mansfield, calling Dr. Barres "a political fruitcake" and another, psychologist Steven Pinker, complaining that Dr. Barres had "reduced science to Oprah."

"If a famous scientist or the president of a prestigious university is going to pronounce in public that women are likely to be innately inferior," Dr. Barres wrote in his Nature essay, "would it be too much to ask that they be aware of the relevant data?"

Citing his own experience, Dr. Barres recalled that, after his transition to life as a man, he led a seminar at an academic conference. A colleague overheard another scientist say, "Ben Barres gave a great seminar today, but then his work is much better than his sister's."

Dr. Barres wrote that in everyday transactions as well as in academic circles, "people who don't know I am transgendered treat me with much more respect" than when he was living as a woman. "I can even complete a whole sentence without being interrupted by a man."

Dr. Barres was born Sept. 13, 1954, in West Orange, N.J. His father was a salesman.

From the age of about 4, Dr. Barres, who had a fraternal twin sister, preferred boys' toys and clothing. For Halloween, the young Barbara Barres dressed as a football player or soldier.

"I felt like a boy," Dr. Barres said on the "Charlie Rose" show in 2015. "The brain has innate circuits that determine our gender identity. And so being transgender is not a choice that I made."

Dr. Barres had an early interest in science and became the first member of his family to attend college. At the Massachusetts Institute of Technology, he later wrote, "I was the only person in a large class of people of nearly all men to solve a hard math problem, only to be told by the professor that my boyfriend must have solved it for me."

After graduating from MIT in 1976, he received a medical degree from Dartmouth in 1979. He later enrolled in graduate school at Harvard, working nights as a physician. He received a PhD in neurobiology — his second doctorate — in 1990.

Dr. Barres then studied at University College London before joining the Stanford faculty in 1993.

When Dr. Barres was 41 — and still known as Barbara — he developed breast cancer, a disease his mother died of at about the same age. He underwent a mastectomy.

"I said, 'While you are there, please take off the other breast,' " Dr. Barres said on "Charlie Rose." "Since this cancer runs in my family, he did agree to remove the other breast.

"And I just can't tell you how therapeutic that was. I felt so relieved to have those breasts removed."

Dr. Barres later read an article about a transgender man who had undergone a female-to-male transition.

"I realized for the first time in my life," he said in 2015, "that there were other people like me and that I might be transgender."

He began to take testosterone, which led to a deeper voice, a beard and male-pattern baldness. Meanwhile, with the full encouragement of his Stanford colleagues, his scientific work continued without interruption. (Dr. Barres also had prosopagnosia, sometimes called face blindness, which made him unable to recognize faces. He identified people by their voices, hairstyles or other sensory cues.)

In addition to running a laboratory with 15 to 20 researchers, Dr. Barres taught classes in the medical school and became chairman of the neurobiology department. He also developed Stanford's master of medicine program, combining clinical work and research, and became an informal adviser to female, gay and transgender science students.

Researchers at his laboratory were an unusually diverse group, with women often outnumbering men. His former students now run research labs at Harvard, Duke University, New York University and elsewhere.

"It was the most fun and creatively dynamic environment I've ever worked in," said Stevens, the Harvard scientist who was a postdoctoral fellow in Dr. Barres's laboratory from 2004 to 2008. "He created such a tight family. These are not just scientists working at the bench. These are people who are working together and helping each other."

Dr. Barres had two surviving sisters and a brother.

After learning of his pancreatic cancer diagnosis, Dr. Barres arranged for other scientists to take over his laboratory, wrote recommendation letters and gave interviews about his journey as a woman and later as a man through science.

"I feel like I have a responsibility to speak out," he said. "Anyone who has changed sex has done probably the hardest thing they can do. It's freeing, in a way, because it makes me more fearless about other things."