Pregnancy, she explained, may help a woman’s brain specialize in “a mother’s ability to recognize the needs of her infant, to recognize social threats or to promote mother-infant bonding.”

The study, which took more than five years, involved 25 women in their 30s in Spain who had never been pregnant but were hoping to conceive. Their brains were scanned before becoming pregnant and within few months after giving birth. For comparison, 20 women who had never been pregnant were also scanned twice, about the same number of months apart.

Only the pregnant women showed gray matter reduction, thinning and changes in the surface area of the cortex in areas related to social cognition. Changes were so clear that imaging results alone could indicate which women had been pregnant. The researchers said they did not yet know what was being reduced in size: neurons, other brain cells, synapses or parts of the circulatory system.

Many of the women had been recruited for the study at a fertility clinic, and the 16 who conceived after fertility treatment were compared with nine who conceived naturally. The treatments caused no difference in brain changes; nor did the sex of the babies.

The researchers also scanned the brains of 17 men who were not fathers and 19 first-time fathers before and after their partners’ pregnancies. The two male groups showed no difference in brain volume.

Researchers wanted to see if the women’s brain changes affected anything related to mothering. They found that relevant brain regions in mothers showed more activity when women looked at photos of their own babies than with photos of other children.

Six months after giving birth, the mothers answered questions on the Maternal Postnatal Attachment Scale, used to assess a woman’s emotional attachment, pleasure and hostility toward her baby. The degree of changes in the mothers’ gray matter volume predicted the degree of hostility and attachment, Dr. Hoekzema said.